:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2c2420;
  --muted: #8a7f75;
  --accent: #7b3f3f;
  --accent-dark: #5e2f2f;
  --gold: #b08d57;
  --border: #e8e0d5;
  --green: #3d7a4e;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(44, 36, 32, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Ensure hidden elements stay hidden even when their class sets display */
[hidden] { display: none !important; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: 'Cormorant Garamond', Georgia, serif; }

a { color: var(--accent); }

.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 5vw;
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--accent-dark); text-decoration: none;
}

.header-actions { display: flex; gap: 10px; align-items: center; }

.cart-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 18px; border-radius: 999px;
  font-family: inherit; font-size: 0.95rem; font-weight: 500;
  cursor: pointer; transition: background 0.2s;
}
.cart-btn:hover { background: var(--accent-dark); }
.cart-count {
  background: var(--gold); border-radius: 999px;
  padding: 1px 8px; margin-left: 6px; font-size: 0.85rem;
}

.chip-btn {
  background: transparent; border: 1px solid var(--accent);
  color: var(--accent); border-radius: 999px; padding: 9px 16px;
  font-family: inherit; font-size: 0.95rem; cursor: pointer;
  transition: all 0.2s;
}
.chip-btn:hover, .chip-btn.on { background: var(--accent); color: #fff; }

.hero { text-align: center; padding: 88px 5vw 72px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 600; color: var(--accent-dark); margin-bottom: 16px; }
.hero p { color: var(--muted); margin-bottom: 28px; }

.btn {
  display: inline-block; border: none; cursor: pointer;
  font-family: inherit; font-size: 1rem; font-weight: 600;
  padding: 13px 30px; border-radius: 999px;
  text-decoration: none; transition: background 0.2s, transform 0.1s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.full { width: 100%; }
.btn-small {
  background: var(--accent); color: #fff; border: none;
  padding: 9px 18px; border-radius: 10px; font-family: inherit;
  font-weight: 600; cursor: pointer;
}

.shop { max-width: 1100px; margin: 0 auto; padding: 0 5vw 80px; }
.section-title { font-size: 2rem; color: var(--accent-dark); margin-bottom: 18px; text-align: center; }

.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; align-items: center; }
.toolbar input[type="search"] {
  width: min(420px, 100%); padding: 11px 18px;
  border: 1px solid var(--border); border-radius: 999px;
  font-family: inherit; font-size: 0.95rem; background: var(--card);
}
.toolbar input[type="search"]:focus { outline: 2px solid var(--gold); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 16px; cursor: pointer;
  font-family: inherit; font-size: 0.88rem; color: var(--ink);
  transition: all 0.15s;
}
.chip.on, .chip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  position: relative;
}
.card-click { cursor: pointer; display: flex; flex-direction: column; flex: 1; }
.wish-heart {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(255,255,255,0.9); border: none;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 1.1rem; color: #c9beb2; cursor: pointer;
  transition: all 0.15s; box-shadow: var(--shadow);
}
.wish-heart.on { color: #d24545; }
.wish-heart:hover { transform: scale(1.1); }

.card-img {
  aspect-ratio: 1; width: 100%; object-fit: cover; display: block;
  background: linear-gradient(135deg, #efe6d8, #e0cdb8);
}
.card-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--gold);
  font-family: 'Cormorant Garamond', serif;
}
.card-img.placeholder.big { aspect-ratio: 1; }
.card-body { padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: 1.25rem; color: var(--accent-dark); }
.card-body .desc {
  font-size: 0.9rem; color: var(--muted); flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { padding: 0 18px 18px; }
.price-row { display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 600; font-size: 1.1rem; }
.stock-note { font-size: 0.8rem; color: var(--gold); }
.stock-note.out { color: #b3372f; }
.rating-line { font-size: 0.85rem; }
.stars { color: var(--gold); letter-spacing: 1px; }

.add-btn {
  background: var(--accent); border: none; color: #fff;
  padding: 10px; border-radius: 10px; font-family: inherit;
  font-weight: 600; cursor: pointer; transition: background 0.2s; width: 100%;
}
.add-btn:hover { background: var(--accent-dark); }
.add-btn:disabled { background: #c9beb2; cursor: not-allowed; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 5vw; text-align: center; color: var(--muted); font-size: 0.9rem;
}

/* Drawer & modals */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 22, 18, 0.45); z-index: 30;
}
.drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(420px, 100vw);
  background: var(--card); z-index: 40; display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.drawer-head h3 { font-size: 1.5rem; color: var(--accent-dark); }
