/* ============================================================
   RESPONSIVE MEDIA QUERIES (DESKTOP · TABLET · MOBILE)
   ============================================================ */

/* Global Touch Action Optimization (Eliminates 300ms tap delay) */
button, a, .nicon, .hero-circle-btn, .pv-size-chip, .qty-btn, .brand-card, .pcard, .search-pill, .pay-card {
  touch-action: manipulation;
}

/* Modal Background 100% Static Scroll Lock */
html.modal-locked,
body.modal-locked {
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  touch-action: none !important;
  -webkit-overflow-scrolling: auto !important;
  overscroll-behavior: none !important;
}

/* Large Screens (Desktop) */
@media(max-width: 1200px) {
  .purpose-grid { grid-template-columns: repeat(3, 1fr); }
  .catalog-grid.nike-plp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 12px; width: 100%; box-sizing: border-box; }
  .shop-your-way-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

@media(max-width: 1120px) {
  .megain { grid-template-columns: 1fr 1fr; gap: 28px; }
  .fcols { grid-template-columns: repeat(3, 1fr); }
  .catalog-grid.nike-plp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; width: 100%; box-sizing: border-box; }
}

/* Tablet Landscape & Portrait (960px - 769px) */
@media(max-width: 960px) {
  .nlinks { display: none; }
  .burger { display: flex; }
  .pv-grid { grid-template-columns: 1fr; }
  .pv-gallery { border-radius: 24px 24px 0 0; padding: 24px; }
  .pv-details { padding: 24px; }
  .trust { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .fit-banner { grid-template-columns: 1fr; padding: 32px 24px; gap: 24px; }
  .brand-hero-card { flex-direction: column; text-align: center; }
  .brand-hero-img { width: 100%; max-height: 140px; }
  .shop-your-way-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* Mobile & Tablet Portrait (<= 768px) */
@media(max-width: 768px) {
  :root { --nav: 56px; }

  /* Responsive Luxury Slidebar on Mobile & Tablet */
  html {
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.25) transparent;
  }
  .dark html {
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  }
  ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }
  ::-webkit-scrollbar-thumb {
    background-color: rgba(15, 23, 42, 0.25);
    border-radius: 999px;
  }
  .dark ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.25);
  }
  /* Keep horizontal touch carousels clean without chunky tracks */
  .brands-grid, .spotlight-rail-wrap, .category-row, .cat-rail-track, .trend-editorial-rail {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .brands-grid::-webkit-scrollbar,
  .spotlight-rail-wrap::-webkit-scrollbar,
  .category-row::-webkit-scrollbar,
  .cat-rail-track::-webkit-scrollbar,
  .trend-editorial-rail::-webkit-scrollbar {
    display: none !important;
  }

  /* Prevent Mobile Viewport Drift & Clean Safe-Area Handling */
  html {
    max-width: 100% !important;
    width: 100% !important;
  }
  body {
    overflow-x: clip !important;
    max-width: 100% !important;
    width: 100% !important;
    position: relative;
    -webkit-overflow-scrolling: touch;
  }

  .wrap, .wrap-wide {
    padding: 0 14px !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Promo Banner Mobile Padding */
  .promo {
    padding: 8px 34px 8px 12px;
    font-size: 11px;
    line-height: 1.35;
  }
  .promo .x {
    right: 8px;
    padding: 2px 6px;
  }

  /* Navbar Phone Layout with Dynamic Island & Safe-Area Padding */
  .navbar {
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  .navin { padding: 0 14px; }
  .logo-main { font-size: 20px; }
  .logo-sub { font-size: 8px; letter-spacing: .25em; }
  
  .nav-search-bar {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    margin-right: 0;
  }
  .nav-search-bar .search-placeholder {
    display: none;
  }
  .header-user-name {
    display: none;
  }
  .user-avatar-tag {
    padding: 0;
    background: none;
    border: none;
  }
  .user-avatar-tag svg {
    width: 20px !important;
    height: 20px !important;
  }
  .nicons {
    gap: 4px;
  }
  .nicon {
    width: 38px;
    height: 38px;
  }
  .nicon svg {
    width: 20px;
    height: 20px;
  }
  .burger {
    width: 38px;
    height: 38px;
    transition: transform 0.2s;
  }
  .burger svg {
    width: 20px;
    height: 20px;
  }
  .burger.active {
    background: rgba(0,0,0,0.06);
    border-radius: 50%;
  }

  /* Hide Navbar Account Button on Mobile (Since Account is inside Mobile Sheet Menu) */
  #accountBtn {
    display: none !important;
  }

  /* Mobile Navigation Sheet Viewport Fit & Smooth Touch Scrolling (Quiet Luxury Layout) */
  .msheet {
    padding: 18px 20px 36px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }
  .msheet-inner {
    padding-bottom: 90px !important;
    gap: 20px !important;
  }
  .msheet-nav-item {
    padding: 16px 4px !important;
  }
  .msheet-item-text {
    font-size: 20px !important;
    font-weight: 600 !important;
    letter-spacing: -0.025em !important;
    color: var(--ink) !important;
  }

  /* Prevent iOS Safari Form Auto-Zoom (Inputs must be >= 16px) */
  input, select, textarea, .form-control {
    font-size: 16px !important;
  }

  /* Fullscreen Search Overlay Phone Optimization */
  .searchbox {
    padding: 24px 18px 28px;
  }
  .search-input-wrapper {
    padding-bottom: 7px;
    gap: 10px;
  }
  .search-input-wrapper input {
    font-size: 18px !important;
  }
  .search-esc-text {
    display: none !important;
  }
  .search-close-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
  }
  .search-cancel-btn {
    font-size: 13px;
    padding: 0;
  }
  .search-quick-link {
    padding: 8px 0;
    font-size: 13.5px;
  }
  .search-products-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Apple-Style Bag Dropdown Fitting */
  .bag-dropdown-menu {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: 440px;
    margin: 0 auto;
    top: calc(var(--nav) + 8px);
    padding: 24px 18px 20px;
  }

  /* Hero Video Stage Phone Layout */
  .hero-cinematic { min-height: 480px; padding: 24px 16px 36px; }
  .hero-cinematic.hero-fullscreen-video {
    min-height: 520px;
    height: calc(100svh - var(--nav) - 36px);
    max-height: 680px;
    padding: 24px 16px 68px;
  }
  .hero-fullscreen-video .hero-content {
    max-width: 100%;
    padding: 0 4px;
  }
  .hero-fullscreen-video .hero-eyebrow {
    font-size: 11px;
    padding: 5px 14px;
    margin-bottom: 10px;
    letter-spacing: .15em;
  }
  .hero-fullscreen-video .hero-title {
    font-size: clamp(28px, 8.5vw, 40px);
    line-height: 0.98;
    margin-bottom: 8px;
  }
  .hero-fullscreen-video .hero-subtitle {
    font-size: 13.5px;
    line-height: 1.35;
    max-width: 320px;
    margin: 0 auto 16px;
  }
  .hero-fullscreen-video .hero-actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }
  .hero-fullscreen-video .hero-pill-primary {
    width: auto;
    padding: 11px 24px;
    font-size: 14px;
  }
  .hero-pill-watch {
    width: auto;
    padding: 11px 20px;
    font-size: 14px;
  }
  .hero-dots-nav {
    bottom: 22px;
    left: 16px;
    transform: none;
    gap: 6px;
  }
  .hero-dot {
    width: 6px;
    height: 6px;
  }
  .hero-dot.active {
    width: 16px;
    height: 6px;
  }
  .hero-controls-bar {
    right: 14px;
    bottom: 14px;
    gap: 6px;
  }
  .hero-circle-btn {
    width: 34px;
    height: 34px;
  }
  .hero-circle-btn svg {
    width: 13px;
    height: 13px;
  }

  /* Catalog PLP Header & Controls Sticky Top on Mobile */
  .nike-plp-header {
    position: sticky;
    top: calc(var(--nav) + env(safe-area-inset-top, 0px));
    z-index: 850;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 10px 0;
    margin-bottom: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    transition: top 0.32s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  }
  .navbar.nav-hidden ~ #catalogView .nike-plp-header {
    top: env(safe-area-inset-top, 0px);
  }
  .nike-plp-title-wrap {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .nike-plp-title {
    font-size: 19px;
  }
  .nike-plp-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }
  .nike-toggle-filters-btn,
  .nike-sort-wrap {
    flex: 1;
  }
  .nike-toggle-filters-btn {
    justify-content: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    width: 100%;
    height: 32px;
  }
  .nike-sort-btn {
    width: 100%;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }
  .nike-sort-dropdown {
    right: 0;
    min-width: 160px;
  }

  /* Catalog PLP Grid Responsive */
  .plp-nike-section, #catalog {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px)) !important;
  }
  .nike-plp-body {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 0 !important;
    box-sizing: border-box !important;
  }
  .nike-main-grid-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  /* Mobile Full-Screen Filter Drawer (Fixed Header + Scroll Body + Fixed Footer) */
  .nike-sidebar {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 2000 !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    transform: translateY(100%) !important;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  .nike-sidebar.mobile-open {
    transform: translateY(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .nike-sidebar-head {
    flex-shrink: 0 !important;
    position: relative !important;
    top: 0 !important;
    z-index: 10 !important;
    background: #ffffff !important;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 12px 18px !important;
    margin: 0 !important;
    border-bottom: 1px solid #e5e5e7 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }
  .nike-sidebar-heading {
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: #111113 !important;
  }
  .nike-sidebar-close-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: #f4f4f5 !important;
    border: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #111113 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
  }
  .nike-sidebar-close-btn:active {
    background: #e5e5ea !important;
  }
  .nike-sidebar-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 12px 18px 24px 18px !important;
    box-sizing: border-box !important;
  }
  .nike-sidebar-body::-webkit-scrollbar {
    width: 4px;
  }
  .nike-sidebar-body::-webkit-scrollbar-thumb {
    background: #e5e5ea;
    border-radius: 4px;
  }
  .nike-sidebar-mobile-footer {
    display: flex !important;
    flex-shrink: 0 !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: 10 !important;
    background: #ffffff !important;
    border-top: 1px solid #e5e5e7 !important;
    padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px)) 18px !important;
    gap: 12px !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06) !important;
    box-sizing: border-box !important;
  }
  .nike-mobile-clear-btn {
    flex: 1 !important;
    padding: 13px !important;
    border-radius: 980px !important;
    background: #f4f4f5 !important;
    border: 1px solid #e5e5e7 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #111113 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    text-align: center !important;
  }
  .nike-mobile-clear-btn:active {
    background: #e5e5ea !important;
  }
  .nike-mobile-apply-btn {
    flex: 1.6 !important;
    padding: 13px !important;
    border-radius: 980px !important;
    background: #111113 !important;
    border: 1px solid #111113 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    text-align: center !important;
  }
  .nike-mobile-apply-btn:active {
    opacity: 0.85 !important;
  }
  .catalog-grid.nike-plp-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .catalog-grid .pcard,
  .nike-plp-grid .pcard {
    flex: 0 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* PDP Quick-View Modal Responsive */
  .pv-pdp-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .pv-pdp-gallery-wrap {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pv-vert-thumbs-col {
    display: flex;
    flex-direction: row;
    gap: 8px;
    max-height: unset;
    order: 2;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }
  .pv-vert-thumb-btn {
    width: 58px;
    height: 58px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
  .pv-size-2col-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px;
  }
  .pv-size-chip {
    height: 44px;
    font-size: 13px;
    white-space: nowrap;
  }
  .pv-similar-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .pv-similar-grid .pcard {
    flex: 0 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Mobile Modals & Centered Dialogs */
  .modal-overlay {
    padding: 14px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .modal-card {
    padding: 22px 16px 28px !important;
    border-radius: 18px !important;
    width: min(540px, calc(100vw - 24px)) !important;
    max-height: min(88vh, calc(100dvh - 24px)) !important;
    margin: auto !important;
    box-sizing: border-box !important;
  }
  .account-portal-box {
    max-width: 540px !important;
    width: min(540px, calc(100vw - 24px)) !important;
    max-height: min(88vh, calc(100dvh - 24px)) !important;
    padding: 20px 16px 24px !important;
    border-radius: 18px !important;
    margin: auto !important;
    box-sizing: border-box !important;
  }
  .account-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding-bottom: 14px !important;
    margin-bottom: 14px !important;
    padding-right: 46px !important;
    position: relative !important;
  }
  .account-header > div:first-child {
    width: 100% !important;
  }
  .account-header > div:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    margin-top: 10px !important;
    width: 100% !important;
  }
  .account-tabs {
    gap: 6px !important;
    padding-bottom: 8px !important;
    margin-bottom: 16px !important;
  }
  .account-tab-btn {
    padding: 6px 13px !important;
    font-size: 12px !important;
  }
  .pv-circle-close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
  }

  /* Brand Showcase: Luxury 3D Stage on Mobile / Tablet */
  .brand-stage-sec {
    padding: 24px 0 32px;
  }
  .brand-stage-box {
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
  .stage-brand-tag {
    display: none; /* Keep clean on touch screens */
  }
  .stage-cta-btn {
    bottom: 5.8%;
    padding: 8px 18px;
    font-size: 11px;
    gap: 6px;
  }
  .stage-cta-arrow {
    width: 12px;
    height: 12px;
  }

  /* Brand Showcase: Apple-Style Horizontal Card Carousel on Mobile */
  .brands-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding: 8px 16px 20px;
    margin: 0 -14px;
    scrollbar-width: none;
  }
  .brands-grid::-webkit-scrollbar {
    display: none;
  }
  .brand-card {
    flex: 0 0 78vw;
    max-width: 320px;
    min-width: 265px;
    min-height: 380px;
    scroll-snap-align: center;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 24px 20px 20px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .brand-card:active {
    transform: scale(0.98);
  }
  .brand-card-top {
    margin-bottom: 8px;
  }
  .brand-badge {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #00875a;
  }
  .brand-title {
    font-size: 24px;
    font-weight: 800;
  }
  .brand-sub {
    font-size: 13px;
    color: var(--ink2);
  }
  .brand-card-img-wrap {
    flex: 1;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
  }
  .brand-card-img {
    max-height: 145px;
    width: 100%;
    object-fit: contain;
  }
  .brand-card-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #edf0f3;
    padding-top: 14px;
    margin-top: 8px;
  }
  
  .shop-your-way-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .shop-card { height: 260px; padding: 18px; }
  .shop-card-title { font-size: 19px; }
  
  /* Beyond the Shoe (Apparel): 2x3 Grid on Mobile */
  .apparel-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 10px;
  }
  .apparel-card {
    height: 250px;
    padding: 18px 14px;
    border-radius: 16px;
  }
  .apparel-card-tag {
    font-size: 9px;
    letter-spacing: .08em;
    margin-bottom: 4px;
  }
  .apparel-card-title {
    font-size: 17px;
    margin-bottom: 10px;
    line-height: 1.15;
  }
  .apparel-card-sub {
    font-size: 11px;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .apparel-card-btn {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 980px;
    display: inline-flex;
  }
  
  .spotlight-card { flex: 0 0 280px; padding: 18px; }
  .spotlight-card-img-wrap { height: 140px; }
  
  .purpose-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .purpose-card { min-height: 140px; padding: 14px 12px; border-radius: 14px; }
  .purpose-tag  { font-size: 8px; letter-spacing: .06em; }
  .purpose-title{ font-size: 15px; margin-top: 2px; }
  .purpose-desc { display: none; }
  .purpose-img  { width: 58%; max-height: 90px; }
  .purpose-title { font-size: 17px; }
  
  .cmp { grid-template-columns: 1fr; border-top: 0; }
  .cmpcol { border-right: 0; border-top: 1px solid var(--hair); padding: 24px 16px; }
  
  .sec { padding: 50px 0; }
  .sec.tight { padding: 36px 0; }
  
  .fcols { grid-template-columns: 1fr 1fr; gap: 20px; }
  .fbot { flex-direction: column; gap: 10px; align-items: flex-start; }
  
  .railwrap {
    position: relative !important;
    width: 100% !important;
    overflow: visible !important;
  }
  .trend-rail {
    display: flex !important;
    margin: 0 -14px !important;
    padding: 4px 14px 22px !important;
    gap: 12px !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-padding-left: 14px !important;
    scrollbar-width: none !important;
    box-sizing: border-box !important;
  }
  .trend-rail .pcard {
    flex: 0 0 clamp(200px, 58vw, 240px) !important;
    min-width: 0 !important;
    max-width: 240px !important;
    scroll-snap-align: start !important;
  }
  .trend-editorial-grid,
  .discovery-feature-grid {
    display: flex !important;
    justify-content: flex-start !important;
    margin: 0 -14px !important;
    padding: 4px 14px 22px !important;
    gap: 12px !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-padding-left: 14px !important;
    scrollbar-width: none !important;
    box-sizing: border-box !important;
  }
  .trend-editorial-grid::-webkit-scrollbar,
  .discovery-feature-grid::-webkit-scrollbar { display: none !important; }
  .trend-editorial-card {
    flex: 0 0 clamp(185px, 58vw, 225px) !important;
    min-width: 185px !important;
    max-width: 240px !important;
    scroll-snap-align: start !important;
    box-sizing: border-box !important;
  }
  .discovery-feature-card {
    flex: 0 0 clamp(185px, 58vw, 225px) !important;
    min-width: 185px !important;
    max-width: 240px !important;
    height: 325px !important;
    scroll-snap-align: start !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }
  .trend-editorial-card {
    height: 325px !important;
    padding: 16px 14px !important;
  }
  .trend-editorial-tag {
    font-size: 17px !important;
    font-weight: 800 !important;
  }
  .trend-editorial-title {
    font-size: 12px !important;
    font-weight: 500 !important;
  }
  .trend-editorial-btn {
    padding: 5px 14px !important;
    font-size: 11px !important;
  }
  .pcard {
    border-radius: 14px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .pcard-plate {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 14px !important;
    background: #f7f7f9 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }
  .pcard-wish-btn {
    width: 32px !important;
    height: 32px !important;
    top: 8px !important;
    right: 8px !important;
  }
  .pcard-wish-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
  .pcard-tag-red {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    margin-top: 8px !important;
    height: 16px !important;
    line-height: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .pname {
    font-size: 13px !important;
    font-weight: 700 !important;
    margin-top: 2px !important;
    height: 18px !important;
    line-height: 18px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .pdesc {
    font-size: 11px !important;
    color: #707072 !important;
    margin-top: 1px !important;
    height: 16px !important;
    line-height: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .pcolor-swatches {
    margin-top: 6px !important;
    gap: 4px !important;
    height: 18px !important;
    line-height: 18px !important;
    display: flex !important;
    align-items: center !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  .pcolor-dot {
    width: 10px !important;
    height: 10px !important;
    flex-shrink: 0 !important;
  }
  .pcolor-count-label {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .pcard-footer {
    margin-top: auto !important;
    padding-top: 8px !important;
    gap: 6px !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .pprice {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    height: 20px !important;
    line-height: 20px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .pcard-add-cart-btn {
    height: 34px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    border-radius: 980px !important;
    background: #111113 !important;
    color: #ffffff !important;
    padding: 0 6px !important;
    gap: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
  }
  
  .nike-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 0 14px;
  }
  .nike-footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .toast-wrap { left: 16px; right: 16px; bottom: 16px; }
  .toast { justify-content: center; width: 100%; }
}

/* Small Phones (<= 480px) */
@media(max-width: 480px) {
  .wrap { padding: 0 14px; }
  .stage-cta-btn {
    bottom: 5%;
    padding: 6px 14px;
    font-size: 9.5px;
    letter-spacing: 0.03em;
    gap: 5px;
  }
  .stage-cta-arrow {
    width: 10px;
    height: 10px;
  }
  .shop-your-way-grid { grid-template-columns: 1fr; }
  .purpose-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .purpose-card { min-height: 120px; padding: 12px 10px; }
  .purpose-tag  { font-size: 7px; }
  .purpose-title{ font-size: 13px; }
  .purpose-img  { width: 55%; max-height: 76px; }
  .fcols { grid-template-columns: 1fr; }
  .trend-rail .pcard {
    flex: 0 0 clamp(190px, 56vw, 220px) !important;
    min-width: 0 !important;
    max-width: 220px !important;
  }
  .trend-editorial-card {
    flex: 0 0 clamp(170px, 60vw, 205px) !important;
    min-width: 170px !important;
    max-width: 215px !important;
  }
  .discovery-feature-card {
    flex: 0 0 clamp(170px, 60vw, 205px) !important;
    min-width: 170px !important;
    max-width: 215px !important;
    height: 292px !important;
    border-radius: 16px !important;
  }
  .trend-editorial-card {
    height: 292px !important;
    padding: 14px 12px !important;
  }
  .trend-editorial-tag {
    font-size: 15px !important;
    font-weight: 800 !important;
  }
  .trend-editorial-title {
    font-size: 11px !important;
    font-weight: 500 !important;
  }
  .catalog-grid.nike-plp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .catalog-grid .pcard,
  .nike-plp-grid .pcard,
  .pv-similar-grid .pcard {
    flex: 0 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .pv-similar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .links { flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
  .pill { text-align: center; width: 100%; }
  .pv-actions { flex-direction: column; }
  .step-options { grid-template-columns: 1fr; }

  .apparel-card {
    height: 230px;
    padding: 14px 12px;
  }
  .apparel-card-title {
    font-size: 15px;
    margin-bottom: 8px;
  }
  .apparel-card-sub {
    display: none;
  }

  /* Checkout & Wizard Form Rows */
  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .form-row.form-row-2col {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .modal-overlay {
    padding: 8px !important;
  }
  .modal-card,
  .account-portal-box {
    width: calc(100vw - 16px) !important;
    max-height: min(92vh, calc(100dvh - 16px)) !important;
    padding: 16px 12px 18px !important;
    border-radius: 16px !important;
    margin: auto !important;
  }
  .checkout-box {
    padding: 14px 12px 14px !important;
    width: 100%;
    margin: auto;
  }
  .wizard-box, .auth-box {
    padding: 18px 14px;
    width: 100%;
    margin: auto;
  }
  .pay-methods {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  .pay-card {
    padding: 5px 2px;
    font-size: 10.5px;
  }
  .cart-item {
    grid-template-columns: 68px 1fr;
    gap: 12px;
  }
}

/* --- Footer: collapse the four columns --- */
@media (max-width: 900px) {
  .club-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
  }
  .club-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .club-footer-inner { padding-top: 44px; }
  .club-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 34px;
  }
  .club-footer-blurb { max-width: none; }
  .club-footer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .club-footer-mark { font-size: 20vw; }
}
