/* club (de café) · gift cards — estilos compartidos */
:root {
  --olive: #37432F;      /* verde oliva (manual de marca) */
  --olive-2: #4F5A47;
  --soft: #737A6C;       /* verde suave */
  --beige: #CBBFAF;
  --cream: #EAE1D8;      /* crema */
  --bone: #F9F6EF;       /* hueso */
  --choco: #3C2415;      /* chocolate */
  --line: #DDD5CA;
  --error: #8A3A22;
  --white: #FFFFFF;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bone); color: var(--olive); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--olive); }
a:hover { color: var(--olive-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.topbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 22px 0; }
.topbar img { height: 26px; width: auto; display: block; }
.muted { color: var(--olive-2); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--olive-2); }

/* Formularios */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
legend { padding: 0; margin-bottom: 14px; font-family: var(--serif); font-weight: 500; font-size: 26px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 600; }
.input, textarea.input, select.input {
  width: 100%; min-height: 52px; padding: 0 16px; background: var(--white);
  border: 1px solid var(--beige); border-radius: var(--radius);
}
textarea.input { padding: 14px 16px; min-height: 96px; resize: vertical; }
.input::placeholder { color: #7A8172; }
.input.bad { border: 1.5px solid var(--error); }
.money-input { display: flex; align-items: center; gap: 8px; max-width: 320px; min-height: 56px; padding: 0 18px; background: var(--white); border: 1px solid var(--beige); border-radius: var(--radius); }
.money-input input { flex: 1; min-width: 0; border: 0; background: transparent; font-weight: 600; font-size: 20px; outline: none; height: 52px; }
.money-input span { font-weight: 600; font-size: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.msg { margin: 0; font-size: 14px; }
.msg.err { color: var(--error); font-weight: 600; }
.msg.ok { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.linkbtn { padding: 0; border: 0; background: none; font-weight: 700; color: var(--olive); text-decoration: underline; cursor: pointer; }
.note { padding: 16px; background: var(--cream); border-radius: var(--radius); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { min-height: 48px; padding: 0 22px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 16px; border: 1px solid var(--olive); background: transparent; color: var(--olive); }
.chip[aria-pressed="true"] { background: var(--olive); color: var(--bone); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seg button { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: var(--radius); cursor: pointer; font-weight: 600; border: 1px solid var(--olive); background: var(--white); color: var(--olive); }
.seg button[aria-checked="true"] { background: var(--olive); color: var(--bone); }

.designs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .designs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.design { padding: 5px; background: transparent; border: 1.5px solid transparent; border-radius: 18px; cursor: pointer; text-align: left; }
.design[aria-pressed="true"] { border-color: var(--olive); }
.design .sw { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 5; border-radius: 12px; }
.design .sw img { width: 74%; height: auto; }
.design span { display: block; margin-top: 8px; font-size: 14px; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: var(--radius); border: 1px solid var(--olive); background: var(--olive); color: var(--bone); font-weight: 600; font-size: 16px; cursor: pointer; text-decoration: none; }
.btn:hover { color: var(--bone); background: #2D3726; }
.btn.secondary { background: var(--white); color: var(--olive); }
.btn.secondary:hover { background: var(--bone); color: var(--olive); }
.btn.danger { background: var(--white); color: var(--error); border-color: var(--error); }
.btn.big { min-height: 60px; font-size: 18px; width: 100%; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.alert { padding: 14px 16px; border: 1px solid var(--error); border-radius: var(--radius); color: var(--error); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }

/* Vista previa de la tarjeta */
.preview { display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 20px; }
.preview .top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.preview .top img { height: 18px; width: auto; }
.preview .pv-hero { width: 56%; height: auto; align-self: center; }
.preview .para { font-family: var(--serif); font-style: italic; font-size: 22px; }
.preview .amount { font-weight: 600; font-size: 32px; line-height: 1.15; }
.preview .panel { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; }
.preview .panel svg { width: 64px; height: 64px; flex: none; background: #fff; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-activa { background: var(--olive); color: var(--bone); }
.b-parcial { background: var(--cream); color: var(--olive); }
.b-programada { background: var(--white); color: var(--olive); border: 1px solid var(--olive); }
.b-agotada { background: var(--line); color: var(--olive-2); }
.b-vencida { background: var(--choco); color: var(--bone); }
.b-anulada { background: var(--white); color: var(--error); border: 1px solid var(--error); }
.b-pendiente_pago, .b-cancelada { background: var(--line); color: var(--olive-2); }

.moves { display: flex; flex-direction: column; gap: 8px; }
.move { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.move b { white-space: nowrap; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--olive); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

dialog { border: 0; border-radius: 18px; padding: 0; max-width: min(480px, calc(100vw - 32px)); width: 100%; color: var(--olive); background: var(--bone); }
dialog::backdrop { background: rgba(31, 38, 27, .45); }
dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
dialog h3 { font-size: 22px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--olive); color: var(--bone); padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 50; max-width: calc(100vw - 32px); }
