/**
 * Storefront responsive layer — load after theme.css
 */

/* --- Global --- */
*,
*::before,
*::after {
  min-width: 0;
}

main .page-width,
main .match-page-width,
.faq-container {
  width: 100%;
  box-sizing: border-box;
}

img,
video,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

/* --- Header --- */
@media (max-width: 480px) {
  .header-inner {
    gap: 6px;
    padding: 8px 12px;
  }

  .header-icons {
    gap: 4px;
  }

  .icon-btn,
  .menu-toggle {
    width: 40px;
    height: 40px;
  }

  .utility-bar {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

/* --- Banner hero --- */
.ndi-hero,
.ndi-hero .hero-swiper {
  max-width: 100%;
}

/* --- Home: category match --- */
.mv2-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
}

@media (min-width: 769px) {
  .mv2-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .mv2-title {
    font-size: 14px;
    padding: 8px;
  }

  .mv2-inner {
    aspect-ratio: 4 / 3;
  }
}

/* --- Fan favourites tabs --- */
@media (max-width: 900px) {
  .heading_tab {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .tab_main_wrap {
    width: 100%;
  }

  .tab_desc {
    width: 100%;
  }
}

/* --- Trust strip --- */
@media (max-width: 640px) {
  .strip24-inner {
    grid-template-columns: 1fr;
  }

  .s24panel {
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    padding: 24px 16px;
  }

  .s24panel:last-child {
    border-bottom: none;
  }

  .s24-num {
    font-size: clamp(32px, 12vw, 56px);
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .strip24-inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .s24panel:nth-child(2n) {
    border-right: none;
  }
}

/* --- Stats & built for you --- */
@media (max-width: 900px) {
  .hb-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .hb-desc {
    max-width: 100%;
    font-size: 15px;
  }

  .stats-section {
    padding: 48px 0;
  }

  .stats-header {
    margin-bottom: 24px;
  }
}

@media (max-width: 640px) {
  .hb-grid {
    grid-template-columns: 1fr;
  }

  .hb-item {
    border-right: none !important;
    border-bottom: 1px solid rgba(26, 26, 26, 0.12);
  }

  .hb-item:last-child {
    border-bottom: none;
  }

  .switch-box {
    min-height: 120px;
    border-width: 12px;
  }
}

/* --- FAQ --- */
@media (max-width: 900px) {
  .faq-img {
    flex-direction: column;
    gap: 20px;
  }

  .faq-inner-img .headings {
    margin-bottom: 16px;
  }

  .faq-question {
    font-size: 15px;
    padding: 14px 0;
  }
}

/* --- Shop filters (collapsible on mobile) --- */
.shop-filters-summary {
  display: none;
  list-style: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 16px;
  margin: 0 0 12px;
  background: var(--white);
  border: 1px solid var(--ndi-border, rgba(26, 26, 26, 0.1));
  border-radius: var(--ndi-radius-lg, 16px);
}

.shop-filters-summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 768px) {
  .shop-filters-summary {
    display: block;
  }

  .shop-filters-details:not([open]) .shop-filters {
    display: none;
  }
}

@media (min-width: 769px) {
  .shop-filters-details .shop-filters-summary {
    display: none;
  }
}

/* --- Shop --- */
@media (max-width: 768px) {
  .shop-layout {
    gap: 16px;
  }

  .shop-filters {
    position: static;
    width: 100%;
  }

  .shop-main {
    min-width: 0;
  }

  .category-banner img {
    max-height: 200px;
  }

  .pagination {
    justify-content: center;
  }
}

/* --- Cart & checkout --- */
@media (max-width: 768px) {
  .checkout-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .checkout-grid .cart-summary {
    order: -1;
  }

  .cart-table td .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-table td .inline-form input[type="number"] {
    width: 100% !important;
  }
}

@media (min-width: 769px) {
  .checkout-form.ndi-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    align-items: start;
  }

  .checkout-form.ndi-form h2,
  .checkout-form.ndi-form > p.hint,
  .checkout-form.ndi-form > .form-error,
  .checkout-form.ndi-form > .form-success {
    grid-column: 1 / -1;
  }

  .checkout-form.ndi-form label:nth-of-type(1),
  .checkout-form.ndi-form label:nth-of-type(2) {
    grid-column: span 1;
  }

  .checkout-form.ndi-form label:has([name="line1"]),
  .checkout-form.ndi-form label:has([name="line2"]) {
    grid-column: 1 / -1;
  }
}

/* --- Mini cart --- */
@media (max-width: 480px) {
  .mini-cart-panel {
    width: 100%;
    max-width: none;
  }
}

/* --- Footer --- */
@media (max-width: 640px) {
  .site-footer {
    padding: 32px 0 20px;
  }

  .footer-block__heading {
    font-size: clamp(20px, 6vw, 28px);
  }

  .footer-links {
    gap: 20px;
  }
}

/* --- Typography scale down on small phones --- */
@media (max-width: 480px) {
  .headings {
    font-size: clamp(24px, 7vw, 36px);
    margin-bottom: 20px;
  }

  .section-products {
    padding: 28px 0;
  }

  .page-hero {
    padding: 16px 0 4px;
  }

  .page-hero .headings {
    font-size: clamp(22px, 6vw, 32px);
  }
}

/* --- Account & auth --- */
@media (max-width: 768px) {
  .account-stats {
    grid-template-columns: 1fr 1fr;
  }

  .account-quick-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel .ndi-card {
    padding: var(--ndi-space-md);
  }
}

@media (max-width: 400px) {
  .account-stats {
    grid-template-columns: 1fr;
  }
}

/* --- Contact & static --- */
@media (max-width: 768px) {
  .contact-grid {
    gap: 20px;
  }

  .ndi-card {
    padding: var(--ndi-space-md);
  }
}

/* --- Product detail --- */
@media (max-width: 768px) {
  .product-detail-grid {
    padding: 24px 0;
    gap: 20px;
  }

  .add-cart-form__row {
    flex-direction: column;
    align-items: stretch;
  }

  .add-cart-form--pdp .add-cart-form__submit {
    width: 100%;
  }
}

/* --- Prevent horizontal scroll from wide children --- */
.scroller,
.feature-bar,
.homepage-swiper,
.hero-swiper,
.collection-nav,
.dropped-swiper {
  max-width: 100%;
}

.collection-nav {
  overflow: hidden;
}

.dropped-swiper .swiper-slide {
  height: auto;
  box-sizing: border-box;
}

/* --- Header: center logo on tablet / phone --- */
@media (max-width: 989px) {
  .header-logo {
    justify-self: center;
    max-width: calc(100vw - 120px);
  }

  .header-logo .logo-text {
    text-align: center;
  }
}

/* --- Home: stats, switch box, section spacing --- */
@media (max-width: 768px) {
  .stats-section {
    padding: 48px 0;
  }

  .switch-box p {
    margin-left: 0;
  }

  .switch-link {
    min-height: 140px;
  }

  .match-page-width {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

@media (max-width: 989px) {
  .heading_tab {
    flex-direction: column;
    align-items: stretch;
  }

  .heading_tab .headings {
    margin-bottom: 0;
  }
}

/* --- Product grid: comfortable columns on all breakpoints --- */
@media (min-width: 381px) and (max-width: 639px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Footer link columns on small tablets --- */
@media (min-width: 481px) and (max-width: 768px) {
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- FAQ image --- */
@media (max-width: 768px) {
  .faq-inner-img img {
    max-width: min(280px, 100%);
    width: 100%;
    height: auto;
  }
}

/* --- Shop toolbar sort on one row when possible --- */
@media (max-width: 768px) {
  .shop-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }
}

/* --- Tables: long product names --- */
.cart-product {
  min-width: 0;
}

.cart-product strong,
.product-card h3 {
  overflow-wrap: anywhere;
}

/* --- Static / RTE content --- */
.static-content.rte {
  max-width: 100%;
  overflow-wrap: anywhere;
}
