/* ================================
   RESPONSIVE — tablet & mobile
   ================================ */

/* ---- Tablet: ≤ 1024px ---- */
@media (max-width: 1024px) {
  .site-nav__inner,
  .hero,
  .catalog-header,
  .catalog-filters,
  .products-grid,
  .single-product-wrap,
  .related-products,
  .page-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-products .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---- Tablet Hero Optimization: ≤ 960px ---- */
@media (max-width: 960px) {
  .hero {
    flex-direction: column-reverse;
    padding: 56px 24px 64px;
    gap: 40px;
    text-align: center;
    overflow: hidden; /* clip orbit cards that swing past the column edges */
  }
  .hero__btns {
    justify-content: center;
    flex-wrap: wrap;
  }
  .hero__title {
    font-size: 38px;
  }
  .hero__desc {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero__visual--cards {
    margin-bottom: 20px;
    min-height: 270px !important;
  }
  
  /* Scale cards for tablet view to avoid screen crowding (orbit amplitude
     is reduced in cards-slider.js; card positions are set inline per frame). */
  .hero__card-deck {
    width: 260px;
    height: 195px;
  }
}

/* ---- Mobile: ≤ 640px ---- */
@media (max-width: 640px) {

  /* --- Navigation --- */
  .site-nav__inner {
    padding: 14px 20px;
    position: relative;
  }

  .site-nav__links {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 28px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 100vh;
    background: var(--color-bg, #fcf9f5);
    z-index: 999;
    padding: 40px 24px;
    border-top: 1px solid rgba(18, 60, 45, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  }

  .site-nav__links.is-open {
    display: flex;
  }

  .site-nav__links.is-open a {
    font-size: 20px;
    color: var(--color-text);
  }

  .site-nav__links.is-open .nav-cta {
    font-size: 16px;
    padding: 12px 32px;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
    z-index: 1000;
  }

  .hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
  }

  .hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.is-open span:nth-child(2) { opacity: 0; }
  .hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* --- Hero --- */
  .hero {
    flex-direction: column-reverse;
    padding: 24px 20px 32px;
    gap: 20px;
    overflow: hidden; /* clip orbit cards at screen edges */
  }

  .hero__title { font-size: 28px; }

  .hero__visual {
    min-height: 200px;
    width: 100%;
  }
  .hero__visual--cards {
    min-height: 230px !important;
    margin-bottom: 10px;
  }

  /* Card positions set inline per frame by cards-slider.js; orbit amplitude
     is reduced for mobile there. Just size the deck down here. */
  .hero__card-deck {
    width: 220px;
    height: 165px;
  }

  .hero__btns { flex-wrap: wrap; }

  /* --- Trust strip --- */
  .trust-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .trust-strip__item {
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 16px;
  }

  .trust-strip__item:nth-child(2n) { border-right: none; }
  .trust-strip__item:nth-child(3),
  .trust-strip__item:nth-child(4) { border-bottom: none; }

  /* --- Product grid --- */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 20px 40px;
    gap: 12px;
  }

  .related-products .products-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0;
  }

  .product-card__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
  }

  .product-card__price {
    font-size: 14px;
    text-align: left;
    display: block;
  }

  .product-card__buy {
    width: 100%;
    text-align: center;
    padding: 8px 12px;
    font-size: 12px;
    display: block;
  }

  .product-card__buy.loading::after,
  .product-card__buy.added::after {
    font-size: 12px;
  }

  /* --- Catalog --- */
  .catalog-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 20px 8px;
    gap: 8px;
  }

  .catalog-header h1 { font-size: 24px; }

  .catalog-filters {
    padding: 12px 20px 16px;
    gap: 6px;
  }

  /* --- Single product --- */
  .single-product-wrap {
    flex-direction: column;
    padding: 8px 20px 40px;
    gap: 24px;
  }

  .product-gallery { position: static; }

  .product-info__title { font-size: 24px; }
  .buy-box__price { font-size: 28px; }

  .inst-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .related-products {
    padding: 24px 20px 40px;
  }

  /* --- Front page inline style overrides --- */
  [style*="48px"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  [style*="repeat(3,1fr)"],
  [style*="repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  [style*="repeat(2,1fr)"],
  [style*="repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  [style*="justify-content:space-between"],
  [style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }

  /* --- Cart --- */
  .vs-continue-shopping {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
  }

  /* --- General --- */
  .container,
  .page-content {
    padding-left: 20px;
    padding-right: 20px;
  }

  h1 { font-size: 26px; }
  h2 { font-size: 22px; }
}
