:root {
  --bg: #f4f8ff;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #6b7a95;
  --line: #dde7f5;
  --accent: #2563c9;
  --accent-2: #4a8af0;
  --gold: #e0a526;
  --green: #2f7d5b;
  --shadow: 0 1px 2px rgba(20, 40, 90, .06), 0 8px 24px rgba(20, 40, 90, .08);
  --radius: 20px;
  --display: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1424;
    --surface: #152038;
    --ink: #eaf1ff;
    --muted: #8fa0c0;
    --line: #243553;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(224, 165, 38, .45), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(255, 255, 255, .12), transparent 60%),
    linear-gradient(135deg, #17398a, #2563c9 60%, #4aa3f0);
  padding: 64px 20px 110px;
  text-align: center;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: "🎄 ✨ 🎁 ⭐ 🎂 ✨ 🎄 🎁 ⭐ 🎂";
  position: absolute; left: 0; right: 0; white-space: nowrap;
  font-size: 22px; opacity: .18; letter-spacing: 18px;
}
.hero::before { top: 14px; animation: drift 60s linear infinite; }
.hero::after  { bottom: 60px; animation: drift 80s linear infinite reverse; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-30%); } }

.hero-inner { position: relative; max-width: 720px; margin: 0 auto; }
.eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 6px 14px;
  background: rgba(255, 255, 255, .18); border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  backdrop-filter: blur(6px);
}
h1 {
  margin: 0 0 12px; font-family: var(--display); font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 4rem); line-height: 1.05; letter-spacing: -.01em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .18);
}
.lead { margin: 0; font-size: clamp(1rem, 2.4vw, 1.15rem); opacity: .94; }
.wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 60px; fill: var(--bg); }

/* ---------- Toolbar ---------- */
main { max-width: 1180px; margin: -18px auto 0; padding: 0 20px 40px; position: relative; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
  border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  font-weight: 600; color: var(--muted); transition: all .2s;
}
.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
select {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; cursor: pointer;
}
.count { color: var(--muted); font-size: 14px; margin: 0 4px; min-height: 1.4em; }

/* ---------- Cartes ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
  animation: pop .45s ease both;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(20, 40, 90, .08), 0 16px 36px rgba(20, 40, 90, .16); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.media {
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #e3eeff, #cfe0fb);
}
@media (prefers-color-scheme: dark) { .media { background: linear-gradient(135deg, #1d2a44, #16203a); } }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .media img { transform: scale(1.05); }
.media .ph { font-size: 56px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .15)); }

.badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.badge {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, .92); color: #2a1f1d; backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.badge.fav { background: var(--gold); color: #3b2a00; }

.body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.card h3 { margin: 0; font-family: var(--display); font-size: 1.2rem; line-height: 1.25; }
.desc { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 800; font-size: 1.25rem; color: var(--accent); margin-top: auto; padding-top: 6px; }
.price.none { color: var(--muted); font-size: .95rem; font-weight: 600; }
.actions { display: flex; gap: 8px; margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px;
  cursor: pointer; text-decoration: none; transition: transform .15s, filter .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; flex: 1; box-shadow: 0 4px 12px rgba(37, 99, 201, .3); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--line); }
.btn.mine { background: var(--green); color: #fff; flex: 1; }
.btn.disabled { background: var(--line); color: var(--muted); flex: 1; cursor: not-allowed; }
.btn:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.card.reserved .media img, .card.reserved .media .ph { filter: grayscale(.9) opacity(.55); }
.card.reserved h3, .card.reserved .price { opacity: .55; }
.ribbon {
  position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-8deg);
  padding: 8px 26px; background: var(--ink); color: var(--bg); border-radius: 8px;
  font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.ribbon.mine { background: var(--green); color: #fff; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.empty-emoji { font-size: 56px; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 20px 40px; }

/* ---------- Skeleton ---------- */
.skeleton { height: 340px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--line) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Dialog ---------- */
dialog {
  border: 0; border-radius: 24px; padding: 26px; width: min(92vw, 420px);
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
dialog::backdrop { background: rgba(6, 12, 30, .6); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .25s ease; }
dialog h2 { margin: 0 0 4px; font-family: var(--display); }
.dlg-gift { margin: 0 0 16px; color: var(--accent); font-weight: 700; }
dialog label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.muted { color: var(--muted); font-weight: 400; }
dialog input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg);
}
.hint { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 14px;
  font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transition: all .3s ease; max-width: 90vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 560px) {
  .hero { padding: 48px 16px 100px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .controls { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
