/**
 * Dealer Quick Order App responsive styles.
 */

.dqoa-mobile-bottom-nav {
  display: none;
}

/**
* Medium desktop / small laptop.
*/
@media (max-width: 1280px) {
  .dqoa-app-shell {
    width: calc(100vw - 48px);
    grid-template-columns: 230px minmax(0, 1fr) 340px;
  }

  #dqoa-product-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dqoa-product-actions {
    grid-template-columns: 1fr;
  }

  .dqoa-qty-wrap {
    width: 100%;
    grid-template-columns: 52px 1fr 52px;
  }

  .dqoa-qty-input {
    width: 100%;
  }
}

/**
* Tablet and mobile app layout.
*/
@media (max-width: 1024px) {
  .dqoa-app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    grid-template-columns: 1fr;
  }

  .dqoa-sidebar {
    display: none;
  }

  .dqoa-main {
    grid-column: 1;
    width: 100%;
    min-width: 0;
    padding: 18px;
    padding-bottom: 104px;
    overflow-x: hidden;
  }

  .dqoa-topbar {
    display: block;
  }

  .dqoa-user-box {
    margin-top: 14px;
  }

  #dqoa-product-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /**
   * Mobile cart drawer.
   */
  .dqoa-cart-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 999998;
    height: 76vh;
    max-height: 76vh;
    padding: 22px;
    border-radius: 28px 28px 0 0;
    border: 1px solid var(--dqoa-border);
    background: #ffffff;
    box-shadow: 0 -24px 70px rgba(17, 24, 39, 0.24);
    transform: translateY(110%);
    transition: transform 0.28s ease;
    overflow-y: auto;
  }

  .dqoa-cart-panel.dqoa-mobile-cart-open {
    transform: translateY(0);
  }

  /**
   * Mobile app bottom navigation with SVG icons.
   */
  .dqoa-mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 999999;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border-radius: 24px;
    background: #111820;
    box-shadow: 0 18px 50px rgba(17, 24, 39, 0.36);
    align-items: stretch;
  }

  .dqoa-mobile-nav-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 58px;
    height: 58px;
    padding: 4px 2px;
    border: 1px solid rgba(227, 6, 19, 0.7);
    border-radius: 14px;
    background: transparent;
    color: #9ca3af;
    font-family: var(--dqoa-font);
    overflow: hidden;
  }

  .dqoa-mobile-nav-btn.dqoa-mobile-active {
    background: var(--dqoa-red);
    border-color: var(--dqoa-red);
    color: #ffffff;
  }

  .dqoa-mobile-nav-icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .dqoa-mobile-nav-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    width: 100%;
    font-size: 9px;
    line-height: 1;
    letter-spacing: 0.2px;
    text-align: center;
    color: currentColor;
    white-space: nowrap;
  }
}

/**
* Mobile phone layout.
*/
@media (max-width: 767px) {
  .dqoa-main {
    padding: 16px;
    padding-bottom: 104px;
  }

  .dqoa-topbar h2 {
    font-size: 36px;
  }

  .dqoa-topbar p {
    font-size: 16px;
  }

  .dqoa-search-section {
    border-radius: 18px;
  }

  .dqoa-search-section input {
    min-height: 52px;
    font-size: 16px;
  }

  .dqoa-category-section {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .dqoa-category-filter {
    white-space: nowrap;
    min-width: max-content;
  }

  #dqoa-product-results {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .dqoa-product-image-wrap {
    height: 210px;
  }

  .dqoa-product-title {
    min-height: auto;
    font-size: 24px;
  }

  .dqoa-product-actions {
    grid-template-columns: 1fr;
  }

  .dqoa-qty-wrap {
    width: 100%;
    grid-template-columns: 52px 1fr 52px;
  }

  .dqoa-qty-input {
    width: 100%;
  }

  .dqoa-add-btn {
    width: 100%;
  }

  .dqoa-checkout-panel {
    width: 100%;
    right: -100%;
    padding: 22px;
  }

  .dqoa-order-card,
  .dqoa-quote-card {
    grid-template-columns: 1fr;
  }

  .dqoa-order-detail-item {
    grid-template-columns: 1fr;
  }

  .dqoa-account-wrap,
  .dqoa-account-grid {
    grid-template-columns: 1fr;
  }

  .dqoa-toast-wrap {
    top: 16px;
    left: 16px;
    right: 16px;
    width: auto;
  }
}

/**
* Small mobile navigation adjustment.
*/
@media (max-width: 390px) {
  .dqoa-mobile-bottom-nav {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 5px;
    padding: 7px;
  }

  .dqoa-mobile-nav-btn {
    min-height: 56px;
    border-radius: 14px;
    padding: 5px 2px;
  }

  .dqoa-mobile-nav-icon {
    width: 18px;
    height: 18px;
  }

  .dqoa-mobile-nav-label {
    font-size: 10px;
  }
}
/**
 * Mobile sticky search and category only.
 */
@media (max-width: 767px) {
  .dqoa-app-shell {
    overflow: visible !important;
  }

  .dqoa-main {
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 120px;
  }

  .dqoa-topbar {
    position: static !important;
    z-index: auto !important;
  }

  #dqoa-section-quick-order {
    overflow: visible !important;
  }

  #dqoa-section-quick-order .dqoa-search-section {
    position: sticky;
    top: 0px;
    z-index: 80;
    background: #f8fafc;
    margin-bottom: 10px;
  }

  #dqoa-section-quick-order .dqoa-category-section {
    position: sticky;
    top: 75px;
    z-index: 79;
    background: #f8fafc;
    padding-top: 8px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
  }

  #dqoa-product-results {
    overflow: visible !important;
  }
}
@media (max-width: 390px) {
  .dqoa-mobile-bottom-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .dqoa-mobile-nav-btn {
    min-width: 0;
    padding-inline: 1px;
  }

  .dqoa-mobile-nav-label {
    font-size: 8px;
    letter-spacing: 0;
  }
}
