:root {
    --primary: #2563EB;
    --secondary: #F3F4F6;
    --accent: #FFD700;
    --text: #1F2937;
    --white: #ffffff;
    --danger: #EF4444;
    --success: #25D366;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }
body { background-color: #f9fafb; padding-bottom: 80px; }

header { background: var(--primary); color: white; padding: 1rem 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.header-content { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.brand h1 { font-size: 1.5rem; font-weight: 600; }

.marca-titulo {
    font-weight: 900; /* Letra muy gorda */
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3); /* Sombra para profundidad */
}

.pasos-compra {
    background-color: #fff3cd; /* Amarillo suave tipo "nota" */
    color: #856404;
    padding: 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 20px;
    border: 1px solid #ffeeba;
}

.search-bar { background: white; border-radius: 50px; padding: 0.5rem 1rem; display: flex; align-items: center; width: 100%; max-width: 500px; }
.search-bar input { border: none; outline: none; width: 100%; margin-left: 10px; font-size: 1rem; }

.cat-btn { border: 1px solid #e5e7eb; background: white; padding: 5px 15px; border-radius: 20px; cursor: pointer; transition: 0.3s; }
.cat-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.container { max-width: 1200px; margin: 0 auto; padding: 10px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; margin-top: 20px; }

.card { background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); display: flex; flex-direction: column; }
.card-img { width: 100%; height: 160px; object-fit: contain; background: #fff; padding: 10px; border-bottom: 1px solid #f3f4f6; }
.card-body { padding: 10px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-title { font-size: 0.9rem; font-weight: 500; margin-bottom: 5px; color: var(--text); line-height: 1.2; }
.card-meta { font-size: 0.75rem; color: #6b7280; margin-bottom: 5px; }
.card-price { font-weight: 700; color: var(--primary); font-size: 1rem; display: block; margin-bottom: 10px; }
.price-input { width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 5px; font-size: 0.9rem; }

.qty-control { display: flex; align-items: center; justify-content: space-between; background: var(--secondary); border-radius: 8px; overflow: hidden; }
.qty-btn { width: 30px; height: 30px; border: none; background: #e5e7eb; font-weight: bold; cursor: pointer; color: var(--primary); font-size: 1.2rem; }
.qty-btn:active { background: #d1d5db; }
.qty-val { font-weight: 600; font-size: 1rem; width: 30px; text-align: center; }

.cart-floater { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: white; padding: 15px 20px; border-radius: 50px; display: flex; align-items: center; gap: 15px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); cursor: pointer; z-index: 1000; transition: transform 0.2s; }
.cart-floater:hover { transform: scale(1.05); }
.badge { background: var(--danger); color: white; padding: 2px 6px; border-radius: 50%; font-size: 0.8rem; position: absolute; top: 5px; left: 35px; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: flex-end; }
.modal.open { display: flex; }
.modal-content { background: white; width: 100%; max-width: 600px; border-radius: 20px 20px 0 0; max-height: 90vh; display: flex; flex-direction: column; animation: slideUp 0.3s ease-out; }
.modal-header { padding: 15px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.cart-items { padding: 15px; overflow-y: auto; flex-grow: 1; }
.cart-summary { padding: 20px; background: #f9fafb; border-top: 1px solid #e5e7eb; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.9rem; }
.summary-row.total { font-weight: bold; font-size: 1.2rem; color: var(--text); border-top: 1px solid #ddd; padding-top: 10px; }

/* NUEVO: Estilos del Formulario */
.checkout-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
.checkout-form h3 { font-size: 1.1rem; margin-bottom: 15px; }
.checkout-form input { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.9rem; }
.checkout-form input:focus { outline: none; border-color: var(--primary); }

.whatsapp-btn { width: 100%; background: var(--success); color: white; padding: 12px; border: none; border-radius: 10px; font-weight: 600; font-size: 1rem; cursor: pointer; margin-top: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.whatsapp-btn:hover { filter: brightness(0.95); }

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }


/* --- BARRA DE NAVEGACIÓN FIJA (STICKY) --- */
.category-nav {
    display: flex;
    justify-content: center; /* Centrado en PC */
    gap: 10px;
    padding: 10px;
    background-color: #ffffff; /* IMPORTANTE: Fondo blanco */
    
    /* LA MAGIA DEL PEGAMENTO: */
    position: sticky;
    top: 0;
    z-index: 1000; /* Para que flote encima de las fotos */
    
    /* Estética */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Sombrita elegante */
    overflow-x: auto; /* Permite deslizar a los lados en celulares pequeños */
    white-space: nowrap;
    border-bottom: 1px solid #eee;
}

/* Ajuste para móviles */
@media (max-width: 600px) {
    .category-nav {
        justify-content: flex-start; /* Alineado a la izquierda para hacer scroll */
        padding: 10px 15px;
    }
}