@media (max-width: 768px) {
  html,
  body {
    overscroll-behavior-x: none;
  }

  body.buyer-ui {
    min-height: 100dvh;
    background-size: auto, auto, 620px auto;
    touch-action: pan-y;
  }

  body.buyer-ui::before,
  body.buyer-ui::after {
    width: 180px;
    height: 180px;
    filter: blur(34px);
    opacity: 0.22;
  }

  .container {
    width: min(100%, 480px);
    margin-inline: auto;
    padding: 12px max(12px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }

  .navbar {
    overflow-x: clip;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .nav-inner {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    gap: 8px;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

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

  .nav-link {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hero {
    padding: 16px;
  }

  .hero h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  .home-page .hero {
    gap: 10px;
    padding: 14px 14px 12px;
  }

  .home-hero-title-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .home-page .hero h1 {
    max-width: none;
    font-size: 24px;
    line-height: 1.06;
  }

  .home-page .hero .muted {
    font-size: 13px;
    line-height: 1.48;
  }

  .home-page #global-search {
    max-width: 100%;
    min-height: 40px;
  }

  .home-hero-mark {
    display: none;
  }

  .home-order-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .home-order-summary {
    padding: 12px;
  }

  .home-order-summary-title {
    font-size: 16px;
  }

  .home-order-summary-sub {
    font-size: 11px;
  }

  .home-order-panel {
    padding: 0 10px 10px;
  }

  .home-need-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-x: visible;
    padding: 0;
    scroll-snap-type: none;
  }

  .home-usp-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-x: visible;
    padding: 0;
    scroll-snap-type: none;
  }

  .home-usp-card,
  .home-need-card {
    min-width: 0;
    min-height: 0;
    padding: 10px;
  }

  .home-usp-card span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-need-card span {
    display: block;
  }

  .home-support-banner {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .home-support-actions {
    justify-content: flex-start;
  }

  .products-page .products-filter-card {
    padding: 10px;
  }

  .products-page .products-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .products-page .filter-field-search,
  .products-page .products-filter-actions {
    grid-column: 1 / -1;
  }

  .products-page .products-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .products-page .products-filter-actions button {
    width: 100%;
  }

  .products-page .products-filter-status {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 9px;
    padding-top: 9px;
  }

  .products-page .active-filter-chips {
    justify-content: flex-start;
  }

  .card {
    padding: 12px;
  }

  .card h4 {
    font-size: 16px;
  }

  .card .row {
    flex-wrap: nowrap;
  }

  .product-card .row {
    gap: 10px;
  }

  .product-card .row .add-btn {
    font-size: 13px;
    padding: 8px 10px;
  }

  .product-card {
    padding: 8px;
    gap: 6px;
    min-height: 220px;
  }

  .product-card h4 {
    min-height: 0;
    font-size: 13px;
    line-height: 1.24;
    font-weight: 700;
  }

  .product-card .product-card-media {
    min-height: 122px;
  }

  .product-card .product-card-body {
    min-height: 88px;
    grid-template-rows: auto minmax(34px, auto) auto;
    padding-inline: 1px;
  }

  .product-card .product-social-inline { gap: 4px; }

  .product-card .rating-chip,
  .product-card .like-btn {
    font-size: 9px;
    font-weight: 700;
  }

  .product-price-row .price-now {
    font-size: 14px;
    font-weight: 800;
  }

  .product-price-row .price-old {
    font-size: 11px;
  }

  .product-price-row {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .product-price-row .price-group {
    width: 100%;
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .product-price-row .detail-link {
    min-width: 0;
    width: fit-content !important;
    max-width: calc(100% - 8px);
    margin-left: 0;
    justify-content: center;
    align-self: center;
    height: 28px;
    min-height: 28px;
    max-height: 28px;
    line-height: normal;
    padding: 0 10px;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    font-weight: 700;
  }

  .product-card .shop-image {
    width: 88px;
    height: 88px;
    margin-inline: auto !important;
    left: auto !important;
    right: auto !important;
  }

  .product-card .product-card-media {
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
  }

  .qty-stepper {
    grid-template-columns: 38px minmax(64px, 78px) 38px;
    gap: 5px;
    padding: 5px;
    margin: 2px 0 10px;
    border-radius: 999px;
  }

  .qty-btn {
    width: 38px;
    min-width: 38px;
    height: 34px;
    min-height: 34px;
    font-size: 20px;
    border-radius: 999px;
  }

  .qty-input {
    min-width: 64px;
    height: 34px;
    min-height: 34px;
    font-size: 14px;
    border-radius: 999px;
  }

  .add-cart-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .detail-main-image {
    max-width: 100%;
    margin-inline: auto;
  }

  .product-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pdp-summary-block,
  .pdp-copy-block,
  .pdp-purchase-block {
    padding: 10px;
  }

  .pdp-purchase-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .pdp-inline-total {
    align-items: flex-start;
  }

  .pdp-action-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .add-cart-btn.add-cart-btn-wide {
    min-width: 132px;
    height: 38px;
    min-height: 38px;
    padding: 0 14px;
    font-size: 12px;
  }

  .product-detail-page .pdp-purchase-block {
    position: sticky;
    bottom: 10px;
    z-index: 8;
    box-shadow: 0 12px 24px rgba(98, 114, 186, 0.16);
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary-card {
    position: static;
    order: -1;
  }

  .cart-item-card {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .cart-item-media .shop-image {
    width: 74px;
    height: 74px;
  }

  .cart-item-head,
  .cart-item-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-line-total {
    justify-items: start;
  }

  .cart-qty-input {
    max-width: 88px;
  }

  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .payment-options {
    grid-template-columns: 1fr;
  }

  .order-summary-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "primary toggle"
      "total chips";
    align-items: start;
    gap: 8px;
  }

  .order-summary-grid .order-primary { grid-area: primary; }
  .order-summary-grid .order-toggle-btn { grid-area: toggle; justify-self: end; }
  .order-summary-grid .order-total { grid-area: total; }
  .order-summary-grid .order-chips { grid-area: chips; justify-content: flex-end; }

  .order-detail-meta {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .section-title {
    width: 100%;
    margin: 12px 0 8px;
    padding: 0 1px 7px;
    border-bottom: 1px solid rgba(184, 198, 247, 0.72);
  }

  .featured-title {
    width: 100%;
    font-size: 18px;
    line-height: 1.25;
  }

  .featured-title::before {
    width: clamp(110px, 34vw, 170px);
    bottom: -8px;
  }

  .featured-title::after {
    content: none;
  }

  .category-sidebar {
    top: 118px;
    left: 10px;
    width: min(calc(100vw - 20px), 460px);
    padding: 12px;
    border-radius: 14px;
  }

  .category-sidebar-title {
    font-size: 17px;
  }

  .category-sidebar-link {
    padding: 9px 10px;
  }
}

@media (max-width: 1024px) {
  body.buyer-ui .nav-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    align-content: flex-start;
    gap: 8px;
    row-gap: 8px;
    height: auto;
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  body.buyer-ui .brand {
    width: 100%;
    min-width: 0;
  }

  body.buyer-ui .brand-link {
    min-height: 48px;
    padding-inline-start: 0;
    gap: 10px;
    align-items: center;
  }

  body.buyer-ui .brand-logo {
    position: static;
    transform: none;
    width: 64px;
    height: 64px;
    margin: 0;
  }

  body.buyer-ui .brand-text {
    font-size: 20px;
    line-height: 1.1;
  }

  body.buyer-ui .nav-links {
    width: 100%;
    flex: 0 0 auto;
    min-height: 0;
    margin: 0;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  body.buyer-ui .nav-links::-webkit-scrollbar {
    display: none;
  }

  body.buyer-ui .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .home-hero-mark {
    display: none;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .brand-text {
    font-size: 20px;
    line-height: 1.15;
  }

  .hero h1 {
    font-size: 21px;
    line-height: 1.2;
  }

  .home-kicker {
    font-size: 9.5px;
    padding: 4px 8px;
  }

  .home-page #recommended-meta {
    font-size: 12px;
    line-height: 1.55;
    margin-bottom: 10px;
  }

  .home-order-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    min-height: 206px;
  }

  .home-usp-card,
  .home-need-card,
  .home-order-step {
    padding: 12px;
    min-height: 0;
  }

  .home-usp-card,
  .home-need-card {
    min-width: 0;
    padding: 10px;
  }

  .home-support-banner h3 {
    font-size: 17px;
  }

  .home-order-summary-title {
    font-size: 15px;
  }

  .products-page .products-kicker {
    font-size: 10px;
    padding: 4px 8px;
  }

  .products-page .active-filter-chip,
  .products-page .active-filter-empty {
    font-size: 11px;
    min-height: 28px;
    padding: 5px 9px;
  }

  .products-page .products-filter-grid {
    grid-template-columns: 1fr;
  }

  .products-page .filter-field,
  .products-page .products-filter-actions {
    grid-column: auto;
  }

  .section-title {
    width: 100%;
    margin: 10px 0 7px;
    padding-bottom: 6px;
  }

  .featured-title {
    width: 100%;
    font-size: 17px;
    line-height: 1.24;
  }

  .featured-title::before {
    width: clamp(96px, 36vw, 150px);
    bottom: -7px;
    height: 3px;
    animation: none;
  }

  .featured-title::after {
    content: none;
  }

  .category-sidebar {
    top: 114px;
  }

  .card .row {
    flex-wrap: wrap;
  }

  .product-card .product-social-inline { transform: none; }

  .product-card .shop-image {
    width: 80px;
    height: 80px;
    margin-inline: auto !important;
    left: auto !important;
    right: auto !important;
  }

  .product-card .product-card-media {
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    text-align: center;
  }

  .qty-stepper {
    grid-template-columns: 34px minmax(58px, 70px) 34px;
    gap: 4px;
    padding: 4px;
    margin-bottom: 10px;
    border-radius: 999px;
  }

  .qty-btn {
    width: 34px;
    min-width: 34px;
    height: 30px;
    min-height: 30px;
    font-size: 18px;
    border-radius: 999px;
  }

  .qty-input {
    min-width: 58px;
    height: 30px;
    min-height: 30px;
    font-size: 13px;
    border-radius: 999px;
  }

  .add-cart-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
  }

  .product-detail-page .product-detail-main {
    gap: 10px;
  }

  .pdp-action-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .add-cart-btn.add-cart-btn-wide {
    width: 100%;
    min-width: 0;
    height: 36px;
    min-height: 36px;
  }

  .product-detail-page .pdp-purchase-block {
    bottom: 8px;
  }

  .cart-page .cart-kicker {
    font-size: 10px;
    padding: 4px 8px;
  }

  .cart-summary-card {
    padding: 14px;
  }

  .cart-summary-lines .grand-total strong {
    font-size: 19px;
  }

  .product-price-row .detail-link {
    min-width: 0;
    width: fit-content !important;
    max-width: calc(100% - 8px);
    margin-left: 0;
    justify-content: center;
    align-self: center;
    font-size: 9px;
    height: 26px;
    min-height: 26px;
    max-height: 26px;
    line-height: normal;
    padding: 0 9px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    font-weight: 700;
  }

  .product-price-row .price-old { font-size: 10px; }

  .order-item-card {
    padding: 12px;
  }

  .order-total {
    font-size: 15px;
  }

  .order-toggle-btn {
    min-width: 30px;
    min-height: 30px;
    width: 30px;
    height: 30px;
  }

  .order-line {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name total"
      "qty qty";
    row-gap: 2px;
  }

  .order-line .line-name { grid-area: name; }
  .order-line .line-total { grid-area: total; }
  .order-line .line-qty { grid-area: qty; }
}
