/* =========================================================
   responsive.css — Mobile First breakpoints
   base = mobile (375–430px)
   ========================================================= */

/* ---------- Small mobile safety (375px) ---------- */
@media (max-width: 380px) {
  .product-card__actions { flex-direction: column; }
  .hero__points { gap: 14px; }
  .brand__tag { display: none; }
}

/* ---------- Mobile: show mobile-only UI ---------- */
@media (max-width: 767px) {
  /* ลายน้ำใน footer ย่อลงและเลื่อนต่ำ ไม่ให้ไปทับกลุ่มไอคอนติดต่อ */
  .footer-big-brand span { font-size: clamp(3.6rem, 26vw, 11rem); }

  /* มือถือ: ตัดภาพประกอบทิ้ง ใช้รูปสินค้าจริงที่ร่วมรายการแทน ได้ข้อมูลมากกว่าและไม่กินที่ */
  .promo { padding: 24px 20px; }
  .promo__img { display: none; }
  .promo__cta { width: 100%; }

  /* เรื่องราวของเรา: เว้นที่ให้ป้ายตัวเลขที่ล้นออกมาใต้รูป และปุ่มเต็มความกว้าง */
  .story { gap: 44px; }
  .story__media::before { inset: 10px -10px -10px 10px; }
  .story__quote::before { left: -.04em; top: -.36em; font-size: 2.8em; }
}

@media (max-width: 991px) {
  .main-nav { display: none; }
  .header-cta { display: none; }
  .tabbar { display: flex; }
  /* เว้นที่ให้แถบเมนูด้านล่าง ไม่ให้บังเนื้อหาท้ายหน้า */
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .back-to-top { bottom: calc(100px + env(safe-area-inset-bottom)); }

  /* Filter drawer on mobile */
  .filter-open { display: inline-flex; }
  .filters {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
    width: min(330px, 88vw); border-radius: 0; overflow-y: auto;
    transform: translateX(-100%); transition: transform .3s ease;
    box-shadow: 12px 0 40px rgba(32, 35, 31, .12);
  }
  .filters.is-open { transform: translateX(0); }
  .filters-close { display: grid; }
}

/* ---------- 480px+ ---------- */
@media (min-width: 480px) {
  .container { padding-inline: 20px; }
}

/* ---------- Tablet 768px+ ---------- */
@media (min-width: 768px) {
  .section { padding-block: 80px; }
  .section--tight { padding-block: 48px; }
  .container { padding-inline: 24px; }
  /* จอกว้างพอ: เลิกเลื่อน กลับเป็นตารางและถอดกรอบการ์ดออก */
  .trust-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px;
    overflow-x: visible;
    margin-inline: 0; padding-inline: 0;
    -webkit-mask-image: none; mask-image: none;
  }
  .trust {
    flex: none; padding: 0; background: none; box-shadow: none; border-radius: 0;
    /* จอกว้าง: กลับไปวางไอคอนไว้ซ้าย ข้อความมีที่พอแล้ว */
    display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: start;
  }
  .trust:hover { transform: none; box-shadow: none; }
  .trust__ic { grid-row: 1 / span 2; margin-bottom: 0; }
  /* จอกว้างพอให้ครบ 6 อัน: เลิกเลื่อน กลับเป็นแถวจัดกลาง */
  .cat-chips {
    flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 56px;
    overflow-x: visible;
    margin-inline: 0; padding-inline: 0;
    -webkit-mask-image: none; mask-image: none;
  }
  .cat-chip { font-size: .95rem; padding-right: 20px; }

  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .review-grid { grid-template-columns: repeat(2, 1fr); }
  /* เหลือกล่องเดียว จัดเป็นแนวนอน ข้อความซ้าย ปุ่มขวา */
  .cta-line { padding: 40px 44px; }
  .cta-line__body { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
  .cta-line__btn { margin-top: 0; flex-shrink: 0; }
  .cta-line__text { min-width: 0; }
  .promo { grid-template-columns: 1.05fr .95fr; padding: 40px; }
  .promo__cta { width: auto; }
  .story { grid-template-columns: 1fr 1fr; }
  .pdp { grid-template-columns: 1fr 1fr; gap: 40px; }
}

/* ---------- Laptop 992px+ ---------- */
@media (min-width: 992px) {
  .hero { padding-block: 40px 0; }
  .hero > .container { min-height: 60vh; }
  .hero__grid { grid-template-columns: 45fr 55fr; gap: 48px; }
  .trust-grid { grid-template-columns: repeat(4, 1fr); gap: 30px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .review-grid { grid-template-columns: repeat(3, 1fr); }
  .shop-layout { grid-template-columns: 268px minmax(0, 1fr); gap: 32px; }
  .filters { position: sticky; top: calc(var(--header-h) + 20px); }
}

/* ---------- Desktop 1280px+ ---------- */
@media (min-width: 1280px) {
  .section { padding-block: 92px; }
  .wave + .section { padding-top: 56px; }
  .section--tight { padding-block: 52px; }
  .product-grid--wide { grid-template-columns: repeat(4, 1fr); }
  .hero__title { line-height: 1.2; }
}

/* ---------- Large desktop 1600px+ ---------- */
@media (min-width: 1600px) {
  :root { --container: 1320px; }
}

/* ---------- Feature + สไลด์สินค้า ---------- */
/* มือถือ/แท็บเล็ต: เรียงบนล่าง ต้องมีระยะพักระหว่างสองฝั่งให้ชัด
   ไม่งั้นหัวข้อ "ผลิตภัณฑ์ยอดนิยม" จะไปติดกับลิงก์ของฝั่งบน */
@media (max-width: 991px) {
  .feature-split__side { margin-top: 48px; }
  /* ปุ่มกับลิงก์รองต้องแยกบรรทัด ไม่งั้นลิงก์ตัดคำเสียรูป */
  .feature-split__cta { flex-direction: column; align-items: stretch; gap: 16px; margin-top: 30px; }
  .feature-split__cta .cf__go--lg { justify-content: center; }
  .feature-split__link { text-align: center; }
}

/* จอใหญ่: แยกซ้าย-ขวา ระยะห่างมาจาก gap ของ grid แทน */
@media (min-width: 992px) {
  .feature-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
    gap: 56px;
    align-items: center;
  }
  .feature-split__cta { flex-direction: row; align-items: center; }
}
