/* =========================================================
   Helados Lucca · sistema visual
   Paleta pastel original (celeste / amarillo / rosa) + "tinta" del logo.
   Firma: estilo sticker — contorno de tinta y sombra desplazada sólida,
   igual que las letras del logotipo.
   ========================================================= */

:root {
    /* Paleta original de la marca */
    --celeste: #80DEEA;
    --celeste-dark: #4DD0E1;
    --celeste-light: #B2EBF2;
    --celeste-wash: #E9F9FB;
    --amarillo: #FFE082;
    --amarillo-dark: #FFD54F;
    --amarillo-wash: #FFF6D9;
    --rosa: #F8BBD0;
    --rosa-dark: #F48FB1;
    --rosa-wash: #FDEBF1;

    /* Tinta del logo y neutros */
    --ink: #1F2A30;
    --ink-soft: #4A5A62;
    --ink-faint: #7C8C93;
    --paper: #FFFFFF;
    --bg: #F4FCFD;
    --line: #D5E9EC;

    /* Estados */
    --ok: #1E7D4F;
    --ok-wash: #DDF5E8;
    --warn: #8A5A00;
    --warn-wash: #FFF0C7;
    --danger: #B3261E;
    --danger-wash: #FCE4E2;

    /* Tipografía */
    --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Forma */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --stroke: 2px solid var(--ink);
    --pop: 4px 4px 0 var(--ink);
    --pop-sm: 3px 3px 0 var(--ink);
    --soft-shadow: 0 6px 24px rgba(31, 42, 48, 0.08);

    --header-h: 64px;
    --gutter: 16px;
    --maxw: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--celeste-dark); outline-offset: 2px; border-radius: 6px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 200;
    background: var(--amarillo); border: var(--stroke); padding: .5rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Encabezado ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(244, 252, 253, 0.92);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 46px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
    text-decoration: none; font-weight: 600; padding: .55rem .8rem; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { background: var(--celeste-wash); }
.nav a[aria-current="page"] { background: var(--celeste-light); }
.nav .nav-account { display: inline-flex; align-items: center; gap: 6px; }
.nav-toggle {
    display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 12px;
    border: var(--stroke); background: var(--paper); cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 760px) {
    .nav-toggle { display: inline-flex; }
    .nav {
        position: absolute; top: var(--header-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--paper); border-bottom: var(--stroke); padding: 8px var(--gutter) 16px;
        display: none;
    }
    .nav.open { display: flex; }
    .nav a { padding: .9rem .75rem; border-radius: var(--radius-sm); }
    .nav .btn { margin-top: 8px; justify-content: center; }
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 48px; padding: .7rem 1.3rem;
    font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; text-decoration: none;
    border: var(--stroke); border-radius: 999px; background: var(--paper); color: var(--ink);
    box-shadow: var(--pop-sm); cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--pop); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] {
    opacity: .45; cursor: not-allowed; transform: none; box-shadow: none;
}
.btn-primary { background: var(--amarillo); }
.btn-primary:hover { background: var(--amarillo-dark); }
.btn-pink { background: var(--rosa); }
.btn-celeste { background: var(--celeste); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn-ghost:hover { box-shadow: none; transform: none; background: var(--celeste-wash); }
.btn-sm { min-height: 38px; padding: .35rem .9rem; font-size: .92rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger-wash); }

/* Botón redondo para sumar/restar */
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button {
    width: 44px; height: 44px; border-radius: 50%; border: var(--stroke); background: var(--paper);
    font-size: 1.4rem; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: 2px 2px 0 var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
}
.stepper button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.stepper button[disabled] { opacity: .35; cursor: not-allowed; box-shadow: none; }
.stepper output { min-width: 2ch; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }

/* ---------- Tarjetas ---------- */
.card {
    background: var(--paper); border: var(--stroke); border-radius: var(--radius-lg); box-shadow: var(--pop);
    padding: 1.25rem;
}
.card-soft { background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--soft-shadow); padding: 1.25rem; border: 1px solid var(--line); }

.tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .78rem; font-weight: 700; letter-spacing: .02em;
    padding: .2rem .6rem; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--paper);
    white-space: nowrap;
}
.tag-pura { background: var(--celeste-light); }
.tag-yellow { background: var(--amarillo); }
.tag-pink { background: var(--rosa); }
.tag-ok { background: var(--ok-wash); color: var(--ok); border-color: var(--ok); }
.tag-warn { background: var(--warn-wash); color: var(--warn); border-color: var(--warn); }
.tag-danger { background: var(--danger-wash); color: var(--danger); border-color: var(--danger); }
.tag-muted { background: #EEF3F4; color: var(--ink-soft); border-color: var(--ink-faint); }

.price { font-family: var(--font-display); font-weight: 800; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; }
.field label, .field .label { font-weight: 700; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--ink-soft); }
.input, .field input, .field select, .field textarea {
    width: 100%; min-height: 48px; padding: .7rem .9rem;
    border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
    font-size: 1rem; /* 16px evita el zoom automático en iOS */
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 84px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--ink); box-shadow: 3px 3px 0 var(--celeste);
}
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .88rem; font-weight: 600; }
.form-error {
    background: var(--danger-wash); color: var(--danger); border: 1.5px solid var(--danger);
    border-radius: var(--radius-sm); padding: .7rem .9rem; font-weight: 600; margin-bottom: 1rem;
}
.form-ok {
    background: var(--ok-wash); color: var(--ok); border: 1.5px solid var(--ok);
    border-radius: var(--radius-sm); padding: .7rem .9rem; font-weight: 600; margin-bottom: 1rem;
}

/* ---------- Avisos (toasts) ---------- */
.toasts {
    position: fixed; z-index: 300; left: 50%; transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom)); width: min(440px, calc(100% - 32px));
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
    pointer-events: auto; background: var(--ink); color: #fff; border-radius: var(--radius);
    padding: .85rem 1rem; font-weight: 600; box-shadow: 4px 4px 0 var(--celeste);
    animation: toast-in .2s ease-out;
}
.toast.warn { box-shadow: 4px 4px 0 var(--amarillo); }
.toast.error { box-shadow: 4px 4px 0 var(--rosa-dark); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: #E6F2F4; margin-top: 4rem; padding: 2.5rem 0 calc(2rem + env(safe-area-inset-bottom)); }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-grid h4 { font-size: 1rem; color: var(--amarillo); margin-bottom: .4rem; }
.footer-grid p { margin: 0 0 .3rem; color: #C9DADE; }
.social { display: flex; gap: 10px; }
.social a {
    width: 44px; height: 44px; border-radius: 50%; background: var(--paper);
    display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--paper);
}
.social img { width: 24px; height: 24px; }
.footer-bottom { margin-top: 2rem; font-size: .85rem; color: #9FB3B8; }

/* WhatsApp flotante */
.wa-float {
    position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
    width: 56px; height: 56px; border-radius: 50%; background: #25D366;
    display: flex; align-items: center; justify-content: center;
    border: var(--stroke); box-shadow: var(--pop-sm);
}
.wa-float img { width: 30px; height: 30px; filter: brightness(0) invert(1); }

/* Utilidades */
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.hidden { display: none !important; }
.loading { color: var(--ink-soft); padding: 2rem 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
