:root {
  --bg: #faf8f5;
  --card: #ffffff;
  --text: #1f1d1a;
  --muted: #7a746c;
  --accent: #b8860b;
  --accent-dark: #8f6908;
  --border: #ece7e0;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }

.header { position: sticky; top: 0; z-index: 10; background: rgba(250,248,245,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { font-size: 22px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: .5px; }
.cart-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--card); padding: 8px 14px; border-radius: 999px; font-size: 15px; cursor: pointer; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; min-width: 22px; padding: 2px 7px; font-size: 13px; }

.hero { text-align: center; padding: 48px 0 24px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 40px); }
.hero p { margin: 0; color: var(--muted); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 16px 0 28px; }
.chip { border: 1px solid var(--border); background: var(--card); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; padding-bottom: 60px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.06); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eee; }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.card h3 { margin: 0; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.price { font-weight: 700; font-size: 18px; }

.btn { border: 1px solid var(--border); background: var(--card); padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.full { width: 100%; }
.icon-btn { border: none; background: none; font-size: 20px; cursor: pointer; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%); background: var(--card); z-index: 30; transform: translateX(100%); transition: transform .25s; display: flex; flex-direction: column; padding: 20px; overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.drawer-head h2 { margin: 0; }

.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.cart-item h4 { margin: 0 0 4px; font-size: 15px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); cursor: pointer; }
.remove { border: none; background: none; color: #c0392b; cursor: pointer; font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.cart-foot { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.total { font-size: 17px; }

.checkout { display: flex; flex-direction: column; gap: 12px; }
.checkout label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.checkout input, .checkout textarea { font: inherit; color: var(--text); padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; resize: vertical; }
.checkout input:focus, .checkout textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
.error { color: #c0392b; margin: 0; min-height: 1em; font-size: 14px; }

.success { text-align: center; padding-top: 40px; }
.success-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: #27ae60; color: #fff; font-size: 34px; display: grid; place-items: center; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: .2s; z-index: 40; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
