* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Paleta moderna y elegante: navy, coral y dorado sutil */
    --bg-1: #fbfbfc; /* fondo muy claro */
    --bg-2: #fff6f8; /* ligero rubor */
    --primary: #0b2545; /* navy profundo */
    --primary-2: #132f5b; /* navy secundario */
    --accent: #ff6b6b; /* coral vibrante */
    --gold: #f2c94c; /* dorado sutil */
    --muted: #2b2b2b; /* texto principal */
    --card: #ffffff; /* tarjeta */
    --card-border: #ececec; /* borde suave */

    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
    min-height: 100vh;
    color: var(--muted);
    margin: 0;
    padding: 0;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

.back-arrow {
    background: rgba(255, 255, 255, 0.12);
    color: var(--gold);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-arrow:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(-5px);
}

header h1 {
    font-size: 2.5em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    flex: 1;
    text-align: center;
}

.cart-icon {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gold);
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Ocultar selector de temas */
.theme-selector {
    display: none !important;
}

/* ===== NAVEGACIÓN DE CATEGORÍAS ===== */
.category-nav {
    background: rgba(19, 47, 91, 0.04);
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    border-bottom: 2px solid rgba(11,37,69,0.08);
    max-width: 100%;
    overflow-x: auto;
}

.category-btn {
    padding: 12px 25px;
    background: white;
    border: 2px solid rgba(11,37,69,0.08);
    color: var(--primary);
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(255,107,107,0.14);
}

.category-btn.active {
    background: linear-gradient(90deg, var(--accent) 0%, #ff8a7a 100%);
    color: white;
    box-shadow: 0 8px 26px rgba(255,107,107,0.18);
}

/* ===== CONTENEDOR DEL MENÚ ===== */
.menu-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* ===== TARJETAS DE PRODUCTOS ===== */
.product {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

/* ===== SEPARADOR DE CATEGORÍA ===== */
.category-separator {
    grid-column: 1 / -1;
    text-align: center;
    margin: 30px 0 20px;
    padding: 20px 0;
    border-top: 3px solid var(--gold);
    border-bottom: 3px solid var(--gold);
}

.category-separator h2 {
    font-size: 2em;
    color: var(--gold);
    margin: 0;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.product:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.product img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-placeholder {
    width: 100%;
    height: 250px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.1em;
    font-weight: 500;
    border: 1px dashed #ccc;
}

.product:hover img {
    transform: scale(1.1);
}

.product h3 {
    font-size: 1.28em;
    color: var(--primary);
    padding: 15px 20px 5px;
    margin: 0;
    font-weight: 700;
}

.product p {
    color: #666;
    padding: 0 20px;
    font-size: 0.95em;
    margin: 5px 0;
}

.product-price {
    color: var(--accent);
    font-size: 1.4em;
    font-weight: 700;
    padding: 10px 20px;
    margin: 0;
}

.product button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    margin: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.3s ease;
    margin-top: auto;
}

.product button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 95, 0.18);
}

.product button:active {
    transform: scale(0.98);
}

/* ===== FOOTER ===== */
.menu-footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    padding: 30px 20px;
    text-align: center;
    border-top: 2px solid rgba(11,37,69,0.08);
    margin-top: 50px;
}

.whatsapp-btn {
    background: white;
    color: var(--primary-2);
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.whatsapp-btn:hover {
    background: var(--primary-2);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .menu-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }

    header h1 {
        font-size: 2em;
    }

    .product img {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        gap: 15px;
    }

    header h1 {
        font-size: 1.6em;
        order: 2;
        width: 100%;
    }

    .back-arrow {
        font-size: 0.9em;
    }

    .cart-icon {
        font-size: 1em;
    }

    .category-nav {
        gap: 10px;
    }

    .category-btn {
        padding: 10px 18px;
        font-size: 0.9em;
    }

    .menu-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
        margin: 30px auto;
    }

    .product h3 {
        font-size: 1.1em;
    }

    .product-price {
        font-size: 1.3em;
    }

    .product img {
        height: 220px;
    }

    .whatsapp-btn {
        padding: 12px 30px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .menu-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    header h1 {
        font-size: 1.3em;
    }

    .back-arrow {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .cart-icon {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .category-btn {
        padding: 8px 15px;
        font-size: 0.85em;
    }

    .product img {
        height: 300px;
    }

    .product h3 {
        font-size: 1em;
        padding: 12px 15px 5px;
    }

    .product button {
        padding: 10px 15px;
        margin: 10px 15px;
        font-size: 0.9em;
    }

    .whatsapp-btn {
        padding: 10px 25px;
        font-size: 0.95em;
        width: 90%;
    }
}

main {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.product {
    background-color: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.product img {
    width: 100%;
    border-radius: 8px;
}

.product button {
    margin-top: 0.5rem;
    background: linear-gradient(90deg, var(--accent) 0%, #ff8a7a 100%);
    color: white;
    border: none;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(255,107,107,0.12);
}

footer {
    text-align: center;
    padding: 1rem;
}

#whatsapp-button {
    background-color: #25d366;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

/* ===== BOTÓN DE DESPLAZAMIENTO ===== */
.scroll-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}
.scroll-top-btn { /* botón fijo para subir */
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    color: var(--primary-2);
    border: 2px solid var(--primary-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    box-shadow: 0 8px 22px rgba(0,0,0,0.12);
    cursor: pointer;
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease, background 0.18s ease;
    z-index: 210;
}
.scroll-top-btn.show {
    transform: translateY(0);
    opacity: 1;
}
.scroll-top-btn:hover { background: var(--primary-2); color: white; }

/* ===== BOTÓN FLOTANTE DE WHATSAPP (FAB) ===== */
.whatsapp-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: linear-gradient(90deg, var(--accent) 0%, #ff8a7a 100%);
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25em;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.18);
    cursor: pointer;
    z-index: 200;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.whatsapp-fab:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 18px 42px rgba(255, 107, 107, 0.28);
}

/* icono interno */
.whatsapp-fab .fab-icon { pointer-events: none; }

/* contador (badge) */
.whatsapp-fab .fab-badge {
    position: absolute;
    right: 6px;
    top: 6px;
    background: #ff3b30;
    color: white;
    font-size: 0.7em;
    padding: 3px 6px;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: none;
}
.whatsapp-fab.has-items .fab-badge { display: inline-block; }

/* etiqueta que aparece a la derecha al pasar el cursor (desktop) */
.whatsapp-fab .fab-label {
    position: absolute;
    right: 70px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.95em;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
    white-space: nowrap;
}
.whatsapp-fab:hover .fab-label { opacity: 1; transform: translateX(0); }

/* pulso sutil para llamar la atención si no hay items */
@keyframes fab-pulse {
    0% { box-shadow: 0 8px 20px rgba(37,211,102,0.18); }
    70% { box-shadow: 0 18px 36px rgba(37,211,102,0.12); }
    100% { box-shadow: 0 8px 20px rgba(37,211,102,0.18); }
}
.whatsapp-fab.pulse { animation: fab-pulse 2.4s infinite; }

@media (max-width: 768px) {
    header {
        padding-top: 60px;
    }
}

@media (max-width: 480px) {
    .whatsapp-fab { right: 12px; bottom: 12px; width: 50px; height: 50px; }
    .scroll-down-btn { width: 40px; height: 40px; font-size: 1.4em; }
}

/* Ocultar el botón footer en pantallas grandes para priorizar el FAB */
@media (min-width: 768px) {
    .menu-footer .whatsapp-btn { display: none; }
}