:root {
  --bg: #faf7f3;
  --surface: #ffffff;
  --text: #2a1d15;
  --muted: #7a6a5e;
  --primary: #6b3e26;
  --primary-hover: #52301d;
  --border: #e8dfd6;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }
.muted { color: var(--muted); margin: 4px 0; font-size: .9rem; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--text); white-space: nowrap; }
.nav nav { display: flex; gap: 18px; align-items: center; overflow-x: auto; }
.nav nav a { text-decoration: none; color: var(--text); white-space: nowrap; }
.badge { background: var(--primary); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .8rem; }
.site-footer { border-top: 1px solid var(--border); padding: 20px 0; color: var(--muted); font-size: .9rem; }

/* Buttons */
.btn { display: inline-block; background: var(--primary); color: #fff; border: 0; border-radius: var(--radius); padding: 10px 18px; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--primary-hover); }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: #f3ebe4; }
.btn-block { width: 100%; margin-top: 20px; }
.link { background: none; border: 0; color: #b3261e; cursor: pointer; }

/* Hero */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(120deg, #3b2416, #8a5a3b); color: #fff; padding: 32px; border-radius: 16px; text-decoration: none; margin-bottom: 24px; }
.hero h1 { margin: 4px 0 8px; font-size: clamp(1.4rem, 4vw, 2.2rem); }
.hero .btn { background: #fff; color: var(--primary); }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; opacity: .8; margin: 0; }

/* Filters + grid */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.card h3 { margin: 10px 0 2px; font-size: 1.05rem; }
.card-link { text-decoration: none; color: inherit; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; }
.price { font-weight: 700; color: var(--primary); }
.price.big { font-size: 1.5rem; }
.thumb { aspect-ratio: 4/3; border-radius: 8px; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 60%, #fff), var(--c)); display: grid; place-items: center; font-size: 3rem; }
.thumb.lg { font-size: 6rem; }

/* Product detail */
.crumb { margin-top: 0; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.detail h1 { margin: 4px 0; }
.qty-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-top: 16px; }
.qty-row input { width: 70px; }

/* Forms */
input { font: inherit; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
label { display: block; margin-bottom: 10px; }
label input:not([type=radio]) { display: block; width: 100%; margin-top: 4px; }
label.radio { display: flex; gap: 8px; align-items: center; }

/* Cart */
.cart-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.cart-table th, .cart-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
.cart-table .qty-input { width: 64px; }
.cart-summary { display: flex; justify-content: flex-end; align-items: center; gap: 20px; margin-top: 16px; flex-wrap: wrap; }

/* Checkout */
.checkout { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel h2 { font-size: 1.1rem; margin-top: 20px; }
.panel h2:first-child { margin-top: 0; }
.summary { list-style: none; padding: 0; margin: 0 0 16px; }
.summary li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.summary .sep { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }
.summary .total { font-weight: 700; font-size: 1.15rem; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; min-width: 0; }
.center { text-align: center; max-width: 560px; margin: 40px auto; }

/* Newsletter */
.newsletter { margin-top: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.newsletter form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.newsletter input { min-width: 240px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #2a1d15; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; transition: .25s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* dataLayer debug panel */
#dl-debug { position: fixed; right: 16px; bottom: 16px; z-index: 50; font-size: 12px; display: flex; flex-direction: column-reverse; align-items: flex-end; }
#dl-debug .dl-toggle { background: #1e1e1e; color: #9cdcfe; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-family: ui-monospace, monospace; }
#dl-debug .dl-body { display: none; width: min(420px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; background: #1e1e1e; color: #d4d4d4; border-radius: 8px; margin-bottom: 8px; padding: 10px; }
#dl-debug.open .dl-body { display: block; }
#dl-debug .dl-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
#dl-debug .dl-clear { margin-left: auto; }
#dl-debug .dl-clear { background: #333; color: #ddd; border: 0; border-radius: 4px; padding: 2px 8px; cursor: pointer; }
#dl-debug ul { list-style: none; padding: 0; margin: 0; }
#dl-debug li { border-top: 1px solid #333; padding: 6px 0; }
#dl-debug strong { color: #4ec9b0; }
#dl-debug small { color: #888; }
#dl-debug pre { margin: 4px 0 0; white-space: pre-wrap; word-break: break-all; font-size: 11px; }

@media (max-width: 760px) {
  .detail, .checkout { grid-template-columns: 1fr; }
  .nav nav { gap: 12px; font-size: .9rem; }
  .nav nav a:not(.cart-link):not(:first-child) { display: none; }
  .cart-table th:nth-child(2), .cart-table td:nth-child(2) { display: none; }
  .hero { padding: 22px; }
}
