:root {
    --amarillo: #f2b705;
    --verde: #25d366;
    --negro: #000;
    --gris: #121212;
    --fuente: 'Poppins', sans-serif;
}

body { margin: 0; font-family: var(--fuente); background: var(--negro); color: white; overflow-x: hidden; }

/* Header y Nav */
.main-header { text-align: center; padding: 25px 20px 10px; }
.logo-principal { width: 80px; border-radius: 50%; }
.brand-name { color: var(--amarillo); margin: 0; font-size: 2rem; font-weight: 700; }
.sticky-nav { position: sticky; top: 0; background: var(--negro); z-index: 100; padding: 10px 0; }
.search-box { display: flex; justify-content: center; padding: 0 15px; margin-bottom: 10px; }
#busqueda { width: 100%; max-width: 450px; padding: 12px 20px; border-radius: 25px; border: 1px solid #333; background: #111; color: white; outline: none; }

/* Categorías en Doble Fila */
.category-bar-double { 
    display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; 
    gap: 10px; padding: 10px 15px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.category-bar-double::-webkit-scrollbar { display: none; }
.cat-bubble { 
    display: flex; align-items: center; gap: 8px; background: #1a1a1a; 
    padding: 8px 16px; border-radius: 20px; cursor: pointer; border: 1px solid #333;
    transition: 0.3s; color: #ccc; white-space: nowrap; font-size: 0.85rem;
}
.cat-bubble:hover { background: #222; border-color: var(--amarillo); transform: translateY(-2px); }
.cat-bubble.active { background: var(--amarillo); color: black; font-weight: 600; border-color: var(--amarillo); }

/* Grid de Productos */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 15px; padding: 15px; }
.card { background: var(--gris); padding: 12px; border-radius: 15px; border: 1px solid #222; text-align: center; cursor: pointer; transition: 0.3s; }
.card:hover { border-color: var(--amarillo); }
.card img { width: 100%; height: 140px; object-fit: contain; background: white; border-radius: 10px; }
.precio { color: var(--amarillo); font-weight: 700; font-size: 1.1rem; margin: 10px 0; }
.btn-add { background: var(--amarillo); border: none; padding: 10px; width: 100%; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* BOTÓN FLOTANTE (Recuperado) */
#cart-float { 
    position: fixed; bottom: 25px; right: 25px; background: var(--amarillo); 
    width: 65px; height: 65px; border-radius: 50%; display: flex; 
    justify-content: center; align-items: center; cursor: pointer; 
    z-index: 1500; color: black; font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); transition: 0.3s;
}
#cart-float:hover { transform: scale(1.1); }
#cantidad-badge { font-size: 1rem; font-weight: 800; margin-left: 5px; }

/* Carrito Lateral */
.cart-sidebar { position: fixed; right: -100%; top: 0; width: 350px; height: 100%; background: #0a0a0a; transition: 0.4s; z-index: 2000; display: flex; flex-direction: column; box-shadow: -5px 0 15px rgba(0,0,0,0.5); }
.cart-sidebar.open { right: 0; }
.cart-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #222; }
.btn-close { background: none; border: none; color: white; font-size: 28px; cursor: pointer; }
.cart-body { flex: 1; overflow-y: auto; padding: 15px; }

/* Botones +/- dentro del carrito */
.qty-btn { background: var(--amarillo); border: none; width: 28px; height: 28px; border-radius: 5px; font-weight: bold; cursor: pointer; margin: 0 8px; }

/* Modal Detalle */
.modal { display: none; position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-content { background: #1a1a1a; width: 90%; max-width: 450px; border-radius: 20px; padding: 25px; position: relative; border: 1px solid #333; text-align: center; }
.modal-close { position: absolute; top: 15px; right: 15px; background: none; border: none; color: white; font-size: 24px; cursor: pointer; }
#modal-body img { width: 100%; max-height: 250px; object-fit: contain; background: white; border-radius: 15px; margin-bottom: 15px; }

/* Footer del carrito */
.cart-footer { padding: 20px; border-top: 1px solid #222; }
.total-container { display: flex; justify-content: space-between; margin-bottom: 15px; font-size: 1.3rem; font-weight: bold; color: var(--amarillo); }
.btn-whatsapp { width: 100%; padding: 15px; background: var(--verde); color: white; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 1rem; }

@media (max-width: 768px) {
    .products-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .cart-sidebar { width: 100%; }
}