/* FONDO DINÁMICO */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    background: linear-gradient(-45deg, #f5f5f5, #e8e8e8, #d6d600, #f5f5f5);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    background: #d6d600;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 4px solid #1a1a1a;
}

header img { position: absolute; left: 20px; height: 50px; border-radius: 50%; }

.logo-box {
    background: #1a1a1a;
    padding: 8px 20px;
    border-radius: 25px 10px;
    transform: rotate(-2deg);
    text-align: center;
}

header .titulo-logo {
    font-family: 'Luckiest Guy', cursive;
    font-size: 28px;
    color: white;
}

nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    background: #000;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav a { color: white; text-decoration: none; font-weight: bold; font-size: 13px; cursor: pointer; }

.main-layout { display: flex; flex: 1; }

/* GRID DE PRODUCTOS: 2 columnas en móvil */
.container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
    flex: 1;
    margin-right: 320px;
}

.card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #d6d600;
    text-align: center;
    padding-bottom: 10px;
}

.card img { width: 100%; height: 110px; object-fit: cover; }
.card h3 { font-size: 14px; margin: 5px; }
.card p { font-size: 12px; margin: 3px; color: #555; }

.controls { display: flex; justify-content: center; align-items: center; gap: 8px; }
.controls button {
    background: #d6d600;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

/* CARRITO ESCRITORIO */
#cart {
    position: fixed;
    right: 0; top: 0; width: 320px; height: 100%;
    background: white;
    border-left: 4px solid #d6d600;
    padding: 20px;
    z-index: 2000;
    transition: 0.3s;
}

.cart-header { display: flex; justify-content: space-between; align-items: center; }
.close-cart { display: none; font-size: 25px; border: none; background: none; cursor: pointer; }

/* BOTÓN FLOTANTE */
.cart-mobile-btn {
    display: none;
    position: fixed;
    bottom: 20px; right: 20px;
    background: #1a1a1a; color: #d6d600;
    width: 60px; height: 60px; border-radius: 50%;
    z-index: 1500; justify-content: center; align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#cart-count {
    position: absolute; top: 0; right: 0;
    background: red; color: white; border-radius: 50%;
    padding: 2px 6px; font-size: 12px;
}

.total-container { background: #f1f1f1; padding: 10px; border-radius: 8px; text-align: center; margin: 10px 0; }
input { width: 100%; padding: 10px; margin-bottom: 8px; border-radius: 5px; border: 1px solid #ddd; box-sizing: border-box; }
.whatsapp { background: #25d366; color: white; padding: 12px; display: block; text-align: center; text-decoration: none; border-radius: 5px; font-weight: bold; }
.whatsapp.disabled { background: #ccc; pointer-events: none; }

#overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1800; }

footer { background: #000; color: white; text-align: center; padding: 15px; margin-right: 320px; font-size: 12px; }

/* AJUSTES MÓVIL */
@media (max-width: 1000px) {
    .container, footer { margin-right: 0; }
    .cart-mobile-btn { display: flex; }
    #cart { right: -100%; width: 85%; }
    #cart.active { right: 0; }
    #overlay.active { display: block; }
    .close-cart { display: block; }
}

@media (min-width: 768px) {
    .container { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .card img { height: 150px; }
}