/* ==============================================
   RESPONSIVE — Media queries for all pages.
   Loaded by every page. Must come last in cascade.
   ============================================== */

/* RESPONSIVE */
@media (min-width: 1081px) {
  body.page-shop.drawer-open {
    overflow-y: auto;
  }

  body.page-shop .checkout-modal {
    width: min(920px, 100%);
    max-height: min(88vh, calc(100vh - 40px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body.page-shop .checkout-modal-header p {
    margin-top: 4px;
  }

  body.page-shop #checkout-status,
  body.page-shop .checkout-shipping,
  body.page-shop .checkout-order-summary {
    margin-top: 0;
  }

  body.page-shop .checkout-shipping {
    padding: 10px 12px;
  }

  body.page-shop .checkout-items {
    margin-top: 10px;
    max-height: min(28vh, 280px);
  }

  body.page-shop .checkout-item-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }

  body.page-shop .checkout-item-thumb {
    width: 56px;
    height: 56px;
  }

  body.page-shop .checkout-summary-row {
    margin-top: 10px;
    padding-top: 10px;
  }

  body.page-shop .checkout-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin-top: auto;
    padding-top: 12px;
    background: var(--bg-surface);
    border-top: 1px solid var(--line-soft);
  }

  body.page-shop.drawer-open .page-grid {
    margin-right: calc(var(--cart-drawer-width) + 18px);
  }

  body.page-shop .cart-drawer-backdrop {
    display: none;
  }
}

@media (max-width: 1080px) {
  body.page-shop .page-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.page-shop .sidebar-left {
    position: static;
  }

  body.page-admin .admin-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.page-admin .admin-filter-field.admin-filter-field-wide {
    grid-column: auto;
  }

  body.page-admin .seller-detail-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-admin .seller-detail-content {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  body.page-shop .search-discovery-panel {
    display: none !important;
  }
}

@media (max-width: 900px) {
  body.page-shop .search-discovery-panel {
    top: calc(100% + 0.45rem);
    padding: 0.78rem;
    border-radius: 18px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    max-height: min(60vh, 320px);
    overflow-y: auto;
  }

  body.page-shop .search-discovery-section + .search-discovery-section {
    margin-top: 0.72rem;
    padding-top: 0.72rem;
  }

  body.page-shop .search-discovery-chip-list {
    gap: 0.42rem;
  }

  body.page-shop .search-discovery-chip {
    min-height: 36px;
    padding: 0 0.74rem;
    font-size: 0.8rem;
  }

  body.page-shop .search-discovery-product-list {
    gap: 0.42rem;
  }

  body.page-shop .search-discovery-product {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 0.62rem;
    padding: 0.58rem 0.68rem;
    border-radius: 14px;
  }

  body.page-shop .search-discovery-product-thumb {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  body.page-shop .search-discovery-product-copy {
    display: flex;
    align-items: center;
    min-height: 30px;
  }

  body.page-shop .search-discovery-product-meta {
    display: none;
  }

  body.page-shop .search-discovery-product-name {
    font-size: 0.86rem;
  }

  body.page-shop .search-discovery-product-price {
    font-size: 0.8rem;
  }

  body.page-shop .product-modal-layout,
  body.page-shop .product-detail-layout {
    grid-template-columns: 1fr;
  }

  body.page-shop .product-modal-image-wrapper,
  body.page-shop .product-detail-media {
    min-height: 240px;
  }
}

@media (max-width: 820px) {
  body.page-shop {
    --cart-drawer-top-offset: 114px;
    --cart-drawer-bottom-gap: 10px;
  }

  .top-bar {
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
  }

  .top-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  body.page-shop .top-bar-right {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  body.page-shop .customer-greeting {
    max-width: 220px;
    text-align: center;
  }

  body.page-shop .hero-section {
    text-align: center;
    padding: 20px 16px;
  }

  body.page-shop .hero-title,
  body.page-shop .hero-subtitle {
    max-width: none;
  }

  body.page-shop .hero-highlights-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-shop .hero-why-mini {
    text-align: left;
  }

  body.page-shop .hero-actions {
    justify-content: center;
  }

  body.page-shop .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-seller .current-seller-card,
  body.page-seller .my-product-row {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-seller .my-product-actions {
    justify-content: flex-start;
  }

  body.page-admin .admin-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-admin .admin-charts {
    grid-template-columns: 1fr;
  }

  body.page-admin .chart-card-wide {
    grid-column: auto;
  }
}

/* Hamburger hidden on desktop; shown on mobile inside header-nav-row */
.header-categories-toggle {
  display: none;
  min-height: 40px;
  min-width: 40px;
  border: 1px solid rgba(214, 223, 231, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #13283e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

/* On desktop: nav row is a normal inline flex child of header-inner */
.header-nav-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 768px) {
  /* Two-row header layout */
  /* Row 1 left: Hamburger */
  .header-nav-row {
    order: 0;
    width: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
  }

  /* Row 1 middle/left: Logo */
  .header-left {
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
  }

  /* Row 1 right: Cart + Account */
  .header-right {
    order: 2;
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem; /* Phase 1: mobile header declutter */
  }

  .header-language-switcher {
    position: relative;
    gap: 0;
  }
  .header-language-label.header-language-flag {
    margin: 0;
  }
  .header-language-select {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    padding: 0;
    margin: 0;
  }

  /* Hide brand name on very small screens to prevent push */
  @media (max-width: 360px) {
    .brand-name {
      display: none;
    }
  }

  .header-inner {
    padding: 0.35rem 0.75rem; /* Phase 1: mobile header declutter */
    flex-wrap: nowrap;
    gap: 0.35rem; /* Phase 1: mobile header declutter */
  }

  body.page-shop .header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "nav left right"
      "search search search";
    align-items: center;
    row-gap: 0.5rem;
  }

  body.page-shop .header-left {
    grid-area: left;
    order: initial;
  }

  body.page-shop .header-nav-row {
    grid-area: nav;
    order: initial;
    width: auto;
    flex: 0 0 auto;
  }

  body.page-shop .header-right {
    grid-area: right;
    order: initial;
  }

  body.page-shop .header-search-slot {
    grid-area: search;
    width: 100%;
    min-width: 0;
  }

  body.page-shop .prominent-search-shell {
    min-height: 48px;
    padding: 0.24rem 0.24rem 0.24rem 0.9rem;
    border-radius: 16px;
    gap: 0.6rem;
  }

  body.page-shop .prominent-search-button {
    min-height: 40px;
    padding: 0 0.82rem;
    font-size: 0.82rem;
  }

  /* Show hamburger on mobile */
  .header-categories-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    cursor: pointer;
  }

  .header-categories-toggle:hover {
    background: #ffffff;
    border-color: #c8d5e2;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
    transform: translateY(-1px);
  }

  .header-categories-toggle:focus-visible {
    outline: none;
    border-color: #9dc9ab;
    box-shadow:
      0 0 0 4px rgba(22, 163, 74, 0.08),
      0 6px 16px rgba(15, 23, 42, 0.05);
  }

  /* Nav links: Hidden on mobile to reduce clutter and fix overflow */
  .header-nav {
    display: none;
  }

  .header-nav::-webkit-scrollbar {
    display: none;
  }

  body.page-shop .page-grid {
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    padding-bottom: 24px; /* Fix: removed the 120px padding stack pushing the footer away */
  }

  body.page-shop .homepage-right-column,
  body.page-shop .homepage-left-column {
    display: contents;
  }

  body.page-shop .search-discovery-panel {
    left: 0;
    right: 0;
  }

  body.page-shop .main-column {
    order: 1;
  }

  body.page-shop .homepage-catalog-tools {
    order: 2;
    display: block;
    margin-bottom: 1rem;
  }

  body.page-shop .products-section {
    order: 3;
  }

  body.page-shop .sidebar-left {
    order: 4; /* overridden to unset when desktop-filter-panel-ready */
  }

  body.page-shop .commerce-layer-section {
    order: 6;
  }

  body.page-shop .platform-cta-section {
    order: 7;
  }

  body.page-shop .main-column {
    gap: 12px;
  }

  body.page-shop .hero-section {
    padding: 1.25rem 1rem;
    margin-bottom: 0; /* remove large gap */
    border-radius: 18px;
  }

  .hero-layout {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 1.25rem;
  }

  .hero-card-primary {
    padding: 1.25rem 1.25rem;
  }

  body.page-shop .hero-pill {
    padding: 4px 9px;
    font-size: 10px;
  }

  body.page-shop .hero-title {
    margin-top: 6px;
    font-size: 1.4rem;
    line-height: 1.25;
  }

  body.page-shop .hero-subtitle {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.35;
  }

  body.page-shop .hero-highlights {
    padding: 0.5rem 0 0;
  }

  body.page-shop .hero-highlights-row {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  body.page-shop .hero-highlight-card {
    min-width: 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
  }

  body.page-shop .hero-highlight-card h3 {
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
  }

  body.page-shop .hero-why-mini {
    grid-template-columns: 1fr;
    border-radius: 0.75rem;
    align-items: flex-start;
    margin-top: 0.75rem;
    gap: 0.45rem;
    padding: 0.75rem 1rem;
  }

  body.page-shop .hero-why-label {
    font-size: 0.8rem;
  }

  body.page-shop .hero-why-list {
    gap: 0.45rem;
    font-size: 0.8rem;
  }

  body.page-shop .products-section {
    margin-top: 0.5rem;
  }

  body.page-shop .products-section {
    padding: 14px 0 12px; /* Phase 1: tighter gutters to match hero */
  }

  body.page-shop .section-heading {
    margin-bottom: 0.45rem;
  }

  body.page-shop .section-subtitle {
    margin-top: 4px;
  }

  body.page-shop .product-disclaimer {
    margin-top: 6px;
  }

  body.page-shop .product-delivery-note {
    margin-top: 2px;
  }

  body.page-shop .category-sidebar,
  body.page-shop #categories-sidebar {
    display: none;
  }

  body.page-shop #categories-sidebar .sidebar-card {
    border-radius: 18px;
    padding: 0.75rem 1rem;
  }

  body.page-shop #categories-sidebar .sidebar-title {
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
  }

  body.page-shop #categories-sidebar .categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  body.page-shop #categories-sidebar .sidebar-section {
    display: contents;
    border: 0;
    padding: 0;
    margin: 0;
  }

  body.page-shop #categories-sidebar .sidebar-section-title {
    display: none;
  }

  body.page-shop #categories-sidebar .category-link,
  body.page-shop #categories-sidebar .chip,
  body.page-shop #categories-sidebar button,
  body.page-shop #categories-sidebar a {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-height: 38px;
    padding-inline: 0.9rem;
    padding-block: 0.4rem;
    border-radius: 999px;
    font-size: 0.8rem;
  }

  body.page-shop .mobile-category-bar {
    display: none;
  }

  body.page-shop {
    padding-bottom: 3.25rem;
  }

  body.page-shop .mobile-cart-bar,
  body.page-shop .cart-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
    background: rgba(15, 23, 42, 0.98);
    color: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.35);
  }

  body.page-shop .cart-sticky-bar-summary {
    font-size: 0.85rem;
  }

  body.page-shop .cart-sticky-bar button,
  body.page-shop .mobile-cart-bar button,
  body.page-shop .cart-sticky-bar .btn-view-cart {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
  }

  body.page-shop .catalog-controls {
    grid-template-columns: 1fr;
    margin-top: 0.35rem;
    margin-bottom: 0.65rem;
    max-width: none;
    padding: 0.75rem;
    gap: 0.5rem;
  }

  body.page-shop .catalog-search,
  body.page-shop .catalog-sort {
    width: 100%;
  }

  body.page-shop .catalog-search-shell {
    min-height: 44px;
  }

  body.page-shop .catalog-sort select {
    min-height: 44px;
  }

  body.page-shop .catalog-server-filters {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0 0.5rem;
  }

  body.page-shop .catalog-apply-button {
    grid-column: span 2;
    min-height: 40px;
  }

  body.page-shop .catalog-search-shell,
  body.page-shop .catalog-search input,
  body.page-shop .catalog-sort select {
    width: 100%;
    min-width: 0;
  }

  body.page-shop .catalog-reset-button {
    width: 100%;
    align-self: stretch;
  }

  .page-container,
  .main-layout,
  body.page-shop .page-grid,
  body.page-orders .orders-page-shell,
  body.page-orders .orders-page,
  body.page-orders .orders-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body.page-shop .page-grid,
  body.page-shop .main-column,
  body.page-shop .products-section,
  body.page-shop .product-grid {
    min-width: 0;
  }

  body.page-shop .hero-section {
    display: block;
    text-align: left;
  }

  body.page-shop .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    margin-top: 0.9rem;
  }

  body.page-shop .hero-button,
  body.page-shop .hero-actions .btn-primary,
  body.page-shop .hero-actions .btn-secondary,
  body.page-shop .hero-actions .btn-outline {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    padding: 0.5rem 0.8rem;
    font-size: 0.95rem;
  }

  body.page-shop .product-grid,
  body.page-shop .products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 6px;
    row-gap: 10px;
    margin-top: 0.25rem;
  }

  body.page-shop .product-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 18px;
    padding: 0;
  }

  body.page-shop .product-card img,
  body.page-shop .product-image {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    height: auto;
    object-fit: cover;
    border-radius: 0;
  }

  body.page-shop .product-card-top {
    gap: 0.5rem;
  }

  body.page-shop .product-card-media-top {
    inset: 12px 12px auto;
  }

  body.page-shop .product-card-body {
    padding: 10px 10px 12px;
    gap: 0.5rem;
  }

  body.page-shop .product-card-badge-stack {
    margin-left: 0;
  }

  body.page-shop .product-card-bottom {
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    gap: 0.75rem;
    margin-top: 0.5rem;
  }

  body.page-shop .product-card-actions {
    width: auto;
  }

  body.page-shop .product-card-price,
  body.page-shop .product-price {
    font-size: 1.02rem;
  }

  body.page-shop .product-card-bottom .add-to-cart-button {
    padding: 6px 10px;
    min-height: 44px;
    width: 100%;
    font-size: 0.85rem;
    letter-spacing: 0;
  }

  body.page-shop .product-card-bottom .add-to-cart-button::before {
    display: none !important;
  }

  body.page-shop .product-badge,
  body.page-shop .product-category-pill,
  body.page-shop .product-launch-badge {
    min-height: 26px;
    font-size: 0.7rem;
    line-height: 1.1;
    justify-content: flex-start;
    text-align: left;
    padding: 0.22rem 0.62rem 0.22rem 0.45rem;
  }

  body.page-shop .cart-drawer-panel {
    width: 100%;
    max-width: 100%;
    top: 0;
    bottom: 0;
    padding: 80px 16px 24px 16px;
  }

  body.page-shop .checkout-modal,
  body.page-shop .checkout-dialog,
  body.page-shop .modal-content,
  body.page-shop .product-modal,
  body.page-shop .product-detail-dialog {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 20px;
    border-radius: 24px 24px 0 0 !important;
    max-height: 92vh !important;
    animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  @keyframes slide-up {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  body.page-shop .modal-backdrop,
  body.page-shop .checkout-modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
    overflow: hidden;
    overscroll-behavior: contain;
  }

  body.page-shop .checkout-modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  body.page-shop .checkout-actions {
    margin-top: 12px;
  }

  body.page-shop .product-modal,
  body.page-shop .product-detail-dialog {
    margin: 0 !important;
    max-height: 92vh;
    overflow-y: auto;
  }

  body.page-shop .product-modal-content {
    padding: 1rem;
    max-width: 100%;
  }

  body.page-shop .product-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  body.page-shop .product-modal-left,
  body.page-shop .product-modal-right {
    width: 100%;
    margin-bottom: 0;
  }

  body.page-shop .product-modal-image {
    max-height: 320px;
    object-fit: contain;
    border-radius: 12px;
  }

  body.page-shop .product-modal-actions {
    position: sticky;
    bottom: -20px;
    background: var(--bg-surface);
    padding: 1rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid var(--line-soft);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    z-index: 10;
  }

  body.page-shop .product-buy-now-button {
    grid-column: span 2;
  }

  body.page-shop .product-modal-actions .btn-primary,
  body.page-shop .product-modal-actions .btn-outline {
    min-width: 0;
    width: 100%;
  }

  body.page-shop .product-modal-trust-box .trust-row {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-shop .product-detail-layout {
    display: block;
  }

  body.page-shop .product-detail-media {
    margin-bottom: 1rem;
  }

  body.page-orders .orders-header-row {
    display: none;
  }

  body.page-orders .orders-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  body.page-orders .orders-page-status {
    text-align: left;
  }

  body.page-orders .orders-layout {
    padding: 14px;
    border-radius: 18px;
  }

  body.page-orders .orders-toolbar {
    align-items: stretch;
    padding: 0.9rem;
    margin-bottom: 12px;
  }

  body.page-orders .orders-toolbar-controls {
    width: 100%;
    align-items: stretch;
  }

  body.page-orders .orders-filter-group {
    justify-content: flex-start;
  }

  body.page-orders .orders-toolbar-secondary,
  body.page-orders .orders-utility-group {
    align-items: stretch;
    justify-content: flex-start;
  }

  body.page-orders .orders-toolbar-secondary {
    flex-direction: column;
  }

  body.page-orders .orders-utility-group {
    width: 100%;
  }

  body.page-orders .orders-search-field {
    min-width: 0;
  }

  body.page-orders .orders-select-field {
    min-width: 0;
    flex: 1 1 100%;
  }

  body.page-orders .orders-search-input {
    min-width: 0;
    width: 100%;
  }

  body.page-orders .order-label-mobile {
    display: block;
  }

  body.page-orders .order-card-header {
    grid-template-columns: 1fr 1fr;
    row-gap: 0.75rem;
    padding: 0.9rem 0.95rem 0.8rem;
  }

  body.page-orders .order-card-body {
    grid-template-columns: 1fr;
    gap: 0.9rem;
    padding: 0.85rem 0.95rem 0.95rem;
  }

  body.page-orders .order-cell-action {
    justify-content: flex-start;
    margin-top: 0;
  }

  body.page-orders .order-row-details {
    margin-top: 0.1rem;
  }

  body.page-orders .order-status-badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  body.page-orders .orders-cell-status {
    justify-content: flex-start;
  }

  body.page-orders .order-actions-group {
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
  }

  body.page-orders .order-primary-actions,
  body.page-orders .order-feedback-actions {
    width: 100%;
  }

  body.page-orders .order-details-button {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  body.page-orders .order-feedback-actions {
    align-items: flex-start;
  }

  body.page-orders .order-feedback-button {
    width: auto;
    min-height: 24px;
    padding: 0.08rem 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #6b7280;
    justify-content: flex-start;
    text-decoration: underline;
  }

  body.page-orders .order-status-timeline .timeline-track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 0.25rem;
  }

  body.page-orders .timeline-step .timeline-label {
    font-size: 0.7rem;
  }

  body.page-seller,
  body.page-admin {
    overflow-x: hidden;
  }

  body.page-seller .seller-dashboard,
  body.page-seller .seller-main,
  body.page-seller .seller-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body.page-seller .seller-layout,
  body.page-seller .seller-dashboard-grid {
    display: block;
  }

  body.page-seller .seller-login,
  body.page-seller .seller-auth-card,
  body.page-seller .seller-shell {
    max-width: 100%;
    margin: 1rem auto;
    padding: 1rem;
  }

  body.page-seller .seller-login form,
  body.page-seller .seller-auth-card form,
  body.page-seller .seller-form,
  body.page-seller .seller-product-form {
    width: 100%;
  }

  body.page-seller .seller-earnings-cards {
    grid-template-columns: 1fr;
  }

  body.page-seller .seller-card,
  body.page-seller .seller-panel,
  body.page-seller .seller-dashboard-note,
  body.page-seller .seller-dashboard-section,
  body.page-seller .seller-products {
    margin-bottom: 1rem;
  }

  body.page-seller .seller-products-table,
  body.page-seller .seller-products-list,
  body.page-seller .my-products-list {
    width: 100%;
    overflow-x: auto;
  }

  body.page-seller .my-product-main h3,
  body.page-seller .my-product-main p {
    word-break: break-word;
  }

  body.page-seller .seller-product-image-workspace {
    grid-template-columns: 1fr;
  }

  body.page-seller .seller-product-image-url-row {
    grid-template-columns: 1fr;
  }

  body.page-admin .admin-page,
  body.page-admin .admin-dashboard,
  body.page-admin .admin-content,
  body.page-admin .admin-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body.page-admin .admin-layout,
  body.page-admin .admin-main-grid {
    display: block;
  }

  body.page-admin .admin-login,
  body.page-admin .admin-auth-card,
  body.page-admin .admin-auth-shell {
    max-width: 100%;
    margin: 1rem auto;
    padding: 1rem;
  }

  body.page-admin .admin-login form,
  body.page-admin .admin-auth-card form {
    width: 100%;
  }

  body.page-admin .admin-stats-grid,
  body.page-admin .admin-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  body.page-admin .admin-stat-card,
  body.page-admin .admin-metric-card {
    padding: 0.75rem 0.9rem;
  }

  body.page-admin .admin-orders-table,
  body.page-admin .admin-orders-list,
  body.page-admin .admin-table-wrapper,
  body.page-admin .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.page-admin .admin-orders-table,
  body.page-admin .admin-table {
    min-width: 680px;
  }

  body.page-admin .admin-orders-table th,
  body.page-admin .admin-orders-table td {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
  }

  body.page-admin .admin-controls,
  body.page-admin .admin-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  body.page-admin .admin-controls > * {
    flex: 1 1 100%;
  }

  body.page-admin .admin-orders-search {
    max-width: none;
    width: 100%;
  }

  .sell-landing-page {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }

  .sell-lead {
    font-size: 1rem;
  }
}

@media (max-width: 680px) {
  body.page-shop .cart-drawer-panel {
    width: 100%;
    padding: 12px;
  }

  body.page-shop .checkout-summary-row {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-shop .checkout-shipping-grid {
    grid-template-columns: 1fr;
  }

  body.page-shop .checkout-summary-total {
    text-align: left;
  }

  body.page-shop .order-success-summary {
    grid-template-columns: 1fr;
  }

  body.page-shop .checkout-confirmation-grid {
    grid-template-columns: 1fr;
  }

  body.page-shop .orders-history-items li {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-profile .profile-form {
    grid-template-columns: 1fr;
  }

  body.page-shop .orders-history-item-actions {
    justify-content: flex-start;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-shop .footer-content {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.page-shop .footer {
    padding: 18px 14px;
  }
}

@media (max-width: 640px) {
  body.page-orders .feedback-modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  body.page-orders .feedback-modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  body.page-orders .feedback-modal-footer .btn-primary,
  body.page-orders .feedback-modal-footer .btn-secondary {
    width: 100%;
  }

  body.page-orders .buyer-msg-overlay:not([hidden]) {
    padding: 0;
    align-items: flex-end;
  }

  body.page-orders .buyer-msg-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
  }

  body.page-orders .buyer-msg-thread {
    max-height: 240px;
  }

  body.page-shop .seller-info-top {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-shop .product-reviews-header {
    align-items: flex-start;
  }

  body.page-shop .product-review-sort-label {
    margin-left: 0;
  }

  body.page-shop .product-review-top {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-admin .admin-auth-shell {
    padding: 16px;
    border-radius: 18px;
  }

  body.page-admin .admin-header {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-admin .admin-header-actions {
    width: 100%;
  }

  body.page-admin .admin-header-actions .btn-outline {
    flex: 1;
  }

  body.page-admin .seller-detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-admin .seller-detail-actions {
    width: 100%;
  }

  body.page-admin .seller-detail-actions .btn-outline {
    flex: 1;
  }

  body.page-admin .admin-controls {
    grid-template-columns: 1fr;
  }

  body.page-admin .admin-filter-actions {
    align-items: stretch;
  }

  body.page-admin .summary-grid {
    grid-template-columns: 1fr;
  }

  body.page-admin .notifications-controls {
    align-items: stretch;
  }

  body.page-admin .notification-time {
    margin-left: 0;
    width: 100%;
  }

  body.page-admin .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.page-admin .admin-table {
    font-size: 12px;
  }

  body.page-admin .admin-table th,
  body.page-admin .admin-table td {
    padding: 8px 6px;
  }

  body.page-admin .order-top-row {
    align-items: flex-start;
    flex-direction: column;
  }

  body.page-admin .order-status-controls {
    align-items: stretch;
    flex-direction: column;
  }

  body.page-admin .order-status-select,
  body.page-admin .order-status-controls .order-status-update-btn {
    width: 100%;
  }

  body.page-admin .order-items-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-admin .chart-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-admin .orders-pager {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-admin .orders-page-controls {
    justify-content: space-between;
  }

  body.page-admin .seller-detail-kpis {
    grid-template-columns: 1fr;
  }

  body.page-orders .order-row {
    grid-template-columns: 1fr;
  }

  body.page-orders .order-row-details {
    margin-top: 0.25rem;
  }

  body.page-order-details .order-details-header {
    flex-direction: column;
    align-items: flex-start;
  }

  body.page-order-details .order-status-timeline .timeline-track {
    column-gap: 0.25rem;
  }

  body.page-order-details .order-status-timeline .timeline-step .timeline-label {
    font-size: 10px;
  }

  body.page-order-details .order-details-item {
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: flex-start;
  }

  body.page-order-details .order-details-item-line-total {
    grid-column: 1 / -1;
  }

  body.page-payment-status .payment-status-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-payment-status .payment-status-actions .btn-primary,
  body.page-payment-status .payment-status-actions .btn-outline {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body.page-shop .hero-section {
    min-height: auto;
    padding: 16px 14px;
    border-radius: 16px;
  }

  body.page-shop .hero-body {
    padding: 0;
  }

  body.page-shop .hero-content {
    max-width: 100%;
  }

  body.page-shop .hero-title {
    margin-top: 5px;
    font-size: 1.28rem;
    line-height: 1.16;
    letter-spacing: -0.02em;
  }

  body.page-shop .hero-subtitle-desktop {
    display: none;
  }

  body.page-shop .hero-subtitle-mobile {
    display: block;
    margin: 0.42rem 0 0;
    font-size: 0.84rem;
    line-height: 1.38;
    max-width: 28ch;
  }

  body.page-shop .hero-actions {
    margin-top: 0.8rem;
  }

  body.page-shop .hero-trust-bar {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 9px;
    margin-top: 14px;
    padding-top: 13px;
    font-size: 12.5px;
    text-align: left;
  }

  body.page-shop .trust-item {
    gap: 8px;
  }

  body.page-shop .hero-trust-bar .trust-item:nth-child(n + 3) {
    display: none;
  }

  body.page-shop .hero-category-pills {
    display: none;
  }
}

@media (max-width: 430px) {
  body.page-shop .hero-section {
    padding: 14px 12px;
  }

  body.page-shop .hero-pill {
    padding: 4px 8px;
    font-size: 9.5px;
  }

  body.page-shop .hero-title {
    font-size: 1.2rem;
  }

  body.page-shop .hero-subtitle-mobile {
    max-width: 26ch;
    font-size: 0.82rem;
  }
}

@media (max-width: 360px) {
  body.page-shop .hero-title {
    font-size: 1.12rem;
  }

  body.page-shop .hero-subtitle-mobile {
    max-width: 24ch;
    font-size: 0.79rem;
  }

  body.page-shop .hero-trust-bar {
    gap: 8px;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  body.page-shop .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  body.page-shop .hero-button {
    width: 100%;
  }

  body.page-shop .product-grid,
  body.page-shop .products-grid {
    grid-template-columns: 1fr;
  }

  body.page-shop .product-card,
  body.page-shop .checkout-modal,
  body.page-shop .product-modal,
  body.page-shop .order-success-modal,
  body.page-shop .auth-modal,
  body.page-shop .orders-history-modal {
    padding: 14px;
  }

  /* Auth form submit buttons: full-width on mobile for an ergonomic tap target.
     Secondary buttons (btn-small) keep justify-self: start via the base rule. */
  body.page-shop .auth-form button[type="submit"] {
    justify-self: stretch;
  }

  body.page-shop .checkout-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-shop .cart-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-seller .seller-shell,
  body.page-admin .admin-shell {
    padding: 14px;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .header-nav,
  .top-nav {
    flex-wrap: wrap;
  }

  .header-right {
    width: auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem; /* Phase 1: mobile header declutter */
    min-width: 0;
  }

  .header-account,
  .header-account .account-menu,
  .account-menu .account-button {
    min-width: 0;
    max-width: 100%;
  }

  .header-account .account-button.account-button-signed-out {
    min-width: 0;
    padding: 0.48rem 0.82rem 0.48rem 0.7rem;
  }

  .account-label {
    display: none;
  }

  .top-bar-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body.page-product-detail .product-detail-top-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-product-detail .product-detail-top-actions .btn-secondary,
  body.page-product-detail .product-detail-price-block .btn-primary {
    width: 100%;
    justify-content: center;
  }

  body.page-order-details .order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  body.page-order-details .order-actions > * {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
    justify-content: center;
  }

  body.page-order-details .order-details-line,
  body.page-order-details .order-meta,
  body.page-orders .orders-page-order-ref,
  body.page-orders .order-row-meta,
  body.page-profile .profile-intro p {
    overflow-wrap: anywhere;
  }

  body.page-shop .cart-item-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  body.page-shop .cart-item-main {
    flex: 1 1 calc(100% - 92px);
  }

  body.page-shop .cart-item-controls {
    width: 100%;
    justify-content: space-between;
  }

  body.page-shop .cart-line {
    min-width: 0;
    margin-left: auto;
  }

  body.page-shop .checkout-item-row {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: flex-start;
  }

  body.page-shop .checkout-item-price {
    grid-column: 2;
    justify-self: start;
    white-space: normal;
  }

  body.page-seller .seller-tabs,
  body.page-admin .admin-dashboard-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.page-seller .seller-tab,
  body.page-admin .admin-dashboard-tabs .seller-tab {
    flex: 0 0 auto;
  }

  body.page-seller .seller-dashboard-tools {
    width: 100%;
  }

  body.page-seller .seller-dashboard-tools > * {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }

  body.page-seller .dashboard-notification-bell,
  body.page-seller #btn-logout {
    width: 100%;
    justify-content: center;
  }

  body.page-admin .admin-header-actions {
    width: 100%;
    align-items: stretch;
  }

  body.page-admin .admin-global-search-shell {
    flex: 1 1 100%;
    max-width: none;
    order: -1;
  }

  body.page-admin .admin-header-actions > .btn-outline,
  body.page-admin .admin-header-actions > .btn-primary,
  body.page-admin .admin-header-actions > .dashboard-notification-shell {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: 0;
  }

  body.page-admin .dashboard-notification-bell {
    width: 100%;
    justify-content: center;
  }

  body.page-admin .orders-pager-main,
  body.page-admin .orders-page-buttons,
  body.page-admin .orders-page-jump {
    width: 100%;
  }

  body.page-admin .orders-page-jump {
    margin-left: 0;
  }

  body.page-admin .orders-page-jump input {
    flex: 1 1 4.5rem;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .header-right {
    justify-content: flex-end;
  }

  .top-bar-right .profile-pill {
    width: 100%;
    justify-content: center;
  }

  .dashboard-notification-panel {
    width: min(22rem, calc(100vw - 2rem));
  }

  .dashboard-notification-panel-header,
  .dashboard-notification-entry-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .dashboard-notification-time {
    width: 100%;
  }

  body.page-orders .order-actions-group {
    width: 100%;
  }

  body.page-orders .order-actions-group > * {
    flex: 1 1 100%;
    justify-content: center;
  }

  body.page-order-details .order-actions > * {
    flex-basis: 100%;
  }

  body.page-profile .profile-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-profile .profile-actions > * {
    width: 100%;
    justify-content: center;
  }

  body.page-shop .checkout-actions .checkout-secondary-button,
  body.page-shop .checkout-actions .checkout-primary-button,
  body.page-shop .checkout-actions .checkout-stripe-button {
    width: 100%;
    justify-content: center;
  }

  body.page-seller .seller-dashboard-tools > * {
    flex-basis: 100%;
  }

  body.page-seller .seller-product-image-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  body.page-seller .seller-product-image-thumb {
    width: 72px;
    height: 72px;
  }

  body.page-seller .seller-orders-actions > * {
    flex: 1 1 100%;
  }

  body.page-seller .seller-fulfillment-dialog-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  body.page-admin .admin-header-actions > .btn-outline,
  body.page-admin .admin-header-actions > .btn-primary,
  body.page-admin .admin-header-actions > .dashboard-notification-shell {
    flex-basis: 100%;
  }

  body.page-admin .admin-filter-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  body.page-admin .admin-filter-actions > * {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }
}

@media (max-width: 480px) {
  body.page-order-details .order-summary-row,
  body.page-order-details .order-details-summary-line,
  body.page-order-details .order-details-total {
    flex-wrap: wrap;
  }

  body.page-shop .checkout-item-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  body.page-shop .checkout-item-price {
    grid-column: 1 / -1;
    padding-left: 54px;
  }

  body.page-shop .cart-item-controls {
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }

  body.page-admin .admin-filter-actions > * {
    flex-basis: 100%;
  }

  body.page-orders .status-badge,
  body.page-order-details .status-badge,
  body.page-seller .status-badge,
  body.page-admin #admin-dashboard-root .status-badge {
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }
}

@media (max-width: 768px) {
  body.page-shop.mobile-category-drawer-open {
    overflow: hidden;
  }

  body.page-shop .category-sidebar,
  body.page-shop #categories-sidebar {
    display: none;
  }

  body.page-shop .homepage-catalog-tools {
    display: block !important;
  }

  body.page-shop .catalog-controls {
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    grid-template-columns: 1fr;
  }

  body.page-shop .catalog-sort {
    width: 100%;
  }

  body.page-shop .catalog-reset-button {
    margin-left: 0;
  }

  body.page-shop .mobile-category-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 930;
    opacity: 1;
    transition: opacity 0.22s ease;
  }

  body.page-shop .mobile-category-menu[hidden],
  body.page-shop .mobile-category-backdrop[hidden] {
    display: none !important;
  }

  body.page-shop .mobile-category-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(21rem, calc(100vw - 2.75rem));
    max-width: 100%;
    margin-top: 0;
    padding: 1rem;
    display: block;
    overflow-y: auto;
    background: #ffffff;
    box-shadow: 20px 0 45px rgba(15, 23, 42, 0.2);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 940;
  }

  body.page-shop .mobile-category-menu.is-open {
    display: block;
    transform: translateX(0);
  }

  body.page-shop .mobile-category-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid #edf2f7;
  }

  body.page-shop .mobile-category-menu-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f2233;
    letter-spacing: -0.01em;
  }

  body.page-shop .mobile-category-close {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid #d7dee7;
    border-radius: 999px;
    background: #f4f7fb;
    color: #3a5068;
    padding: 0.38rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    transition:
      background 0.12s ease,
      border-color 0.12s ease;
  }

  body.page-shop .mobile-category-close:hover {
    background: #e9eef5;
    border-color: #b8c8d8;
  }

  body.page-shop .mobile-category-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  body.page-shop .mobile-category-menu-list .mobile-category-option {
    width: 100%;
    min-height: 2.5rem;
    justify-content: flex-start;
    margin: 0;
  }

  body.page-shop .search-row {
    margin-top: 0;
    margin-bottom: 0.45rem;
  }

  body.page-shop .filter-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0.6rem;
  }

  body.page-shop .filter-chips::-webkit-scrollbar {
    display: none;
  }

  /* Horizontal Scroll Carousel for shop modal Related Products */
  body.page-shop .product-modal-related-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding: 0.25rem 0 1rem !important;
    gap: 12px !important;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  body.page-shop .product-modal-related-grid::-webkit-scrollbar {
    display: none;
  }

  body.page-shop .product-modal-related-card {
    flex: 0 0 82% !important;
    scroll-snap-align: start;
  }

  /* Seller Storefront Mobile Improvements */
  body.page-seller-storefront .storefront-header {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 1rem;
  }

  body.page-seller-storefront .storefront-avatar {
    margin-top: 0;
    border: 0;
    box-shadow: none;
  }

  body.page-seller-storefront .storefront-banner {
    height: 160px;
    border-radius: 14px;
  }

  body.page-shop .product-feedback {
    min-height: 0;
    margin-bottom: 0.35rem;
  }

  body.page-shop .product-feedback:empty,
  body.page-shop #catalog-status:empty {
    display: none;
  }

  body.page-shop #productLoadingState[hidden] {
    display: none !important;
  }

  body.page-shop .catalog-header {
    display: block;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 0.75rem;
  }

  body.page-shop .product-grid,
  body.page-shop .products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 6px; /* Phase 1: tighter product grid */
    row-gap: 10px;
    margin-top: 0.5rem;
  }

  body.page-shop .product-card {
    min-width: 0;
    padding: 0;
    gap: 0;
    border-radius: 16px;
  }

  body.page-shop .product-card img,
  body.page-shop .product-image {
    height: 148px;
    border-radius: 0;
  }

  body.page-shop .product-card-top {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 0.35rem;
  }

  body.page-shop .product-card-media-top {
    inset: 10px 10px auto;
  }

  body.page-shop .product-card-body {
    padding: 12px 12px 14px;
    gap: 0.72rem;
  }

  body.page-shop .product-card-badge-stack {
    justify-content: flex-start;
    justify-self: start;
    margin-left: 0;
  }

  body.page-shop .product-name,
  body.page-shop .product-card h3 {
    font-size: 0.92rem;
  }

  body.page-shop .product-description {
    font-size: 0.78rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  body.page-shop .product-card-price,
  body.page-shop .product-price {
    font-size: 1rem;
    margin-block: 0;
    min-height: 0;
    padding: 0;
  }

  body.page-shop .product-card-price-label {
    font-size: 8px;
  }

  body.page-shop .product-card-bottom .add-to-cart-button {
    min-height: 44px;
    padding: 6px;
    width: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.page-shop .add-to-cart-text {
    display: none;
  }

  body.page-shop .cart-btn-icon {
    display: block;
    width: 20px;
    height: 20px;
  }

  body.page-shop .product-card-bottom .add-to-cart-button::before {
    display: none !important;
  }

  body.page-payment-status .order-confirmation-page {
    padding: 0 12px 24px;
    min-width: 0;
  }

  body.page-payment-status .order-confirmation-card {
    overflow: hidden;
  }

  body.page-payment-status .order-confirmation-heading,
  body.page-payment-status .order-confirmation-digital-text,
  body.page-payment-status .order-confirmation-item-main {
    min-width: 0;
  }

  body.page-payment-status .order-confirmation-heading p,
  body.page-payment-status .order-confirmation-note,
  body.page-payment-status .order-confirmation-item-title,
  body.page-payment-status .order-confirmation-item-qty,
  body.page-payment-status .order-confirmation-digital-value {
    overflow-wrap: anywhere;
  }

  body.page-payment-status .order-confirmation-summary .status-badge {
    white-space: normal;
    text-align: center;
  }

  body.page-orders .order-row {
    gap: 0.65rem 0.85rem;
    align-items: flex-start;
  }

  body.page-orders .order-cell,
  body.page-orders .orders-cell-date,
  body.page-orders .orders-cell-status,
  body.page-orders .orders-cell-total,
  body.page-orders .order-cell-action {
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
  }

  body.page-orders .orders-col-status {
    white-space: normal;
  }

  body.page-orders .orders-cell-status .status-badge,
  body.page-orders .order-total,
  body.page-orders .order-date {
    align-self: flex-start;
  }

  body.page-orders .order-actions-group {
    width: 100%;
    justify-content: flex-start;
  }

  body.page-orders .order-actions-group > * {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }

  body.page-seller #seller-dashboard-tabs {
    position: sticky;
    top: calc(120px + env(safe-area-inset-top));
    z-index: 24;
    margin: 0.75rem 0 1rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(12px);
  }

  body.page-seller .seller-dashboard-panel {
    scroll-margin-top: 8rem;
  }

  body.page-seller .seller-ledger-toolbar,
  body.page-seller .seller-ledger-pager {
    align-items: stretch;
  }

  body.page-seller .seller-ledger-filters {
    width: 100%;
  }

  body.page-seller .seller-ledger-filters .form-field {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }

  body.page-seller .seller-ledger-table-wrap,
  body.page-seller .seller-orders-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  body.page-seller .seller-ledger-table {
    min-width: 680px;
  }

  body.page-seller .seller-ledger-table th,
  body.page-seller .seller-ledger-table td {
    padding: 0.7rem 0.75rem;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  body.page-payment-status .order-confirmation-header {
    align-items: flex-start;
  }

  body.page-payment-status .order-confirmation-summary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  body.page-payment-status .order-confirmation-summary-row > span:last-child {
    max-width: 100%;
    text-align: left;
    overflow-wrap: anywhere;
  }

  body.page-payment-status .order-confirmation-item {
    flex-direction: column;
  }

  body.page-payment-status .order-confirmation-item-total {
    align-self: flex-start;
  }
}

@media (max-width: 520px) {
  body.page-shop .mobile-category-menu {
    width: min(20rem, calc(100vw - 1.5rem));
    padding: 0.9rem;
  }

  body.page-shop .product-card {
    padding: 0;
  }

  body.page-shop .product-card img,
  body.page-shop .product-image {
    height: auto; /* 1-column layout — restore aspect-ratio: 1 set in the max-width: 768px block */
  }

  body.page-shop .product-card-body {
    padding: 11px 11px 13px;
  }

  body.page-seller .seller-ledger-filters .form-field,
  body.page-seller .seller-ledger-filters > button {
    flex-basis: 100%;
  }

  body.page-seller .seller-ledger-table {
    min-width: 620px;
  }

  body.page-orders .order-actions-group > * {
    flex-basis: 100%;
  }
}

@media (max-width: 340px) {
  body.page-shop .product-grid,
  body.page-shop .products-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================================
   BUG-FIX PASS 2 — Targeted mobile fixes
   ============================================== */

/* Issues 1 & 2: Remove section description clutter and redundant catalog-header
   on mobile so products are visible sooner with no large blank gap.
   Root cause of the gap: catalog-search has flex: 1 1 280px; in column layout
   that flex-basis becomes HEIGHT (280px), creating ~240px of empty space below
   the 40px input. Fix: reset flex to auto on mobile. */
/* Conflict removed: Moved to premium mobile block */

/* Conflict removed: 1-column grid enforced */

/* Issue 4: Payment success — prevent long Stripe reference from overflowing. */
@media (max-width: 640px) {
  body.page-payment-status .order-confirmation-summary-row {
    flex-wrap: wrap;
  }

  body.page-payment-status .order-confirmation-summary-row > span:last-child {
    min-width: 0;
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  body.page-payment-status .order-confirmation-digital-value {
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  body.page-payment-status .order-confirmation-card {
    padding: 14px 12px 18px;
  }

  body.page-payment-status .order-confirmation-page {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Issue 5: My Orders — prevent cell overflow and ensure clean button alignment. */
@media (max-width: 640px) {
  body.page-orders .order-row {
    overflow: hidden;
  }

  body.page-orders .order-cell,
  body.page-orders .order-meta,
  body.page-orders .order-main {
    min-width: 0;
    max-width: 100%;
  }

  body.page-orders .orders-page-order-ref {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }

  body.page-orders .order-actions-group {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body.page-orders .order-actions-group > * {
    flex: 0 0 auto;
  }
}

/* Issues 7 & 8: Seller — tables scrollable, section tabs compact. */
@media (max-width: 768px) {
  /* Issue 7: Explicitly constrain table wrappers so overflow-x:auto works */
  body.page-seller .seller-ledger-table-wrap,
  body.page-seller .seller-orders-table-wrap,
  body.page-seller .seller-orders-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  body.page-seller .seller-ledger-section,
  body.page-seller .seller-orders-section {
    overflow: visible;
  }

  /* Issue 8: Seller section tabs — keep compact, don't stretch to full width */
  body.page-seller #seller-dashboard-tabs {
    width: auto;
    max-width: 100%;
    display: inline-flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    align-self: flex-start;
  }

  body.page-seller #seller-dashboard-tabs .seller-tab {
    padding: 6px 11px;
    font-size: 12px;
    flex: 0 0 auto;
  }

  /* Also compact the auth tabs (Login / Create seller account) */
  body.page-seller .seller-tabs:not(#seller-dashboard-tabs) {
    width: auto;
    max-width: 100%;
    display: inline-flex;
  }
}

/* Issue 6: Seller sticky tabs — tighten the top offset to better clear the header. */
@media (max-width: 768px) {
  body.page-seller #seller-dashboard-tabs {
    top: 78px;
  }
}

/* ── Mobile filter drawer (below desktop breakpoint) ── */
@media (max-width: 1080px) {
  /* Convert homepage-left-column to a slide-in drawer */
  body.page-shop.desktop-filter-panel-ready .homepage-left-column {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    width: min(348px, calc(100vw - 28px));
    max-width: 348px;
    z-index: 850;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 252, 0.99));
    border-right: 1px solid rgba(217, 227, 236, 0.92);
    border-radius: 0 24px 24px 0;
    box-shadow: 18px 0 42px rgba(15, 23, 42, 0.12);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    max-height: none;
    align-self: auto;
    padding: 0 0 20px;
  }

  body.page-shop.desktop-filter-panel-ready.desktop-filter-panel-open .homepage-left-column {
    transform: translateX(0);
    pointer-events: auto;
  }

  /* Show the close header inside the drawer */
  body.page-shop.desktop-filter-panel-ready .desktop-filter-panel-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px;
    border-bottom: 1px solid #e7eef5;
    position: sticky;
    top: 0;
    background: rgba(252, 253, 254, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2;
    flex-shrink: 0;
  }

  /* Reset sidebar-left inside drawer */
  body.page-shop.desktop-filter-panel-ready .sidebar-left {
    order: unset;
    position: static;
    top: auto;
    max-height: none;
    overflow-y: visible;
    align-self: auto;
    padding: 10px 0 20px;
    flex: 1;
  }

  /* Show categories inside drawer, above filters */
  body.page-shop.desktop-filter-panel-ready #categories-sidebar {
    display: block !important;
    padding: 10px 18px 0;
    flex-shrink: 0;
  }

  body.page-shop.desktop-filter-panel-ready #categories-sidebar .sidebar-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
  }

  body.page-shop.desktop-filter-panel-ready #categories-sidebar .sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 8px;
  }

  body.page-shop.desktop-filter-panel-ready #categories-sidebar .categories-list {
    display: block;
  }

  body.page-shop.desktop-filter-panel-ready #categories-sidebar .sidebar-section {
    display: block;
    border: none;
    padding: 0;
    margin: 0 0 10px;
  }

  body.page-shop.desktop-filter-panel-ready #categories-sidebar .sidebar-section-title {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 4px 0 2px;
  }

  body.page-shop.desktop-filter-panel-ready #categories-sidebar .category-link,
  body.page-shop.desktop-filter-panel-ready #categories-sidebar button {
    display: block;
    width: 100%;
    text-align: left;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.88rem;
    min-height: unset;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #334155;
  }

  body.page-shop.desktop-filter-panel-ready #categories-sidebar .category-link.active,
  body.page-shop.desktop-filter-panel-ready #categories-sidebar button.active {
    background: #fff4ee;
    color: #e8651a;
    font-weight: 600;
  }

  /* Divider between categories and filters */
  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools {
    border-top: 1px solid #e7eef5;
    padding: 12px 18px 18px;
    margin-top: 6px;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-tools-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.62rem;
    max-width: none;
    margin-bottom: 0.78rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-search {
    display: none;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-reset-button {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    border-radius: 14px;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-server-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    padding: 0;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-price-filter:nth-child(3),
  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-stock-toggle,
  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-filter-actions {
    grid-column: 1 / -1;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-stock-toggle {
    min-height: 44px;
    padding: 0.7rem 0.95rem;
    white-space: normal;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-filter-actions {
    order: initial;
    gap: 0.52rem;
    margin: 0;
    padding-top: 0.62rem;
    border-top: 1px solid #e7eef5;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-filter-apply-hint {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  body.page-shop.desktop-filter-panel-ready .homepage-catalog-tools .catalog-apply-button {
    min-height: 44px;
    border-radius: 14px;
    box-shadow: none;
  }

  /* Hide the hero filter button on mobile — hamburger is the sole entry point */
  body.page-shop .desktop-filter-toggle {
    display: none !important;
  }

  /* Backdrop: show on mobile when drawer is open */
  body.page-shop.desktop-filter-panel-ready.desktop-filter-panel-open .desktop-filter-backdrop {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 840;
  }

  /* Premium Mobile: Auto-advancing Zagrin Picks Carousel */

  body.page-shop .picks-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 14px;
    padding: 0 4px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.page-shop .picks-track::-webkit-scrollbar {
    display: none;
  }

  body.page-shop .picks-track .pick-card {
    flex: 0 0 75vw;
    max-width: none;
    min-width: 0;
    scroll-snap-align: center;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  body.page-shop .picks-dots {
    display: none;
  }
}

@media (max-width: 420px) {
  body.page-shop.desktop-filter-panel-ready .homepage-left-column {
    width: min(324px, calc(100vw - 40px));
    max-width: 324px;
  }
}

@media (max-width: 768px) {
  body.page-shop .picks-header {
    padding: 0 1rem; /* Phase 1: mobile homepage gutters */
  }
  body.page-shop .picks-track {
    padding: 0 1rem 8px; /* Phase 1: mobile homepage gutters */
  }
}

/* Respect prefers-reduced-motion for the mobile category menu slide animation */
@media (prefers-reduced-motion: reduce) {
  body.page-shop .mobile-category-menu {
    transition: none;
  }
}
