/* Mobile storefront home audit: hero/banner visibility, spacing and content density. */
@media (max-width: 767px) {
  #main-content {
    overflow-x: clip;
  }

  /* Hero: never crop desktop fallback banners into a tall blank-looking frame. */
  .hero {
    min-height: 0;
    --mobile-hero-image-height: calc(100vw * 542 / 750);
    background: #101212;
  }
  .hero-track {
    align-items: flex-start;
    touch-action: pan-y pinch-zoom;
  }
  .hero-slide,
  .hero-slide > button,
  .hero-slide > a {
    width: 100vw;
  }
  .hero-slide img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0 !important;
    aspect-ratio: 750 / 542 !important;
    object-fit: contain;
    object-position: center;
    background: #101212;
  }
  .hero-pagination {
    display:flex !important;align-self:auto;width:100%;max-width:100%;
    margin:0;padding:0;overflow-x:auto;overflow-y:hidden;
    scrollbar-width:thin;scrollbar-color:#bbb #fff;overscroll-behavior-x:contain;
    touch-action:pan-x pan-y pinch-zoom;
  }
  .hero-pagination::-webkit-scrollbar {height:3px;}
  .hero-pagination::-webkit-scrollbar-thumb {background:#bbb;border-radius:3px;}
  .hero-pagination li {flex:1 0 auto;min-width:76px;}
  .hero .hero-page {
    min-height:44px;padding:0 14px;color:#777;font-size:12px;line-height:1.3;
    border-bottom:2px solid #ddd;text-align:center;align-items:center;
  }
  .hero .hero-page.active {color:#111;font-weight:600;}
  .hero .hero-page:focus-visible {outline:2px solid var(--purple);outline-offset:-3px;}

  .hero .hero-arrow {
    display: grid !important;
    width: 44px;
    height: 44px;
    top:calc(var(--mobile-hero-image-height) / 2);
    font-size: 0;
    color: #fff;
    border-radius: 8px;
    background: transparent;
    isolation: isolate;
    touch-action: manipulation;
  }
  .hero .hero-arrow.prev { left: 8px; }
  .hero .hero-arrow.next { right: 8px; }
  .hero .hero-arrow::before {
    position:absolute;z-index:1;top:50%;left:50%;
    width:12px;height:12px;border-width:2px;
  }
  .hero .hero-arrow.prev::before {left:calc(50% + 4px);transform:translate(-50%,-50%) rotate(45deg);}
  .hero .hero-arrow.next::before {left:calc(50% - 4px);transform:translate(-50%,-50%) rotate(225deg);}
  .hero .hero-arrow::after {
    content:"";position:absolute;z-index:0;left:50%;top:50%;
    width:28px;height:34px;border-radius:5px;background:rgb(0 0 0 / 28%);
    transform:translate(-50%,-50%);pointer-events:none;
  }
  .hero-bottom {
    position:relative;display:block;right:auto;bottom:auto;left:auto;
    width:100%;height:auto;max-width:none;padding:0 10px;
    color:#555;background:#fff;transform:none;
  }
  .hero-control {
    position:absolute;right:10px;bottom:calc(100% + 8px);
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgb(0 0 0 / 52%);
    backdrop-filter: blur(3px);
  }
  .hero-count {
    color: #fff;
    font-size: 11px;
    line-height: 1;
  }
  .hero-progress,
  .hero-pause {
    display: none !important;
  }

  /* Mobile home spacing: keep the first useful content above the fold. */
  .home-section {
    padding: 34px 0;
  }
  .home-section + .home-section {
    padding-top: 4px;
  }
  .home-section > .container,
  .brand-section > .container {
    width: calc(100% - 32px);
  }

  /* Managed center campaign banners: show every card as a horizontal snap rail. */
  .spotlight {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .spotlight-copy {
    min-width: 0;
    padding-top: 0;
  }
  .spotlight-copy h1 {
    margin: 0 0 13px;
    font-size: 23px;
    line-height: 1.35;
  }
  .spot-tabs {
    display: flex;
    flex-flow: row nowrap;
    gap: 8px;
    max-width: 100%;
    margin-right: -16px;
    padding: 0 16px 4px 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .spot-tabs::-webkit-scrollbar {
    display: none;
  }
  .spot-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 9px 16px;
    font-size: 13px;
  }
  .spot-cards {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 12px;
    width: auto;
    margin: 0 -16px !important;
    padding: 0 16px 7px;
    overflow-x: auto;
    scroll-padding-inline: 16px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .spot-cards::-webkit-scrollbar {
    display: none;
  }
  .spot-card,
  .spot-card:first-child {
    display: block !important;
    flex: 0 0 min(72vw, 300px);
    width: auto !important;
    height: auto !important;
    aspect-ratio: 356 / 400;
    border-radius: 12px;
    scroll-snap-align: start;
  }

  /* New products: retain 2 columns but reduce desktop-sized whitespace and fixed media widths. */
  .new-products {
    padding-top: 44px;
  }
  .home-heading {
    margin-bottom: 18px;
    text-align: left;
  }
  .section-title {
    font-size: 24px;
    line-height: 1.3;
  }
  .product-tabs {
    justify-content: flex-start;
    gap: 8px;
    max-width: none;
    margin: 14px -16px 24px;
    padding: 0 16px 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }
  .product-tabs::-webkit-scrollbar {
    display: none;
  }
  .product-tab {
    flex: 0 0 auto;
    min-width: 0;
    height: 40px;
    padding: 0 16px;
    font-size: 13px;
  }
  .new-products .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 10px;
  }
  .new-products .product-card {
    min-width: 0;
  }
  .new-products .product-card-media {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 10px;
  }
  .product-card-info {
    min-width: 0;
    padding: 10px 2px 0;
  }
  .product-brand {
    margin-bottom: 4px;
    font-size: 12px;
  }
  .product-name {
    display: -webkit-box;
    min-height: 36px;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .product-device {
    min-height: 16px;
    margin-top: 4px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .product-price {
    min-height: 23px;
    margin-top: 9px;
    font-size: 15px;
  }

  /* Brand area and lower home spacing. */
  .brand-section {
    padding: 44px 0 96px;
  }
  .brand-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 18px;
  }
  .brand-grid button {
    border-radius: 8px;
  }

  /* Keep the floating top button above the fixed mobile navigation. */
  .scroll-top,
  [data-scroll-top] {
    bottom: 92px;
  }
}

@media (max-width: 420px) {
  .home-section > .container,
  .brand-section > .container {
    width: calc(100% - 28px);
  }
  .spot-cards {
    margin-right: -14px !important;
    margin-left: -14px !important;
    padding-right: 14px;
    padding-left: 14px;
    scroll-padding-inline: 14px;
  }
  .product-tabs {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }
}

/* Keep the center banner's PC reading order: three columns and three rows. */
@media (max-width: 900px) {
  .feature-matrix:not([data-center-banner2-editor]) {
    display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:0;width:100%;max-width:1200px;margin:20px auto 0;padding:0;
    overflow:visible;scroll-snap-type:none;
  }
  .feature-matrix:not([data-center-banner2-editor]) > button,
  .feature-matrix:not([data-center-banner2-editor]) > a {display:block;min-width:0;max-width:100%;}
  .feature-matrix:not([data-center-banner2-editor]) img {display:block;width:100%;height:auto;object-fit:contain;}
}
