/* =======================================================================
   Heidhi Wellness — storefront stylesheet
   ======================================================================= */

:root {
  --color-bg: #fbf8f4;
  --color-surface: #ffffff;
  --color-primary: #5c7a5e;      /* sage green */
  --color-primary-dark: #435c45;
  --color-accent: #c98a6b;       /* warm terracotta/blush */
  --color-accent-light: #f3e3da;
  --color-text: #2c2a26;
  --color-text-muted: #6f6a62;
  --color-border: #e8e1d8;
  --color-success: #3f7a4e;
  --color-danger: #b3432b;
  --color-warning: #b8862c;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(44, 42, 38, 0.08);
  --shadow-md: 0 8px 24px rgba(44, 42, 38, 0.08);
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 15.5px;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .5em;
  color: var(--color-primary-dark);
}
/* Mobile-first type scale: comfortable on small screens, scales up at 640px+ */
h1 { font-size: 1.9rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
@media (min-width: 640px) {
  h1 { font-size: 2.6rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.4rem; }
}
p { margin: 0 0 1em; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 20px; } }
.section { padding: 36px 0; }
@media (min-width: 640px) { .section { padding: 60px 0; } }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 28px; }
@media (min-width: 640px) { .section-head { margin: 0 auto 40px; } }
.section-head .eyebrow { color: var(--color-accent); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  border: 1px solid transparent; cursor: pointer; transition: all .18s ease;
  font-family: var(--font-body);
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { background: transparent; border-color: var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { opacity: .9; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: .82rem; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: .92rem; }
.alert-success { background: #eaf4ec; color: var(--color-success); border: 1px solid #cfe6d4; }
.alert-danger { background: #fbeae6; color: var(--color-danger); border: 1px solid #f1cec5; }
.alert-info { background: #eef3f6; color: #3a5d75; border: 1px solid #cfe0ea; }

/* Top bar + header */
.topbar { background: var(--color-primary-dark); color: #f2ede4; font-size: .8rem; padding: 8px 0; text-align: center; letter-spacing: .03em; }
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; max-width: var(--container); margin: 0 auto; gap: 16px; }
.logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: var(--color-primary-dark); letter-spacing: .02em; }
.logo span { color: var(--color-accent); }
.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a { font-weight: 500; font-size: .93rem; color: var(--color-text); }
.main-nav a:hover { color: var(--color-primary); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-link {
  position: relative; font-size: 1.2rem; background: none; border: none; cursor: pointer; color: var(--color-text);
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
}
.icon-link:hover { background: var(--color-accent-light); }
.nav-toggle {
  display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer;
  width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 50%;
}
.nav-toggle:hover { background: var(--color-accent-light); }

.header-search { display: flex; gap: 8px; }
.header-search input { flex: 1; }

@media (min-width: 901px) {
  .header-search { max-width: 220px; margin-left: auto; margin-right: 12px; }
  .header-search button { display: none; }
}

@media (max-width: 900px) {
  .main-nav { position: fixed; top: 0; right: -280px; height: 100vh; width: min(80vw, 300px); background: #fff; flex-direction: column; padding: 90px 24px 24px; box-shadow: var(--shadow-md); transition: right .25s ease; z-index: 60; overflow-y: auto; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
  .main-nav.open { right: 0; }
  .nav-toggle { display: inline-flex; }

  .header-search {
    display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--color-surface);
    padding: 14px 16px; border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-sm); z-index: 40;
  }
  .header-search.open { display: flex; }
  .topbar { font-size: .72rem; padding: 7px 14px; }
  .logo { font-size: 1.3rem; }
}

/* Hero */
.hero { background: linear-gradient(120deg, var(--color-accent-light), #eef1e6); padding: 36px 0; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1fr; align-items: center; gap: 28px; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.hero-inner > div { min-width: 0; }
.hero h1 { font-size: 2rem; }
.hero-badges { display: flex; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.hero-badges div { font-size: .8rem; color: var(--color-text-muted); display: flex; align-items: center; gap: 8px; }
.hero-visual { background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; }
.hero-visual img { width: 42% !important; }
@media (min-width: 800px) {
  .hero { padding: 70px 0; }
  .hero-inner { grid-template-columns: 1.1fr 1fr; gap: 40px; padding: 0 20px; }
  .hero h1 { font-size: 3rem; }
  .hero-badges { gap: 22px; margin-top: 28px; }
  .hero-badges div { font-size: .82rem; }
  .hero-visual img { width: 60% !important; }
}

/* Product grid / cards */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.product-grid > * { min-width: 0; }
@media (max-width: 1000px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }

.product-card { background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-border); transition: box-shadow .2s ease, transform .2s ease; position: relative; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.product-card .thumb { aspect-ratio: 1/1; background: #f4f0ea; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 16px; }
.product-card .cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--color-accent); font-weight: 600; }
.product-card h3 { font-size: 1.05rem; margin: 6px 0; font-family: var(--font-body); font-weight: 600; color: var(--color-text); }
.product-card .price { font-weight: 700; color: var(--color-primary-dark); }
.strike { text-decoration: line-through; color: var(--color-text-muted); font-weight: 400; font-size: .85em; margin-left: 6px; }
.badge-sale { position: absolute; top: 12px; left: 12px; background: var(--color-accent); color: #fff; font-size: .68rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge-outofstock { position: absolute; top: 12px; left: 12px; background: #9c9488; color: #fff; font-size: .68rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.product-card form { margin-top: 10px; }

/* Category chips */
.category-strip { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.category-chip { flex: 0 0 auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; padding: 10px 20px; font-size: .88rem; font-weight: 500; white-space: nowrap; }
.category-chip.active, .category-chip:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* Breadcrumb */
.breadcrumb { font-size: .82rem; color: var(--color-text-muted); padding: 18px 0; }
.breadcrumb a:hover { color: var(--color-primary); }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.product-detail > div { min-width: 0; }
@media (max-width: 800px) { .product-detail { grid-template-columns: 1fr; } }
.pd-gallery { position: relative; }
.pd-slider {
  display: flex; width: 100%; max-width: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; border-radius: var(--radius-lg); background: #f4f0ea;
  scrollbar-width: none; -ms-overflow-style: none;
}
.pd-slider::-webkit-scrollbar { display: none; }
.pd-slide { flex: 0 0 100%; max-width: 100%; aspect-ratio: 1/1; scroll-snap-align: start; }
.pd-slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pd-slider-arrow {
  display: none; position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  border-radius: 50%; border: none; background: rgba(255,255,255,.9); box-shadow: var(--shadow-sm);
  font-size: .85rem; cursor: pointer; align-items: center; justify-content: center; color: var(--color-text);
}
.pd-slider-prev { left: 10px; }
.pd-slider-next { right: 10px; }
.pd-dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.pd-dots .pd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-border); }
.pd-dots .pd-dot.active { background: var(--color-primary); }
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.pd-thumbs img {
  width: 68px; height: 68px; flex-shrink: 0; object-fit: contain; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer; opacity: .65; transition: opacity .15s ease, border-color .15s ease;
  background: #f4f0ea;
}
.pd-thumbs img.active { opacity: 1; border-color: var(--color-primary); }
@media (min-width: 700px) {
  .pd-slider-arrow { display: flex; }
}
.btn-buy-now { width: 100%; }
@media (min-width: 640px) { .btn-buy-now { width: auto; min-width: 240px; } }
.pd-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--color-border); margin: 32px 0 20px; overflow-x: auto; white-space: nowrap; }
.pd-tabs button { background: none; border: none; padding: 10px 0; font-weight: 600; color: var(--color-text-muted); cursor: pointer; border-bottom: 2px solid transparent; flex-shrink: 0; }
.pd-tabs button.active { color: var(--color-primary-dark); border-color: var(--color-primary); }
.pd-tab-panel { display: none; }
.pd-tab-panel.active { display: block; }

/* Cart / checkout */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 14px 10px; border-bottom: 1px solid var(--color-border); text-align: left; font-size: .92rem; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.summary-box { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 24px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: .92rem; gap: 12px; }
.summary-row.total { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--color-border); padding-top: 14px; margin-top: 14px; color: var(--color-primary-dark); }
.checkout-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.checkout-grid > div { min-width: 0; }
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } }
.reviews-grid { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.reviews-grid > div { min-width: 0; }
@media (max-width: 900px) { .reviews-grid { grid-template-columns: 1fr; } }

/* Forms */
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], textarea, select {
  width: 100%; padding: 13px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 16px; background: #fff; color: var(--color-text); min-height: 46px;
}
textarea { resize: vertical; min-height: 110px; }
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.auth-box { max-width: 440px; margin: 0 auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 36px; }
@media (max-width: 480px) { .auth-box { padding: 26px 20px; } }
.acct-layout { display: flex; gap: 20px; flex-wrap: wrap; }
.acct-sidebar { width: 100%; flex-shrink: 0; }
@media (min-width: 680px) { .acct-sidebar { width: 220px; } }
.acct-main { flex: 1; min-width: 0; }
@media (min-width: 680px) { .acct-main { min-width: 280px; } }

/* Star ratings (display) */
.star-rating { display: inline-flex; gap: 1px; line-height: 1; }
.star-rating .star-filled { color: #e8b74b; }
.star-rating .star-empty { color: #ddd6c8; }
.verified-badge { display: inline-flex; align-items: center; gap: 3px; color: var(--color-success); font-weight: 600; margin-left: 4px; }

/* Star rating input (write a review) */
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2rem; color: #ddd6c8; cursor: pointer; line-height: 1; padding: 4px; }
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: #e8b74b; }
.star-input input:focus-visible + label { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }

/* Static/policy pages */
.policy-content h2 { margin-top: 34px; font-size: 1.35rem; }
.policy-content ul { padding-left: 20px; }
.policy-content li { margin-bottom: 8px; }

/* Footer */
.site-footer { background: #2f3b30; color: #d9dfd4; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 40px 16px 24px; max-width: var(--container); margin: 0 auto; }
@media (min-width: 560px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; padding: 60px 20px 30px; } }
.footer-grid h4 { color: #fff; font-family: var(--font-body); font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; font-size: .88rem; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); text-align: center; padding: 18px; font-size: .8rem; color: #a9b3a2; }
.newsletter-form { display: flex; gap: 8px; margin-top: 6px; }
.newsletter-form input { flex: 1; }
.social-row { display: flex; gap: 12px; margin-top: 16px; }
.social-row a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; }

/* Misc */
.empty-state { text-align: center; padding: 70px 20px; color: var(--color-text-muted); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); font-size: .88rem; }
.pagination .active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.trust-strip { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; padding: 24px 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); margin: 28px 0; }
@media (min-width: 700px) { .trust-strip { gap: 40px; padding: 30px 0; margin: 40px 0; } }
.trust-strip div { text-align: center; font-size: .85rem; color: var(--color-text-muted); max-width: 160px; }
.trust-strip .ic { font-size: 1.6rem; margin-bottom: 6px; }
table.order-items { width: 100%; border-collapse: collapse; margin: 16px 0; }
table.order-items th, table.order-items td { padding: 10px; border-bottom: 1px solid var(--color-border); font-size: .88rem; text-align: left; }
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.status-pending_payment, .status-pending { background: #fbeee0; color: #a6620f; }
.status-processing { background: #e6eef8; color: #2f5f9e; }
.status-shipped { background: #eef0fb; color: #4a4ec9; }
.status-delivered, .status-paid { background: #e7f4e9; color: #2f7a3f; }
.status-cancelled, .status-failed { background: #fbe7e4; color: #b3432b; }
.status-refunded { background: #f3e9fb; color: #7a3fb3; }
.status-cod { background: #e6f4ea; color: #1e7e34; }
.status-cod-pending { background: #fbeee0; color: #a6620f; }

/* Checkout: payment method popup. Note: the modal's show/hide is driven
   by inline style.display in checkout.php's JS (not this .heidhi-modal-overlay
   rule) so it can never get stuck open from a stale cached copy of this
   file — only the cosmetic bits below (option card styling) live here. */
.heidhi-modal-box { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-md); max-width: 400px; width: 100%; padding: 26px 22px; max-height: 90vh; overflow-y: auto; }
.heidhi-payment-option { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.heidhi-payment-option:hover { border-color: var(--color-primary); }
.heidhi-payment-option.selected { border-color: var(--color-primary); background: var(--color-accent-light); }
.heidhi-payment-option input[type="radio"] { width: auto; margin-top: 3px; pointer-events: none; }