.icon-btn {
  background: none; border: none; font-size: 1.1rem; cursor: pointer;
  color: var(--muted); padding: 6px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.drawer-foot { padding: 18px 22px; border-top: 1px solid var(--border); }
.drawer-foot .row { display: flex; justify-content: space-between; margin-bottom: 8px; }

.cart-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cart-item img, .cart-item .thumb {
  width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
  background: linear-gradient(135deg, #efe6d8, #e0cdb8);
  display: flex; align-items: center; justify-content: center; color: var(--gold);
  flex-shrink: 0;
}
.cart-item .info { flex: 1; }
.cart-item .info .name { font-weight: 600; font-size: 0.95rem; }
.cart-item .info .unit { font-size: 0.85rem; color: var(--muted); }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-controls button {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; font-size: 1rem; line-height: 1;
}
.empty-cart { text-align: center; color: var(--muted); padding: 40px 0; }

.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(30, 22, 18, 0.45); padding: 4vw;
}
.modal-card {
  background: var(--card); border-radius: var(--radius);
  width: min(560px, 100%); max-height: 90dvh; overflow-y: auto;
  box-shadow: var(--shadow); position: relative;
}
.modal-card form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-card label { display: flex; flex-direction: column; gap: 5px; font-size: 0.9rem; font-weight: 500; }
.modal-card input, .modal-card textarea, .modal-card select {
  font-family: inherit; font-size: 1rem; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
.modal-card input:focus, .modal-card textarea:focus, .modal-card select:focus {
  outline: 2px solid var(--gold);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }

.coupon-row { display: flex; gap: 10px; }
.coupon-row input { flex: 1; text-transform: uppercase; }

.summary {
  background: var(--bg); border-radius: 10px; padding: 14px 16px;
  font-size: 0.95rem;
}
.summary .row { display: flex; justify-content: space-between; padding: 3px 0; }
.summary .row.green { color: var(--green); }
.summary .total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }

.error { color: #b3372f; font-size: 0.9rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }
.green { color: var(--green); }

.modal-card.center { padding: 40px 30px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.success-mark {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
}

/* Product modal */
.product-view { width: min(880px, 100%); padding: 0; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 3; background: rgba(255,255,255,0.85); border-radius: 50%; }
.product-layout { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .product-layout { grid-template-columns: 1fr; } }
.gallery { padding: 18px; }
.gallery-main {
  border-radius: 10px; overflow: hidden; cursor: zoom-in;
  aspect-ratio: 1; background: linear-gradient(135deg, #efe6d8, #e0cdb8);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; display: block; }
.gallery-main.zoomed { cursor: zoom-out; }
.gallery-main.zoomed img { transform: scale(2.2); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  cursor: pointer; opacity: 0.6; border: 2px solid transparent;
}
.gallery-thumbs img.on { opacity: 1; border-color: var(--accent); }
.product-info { padding: 26px 22px; display: flex; flex-direction: column; gap: 10px; }
.product-info h3 { font-size: 1.7rem; color: var(--accent-dark); }
.pv-actions { display: flex; gap: 10px; align-items: center; }
.pv-actions .chip-btn.on { background: #d24545; border-color: #d24545; color: #fff; }

.reviews-block { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
.reviews-block h4 { font-size: 1.2rem; color: var(--accent-dark); margin-bottom: 8px; }
.review { border-bottom: 1px solid var(--border); padding: 8px 0; font-size: 0.9rem; }
.review p { color: var(--muted); margin-top: 2px; }
.review-form-box { margin-top: 10px; }
.review-form-box summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.review-form-box form { padding: 12px 0 0; display: flex; flex-direction: column; gap: 10px; }
.star-input button {
  background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #d8cfc2; padding: 0 2px;
}
.star-input button.on { color: var(--gold); }
