/* =========================================================
   CAFETERÍA BOSQUE ESPRESSO — hoja de estilos
   Paleta: madera + bosque de pino (Ferrería de Tula, Jalisco)
   Tipografía: Cormorant Garamond (display) / Nunito Sans (texto) / Space Mono (precios)
   ========================================================= */

:root {
    --wood-dark: #2B1B12;
    --wood-dark-2: #201209;
    --wood: #6B4226;
    --wood-light: #D8B27C;
    --pine: #2F4A38;
    --pine-light: #6E8F6C;
    --cream: #F6EFE0;
    --cream-soft: #EDE1C8;
    --ink: #241A12;
    --text-muted-dark: #C9BBA0;
    --text-muted-light: #6b5d47;
    --gold: #C89B3C;

    --display: 'Cormorant Garamond', serif;
    --body: 'Nunito Sans', sans-serif;
    --mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--wood-dark);
    color: var(--cream);
    font-family: var(--body);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ===== LOGO (recorta el marco negro del jpg vía CSS) ===== */

.logo-crop {
    display: block;
    overflow: hidden;
    border-radius: 10px;
}
.logo-crop img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: center;
}
.nav .logo-crop { width: 54px; height: 44px; }
footer .logo-crop { width: 40px; height: 33px; }
.hero-badge .logo-crop { width: 100%; height: 100%; }

/* ===== DIVISOR — ramas de pino (elemento de marca) ===== */

.pine-divider {
    display: flex;
    width: 100%;
    overflow: hidden;
    background: var(--wood-dark-2);
    padding: 10px 0;
    gap: 26px;
    justify-content: center;
}
.pine-divider svg { flex: 0 0 auto; opacity: 0.85; }
.pine-divider svg:nth-child(odd) { transform: translateY(-3px); }

/* ===== NAV ===== */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-text {
    font-family: var(--display);
    font-size: 21px;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: 0.01em;
}
.brand-text span { color: var(--gold); font-style: italic; }

.nav-links { display: flex; gap: 30px; font-size: 14px; color: var(--text-muted-dark); }
.nav-links a:hover { color: var(--gold); }

.nav-cta {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 9px 18px;
    border-radius: 3px;
    transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--gold); color: var(--wood-dark-2); }

/* ===== HERO ===== */

.hero {
    padding: 60px 0 90px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 50px;
    align-items: center;
    position: relative;
}
.hero::before {
    content: "";
    position: absolute;
    inset: -10% -10% auto auto;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(200,155,60,0.14), transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 18px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pine-light);
    margin-bottom: 18px;
    display: inline-block;
}

.hero h1 {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(42px, 5.6vw, 72px);
    line-height: 1.05;
    color: var(--cream);
    margin-bottom: 22px;
}
.hero h1 em { font-style: italic; color: var(--gold); }

.hero p.lead {
    font-size: 19px;
    color: var(--text-muted-dark);
    max-width: 46ch;
    margin-bottom: 34px;
}

.btn-row { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 26px; border-radius: 4px; font-size: 14px; font-weight: 700;
    cursor: pointer; border: none; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(0.97); }

.btn-solid { background: var(--gold); color: var(--wood-dark-2); box-shadow: 0 10px 30px rgba(200,155,60,0.25); }
.btn-solid:hover { background: #dcb257; }

.btn-ghost { background: transparent; color: var(--cream); border: 1px solid rgba(246,239,225,0.3); }
.btn-ghost:hover { border-color: var(--cream); }

/* Hero: insignia de madera flotante */
.hero-visual { position: relative; z-index: 1; display: flex; justify-content: center; }
.hero-badge {
    width: 700px; height: 400px;
    border-radius: 14px;
    transform: rotate(-2deg);
    padding: 10px;
}

/* ===== FEATURES ===== */

.section { padding: 84px 0; }

.section-head { text-align: center; max-width: 560px; margin: 0 auto 50px; }
.section-head .eyebrow { color: var(--gold); }
.section-head h2 {
    font-family: var(--display); font-weight: 600;
    font-size: clamp(30px, 3.6vw, 42px); color: var(--cream);
}

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

.feature-card {
    background: var(--wood);
    border: 1px solid rgba(216,178,124,0.18);
    border-radius: 10px;
    padding: 32px 28px;
    transition: transform .2s, border-color .2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(200,155,60,0.5); }
.feature-card .icon { font-size: 30px; margin-bottom: 18px; display: block; }
.feature-card h3 { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--cream); margin-bottom: 10px; }
.feature-card p { font-size: 18px; color: var(--text-muted-dark); }

