/* ===== CSS original del usuario ===== */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: #252525;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    color: #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-content .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5em;
    color: #333;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-content .close:hover {
    color: #e74c3c;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8em;
    color: #f3f3f3;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

#carrito-lista-modal {
    list-style-type: none;
    padding: 0;
    margin: 0 0 20px;
    max-height: 200px;
    overflow-y: auto;
}

#carrito-lista-modal li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#total-precio {
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    color: #2ecc71;
    margin-bottom: 20px;
}

#enviar-ubicacion {
    transform: scale(1.2);
    cursor: pointer;
}

#whatsapp-button {
    display: block;
    width: 100%;
    padding: 12px 0;
    background-color: #25d366;
    color: white;
    font-size: 1.2em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#whatsapp-button:hover {
    background-color: #1ebe56;
}

.opciones-envio label {
    display: block;
    margin-bottom: 5px;
}

#costo-envio {
    font-weight: bold;
    color: #333;
    margin-top: 10px;
}

label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    color: #a3a3a3;
    margin-bottom: 20px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #fff;
    text-decoration: none;
}

#carrito-lista-modal::-webkit-scrollbar {
    width: 6px;
}

#carrito-lista-modal::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 5px;
}

#carrito-lista-modal::-webkit-scrollbar-thumb:hover {
    background-color: #bbb;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

main {
    flex: 1;
    padding: 20px;
    max-width: 90%;
    margin: 0 auto;
    background-color: rgb(25,25,25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

header {
    background-color: #121212;
    color: #fff;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

header h1 {
    font-size: 2em;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-align: center;
    color: #e0e0e0;
    margin: 0;
}

.logo-container {
    position: absolute;
    left: 25px;
}

.logo-container:hover .admin-link {
    display: block;
}
.logo-container img {
    height: 80px;
    max-height: 80px;
    filter: grayscale(20%);
}

.horarios {
    position: absolute;
    top: 50%;
    left: 25%;
    transform: translate(-50%, -50%);
    font-size: 0.9em;
    color: #e0e0e0;
    text-align: center;
    background-color: #222;
    padding: 8px 15px;
    border-radius: 5px;
    opacity: 0.9;
}

.horarios p {
    margin: 3px 0;
}

.dias {
    font-size: 1.2em;
    font-weight: bold;
}

.horas {
    font-size: 1.1em;
    font-style: italic;
}

.admin-link {
    position: absolute;
    bottom: -25px; /* debajo del logo */
    left: 50%;
    transform: translateX(-50%);
    display: none;
    background-color: rgba(0,0,0,0.8);
    padding: 4px 8px;
    border-radius: 4px;
}

.admin-link a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
}

.admin-link a:hover {
    opacity: 1;
    color: #000;
}

#carrito-lista li {
    margin-bottom: 5px;
}

.disabled-button {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

#carrito-flotante {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4a90e2;
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-size: 24px;
    z-index: 1000;
    transition: background-color 0.3s;
}

#carrito-flotante:hover {
    background-color: #357abd;
}

#carrito-cantidad {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 12px;
}

.login-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4caf50;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1em;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(-20px);
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

#login-btn {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 16px;
    cursor: pointer;
}

#login-btn:hover {
    background-color: #45a049;
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    background-color: #333;
    border-radius: 8px;
    max-width: 400px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}



#search-input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px 0 0 8px;
    background-color: #222;
    color: #e0e0e0;
}

#search-button {
    background-color: #4a90e2;
    color: #fff;
    border: none;
    padding: 12px;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    transition: background-color 0.3s;
}

#search-button:hover {
    background-color: #357abd;
}

.main-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

#catalogo {
    flex: 3;
    background-color: rgb(14, 14, 14);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.menu-icon {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    position: absolute;
    margin: 10px;
    z-index: 100;
}

#menu-categorias {
    display: block;
    flex: 1;
    max-width: 180px;
    background-color: #0c0c0c;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#menu-categorias.active {
    display: block; /* Mostrar */
    opacity: 1;
    height: auto; /* Automático para expandirse */
    padding: 15px;
}
 
#menu-categorias h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #dfdfdf;
}

#categorias-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

#categorias-lista li {
    margin-bottom: 5px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

#categorias-lista li:hover {
    background-color: #ddd;
}

#categorias-lista li.active {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.hidden {
    display: none;
}

#banner-container {
    width: 100%;
    max-width: 1000px;
    max-height: 200px;
    margin: 20px auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    background-size: cover;
    background-position: center;
    
}

.banner {
    width: 100%;
    height: 210px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    transition: background-image 0.5s ease-in-out; /* Suavizar cambio de imagen */
}



