/* Estética del sitio dinámico — replica visualmente a /gardelparrillada sin
   depender de css/main.css ni del template artesanal. Un solo motor la usa para
   público y para el preview del editor. */

:root {
    --bg: #0a0a0a;
    --text: #e8e8e8;
    --muted: #a0a0a0;
    --accent: #E84545;
    --accent2: #d63939;
    --card: #111111;
    --card2: #1a1a1a;
    --border: #222222;
    --border2: #333333;
    --yellow: #f5c518;
    --wa: #25D366;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.site-dynamic {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 90px;
}

/* ----- Banner de vista previa (sólo modo edición) ----- */
.preview-banner {
    position: sticky; top: 0; z-index: 50;
    background: var(--accent); color: #fff;
    text-align: center; font-size: 13px; font-weight: 600;
    padding: 8px 12px; letter-spacing: .3px;
    transition: transform .25s ease, opacity .25s ease;
}
.preview-banner.hidden { transform: translateY(-100%); opacity: 0; }

/* ----- Hero ----- */
.hero {
    position: relative; width: 100%; height: 42vh; min-height: 240px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 2px solid var(--accent); overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.72) 100%);
}
.hero-content { position: relative; z-index: 2; text-align: center; padding: 20px; }
.hero-logo { max-width: 220px; width: 56vw; height: auto; filter: drop-shadow(0 6px 18px rgba(0,0,0,.75)); }
.hero-title { color: #fff; font-size: 2.4rem; font-weight: 700; margin: 0; text-shadow: 0 4px 12px rgba(0,0,0,.5); }
@media (min-width: 768px) {
    .hero { height: 50vh; min-height: 340px; }
    .hero-logo { max-width: 280px; }
    .hero-title { font-size: 3rem; }
}

/* ----- Tiles de categorías ----- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px 16px 8px; max-width: 980px; margin: 0 auto; }
@media (min-width: 768px) { .tiles { grid-template-columns: repeat(6, 1fr); gap: 14px; } }
.tile {
    position: relative; border-radius: 12px; overflow: hidden; cursor: pointer;
    height: 96px; background: var(--card); border: 1px solid var(--border);
    transition: transform .12s ease, border-color .12s ease; text-decoration: none;
}
.tile:hover { transform: translateY(-2px); border-color: var(--border2); }
.tile-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,.7) 100%); }
.tile-label { position: absolute; left: 10px; bottom: 10px; z-index: 2; color: #fff; font-weight: 700; letter-spacing: .3px; }

/* ----- Nav sticky de categorías ----- */
.cat-nav {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; background: rgba(10,10,10,.92);
    backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.cat-nav-pills {
    flex: 1; min-width: 0; display: flex; gap: 8px;
    overflow-x: auto; scrollbar-width: none;
}
.cat-nav-pills::-webkit-scrollbar { display: none; }
.cat-pill {
    flex: 0 0 auto; padding: 8px 14px; border-radius: 999px;
    background: var(--card2); border: 1px solid var(--border);
    color: var(--text); font-size: 14px; cursor: pointer; text-decoration: none;
    white-space: nowrap;
}
.cat-pill:hover { border-color: var(--border2); }
.cat-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ----- Buscador en el nav ----- */
.nav-search { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.search-icon-btn, .search-clear-btn {
    background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px;
    display: flex; align-items: center; justify-content: center; transition: color .2s ease;
}
.search-icon-btn:hover, .search-clear-btn:hover { color: var(--text); }
.search-clear-btn { display: none; }
.search-clear-btn svg, .search-icon-btn svg { display: block; }
.search-input {
    width: 0; height: 34px; background: var(--card2); border: 1px solid var(--border);
    border-radius: 0; color: var(--text); padding: 0; font-size: 14px; font-family: inherit;
    transition: width .3s ease, padding .3s ease, border-radius .3s ease; overflow: hidden;
}
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-input:focus { outline: none; border-color: var(--border2); }
.search-input.active { width: 150px; padding: 6px 10px; border-radius: 8px; }
@media (min-width: 768px) { .search-input.active { width: 220px; height: 36px; } }

/* Mensaje sin resultados */
.search-empty { display: none; max-width: 720px; margin: 14px auto 0; padding: 0 16px; color: var(--muted); }

/* ----- Menú / secciones ----- */
.menu { max-width: 720px; margin: 0 auto; padding: 8px 16px 40px; }
.section-title {
    font-size: 1.5rem; font-weight: 700; color: var(--accent); margin: 30px 0 10px;
    letter-spacing: .04em; text-transform: uppercase;
}
.featured-badge {
    display: inline-flex; align-items: center; gap: 4px; background: var(--yellow);
    color: #1a1a1a; font-size: 10px; font-weight: 700; padding: 4px 10px; line-height: 1.1;
    border-radius: 999px; text-transform: uppercase; letter-spacing: .3px;
    margin-bottom: 8px; width: fit-content; max-width: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* ----- Item (estética /gardelparrillada) ----- */
.item {
    display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
    padding: 20px 0; border-bottom: 1px solid var(--border); transition: background-color .2s ease;
}
.item:hover { background-color: rgba(232,69,69,.03); }
.item:last-child { border-bottom: none; }

.item-image {
    position: relative; width: 80px; height: 80px; min-width: 80px; flex-shrink: 0;
    border-radius: 8px; overflow: hidden; cursor: zoom-in; padding: 0;
    border: 2px solid var(--border); background: var(--card2) center/cover no-repeat;
    transition: border-color .3s ease, transform .3s ease;
}
.item-image:hover { border-color: var(--accent); transform: scale(1.05); }
.image-overlay {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 4px; text-align: center;
    background: linear-gradient(to top, rgba(0,0,0,.9), transparent); color: #fff;
    font-size: 9px; font-weight: 500; opacity: 0; transition: opacity .3s ease;
}
.item-image:hover .image-overlay, .item-image:focus-visible .image-overlay { opacity: 1; }

.item-info { flex: 1; min-width: 0; padding-right: 12px; }
.nombre { display: block; font-weight: 600; font-size: 1.05rem; color: #fff; letter-spacing: .01em; }
.descripcion { color: var(--muted); font-size: .875rem; line-height: 1.55; font-weight: 300; margin: 6px 0 0; }

.item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.precio { font-weight: 700; color: var(--accent); font-size: 1.125rem; white-space: nowrap; letter-spacing: .02em; }
.cantidad-controls {
    display: flex; align-items: center; gap: 8px; background: var(--card2);
    border-radius: 24px; padding: 4px;
}
.qty-btn {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: #252525; color: var(--text); font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    transition: background-color .2s ease, transform .2s ease;
}
.qty-btn:hover { background: var(--accent); color: #fff; transform: scale(1.1); }
.qty-btn:active { transform: scale(.95); }
.qty-val { min-width: 22px; text-align: center; font-weight: 600; color: #fff; }

/* ----- Modal de imagen ampliada (lightbox) ----- */
.image-modal {
    position: fixed; inset: 0; z-index: 70; display: none;
    align-items: center; justify-content: center; flex-direction: column;
    background: rgba(0,0,0,.9); padding: 24px;
}
.image-modal.show { display: flex; }
.image-modal-content { max-width: 92vw; max-height: 80vh; border-radius: 10px; object-fit: contain; }
.image-modal-caption { color: #fff; margin-top: 14px; font-size: 1rem; text-align: center; }
.image-modal-close {
    position: absolute; top: 16px; right: 20px; background: none; border: none;
    color: #fff; font-size: 38px; line-height: 1; cursor: pointer;
}
/* ----- Barra de pedido ----- */
.cart-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: none; align-items: center; gap: 12px; padding: 12px 16px;
    background: var(--card); border-top: 2px solid var(--accent);
    box-shadow: 0 -4px 20px rgba(0,0,0,.5);
}
.cart-bar.show { display: flex; }
.cart-bar .count {
    background: var(--accent); color: #fff; border-radius: 999px;
    min-width: 26px; height: 26px; display: inline-flex; align-items: center;
    justify-content: center; font-size: 13px; font-weight: 700; padding: 0 8px;
}
.cart-bar .cart-total { font-weight: 700; }
.cart-bar .spacer { flex: 1; }
.btn-cart {
    padding: 11px 22px; border-radius: 10px; border: none; text-transform: uppercase;
    background: var(--accent); color: #fff; font-weight: 700; cursor: pointer;
    font-size: .9rem; letter-spacing: .03em; transition: background-color .2s ease;
}
.btn-cart:hover { background: var(--accent2); }

/* ----- Modal checkout ----- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 60; display: none;
    background: rgba(0,0,0,.7); align-items: flex-end; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
    width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
    background: var(--bg); border: 1px solid var(--border2); border-radius: 16px 16px 0 0;
    padding: 20px;
}
@media (min-width: 600px) { .modal-overlay { align-items: center; } .modal { border-radius: 16px; } }
.modal h2 { margin: 0 0 12px; font-size: 1.2rem; }
.modal-close { float: right; background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.pedido-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pedido-item .thumb { width: 44px; height: 44px; min-width: 44px; border-radius: 8px; background: var(--card2) center/cover no-repeat; }
.pedido-item .thumb-empty { display: flex; align-items: center; justify-content: center; color: #555; font-size: 18px; }
.pedido-item .info { flex: 1; min-width: 0; font-size: .9rem; }
.pedido-item .line-price { font-weight: 600; white-space: nowrap; }
.sum-line { display: flex; justify-content: space-between; color: var(--muted); margin: 8px 0; font-size: .95rem; }
.sum-line.hidden { display: none; }
.subtotal { display: flex; justify-content: space-between; font-weight: 700; margin: 10px 0 14px; font-size: 1.15rem;
    padding-top: 12px; border-top: 1px solid var(--border); }
.field-note { color: var(--yellow); font-size: .8rem; margin: 8px 0 0; line-height: 1.35; }

.switch-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px; padding: 14px 16px; margin: 12px 0; cursor: pointer; user-select: none;
}
.switch-row.is-active { border-color: rgba(232,69,69,.3); background: rgba(232,69,69,.08); }
.switch-row .s-title { color: #fff; font-size: 15px; font-weight: 500; }
.switch-row .s-sub { color: rgba(255,255,255,.5); font-size: 13px; }
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; z-index: 2; }
.switch .track { position: absolute; inset: 0; background: #3a3a3a; border-radius: 26px; transition: background-color .2s; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; background: #888; border-radius: 50%; transition: transform .2s, background-color .2s; pointer-events: none; }
.switch-row.is-active .track { background: var(--accent2); }
.switch-row.is-active .thumb { transform: translateX(18px); background: #fff; }

.field { margin: 12px 0; }
.field label { display: block; font-size: .85rem; color: rgba(255,255,255,.92); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
    width: 100%; padding: 11px 12px; background: var(--card2); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text); font-size: .95rem; font-family: inherit;
}
.field.hidden { display: none; }
.btn-wa {
    width: 100%; padding: 14px; border-radius: 10px; border: none; margin-top: 8px;
    background: var(--wa); color: #073b22; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.btn-wa:disabled { opacity: .5; cursor: not-allowed; }

/* ----- Footer ----- */
.site-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px 16px; }
.site-footer a { color: var(--accent2); text-decoration: none; }
