/* ==========================================================
   Vendalia · Base compartida (tipografía, reset, utilidades)
   ========================================================== */
@font-face { font-family: "DM Sans"; src: url("../fonts/dmsans.woff") format("woff"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora.woff") format("woff"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-italic.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --brand: #E8590C;
  --brand-2: #FFB020;
  --brand-ink: #B8420A;
  --brand-soft: #FFF1E6;
  --ink: #1C1714;
  --ink-2: #4A413A;
  --muted: #8A7F76;
  --line: #ECE5DC;
  --line-2: #F1F0F7;
  --bg: #F7F3EE;
  --card: #FFFFFF;
  --ok: #1F9D61; --ok-soft: #E3F6EC;
  --warn: #D98A00; --warn-soft: #FFF4D9;
  --bad: #D93B3B; --bad-soft: #FDE7E7;
  --info: #2F6FE4; --info-soft: #E6EEFD;
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --sh-1: 0 1px 2px rgba(28,23,20,.06), 0 1px 1px rgba(28,23,20,.04);
  --sh-2: 0 6px 24px -8px rgba(28,23,20,.18), 0 2px 6px rgba(28,23,20,.05);
  --sh-3: 0 30px 80px -24px rgba(28,23,20,.35);
  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 15px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0 0 1em; }
.ico { flex-shrink: 0; }
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Botones ---------- */
.btn { --b: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--b); color: #fff; font-weight: 600; font-size: 14.5px; letter-spacing: -.005em; transition: transform .15s var(--ease), box-shadow .2s, background .2s, filter .2s; white-space: nowrap; user-select: none; }
.btn:hover { filter: brightness(1.08); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-brand { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, var(--brand-2))); box-shadow: 0 8px 22px -10px var(--brand); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #fff; filter: none; }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-white { background: #fff; color: var(--ink); }
.btn-ok { background: var(--ok); } .btn-bad { background: var(--bad); } .btn-info { background: var(--info); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 6px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.link { color: var(--brand-ink); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ---------- Formularios ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field small, .hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .field select, .field textarea, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; outline: none; transition: border .15s, box-shadow .15s; font-size: 14.5px; }
.field textarea, textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); }
.field input[type=color] { width: 54px; height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: #fff; }
.field input[type=file] { font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0 16px; }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 2px; flex-shrink: 0; }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.input-group span { display: flex; align-items: center; padding: 0 12px; background: var(--line-2); color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.input-group input { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }

/* Interruptor */
.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #D9D1C7; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .25s var(--ease); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:disabled + i { opacity: .45; cursor: not-allowed; }

/* ---------- Badges y avisos ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: #A86A00; }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: #EFEAE4; color: var(--muted); }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: #11663F; border-color: #BFE8D2; }
.alert-error, .alert-bad { background: var(--bad-soft); color: #9C2222; border-color: #F6C6C6; }
.alert-warn { background: var(--warn-soft); color: #7A5200; border-color: #F5DE9F; }
.alert-info { background: var(--info-soft); color: #1C4FB0; border-color: #C9D8FA; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 9999; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; min-width: 260px; max-width: 380px; padding: 13px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--sh-3); font-size: 14px; animation: toastIn .35s var(--ease); }
.toast.ok { background: #13693F; } .toast.error { background: #A62626; } .toast.warn { background: #8A5A00; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 900; background: rgba(20,16,13,.55); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 18px; }
.modal-bg.open { display: flex; animation: fade .2s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 36px); overflow: auto; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-3); animation: pop .3s var(--ease); }
.modal-lg { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line-2); background: #FCFAF7; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ---------- Banner de cookies e instalación ---------- */
.cookie-bar { position: fixed; z-index: 1200; left: 18px; bottom: 18px; max-width: 440px; background: #1C1714; color: #F1F0F7; border-radius: 20px; padding: 20px; box-shadow: var(--sh-3); font-size: 14px; display: none; animation: pop .4s var(--ease); }
.cookie-bar.show { display: block; }
.cookie-bar h4 { margin: 0 0 6px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.cookie-bar p { color: #CFC4B8; margin-bottom: 14px; }
.cookie-bar a { color: #FFB27A; text-decoration: underline; }
.cookie-bar .opts { display: none; margin: 0 0 14px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); }
.cookie-bar .opts.open { display: block; }
.cookie-bar .opts label { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; gap: 10px; }
.cookie-bar .row { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-bar .btn-ghost { color: #F1F0F7; border-color: rgba(255,255,255,.2); }
.cookie-bar .btn-ghost:hover { background: rgba(255,255,255,.08); }

.install-sheet { position: fixed; z-index: 1100; right: 18px; bottom: 18px; width: 360px; max-width: calc(100vw - 36px); background: #fff; color: var(--ink); border-radius: 22px; box-shadow: var(--sh-3); padding: 18px; display: none; border: 1px solid var(--line); animation: pop .45s var(--ease); }
.install-sheet.show { display: block; }
.install-sheet .top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.install-sheet img { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--sh-2); }
.install-sheet h4 { margin: 0; font-size: 16px; }
.install-sheet p { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-2); }
.install-sheet .ios { display: none; font-size: 13px; background: var(--line-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.install-sheet .x { position: absolute; right: 12px; top: 12px; border: 0; background: var(--line-2); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
@media (max-width: 600px) {
  .cookie-bar { left: 10px; right: 10px; bottom: 10px; max-width: none; }
  .install-sheet { right: 10px; left: 10px; bottom: 10px; width: auto; max-width: none; }
}

/* ---------- Avatares ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--brand); flex-shrink: 0; letter-spacing: .02em; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }

/* ---------- Paginación ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin: 22px 0 6px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; padding: 0 10px; }
.pager a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Prosa legal ---------- */
.prose { font-size: 16px; line-height: 1.75; color: var(--ink-2); }
.prose h2 { font-size: 22px; margin: 1.8em 0 .6em; color: var(--ink); font-family: var(--serif); }
.prose h3 { font-size: 18px; margin: 1.5em 0 .5em; color: var(--ink); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .45em; }
.prose strong { color: var(--ink); }

@media print {
  .no-print, .toasts, .cookie-bar, .install-sheet { display: none !important; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