/* ===== MENÚ (dinámico, desde Supabase) ===== */

.menu-section { background: var(--wood-dark-2); }

.menu-tabs {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px;
}
.menu-tab {
    background: transparent; border: 1px solid rgba(246,239,225,0.2); color: var(--text-muted-dark);
    padding: 9px 20px; border-radius: 30px; font-family: var(--body); font-size: 13.5px; font-weight: 600;
    cursor: pointer; transition: all .2s;
}
.menu-tab:hover { border-color: var(--gold); color: var(--cream); }
.menu-tab.active { background: var(--gold); border-color: var(--gold); color: var(--wood-dark-2); }

.menu-category-desc { text-align: center; color: var(--text-muted-dark); font-size: 14px; margin-bottom: 30px; margin-top: -14px; }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 40px;
}

.menu-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(246,239,225,0.1); }
.menu-item .menu-thumb {
    width: 200px; height: 200px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--wood);
}
.menu-item .menu-info { flex: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.menu-item .name { font-size: 18px; color: var(--cream); font-family: var(--body); font-weight: 600; }
.menu-item .name em { font-style: italic; font-weight: 400; font-size: 15px; color: var(--pine-light); }
.menu-item .price { font-family: var(--mono); color: var(--gold); white-space: nowrap; font-size: 14px; }

.menu-loading, .menu-empty { text-align: center; color: var(--text-muted-dark); padding: 40px 0; font-size: 18px; }

/* ===== VISIT / HOURS ===== */

.visit { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }

.chalkboard {
    background: var(--wood);
    border-radius: 10px; padding: 36px; position: relative;
    border: 1px solid rgba(216,178,124,0.18);
}
.chalkboard h3 { font-family: var(--display); font-weight: 600; color: var(--gold); font-size: 22px; margin-bottom: 20px; }

.hours-row {
    display: flex; justify-content: space-between; font-family: var(--mono); font-size: 15px;
    padding: 10px 0; color: var(--text-muted-dark); border-bottom: 1px dotted rgba(246,239,225,0.14);
}
.hours-row span:last-child { color: var(--cream); }

.map-card {
    background: var(--wood); border-radius: 10px; border: 1px solid rgba(216,178,124,0.18);
    padding: 36px; display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.map-card h3 { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--cream); }
.map-card p { color: var(--text-muted-dark); font-size: 16px; }
.map-card .addr { font-family: var(--mono); color: var(--pine-light); font-size: 13px; }

/* ===== FOOTER ===== */

footer {
    padding: 40px 0 30px;
    border-top: 1px solid rgba(216,178,124,0.14);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
footer .brand-text { font-size: 16px; }
.footer-links { display: flex; gap: 22px; font-size: 13px; color: var(--text-muted-dark); }
.footer-links a:hover { color: var(--gold); }
.staff-link { font-family: var(--mono); font-size: 11px; color: rgba(246,239,225,0.3); cursor: default; }
.staff-link:hover { color: var(--text-muted-dark); }

/* ===== RESPONSIVE ===== */

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; padding: 36px 0 60px; }
    .hero-badge { width: 260px; height: 213px; }
    .features { grid-template-columns: 1fr; }
    .menu-grid { grid-template-columns: 1fr; }
    .visit { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .pine-divider svg { transform: scale(0.75); }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ===== MODAL D'IMAGE ===== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
    animation: modalFadeIn 0.3s ease;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.image-modal .close-btn:hover {
    color: #d4a574;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Style pour les images cliquables */
.menu-thumb,
.hero-badge img,
.logo-crop img {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.menu-thumb:hover,
.hero-badge img:hover,
.logo-crop img:hover {
    transform: scale(1.02);
}

/* ===== DIAPORAMA ===== */
.diapo-section {
    position: relative;
    width: 100%;
    height: 85vh;
    overflow: hidden;
    background: var(--wood-dark-2);
}

.diapo-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.diapo-slide.active {
    opacity: 1;
}

.diapo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 860px) {
    .diapo-section { height: 55vh; }
}

/* ===== BOTÓN PEDIDO PARA RECOGER ===== */
button.nav-cta {
    border: none;
    font: inherit;
    cursor: pointer;
    display: inline-block;
}

/* ===== MODAL: PEDIDO PARA RECOGER ===== */
.pedido-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32,18,9,0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.pedido-modal-overlay.open { display: flex; }

.pedido-modal-card {
    background: var(--cream);
    color: var(--wood-dark);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 70px rgba(0,0,0,0.4);
}
.pedido-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--wood-dark);
}

.pedido-step1-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
}
.pedido-datos { display: flex; gap: 14px; margin-bottom: 18px; }
.pedido-field { flex: 1; margin-bottom: 14px; }
.pedido-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.pedido-field input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid var(--cream-soft);
    font-family: var(--body);
    font-size: 14px;
}
.pedido-field input:focus { outline: none; border-color: var(--gold); }