.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.promo-img {
    width: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Controles del carrusel */
.banner-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.banner-controls .prev,
.banner-controls .next {
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 10px;
    font-size: 1.5em;
    border-radius: 50%;
    user-select: none;
    transition: background-color 0.3s;
}

.banner-controls .prev:hover,
.banner-controls .next:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Categoría de productos */
.category {
    margin-bottom: 50px;
}

.category h2 {
    font-size: 2.5em;
    color: #f3f3f3;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Catálogo de productos */
.catalog {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
}

.product {
    background-color: #222;
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    max-width: 220px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #e0e0e0;
    position: relative;
}

.product img {
    width: 100%;
    height: auto;
    max-height: 180px;
    min-height: 180px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #fff;
    padding: 5px;
}

.product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: #4a90e2;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.product button:hover {
    background-color: #357abd;
}

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

.product h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a90e2;
}

.product p {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 10px;
}

.price-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.price {
    font-size: 1.5em;
    color: #e67e22;
    font-weight: bold;
    margin-top: auto;
}

.price-original {
    font-size: 0.9em;
    color: #999;
    text-decoration: line-through;
    margin-right: 10px;
}

.price-discounted {
    font-size: 1.6em;
    color: #03a700;
    font-weight: 700;
}

.agotado {
    display: inline-block;
    font-size: 1.2em;
    color: #e74c3c;
    font-weight: bold;
    background-color: #f2d7d5;
    padding: 8px;
    max-width: 100px;
    border-radius: 4px;
    margin-top: 10px;
    text-align: center;
}

.low-stock {
    color: orange;
    font-weight: bold;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #121212;
    color: #e0e0e0;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0;
    font-size: 1em;
    letter-spacing: 1px;
}

.social-icons {
    margin-top: 10px;
}

.social-icons a {
    color: #e0e0e0;
    margin: 0 12px;
    font-size: 1.4em;
    transition: color 0.3s;
    align-items: center;
    text-decoration: none;
}

.social-icons a:hover {
    color: #4a90e2;
}

.whatsapp:hover {
    color: #25d366;
}

.instagram:hover {
    color: #e1306c;
}

body.dark-mode {
    background-color: #181818;
    color: #f0f0f0;
}

header.dark-mode {
    background-color: #1e272e;
}

.search-container.dark-mode {
    background-color: #333;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

#search-input.dark-mode {
    background-color: #444;
    color: #f0f0f0;
}

#search-button.dark-mode {
    background-color: #1e272e;
}

main.dark-mode {
    background-color: #2c2c2c;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

footer.dark-mode {
    background-color: #1e272e;
}

.product.dark-mode {
    background-color: #333;
    color: #f0f0f0;
    border: 1px solid #444;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

.product.dark-mode h3 {
    color: #e67e22;
}

.price.dark-mode {
    color: #e67e22;
}

.social-icons.dark-mode a {
    color: #f0f0f0;
}

#loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    main#catalogo {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    header {
        display: grid;
        grid-auto-flow: row;
        justify-items: center;   /* centra horizontalmente */
        text-align: center;
        padding: 15px 0;
    }

    .logo-container {
        position: static !important;
        left: auto !important;
        right: auto !important;
        display: inline-block;
    }

    .promo-img, .banner img {
        height: 200px;
    }

    header h1 {
        font-size: 2em;
    }

    main {
        padding: 20px 10px;
    }

    .product {
        max-width: 100%;
        margin: 5px 0;
        padding: 5px;
        max-height: 200px;
        border-radius: 8px;
    }

    .horarios {
        position: static;
        transform: none;
        margin-bottom: 10px;
        text-align: center;
        font-size: 0.9em;
    }

    .category h2 {
        font-size: 2em;
    }

    
    .search-container{
        max-width: 300px;
    }

    .search-input{
        width:80%;
    }

    .menu-icon {
        display: block;
    }

    #menu-categorias {
        display: none; /* Oculto por defecto */
        opacity: 0;
        height: 0;
        max-width: 180px;
        background-color: #0c0c0c;
        border-radius: 8px;
        padding: 15px;
        overflow: hidden;
        transition: opacity 0.4s ease-in-out, height 0.4s ease-in-out, padding 0.4s ease-in-out;
    }
    #menu-categorias.hidden {
        display: none;
    }

    #categorias-lista {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    #categorias-lista li {
        padding: 10px;
        text-align: center;
        background-color: #444;
        border-radius: 5px;
        cursor: pointer;
    }

    #categorias-lista li:hover {
        background-color: #555;
    }
}

@media (max-width: 600px) {
    #menu-categorias {
        position: absolute;
        top: 290px;
        left: 0;
        background-color: #131313;
        color: #fff;
        width: 100%;
        padding: 10px;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        z-index: 100;
    }

    #categorias-lista {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    #categorias-lista li {
        padding: 10px;
        text-align: center;
        background-color: #2c2c2c;
        border-radius: 5px;
        cursor: pointer;
    }

    #categorias-lista li:hover {
        background-color: #555;
    }

    .catalog {
        padding: 2px;
        margin: 0;
        max-width: 95%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .product {
        display: flex;
        flex-direction: row;
        max-width: 95%;
        padding: 15px;
        text-align: left;
        max-height: 150px;
    }

    .product img {
        max-width: 150px;
        height: auto;
        margin-bottom: 0;
        margin-right: 15px;
        border-radius: 8px;
    }

    .product-details {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 1;
    }

    .product h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        font-size: 1.5em;
        margin: 0 0 10px;
    }

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

    .banner {
        height: 100px;
    }

    .product img {
        min-height: 150px;
    }

    .price {
        font-size: 1.2em;
        color: #e67e22;
        font-weight: bold;
        margin: 10px 0 0;
    }

    footer {
        padding: 5px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .product {
        padding: 20px;
    }

    .product img {
        min-height: 150px;
    }

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

    .price {
        font-size: 1.2em;
    }

    .category h2 {
        font-size: 1.5em;
    }
}

