:root {
  --bg: #F7EFDD;
  --primary: #1E4E5F;
  --accent: #E9A63B;
  --secondary-accent: #B94A2C;
  --tertiary: #5B6E3A;
  --ink: #241F16;
  --paper: #FFFDF7;
  --line: #E4D6B0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Work Sans', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.display { font-family: 'Fraunces', Georgia, serif; }
.mono { font-family: 'IBM Plex Mono', monospace; }
img, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--primary);
  color: var(--bg);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 40px; width: 40px; border-radius: 10px; object-fit: cover; }
.brand-name { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-weight: 700; letter-spacing: 0.2px; }
.brand-tagline { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); }

.cart-btn {
  background: var(--accent); color: var(--ink); border: none;
  padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.cart-count {
  background: var(--ink); color: var(--accent); border-radius: 999px;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-family: 'IBM Plex Mono', monospace;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--primary); color: var(--bg); padding: 56px 20px 0; text-align: center;
  position: relative;
}
.hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.hero h1 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: clamp(32px, 6vw, 54px);
  line-height: 1.08; margin: 0 auto 16px; max-width: 720px;
}
.hero p { max-width: 520px; margin: 0 auto; font-size: 16px; color: #DDEBE9; line-height: 1.5; }
.hero-image { margin: 32px auto 0; max-width: 640px; border-radius: 16px 16px 0 0; overflow: hidden; }
.hero-image img { width: 100%; height: 260px; object-fit: cover; }
.scallop {
  height: 22px; width: 100%; display: block;
  background-image: radial-gradient(circle at 12px 0, transparent 12px, var(--bg) 13px);
  background-size: 24px 22px; background-repeat: repeat-x; background-position: bottom;
}

/* ---------- Category nav ---------- */
.category-nav {
  position: sticky; top: 66px; z-index: 30; background: var(--bg);
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--primary);
  background: transparent; color: var(--primary); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.pill.active { background: var(--primary); color: var(--bg); }

/* ---------- Product grid ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; }
.category-block { margin-bottom: 40px; scroll-margin-top: 130px; }
.category-title {
  font-family: 'Fraunces', Georgia, serif; font-size: 24px; font-weight: 700;
  margin: 0 0 4px; display: flex; align-items: center; gap: 10px;
}
.category-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 16px; }

.ticket {
  background: var(--paper); border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(30,25,10,0.08);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: relative;
}
.ticket-media { position: relative; background: var(--line); aspect-ratio: 4/5; overflow: hidden; }
.ticket-media img, .ticket-media video { width: 100%; height: 100%; object-fit: cover; }
.ticket-media.empty { display: flex; align-items: center; justify-content: center; font-family: 'Fraunces', serif; font-size: 40px; color: #B8A876; }
.ticket-notch {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px; background: var(--bg); border-radius: 50%; z-index: 2;
}
.ticket-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ticket-name { font-family: 'Fraunces', Georgia, serif; font-size: 18px; font-weight: 700; }
.ticket-desc { font-size: 13px; color: #55503f; line-height: 1.45; flex: 1; }
.variant-row { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.variant-select {
  width: 100%; padding: 9px 10px; border-radius: 8px; border: 1.5px solid var(--line);
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; background: #fff; color: var(--ink);
}
.toppings-box { margin-top: 6px; }
.toppings-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.6px; text-transform: uppercase;
  color: #8a8168; margin-bottom: 6px; display: block;
}
.toppings-grid { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.topping-option {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px 5px 8px;
}
.topping-option input { width: 14px; height: 14px; accent-color: var(--tertiary); margin: 0; }
.ticket-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 10px; }
.price-tag { font-family: 'IBM Plex Mono', monospace; font-weight: 700; color: var(--secondary-accent); font-size: 15px; }
.add-btn {
  background: var(--tertiary); color: #fff; border: none; padding: 9px 16px;
  border-radius: 8px; font-weight: 700; font-size: 13px;
}
.add-btn:active { transform: scale(0.97); }

/* ---------- Footer ---------- */
footer { background: var(--primary); color: var(--bg); padding: 32px 20px; text-align: center; }
footer .display { font-size: 18px; margin-bottom: 6px; }
footer p { font-size: 13px; color: #cfe0dd; max-width: 480px; margin: 6px auto; line-height: 1.5; }
.contact-line { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent); margin-top: 10px; }

/* ---------- Cart drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,16,8,0.45); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%);
  background: var(--bg); z-index: 60; transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0,0,0,0.15);
}
.drawer.open { transform: translateX(0); }
.drawer-header { padding: 18px 20px; background: var(--primary); color: var(--bg); display: flex; justify-content: space-between; align-items: center; }
.drawer-header h2 { font-family: 'Fraunces', Georgia, serif; margin: 0; font-size: 20px; }
.icon-btn { background: transparent; border: none; color: inherit; font-size: 22px; line-height: 1; padding: 4px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-variant { font-size: 12px; color: #6b6252; font-family: 'IBM Plex Mono', monospace; }
.qty-stepper { display: flex; align-items: center; gap: 8px; }
.qty-stepper button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-weight: 700; }
.cart-item-price { font-family: 'IBM Plex Mono', monospace; font-weight: 700; min-width: 60px; text-align: right; }
.remove-btn { background: none; border: none; color: var(--secondary-accent); font-size: 12px; text-decoration: underline; padding: 0; }
.empty-cart { text-align: center; color: #8a8168; padding: 40px 10px; font-size: 14px; }

.drawer-footer { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.total-row .label { font-weight: 600; }
.total-row .amount { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 20px; color: var(--secondary-accent); }
.primary-btn {
  width: 100%; background: var(--accent); color: var(--ink); border: none; padding: 14px;
  border-radius: 10px; font-weight: 700; font-size: 15px;
}
.primary-btn:disabled { opacity: 0.5; }

/* ---------- Checkout form ---------- */
.checkout-form { display: flex; flex-direction: column; gap: 12px; }
.checkout-form label { font-size: 12px; font-weight: 600; color: #55503f; display: block; margin-bottom: 4px; }
.checkout-form input, .checkout-form textarea, .checkout-form select {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--line);
  font-family: 'Work Sans', sans-serif; font-size: 14px; background: #fff; color: var(--ink);
}
.checkout-form textarea { resize: vertical; min-height: 60px; }
.mode-toggle { display: flex; gap: 8px; }
.mode-toggle button {
  flex: 1; padding: 10px; border-radius: 8px; border: 1.5px solid var(--primary);
  background: transparent; color: var(--primary); font-weight: 600; font-size: 13px;
}
.mode-toggle button.active { background: var(--primary); color: #fff; }
.field-error { color: var(--secondary-accent); font-size: 12px; margin-top: 6px; }

.confirmation { text-align: center; padding: 30px 10px; }
.confirmation .stamp {
  width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--tertiary); color: var(--tertiary);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; font-size: 38px;
}
.confirmation h3 { font-family: 'Fraunces', Georgia, serif; font-size: 22px; margin: 0 0 8px; }
.confirmation p { font-size: 13px; color: #55503f; }
.order-number { font-family: 'IBM Plex Mono', monospace; font-weight: 700; color: var(--secondary-accent); font-size: 15px; margin: 10px 0 20px; }

@media (max-width: 480px) {
  .drawer { width: 100%; }
}
