:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1f1c18;
  --muted: #6f685e;
  --line: #e7e1d6;
  --accent: #8a6a3b;
  --accent-ink: #ffffff;
  --ok: #2f7a4a;
  --warn: #a8641a;
  --bad: #a83a2a;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(31, 28, 24, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand { font-family: Georgia, 'Times New Roman', serif; font-weight: 600; letter-spacing: 0.01em; }
h1 { font-size: 1.9rem; margin: 0 0 4px; }
h2 { font-size: 1.35rem; margin: 0 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.hidden { display: none !important; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { font-size: 1.25rem; text-decoration: none; color: var(--ink); }
.brand span { color: var(--accent); }

/* Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .count {
  background: var(--accent-ink); color: var(--accent); border-radius: 999px;
  min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; font-size: 0.8rem;
}
input, select, textarea {
  font: inherit; width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
label { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 6px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.center-card { max-width: 420px; margin: 12vh auto; text-align: center; }
.center-card form { text-align: left; }
.error { color: var(--bad); font-size: 0.9rem; min-height: 1.2em; margin-top: 8px; }

/* Hero */
.hero { padding: 28px 0 8px; }
.hero p { margin: 4px 0 0; max-width: 680px; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.steps span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 0.85rem; color: var(--muted); }
.steps b { color: var(--accent); margin-right: 4px; }

/* Landing */
.landing-hero { background: var(--ink); color: #fff; padding: 48px 0 40px; }
.landing-hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 4px 0 8px; }
.landing-hero p { color: rgba(255, 255, 255, 0.78); max-width: 640px; margin: 0; }
.landing-hero .eyebrow { color: #d9bf8f; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
.landing-hero .steps span { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.85); }
.landing-hero .steps b { color: #d9bf8f; }
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding-bottom: 24px; }
.event-card {
  display: block; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform 0.15s, box-shadow 0.15s;
}
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.event-card .cover { aspect-ratio: 3 / 2; background: #ece6db; overflow: hidden; }
.event-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-card .info { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.event-card h3 { margin: 0; font-size: 1.15rem; }
.event-card .go { color: var(--accent); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 600; font-size: 0.9rem; }

/* Filters */
.filters { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px;
  font: inherit; font-size: 0.9rem; cursor: pointer; white-space: nowrap; color: var(--ink);
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip small { opacity: 0.6; margin-left: 4px; }
.search { max-width: 360px; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.tile {
  position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: #ece6db; cursor: pointer;
  border: 3px solid transparent; transition: border-color 0.15s;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.sel { border-color: var(--accent); }
.tile .name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 0.75rem; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}
.tile .pick {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0, 0, 0, 0.3); color: #fff; display: grid; place-items: center;
  font-size: 18px; font-weight: 700; cursor: pointer; padding: 0;
}
.tile.sel .pick { background: var(--accent); border-color: var(--accent); }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.more { display: flex; justify-content: center; padding: 24px 0 40px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 13, 11, 0.94);
  display: flex; flex-direction: column;
}
.lightbox .lb-img { flex: 1; position: relative; min-height: 0; }
.lightbox img {
  position: absolute; inset: 8px; margin: auto; max-width: calc(100% - 16px); max-height: calc(100% - 16px);
  object-fit: contain; user-select: none; -webkit-user-drag: none;
}
.lightbox .lb-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; color: #fff;
}
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 100%; display: flex; justify-content: space-between; pointer-events: none; padding: 0 8px; }
.lightbox .lb-nav button {
  pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.15);
  color: #fff; font-size: 22px; cursor: pointer;
}
.lightbox .close { background: transparent; border: 0; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; }

/* Drawer */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 45; background: var(--bg);
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.drawer header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer .body { flex: 1; overflow-y: auto; padding: 16px; }
.drawer footer { border-top: 1px solid var(--line); padding: 16px; background: var(--surface); }
.cart-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cart-list .ci { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #ece6db; }
.cart-list img { width: 100%; height: 100%; object-fit: cover; }
.cart-list button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 13px; cursor: pointer; padding: 0;
}
.total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total strong { font-size: 1.4rem; font-family: Georgia, serif; }

/* Confirmation */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.45); }
.modal .card { width: min(480px, 100%); max-height: 92vh; overflow-y: auto; }
.codebox {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg);
  border: 1px dashed var(--accent); border-radius: 10px; padding: 12px 14px; margin: 6px 0 14px;
}
.codebox b { font-size: 1.2rem; font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
ol.howto { padding-left: 20px; margin: 8px 0 16px; }
ol.howto li { margin-bottom: 6px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 0.9rem; box-shadow: var(--shadow);
}
footer.site { padding: 32px 0; text-align: center; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); margin-top: 24px; }

/* Admin */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 16px 0; }
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px 16px; text-align: center; background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.drop.over { border-color: var(--accent); background: #f5efe4; }
.drop .btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.progress { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.9rem; }
.log { max-height: 180px; overflow-y: auto; font: 12px/1.5 ui-monospace, Menlo, monospace; background: var(--bg); border-radius: 8px; padding: 8px; margin-top: 10px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .row.two { grid-template-columns: 1fr 1fr; } }
.order { margin-bottom: 12px; }
.order .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.order .code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 1.05rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--line); }
.badge.pendiente { background: #fbecd6; color: var(--warn); }
.badge.pagado { background: #dcefe2; color: var(--ok); }
.badge.entregado { background: #e3e0f3; color: #4b3f8f; }
.badge.cancelado { background: #f3dcd8; color: var(--bad); }
.thumbs { display: flex; gap: 4px; overflow-x: auto; margin: 10px 0; }
.thumbs img { width: 54px; height: 72px; object-fit: cover; border-radius: 6px; flex: none; }
.names { font: 12px/1.5 ui-monospace, Menlo, monospace; background: var(--bg); border-radius: 8px; padding: 8px; white-space: pre-wrap; word-break: break-all; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.album-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 12px; }
