/* Casa Mar — web pública. Estilo "pizarra": tipografía y espacio, sin adornos. */
:root {
    --bg: #1f2a26;
    --bg-raise: #26332e;
    --ink: #efe8d6;
    --muted: #b9b3a2;
    --accent: #e9b44c;
    --line: rgba(239, 232, 214, 0.18);
    --line-strong: rgba(239, 232, 214, 0.55);
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans: 'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: #fff; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { max-width: 560px; margin: 0 auto; padding: 52px 28px 120px; }

.banner {
    background: var(--accent);
    color: #1f2a26;
    font-weight: 600;
    text-align: center;
    padding: 12px 20px;
    font-size: 15px;
}

/* Cabecera */
.top { display: flex; flex-direction: column; gap: 12px; }
.top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.brand { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; letter-spacing: -0.5px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 14px; line-height: 22px; }
.center { text-align: center; }
.accent { color: var(--accent); }
/* Mensaje destacado bajo el nombre */
.highlight {
    margin: 0; justify-self: start; align-self: flex-start;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px;
    background: rgba(233, 180, 76, 0.14); border: 1px solid rgba(233, 180, 76, 0.5);
    color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .3px;
}
/* Foto de la cabecera: rectangular, a la derecha del nombre, subtítulo y horario */
.top.with-photo { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 12px; align-items: start; }
.top.with-photo > * { grid-column: 1; }
.top.with-photo .head-photo { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
.head-photo { width: 124px; aspect-ratio: 4 / 3; padding: 3px; border: 2px solid var(--accent); border-radius: 14px; }
.head-photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; background: var(--bg-raise); }
.top.with-photo .top-row { justify-content: flex-start; }
.top.with-photo .brand { white-space: nowrap; }
@media (max-width: 699px) {
    /* En el móvil la foto va junto al nombre y el resto ocupa todo el ancho */
    .top.with-photo .top-row { align-self: center; }
    .top.with-photo .top-row .icon-btn { display: none; } /* el teléfono sigue en el pie */
    .top.with-photo .head-photo { grid-row: 1; width: clamp(112px, 32vw, 150px); }
    .top.with-photo > :not(.top-row):not(.head-photo) { grid-column: 1 / -1; }
    .top.with-photo .brand { font-size: 40px; }
}
.status { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status.is-closed { color: var(--muted); }

.icon-btn {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(239, 232, 214, 0.35);
    background: transparent;
    color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.icon-btn.plain { border: 0; }

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }

/* Menú del día: ficha destacada en mostaza, sin bordes */
.promo {
    position: relative; overflow: hidden;
    margin: 40px -16px 0;
    padding: 20px 16px 20px 20px;
    border-radius: 18px;
    background: var(--accent); color: var(--bg);
    display: flex; align-items: center; gap: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}
.promo::after { /* ondas suaves de fondo, como las del rótulo */
    content: ''; position: absolute; right: -50px; bottom: -80px; width: 170px; height: 170px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0 30%, transparent 31% 45%, rgba(255, 255, 255, 0.14) 46% 58%, transparent 59%);
    pointer-events: none;
}
.promo-text { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; z-index: 1; }
.promo .eyebrow.accent { color: var(--bg); opacity: .8; }
.promo .dish-name { color: var(--bg); }
.promo-price { font-weight: 700; color: var(--bg); }
#promo-control { position: relative; z-index: 1; }
.promo .add { border-color: rgba(31, 42, 38, 0.55); color: var(--bg); }
.promo .add:hover { border-color: var(--bg); }
.promo .stepper .minus { color: var(--bg); }
.promo .stepper .plus { background: var(--bg); color: var(--accent); }
.promo .sold-tag { color: var(--bg); }
@media (min-width: 900px) { .promo { margin: 44px -20px 0; padding: 22px 20px; } }

/* Alérgenos de cada plato */
.allergens { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.allergens li { font-size: 12px; line-height: 18px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.promo .allergens li { border-color: rgba(31, 42, 38, 0.35); color: var(--bg); }

/* Carta */
.menu { display: flex; flex-direction: column; }
.menu-section { padding-top: 40px; }
.menu-section h2 { margin: 0 0 4px; color: var(--muted); }
.dish { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.dish-text { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dish-name { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 26px; }
.dish-price { font-size: 15px; color: var(--muted); }
.dish.sold-out .dish-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.sold-tag { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* Foto opcional de un plato: el plato y su foto van juntos en una ficha */
.dish-card {
    margin: 18px -16px 22px; padding: 12px 16px 16px;
    background: var(--bg-raise); border-radius: 18px;
}
.dish-photo {
    display: block; width: 100%;
    margin: 8px 0 0; padding: 0; border: 0; background: none;
    border-radius: 12px; overflow: hidden;
}
.dish-photo img {
    display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    background: var(--bg);
    transition: transform .3s ease;
}
/* En ordenador la ficha se tumba: plato a la izquierda y foto a la derecha */
/* Desde tablet la foto acompaña a todo el bloque y crece o encoge con la ventana */
@media (min-width: 700px) {
    .wrap { max-width: 640px; }
    .top.with-photo { column-gap: clamp(20px, 3vw, 32px); }
    .top.with-photo .top-row { gap: 20px; }
    .head-photo { width: clamp(200px, 26vw, 250px); border-radius: 20px; padding: 4px; }
    .head-photo img { border-radius: 15px; }
}
@media (min-width: 900px) {
    .dish-card {
        display: grid; grid-template-columns: 1fr 250px; align-items: center; gap: 24px;
        margin: 18px -20px 22px; padding: 16px 16px 16px 20px;
    }
    .dish-card .dish { grid-row: 1; grid-column: 1; }
    .dish-card .dish-photo { grid-row: 1; grid-column: 2; margin: 0; }
}
.dish-photo:hover img { transform: scale(1.02); }
.dish-photo.sold-out img { filter: grayscale(1); opacity: .5; }
.photo-sheet { gap: 14px; }
.photo-img {
    display: block; width: 100%; max-height: 62vh; object-fit: cover;
    border-radius: 14px; background: var(--bg-raise);
}
.photo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.photo-price { font-size: 18px; font-weight: 600; }

/* Controles + / − */
.add {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: transparent; color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center;
}
.add:hover { border-color: var(--ink); }
.stepper { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.stepper .minus { width: 40px; height: 44px; border: 0; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.stepper .qty { min-width: 18px; text-align: center; font-weight: 700; font-size: 17px; }
.stepper .plus { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--accent); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; }

.note { margin-top: 44px; }
.foot { margin-top: 24px; }
.foot p { margin: 0 0 12px; }
.legal-links a { color: var(--muted); }

/* Barra del pedido */
.cart-bar {
    position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
    max-width: 528px; margin: 0 auto;
    height: 56px; border: 0; border-radius: 28px;
    background: var(--ink); color: var(--bg);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; font-weight: 700; font-size: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 20;
}

/* Hoja del pedido */
.backdrop { position: fixed; inset: 0; background: rgba(12, 17, 15, 0.6); z-index: 30; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    max-width: 560px; margin: 0 auto;
    max-height: 92vh; overflow-y: auto;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    padding: 24px 24px calc(20px + env(safe-area-inset-bottom));
    z-index: 40;
    display: flex; flex-direction: column; gap: 16px;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; }
#step-cart, #step-send, #order-form { display: flex; flex-direction: column; gap: 16px; }
.lines { display: flex; flex-direction: column; }
.line { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(239, 232, 214, 0.12); }
.line-name { flex-grow: 1; min-width: 0; }
.line-sub { font-weight: 600; white-space: nowrap; min-width: 64px; text-align: right; }
.total-row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select {
    height: 48px; padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(239, 232, 214, 0.3);
    background: rgba(239, 232, 214, 0.06);
    color: var(--ink);
    font-size: 16px;
}
.field select option { color: #1f2a26; }
.error { margin: 0; color: #f1a58f; font-weight: 600; font-size: 14px; }
.closed-msg { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }

.btn {
    height: 56px; border: 0; border-radius: 28px;
    background: var(--accent); color: var(--bg);
    font-weight: 700; font-size: 16px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    text-decoration: none; padding: 0 20px;
}
.btn:hover { color: var(--bg); filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); height: 48px; }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink); }
.row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-btn { border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 8px; font-size: 14px; }
.lead { margin: 0; font-size: 17px; }
.preview {
    margin: 0; padding: 14px 16px;
    background: var(--bg-raise); border-radius: 10px;
    font-family: var(--sans); font-size: 14px; line-height: 21px;
    white-space: pre-wrap; color: #d6d0bf;
}

.toast {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
    background: var(--ink); color: var(--bg);
    padding: 10px 18px; border-radius: 20px; font-weight: 600; font-size: 14px;
    opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50;
}
.toast.show { opacity: 1; }

@media (min-width: 700px) {
    .wrap { padding-top: 88px; }
    .brand { font-size: 56px; }
    .sheet { bottom: 24px; border-radius: 20px; border: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Páginas de texto (aviso legal, privacidad) */
.doc { max-width: 680px; margin: 0 auto; padding: 52px 28px 80px; }
.doc h1 { font-family: var(--serif); font-weight: 400; font-size: 36px; margin: 16px 0 24px; }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 32px 0 8px; }
.doc p, .doc li { color: #d6d0bf; }
.doc .pending { color: var(--accent); }

/* Plantas decorativas en los laterales (semitransparentes, detrás del contenido) */
.plants { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; color: #9dc1a6; }
.plant { position: absolute; bottom: 0; height: 100vh; height: 100dvh; width: auto; opacity: .26; }
.plant-left { left: max(-60px, calc(50% - 280px - 330px)); }
.plant-right { right: max(-60px, calc(50% - 280px - 330px)); transform: scaleX(1); }
.plant .stem { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.plant .lf { fill: currentColor; fill-opacity: .55; stroke: currentColor; stroke-width: 1.3; }
.plant .lf2 { fill: none; stroke: currentColor; stroke-width: 1.5; }
.plant .fr { fill: var(--accent); }
.wrap, .banner { position: relative; z-index: 1; }
@media (max-width: 900px) {
    .plant { height: 80vh; opacity: .14; }
    .plant-left { left: -70px; }
    .plant-right { right: -70px; }
}
@media (max-width: 480px) {
    .plant { height: 70vh; opacity: .13; }
    .plant-left { left: -58px; }
    .plant-right { right: -58px; }
}
