/* =========================
   SECTION: Page safety
   NOTE:
   - Elak horizontal overflow pada mobile
   DEBUG-POINT:
   - Kalau page masih boleh scroll ke kanan, semak elemen yang ada width tetap
   ========================= */
html,
body {
  overflow-x: hidden;
}

/* =========================
   SECTION: Tiny utility helpers
   NOTE:
   - Ganti inline style kecil supaya CSP lebih mudah nanti
   ========================= */
.hb-inline-flex {
  display: inline-flex;
}

.hb-align-center {
  align-items: center;
}

.hb-gap-10 {
  gap: 10px;
}

/* =========================
   SECTION: Product heading
   ========================= */
.product-title {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: 'Playfair Display', serif;
}

.product-title--empty {
  margin-bottom: 8px;
}

.product-muted {
  color: var(--muted);
}

.product-category {
  margin-bottom: 10px;
}

.product-variant-label,
.product-price-label {
  display: block;
}

.product-price-static {
  margin: 6px 0 12px;
  color: var(--accent);
  font-size: 28px;
  font-weight: 800;
}

.product-desc {
  margin: 0;
  line-height: 1.7;
}

.product-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.product-footer-bottom {
  padding: 18px 0;
}

/* =========================
   SECTION: Product detail grid
   NOTE:
   - min-width: 0 penting untuk elak child overflow dalam CSS grid
   DEBUG-POINT:
   - Kalau image / card terkeluar di mobile, semak section ini dulu
   ========================= */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: start;
}

.product-detail-grid > * {
  min-width: 0;
}

.product-detail-grid .card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.product-detail-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

/* =========================
   SECTION: Variant box
   DEPENDENCY:
   - page-product.js guna #variantSelect dan #variantPrice
   NOTE:
   - Jangan ubah ID tanpa update JS
   ========================= */
.variant-box {
  width: 100%;
  max-width: 100%;
  margin: 10px 0 14px;
  padding: 12px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
}

.variant-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.variant-row select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  background: #fff;
  font-family: Poppins, system-ui, sans-serif;
}

.variant-price {
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  word-break: break-word;
}

.variant-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* =========================
   SECTION: Suggested products
   NOTE:
   - Preserve feature dari file asal
   ========================= */
.hb-suggest-section {
  margin-top: 32px;
}

.hb-suggest-head {
  margin-bottom: 14px;
}

.hb-suggest-title {
  margin: 0 0 0.3rem;
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.hb-suggest-sub {
  color: #6b7280;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.hb-suggest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.hb-suggest-card {
  max-width: 220px;
  height: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: 0.25s ease;
}

.hb-suggest-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.hb-suggest-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.hb-suggest-img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 0;
}

.hb-suggest-body {
  padding: 10px 12px;
}

.hb-suggest-name {
  min-height: 38px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.hb-suggest-price {
  margin-top: 6px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
}

/* =========================
   SECTION: Tablet
   ========================= */
@media (max-width: 991px) {
  .hb-suggest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hb-suggest-card {
    max-width: none;
  }
}

/* =========================
   SECTION: Mobile layout hardening
   NOTE:
   - Ini bahagian paling sensitif untuk product page
   DEBUG-POINT:
   - Kalau card senget / button tak full width / text overflow, debug sini dulu
   ========================= */
@media (max-width: 768px) {
  .container {
    width: 100%;
    max-width: 100%;
    padding-right: 14px;
    padding-left: 14px;
    box-sizing: border-box;
  }

  .product-detail-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
  }

  .product-detail-grid > div,
  .product-detail-grid > article,
  .product-detail-grid > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .product-detail-grid .card,
  .product-detail-grid .pad,
  .product-detail-grid .foot,
  .product-detail-grid .variant-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .product-detail-grid img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .variant-price {
    font-size: 24px !important;
    line-height: 1.15 !important;
  }

  .variant-note,
  .hb-suggest-sub,
  .hb-suggest-name,
  p,
  .small {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .product-detail-grid .foot {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .product-detail-grid .foot .btn {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  .hb-suggest-title {
    font-size: 1.1rem !important;
    line-height: 1.25 !important;
  }

  .hb-suggest-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .hb-suggest-card {
    max-width: none !important;
  }

  .hb-suggest-img {
    height: 110px !important;
  }

  body {
    padding-bottom: 90px;
  }

  .wa-float,
  .whatsapp-float,
  .floating-wa,
  .sticky-wa {
    right: 12px !important;
    bottom: 12px !important;
  }

  /* NOTE:
     Tilt effect cantik di desktop, tapi boleh glitch di mobile */
  .tilt {
    transform: none !important;
  }
}

/* =========================
   SECTION: Small mobile
   ========================= */
@media (max-width: 480px) {
  .hb-suggest-grid {
    grid-template-columns: 1fr !important;
  }

  .hb-suggest-img {
    height: 120px !important;
  }
}