body {
    font-family: arial, sans-serif;
    padding: 20px;
    margin: 0;
    background: darkorange;
    color: #333;
}

body.oscuro .modal-contenido {
    background: #1e1e1e;
    color: #f4f4f9;
}

body.oscuro #lista-carrito li {
    background: #333;
}

body.oscuro .producto {
    background: #1e1e1e;
    border: 1px solid #444;
}

body.oscuro .producto button {
    background: #00aaff;
}

body.nicho-Gamer {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #f4f4f9;
}

body.nicho-Moda {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    color: #333;
}

body.nicho-Hogar {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    color: #222;
}

body.nicho-Telefonia {
    background: linear-gradient(135deg, #fcb69f, #f1f1f1);
    color: #444;
}

#filtros {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

#filtros button {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    background: #0077ff;
    color: white;
    transition: transform 0.2s, background 0.2s;
}

#filtros button:hover {
    transform: scale(1.05);
    background: #005fcc;
}

#filtros button.activo {
    background: #ff9800;
    transform: scale(1.1);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0077ff;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    gap: 12px;
}

.acciones {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    display: none;
    border: none;
    background: white;
    color: #0077ff;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

body.oscuro header {
    background: #222;
}

body.oscuro .menu-toggle {
    background: #333;
    color: #f4f4f9;
}

.btn-carrito {
    background: white;
    color: #0077ff;
    font-weight: bold;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

#productos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.producto {
    border:1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    width: 150px;
    text-align: center;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.25s;
}

.producto:hover {
    transform: scale(1.05);
}

.producto button {
    margin-top: 10px;
    background: #0077ff;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
} 

.img-producto {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-contenido {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 400px;
    max-height: 80%;
    overflow: auto;
    animation: aparecer 0.3s ease-in-out;
}

@keyframes aparecer {
    from { transform: scale(0.8);opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-cerrar {
    background: red;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 5px 10px;
}

.btn-vaciar {
    margin-top: 10px;
    background: darkorange;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-eliminar {
    background: red;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 2px 6px;
}

#lista-carrito ul {
    list-style: none;
    padding: 0;
}

#lista-carrito li {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    background: #f1f1f1;
    padding: 5px;
    border-radius: 5px;
}

@media (max-width: 600px) {
    header {
        flex-wrap: wrap;
        text-align: center;
    }

    .menu-toggle:hover  {
        background: #eee;
    }

    body.oscuro .menu-toggle:hover {
        background: #444;
    }

    .acciones {
        display: none;
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        gap: 8px;
        background: white;
        padding: 10px;
        border-radius: 8px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
        animation: despliegue .18s ease-out;
    }

    .acciones.abierto {
        display: flex;
    }

    body.oscuro .acciones {
        background: #1e1e1e;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    }

    header button {
        width: 100%;
    }

    .modal-contenido {
        width: 95%;
        max-height: 95%;
    }
}

@keyframes despliegue {
    from { transform: scaleY(.96); opacity: 0; transform-origin: top; }
    to   { transform: scaleY(1);   opacity: 1; transform-origin: top; }
}

#contador.animar {
    animation: bounce 0.4s ease;
}

@keyframes bounce {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    opacity: 1;
    transition: opacity 1s ease; /* transicion suabe */
    z-index: 9999;
}

.toast.desaparecer {
    opacity: 0; /* se desvanece */
}

.item-carrito {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 5px;
    background: #f1f1f1;
    border-radius: 5px;
    margin-bottom: 5px;
}

.item-carrito .cantidad {
    display: flex;
    align-items: center;
    gap: 5px;
}

.toast.ok {
    background: #28a745; 
}

.toast.error {
    background: #dc3545;
}

.toast.info {
    background: #333; 
}