/* ════════════════════════════════════════
   NICAPLAY — Estilos globales
   ════════════════════════════════════════ */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.container img {
    max-width: 100%;
    height: auto;
}

h1 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #00bfff;
}

h2 {
    text-align: center;
    font-size: 1.2em;
    color: #555;
    margin-bottom: 30px;
}

/* ── Grilla de productos ── */
.productos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.producto {
    border: 1px solid #e0e0e0;
    padding: 16px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: box-shadow 0.2s;
}

.producto:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
}

.producto img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 8px;
    object-fit: cover;
    aspect-ratio: 4/3;
}

.producto h3 {
    margin: 0;
    font-size: 1em;
    font-weight: 700;
    color: #222;
}

.producto strong {
    color: #00bfff;
    font-size: 1.1em;
}

.producto p {
    font-size: 0.88em;
    color: #666;
    margin: 0;
}

.producto s {
    color: #aaa;
    font-size: 0.85em;
}

.agregar {
    margin-top: auto;
    background-color: #00bfff;
    color: #fff;
    padding: 10px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
}

.agregar:hover {
    background-color: #0099cc;
}

.agregar:active {
    transform: scale(0.97);
}

/* ════════════════════════════════════════
   CARRITO LATERAL (DRAWER)
   ════════════════════════════════════════ */

/* Botón flotante */
#carrito-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1100;
    background: #00bfff;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 20px;
    font-size: 1.4em;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
}

#carrito-toggle:hover {
    background: #0099cc;
    transform: scale(1.05);
}

/* Badge de cantidad */
#carrito-badge {
    background: #e74c3c;
    color: white;
    font-size: 0.65em;
    font-weight: 700;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#carrito-badge.hidden {
    display: none;
}

/* Overlay oscuro */
#carrito-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1200;
    transition: opacity 0.3s;
}

#carrito-overlay.open {
    display: block;
}

/* Drawer */
#carrito-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#carrito-drawer.open {
    transform: translateX(0);
}

/* Header del drawer */
.carrito-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #eee;
}

.carrito-header h2 {
    font-size: 1.2em;
    font-weight: 700;
    color: #222;
    margin: 0;
    text-align: left;
}

#carrito-cerrar {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 1em;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#carrito-cerrar:hover {
    background: #f5f5f5;
}

/* Lista de items */
.carrito-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}

.carrito-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #aaa;
    gap: 10px;
    padding: 40px 0;
}

.carrito-vacio span {
    font-size: 3em;
}

.carrito-vacio p {
    font-size: 1em;
    margin: 0;
}

.carrito-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.carrito-item-info {
    flex: 1;
}

.carrito-item-nombre {
    font-size: 0.9em;
    font-weight: 600;
    color: #222;
    margin: 0 0 4px;
    line-height: 1.3;
}

.carrito-item-precio {
    font-size: 0.8em;
    color: #888;
    margin: 0;
}

.carrito-item-subtotal {
    font-size: 0.95em;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
    margin: 0;
}

/* Footer del drawer */
.carrito-footer {
    padding: 16px 20px 24px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.carrito-totales {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.carrito-fila {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #555;
}

.total-fila {
    font-size: 1.05em;
    font-weight: 700;
    color: #222;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

/* Botón pagar */
#pagar {
    background-color: #25d366;
    color: #fff;
    padding: 14px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 700;
    text-transform: uppercase;
    transition: background-color 0.2s;
    width: 100%;
}

#pagar:hover:not(:disabled) {
    background-color: #1ebe5d;
}

#pagar:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Botón vaciar */
#vaciar {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 0.82em;
    cursor: pointer;
    text-align: center;
    padding: 4px;
    text-decoration: underline;
    transition: color 0.2s;
}

#vaciar:hover {
    color: #c0392b;
}

/* ── Footer de la página ── */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 12px 0;
    margin-top: 20px;
}

/* ── Responsive ── */
@media screen and (max-width: 600px) {
    .productos {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    #carrito-toggle {
        bottom: 16px;
        right: 16px;
        padding: 12px 16px;
        font-size: 1.2em;
    }
}
