@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Outfit:wght@500;700&display=swap');

:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --danger: #ef4444;
    --star: #fbbf24;
}

html {
    background-color: var(--bg-color);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: 20px;
    scrollbar-width: none;
}
* {
    scrollbar-width: none;
    -webkit-tap-highlight-color: transparent !important;
    box-sizing: border-box;
    outline: none !important;
}
::-webkit-scrollbar {
    display: none;
}

/* Premium Header */
.restaurant-header {
    position: relative;
    text-align: center;
    padding: calc(env(safe-area-inset-top, 0px) + 40px) 20px 20px;
    background: linear-gradient(180deg, rgba(15,23,42,1) 0%, rgba(15,23,42,0) 100%);
}
.restaurant-header.has-banner {
    padding-top: calc(env(safe-area-inset-top, 0px) + 125px) !important;
}
.restaurant-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    margin: 0;
    background: -webkit-linear-gradient(45deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.kitchen-closed-banner {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 65px);
    left: 15px;
    right: 15px;
    background-color: #f59e0b;
    color: #451a03;
    padding: 6px 12px;
    text-align: center;
    border-radius: 8px;
    margin: 0;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 10;
    box-sizing: border-box;
}

/* Allergen Filters - Horizontal Scroll Native */
.allergen-filters {
    display: flex;
    overflow-x: auto;
    padding: 12px 16px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
}
.allergen-filters::-webkit-scrollbar { display: none; }
.allergen-filters::after {
    content: '';
    padding-right: 10px;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}
.filter-btn.active {
    background: var(--text-main);
    color: var(--bg-color);
    border-color: var(--text-main);
    font-weight: bold;
}

/* Menu Grid */
.menu-container {
    padding: 0 20px;
}
.category-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.items-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
@media (min-width: 600px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.item-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px 16px 16px 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.item-card.safe-dish {
    border-color: #10b981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
    background: linear-gradient(to right, rgba(16,185,129,0.05), var(--card-bg));
    padding-top: 30px;
}

.item-card.safe-dish::before {
    content: '✓ Apto';
    position: absolute;
    top: 0;
    right: 0;
    background: #10b981;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 0 12px 0 8px;
    z-index: 10;
    letter-spacing: 0.5px;
}

.item-card.not-safe-dish {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
    padding-top: 30px;
}

.item-card.not-safe-dish::before {
    content: 'No Apto';
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 0 12px 0 8px;
    z-index: 10;
    letter-spacing: 0.5px;
}
.item-card.out-of-stock {
    opacity: 0.75;
    pointer-events: none;
}
.item-card.out-of-stock .item-name,
.item-card.out-of-stock .item-price,
.item-card.out-of-stock .item-price span,
.item-card.out-of-stock .item-desc {
    filter: grayscale(100%);
    text-decoration: line-through;
}
.item-card.out-of-stock .allergens-list {
    filter: grayscale(100%);
}
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.item-code {
    color: var(--accent);
    font-weight: bold;
    font-size: 1.1rem;
}
.item-name {
    flex-grow: 1;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.item-price {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent);
    flex-shrink: 0;
    margin-left: 10px;
    white-space: nowrap;
}
.item-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 8px 0;
}
.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
.allergens-list span {
    font-size: 1.2rem;
    margin-right: 5px;
}
.badge-agotado {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* Reviews Button - Al final de la carta */
.floating-review-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 30px auto 15px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #451a03;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 16px 32px;
    border-radius: 16px;
    text-align: center;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    transition: all 0.3s ease;
    width: fit-content;
}
.floating-review-btn:active { transform: scale(0.97); }

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal.show { display: flex; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-sizing: border-box;
    margin: auto;
}
.close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}
.stars { font-size: 2.5rem; margin: 20px 0; cursor: pointer; color: var(--text-muted); }
.stars span.active { color: var(--star); }
textarea {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    resize: none;
    box-sizing: border-box;
}
.btn-submit {
    background: var(--text-muted);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
}
.btn-google { background: #10b981; color: white; }

.anti-fraud-box {
    background: rgba(56, 189, 248, 0.1);
    border: 2px dashed var(--accent);
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.5rem;
    color: var(--accent);
    animation: pulse 1s infinite alternate;
}
@keyframes pulse { from { opacity: 0.7; } to { opacity: 1; } }

/* ================== RESPONSIVE DESKTOP (GRID) ================== */
@media (min-width: 768px) {
    body {
        max-width: 900px;
        margin: 0 auto;
        padding: 40px 20px 120px 20px;
    }
    
    .category-section {
        margin-bottom: 40px;
    }

    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 20px;
    }

    .item-card {
        margin-bottom: 0; /* Quitamos el margin-bottom porque usamos gap del grid */
    }

    #allergen-filters {
        justify-content: center;
        flex-wrap: wrap;
    }
}

button, a.btn, .btn, .btn-primary, .btn-secondary, .floating-res-btn, .floating-review-btn {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}
button:focus, button:active, a.btn:focus, a.btn:active {
    outline: none !important;
    box-shadow: none !important;
}

