/* ==========================================================================
   responsive.css — tablet + mobile overrides
   ========================================================================== */

/* ---------------------------------- Package price (intermediate widths) ------ */
/* Between the desktop package grid and the 1024px tablet breakpoint, the
   3-up package cards get narrow enough that the price text wraps/overlaps
   awkwardly. Step the price font-size down in two stages to keep it tidy. */

@media (min-width: 1114px) and (max-width: 1225px) {
  .package-card__price {
    font-size: var(--fs-md);
  }
}

@media (min-width: 1025px) and (max-width: 1114px) {
  .package-card__price {
    font-size: var(--fs-sm);
  }
}

/* ---------------------------------- Tablet (<=1024px) ------------------------ */

@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .package-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .order-layout,
  .cart-page-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary,
  .summary-card {
    position: static;
  }

  .product-card__top {
    grid-template-columns: 180px 1fr;
  }

  .confirm-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  /* Help section: stack to one column once it's too narrow for the
     text + image side-by-side layout. DOM order already puts the
     help-block text before the art, so no reordering is needed here —
     the image simply lands below the text. */
  .help-section {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------- Mobile (<=680px) -------------------------- */

@media (max-width: 680px) {
  :root {
    --header-height: 64px;
  }

  .container {
    padding-inline: var(--space-4);
  }

  .section {
    padding-block: var(--space-6);
  }

  /* Header: collapse secondary nav items, keep essentials */
  .main-nav__link--lang,
  .main-nav__link--help-text {
    display: none;
  }

  .brand__text small {
    display: none;
  }

  .brand__logo {
    height: 40px;
  }

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

  .hero__art {
    order: -1;
    max-height: 220px;
  }

  .hero h1 {
    font-size: var(--fs-xl);
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  /* The access-code input's bold, letter-spaced, uppercase style is sized
     for desktop widths; at narrow widths it overflows and clips the
     placeholder ("Bijvoorbeeld: 123-4DE-34B"), so scale it down here. */
  .input--code {
    font-size: var(--fs-sm);
    letter-spacing: 0.02em;
  }

  .package-grid,
  .package-grid--two {
    grid-template-columns: 1fr;
  }

  /* Package modal: let the footer buttons shrink + wrap their label onto
     multiple lines rather than breaking the price/cancel/add row onto
     separate lines. */
  .package-bg-picker__preview {
    width: 96px;
    height: 120px;
    flex-shrink: 0;
  }

  .package-modal__footer {
    gap: var(--space-2);
  }

  .package-modal__price {
    font-size: var(--fs-md);
  }

  .package-modal__buttons {
    gap: var(--space-2);
  }

  .package-modal__buttons .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.15;
    padding: 0.65rem 0.75rem;
    flex: 1 1 0;
    min-width: 0;
  }

  .field-row,
  .field-row--uneven,
  .field-row--uneven2 {
    grid-template-columns: 1fr;
  }

  /* The top row (photo + title/reference/price) keeps its two-column
     layout at every width — only the photo column narrows — so "Bekijk
     groter" always stays below the photo instead of moving beside it. */
  .product-card__top {
    grid-template-columns: 120px 1fr;
  }

  .product-card__frame {
    width: 120px;
    flex-shrink: 0;
  }

  .product-card__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .product-card__footer .btn {
    width: 100%;
  }

  .cart-item {
    grid-template-columns: 76px 1fr;
  }

  .cart-item__end {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .confirm-meta {
    grid-template-columns: 1fr 1fr;
  }

  .confirm-order-item {
    grid-template-columns: 44px 1fr;
  }

  .confirm-order-item__price {
    grid-column: 2;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

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

  .selector-tab {
    min-width: 168px;
  }

  /* Sticky bottom action / cart bar */
  .cart-summary {
    display: none;
  }

  .mobile-cart-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 -8px 24px rgba(36, 28, 51, 0.1);
    padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
  }

  .mobile-cart-bar__info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }

  .mobile-cart-bar__count {
    font-size: var(--fs-xs);
    color: var(--color-muted);
  }

  .mobile-cart-bar__total {
    font-weight: 800;
    color: var(--color-ink);
  }

  body.has-mobile-cart-bar {
    padding-bottom: 76px;
  }

  .stepper {
    font-size: var(--fs-xs);
    gap: var(--space-1);
  }

  .stepper li span.stepper__label {
    display: none;
  }

  .lightbox__footer {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 500px) {
  .modal-card {
    padding: var(--space-4);
  }
}

@media (max-width: 515px) {
  .choice-pill span {
    padding: var(--space-3) var(--space-3);
  }
}

@media (max-width: 415px) {
  .choice-pill span {
    padding: var(--space-3) var(--space-2);
  }
}

@media (max-width: 420px) {
  .swatch-group {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  }

  .layout-group {
    grid-template-columns: repeat(2, 1fr);
  }
}