.pedido-menu-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.pedido-menu-tabs .menu-tab {
    background: #fff;
    border: 2px solid var(--cream-soft);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.pedido-menu-tabs .menu-tab.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--wood-dark);
}
.pedido-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
}
.pedido-item-card {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    border: 2px solid transparent;
    cursor: default;
    text-align: center;
}
.pedido-item-card.selected { border-color: var(--gold); }
.pedido-item-card img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 6px;
    background: var(--cream-soft);
}
.pedido-item-card .name { font-size: 12px; font-weight: 700; }
.pedido-item-card .price { font-family: var(--mono); font-size: 12px; color: var(--gold-dark); }
.pedido-item-card .qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}
.pedido-item-card .qty-controls button {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--wood-dark);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.pedido-cart-col {
    background: var(--wood-dark-2);
    color: var(--text-light);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
}
.pedido-cart-col h4 { margin-bottom: 10px; font-family: var(--display); }
.pedido-cart-list { flex: 1; overflow-y: auto; max-height: 320px; margin-bottom: 12px; }
.pedido-cart-empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px 0; }
.pedido-cart-item {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(246,239,225,0.08);
    color: var(--gold);
}
.pedido-cart-total {
    display: flex;
    justify-content: space-between;
    font-family: var(--display);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--gold);
}
.pedido-continue-btn { width: 100%; }

.pedido-total-recap { margin-bottom: 16px; font-size: 15px; }
.pedido-datos-banco {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pedido-datos-banco div { display: flex; justify-content: space-between; font-size: 14px; }
.pedido-step2-actions { display: flex; gap: 10px; margin-top: 10px; }
.pedido-step2-actions button { flex: 1; }

.pedido-success-icon { font-size: 42px; text-align: center; margin-bottom: 10px; }
#pedidoStep3 { text-align: center; }
#pedidoStep3 p { margin: 12px 0 20px; font-size: 15px; }

@media (max-width: 720px) {
    .pedido-step1-layout { grid-template-columns: 1fr; }
    .pedido-cart-col { max-height: none; }
}

/* ===== MODAL: ELEGIR INGREDIENTES (pedido para recoger) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32,18,9,0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 210;
    padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-card {
    background: var(--cream);
    color: var(--wood-dark);
    border-radius: 14px;
    padding: 28px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.4);
}
.modal-card h3 {
    font-family: var(--display);
    font-weight: 600;
    font-size: 21px;
    color: var(--wood-dark);
    margin-bottom: 4px;
}
.modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; margin-top: -2px; }

.ingredientes-picker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0 16px;
}
.ingrediente-check {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 2px solid var(--cream-soft);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    color: var(--text-dark);
}
.ingrediente-check input { display: none; }
.ingrediente-check.checked { border-color: var(--gold); background: rgba(200,155,60,0.12); color: var(--gold-dark); }
.ingrediente-check.disabled { opacity: 0.4; cursor: not-allowed; }

.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
}
.modal-cancel { background: var(--cream-soft); color: var(--text-dark); }
.modal-cancel:hover { background: #e2cfa0; }
.modal-confirm { background: var(--gold); color: var(--wood-dark-2); }
.modal-confirm:hover { background: #dcb257; }

/* Bouton "Elegir ingredientes" sur les cartes personnalisables */
.pedido-item-card .btn-personalizar-pedido {
    background: var(--wood-dark);
    color: #fff;
    border: none;
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 6px;
}
.pedido-item-card .btn-personalizar-pedido:hover { background: var(--gold-dark); }

/* Ligne du panier : détail ingrédients + bouton retirer */
.pedido-cart-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.pedido-cart-item-detalle {
    font-size: 11px;
    color: var(--gold);
    font-style: italic;
    display: block;
}
.pedido-cart-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 0 4px;
}
.pedido-cart-item-remove:hover { color: var(--danger); }