/* ====== Cambio de Colores ====== */
:root{
  --bg-0: #0f1115;   /* fondo principal */
  --bg-1: #151821;   /* paneles/containers */
  --bg-2: #1b1f2a;   /* cards */
  --text: #e6e9ef;   /* texto principal */
  --muted:#a8b3cf;   /* texto secundario */
  --border:#2a2f3a;  /* bordes suaves */

  --primary:#4a90e2;       /* azul principal */
  --primary-2:#357abd;     /* hover */
  --accent:#e67e22;        /* acento (precio) */
  --success:#2ecc71;       /* ok/total */
  --danger:#e74c3c;        /* errores */
  --whatsapp:#25d366;      /* WhatsApp */
  --warning:#f4a261;       /* pocas unidades */
}

/* Base y tipografía */
body{ background-color: var(--bg-0); color: var(--text); }
main{ background-color: var(--bg-1); }
header{ background-color:#0e1218; color: var(--text); }
header h1{ color: var(--text); }
.horarios{ background:#1e2330; color: var(--text); }

/* Enlaces admin: evitar negro sobre oscuro */
.admin-link{ color:#9aa6c1; }
.admin-link a:hover{ color: var(--primary); opacity:1; }

/* Modal */
.modal{ background-color: rgba(0,0,0,.75); }
.modal-content{ background-color:#202534; color: var(--text); }
.modal-content h2{ color:#f5f7fb; border-bottom:2px solid var(--border); }
.modal-content .close{ color:#b8c0d9; }
.modal-content .close:hover{ color:#fff; }

/* Lista del carrito */
#carrito-lista-modal li{
  background:#171b26;
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
}
#carrito-lista-modal::-webkit-scrollbar-thumb{ background-color:#3a4154; }
#carrito-lista-modal::-webkit-scrollbar-thumb:hover{ background-color:#4a5268; }

/* Total */
#total-precio{ color: var(--success); }

/* Botones */
#whatsapp-button{ background-color: var(--whatsapp); }
#whatsapp-button:hover{ background-color:#1ebe56; }
.product button,
#search-button{ background-color: var(--primary); }
.product button:hover,
#search-button:hover{ background-color: var(--primary-2); }

/* Carrito flotante */
#carrito-flotante{ background-color: var(--primary); }
#carrito-flotante:hover{ background-color: var(--primary-2); }
#carrito-cantidad{ background-color: var(--danger); }

/* Catálogo / Cards */
#catalogo{ background-color:#111521; }
.product{
  background-color: var(--bg-2);
  color: var(--text);
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.product h3{ color: var(--primary); }
.product p{ color: var(--muted); }
.low-stock{ color: var(--warning); }
.agotado{ color: var(--danger); background-color: rgba(231,76,60,.15); }

/* Precios */
.price{ color: var(--accent); }
.price-original{ color:#8b95b2; }
.price-discounted{ color:#20c15a; }

/* Menú categorías */
#menu-categorias{ background-color:#0f1420; box-shadow: 0 2px 5px rgba(0,0,0,.25); }
#categorias-lista li{ color: var(--text); }
#categorias-lista li:hover{ background-color: rgba(74,144,226,.15); }
#categorias-lista li.active{ background-color: var(--primary); color:#fff; }

/* Banner / controles */
#banner-container{ background-color:#0f1420; }
.banner-controls .prev,
.banner-controls .next{ background-color: rgba(15,17,21,.6); }
.banner-controls .prev:hover,
.banner-controls .next:hover{ background-color: rgba(53,122,189,.6); }

/* Footer */
footer{ background-color:#0e1218; color:#cfd6e6; }
footer.dark-mode{ background-color:#0e1218; }

/* Inputs / buscador */
.search-container{ background-color:#1a1f2b; }
#search-input{ background-color:#131826; color: var(--text); }

/* Close genérico (duplicado) */
.close{ color:#b8c0d9; }
.close:hover, .close:focus{ color:#fff; }

/* Focus visible accesible */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible{
  outline:2px solid var(--primary);
  outline-offset:2px;
}

/* Modo oscuro existente mapeado */
body.dark-mode{ background-color: var(--bg-0); color: var(--text); }
main.dark-mode{ background-color:#1d2230; box-shadow: 0 4px 20px rgba(255,255,255,.08); }
.product.dark-mode{ background-color:#222836; color: var(--text); border:1px solid var(--border); }
.product.dark-mode h3{ color: var(--accent); }
.price.dark-mode{ color: var(--accent); }
