/* =========================================================================
   MenuGenerator — sistema de diseño
   Claro y cálido: la comida se ve mejor sobre fondo claro.
   ========================================================================= */

:root {
    /* Fondos */
    --bg: #fbf7f0;
    --bg-soft: #f4ede1;
    --surface: #ffffff;
    --surface-warm: #fffdf9;

    /* Tinta */
    --ink: #2c2520;
    --ink-soft: #5b5049;
    --ink-faint: #8c8078;

    /* Acentos */
    --olive: #6a8352;
    --olive-dark: #52673f;
    --olive-soft: #edf2e6;
    --terracotta: #c4633f;
    --terracotta-dark: #a44f2f;
    --terracotta-soft: #fbeee8;
    --wheat: #e0a63c;
    --wheat-soft: #fdf3e0;

    --line: #e6ddd0;
    --line-strong: #d5c8b6;

    --shadow-sm: 0 1px 2px rgba(60, 45, 30, 0.06), 0 2px 6px rgba(60, 45, 30, 0.05);
    --shadow-md: 0 2px 6px rgba(60, 45, 30, 0.07), 0 8px 24px rgba(60, 45, 30, 0.07);
    --shadow-lg: 0 10px 40px rgba(60, 45, 30, 0.12);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --content: 1120px;
    --narrow: 760px;

    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
fieldset {
    margin: 0;
    padding: 0;
}

fieldset {
    border: 0;
}

ul,
ol {
    list-style: none;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.015em;
}

a {
    color: var(--olive-dark);
    text-decoration: none;
    transition: color 0.16s ease;
}

a:hover {
    color: var(--terracotta);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

:focus-visible {
    outline: 2px solid var(--olive);
    outline-offset: 3px;
    border-radius: 4px;
}

/* =========================================================================
   Estructura
   ========================================================================= */

.shell {
    width: 100%;
    max-width: var(--content);
    margin: 0 auto;
    padding: 0 20px;
}

.shell--narrow {
    max-width: var(--narrow);
}

.section {
    padding-block: clamp(46px, 6vw, 78px);
}

.stack {
    display: grid;
    gap: 18px;
}

.stack--tight {
    gap: 10px;
}

.stack--loose {
    gap: 30px;
}

/* =========================================================================
   Cabecera
   ========================================================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(251, 247, 240, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    height: 62px;
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-display);
    font-size: 1.16rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.wordmark:hover {
    color: var(--ink);
}

.wordmark__mark {
    font-size: 1.3rem;
}

.topbar__links {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 0.92rem;
}

.topbar__links a:not(.btn) {
    color: var(--ink-soft);
    font-weight: 500;
}

.topbar__links a:not(.btn):hover {
    color: var(--terracotta);
}

/* =========================================================================
   Botones
   ========================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    color: #fff;
    background: var(--olive);
    border: 1px solid var(--olive);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover:not(:disabled) {
    color: #fff;
    background: var(--olive-dark);
    border-color: var(--olive-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:disabled,
.btn[aria-disabled='true'] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--accent {
    background: var(--terracotta);
    border-color: var(--terracotta);
}

.btn--accent:hover:not(:disabled) {
    background: var(--terracotta-dark);
    border-color: var(--terracotta-dark);
}

.btn--ghost {
    color: var(--ink-soft);
    background: transparent;
    border-color: var(--line-strong);
}

.btn--ghost:hover:not(:disabled) {
    color: var(--ink);
    background: var(--bg-soft);
    border-color: var(--ink-faint);
}

.btn--small {
    padding: 7px 14px;
    font-size: 0.85rem;
}

.btn--large {
    padding: 14px 28px;
    font-size: 1.02rem;
}

.btn--block {
    width: 100%;
}

/* =========================================================================
   Superficies
   ========================================================================= */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card--padded {
    padding: 24px;
}

.card--warm {
    background: var(--surface-warm);
}

.panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-title h2,
.panel-title h3 {
    font-size: 1.16rem;
}

/* =========================================================================
   Tipografía auxiliar
   ========================================================================= */

.eyebrow {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--terracotta);
}

.muted {
    color: var(--ink-faint);
}

.soft {
    color: var(--ink-soft);
}

.lead {
    font-size: 1.08rem;
    color: var(--ink-soft);
}

.small {
    font-size: 0.87rem;
}

/* =========================================================================
   Etiquetas
   ========================================================================= */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    font-size: 0.79rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
}

.tag--protein {
    color: #fff;
    background: var(--tag-color, var(--olive));
    border-color: transparent;
}

.tag--soft {
    color: var(--olive-dark);
    background: var(--olive-soft);
    border-color: transparent;
}

/* =========================================================================
   Formularios
   ========================================================================= */

.field {
    display: grid;
    gap: 6px;
}

.field > label,
.field-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.field input[type='text'],
.field input[type='email'],
.field input[type='password'],
.field input[type='number'],
.field select,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 0.97rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--olive);
    box-shadow: 0 0 0 3px var(--olive-soft);
}

.field__hint {
    font-size: 0.82rem;
    color: var(--ink-faint);
}

.field__error {
    font-size: 0.84rem;
    color: var(--terracotta-dark);
}

.field__error:empty {
    display: none;
}

/* Casillas con aspecto de píldora, para los filtros de dieta */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    font-size: 0.89rem;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.16s ease;
}

.chip label:hover {
    border-color: var(--olive);
    color: var(--ink);
}

.chip input:checked + label {
    color: #fff;
    background: var(--olive);
    border-color: var(--olive);
}

.chip input:focus-visible + label {
    outline: 2px solid var(--olive);
    outline-offset: 2px;
}

/* =========================================================================
   Avisos
   ========================================================================= */

.flashes {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.flash {
    padding: 12px 16px;
    font-size: 0.93rem;
    background: var(--olive-soft);
    border-left: 3px solid var(--olive);
    border-radius: var(--radius-sm);
}

.flash--error {
    background: var(--terracotta-soft);
    border-left-color: var(--terracotta);
}

.flash--success {
    background: var(--olive-soft);
    border-left-color: var(--olive);
}

/* =========================================================================
   Estados vacíos
   ========================================================================= */

.empty {
    padding: 44px 24px;
    text-align: center;
    color: var(--ink-faint);
    background: var(--bg-soft);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
}

/* =========================================================================
   Pie
   ========================================================================= */

.footer {
    margin-top: 60px;
    padding-block: 32px;
    border-top: 1px solid var(--line);
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: 0.86rem;
    color: var(--ink-faint);
}

/* =========================================================================
   Impresión: solo la lista de la compra
   ========================================================================= */

@media print {
    .topbar,
    .footer,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
        font-size: 12pt;
    }

    .card {
        border: none;
        box-shadow: none;
        break-inside: avoid;
    }
}

@media (max-width: 700px) {
    .topbar__links a:not(.btn) {
        display: none;
    }
}
