/* --- CONFIGURACIÓN BASE --- */
:root {
    --color-azul: #002B5C;   /* Azul Oscuro Electrobanda */
    --color-rojo: #E31C23;   /* Rojo Logotipo */
    --color-gris: #f4f4f4;
    --color-verde: #25D366;  /* WhatsApp */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-gris);
    color: #333;
    padding-bottom: 50px;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: auto;
}

/* --- ENCABEZADO --- */
header {
    background: white;
    padding: 15px 0;
    border-bottom: 4px solid var(--color-azul);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .logo img {
    max-height: 60px; /* Ajusta esto según tu logo */
    display: block;
    margin: auto;
}

/* --- LAYOUT PRINCIPAL (Dos Columnas) --- */
.layout-tienda {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
    align-items: flex-start; /* Evita que el sidebar se estire */
}

.catalogo {
    flex: 1 1 600px; /* Ocupa el espacio principal */
}

/* --- BARRA LATERAL (CARRITO) --- */
.sidebar-carrito {
    flex: 0 0 320px; /* Ancho fijo en PC */
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 110px; /* Se queda pegado al bajar */
    border-top: 5px solid var(--color-rojo);
}

.sidebar-carrito h3 { color: var(--color-azul); border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; }

/* Items del Carrito */
.item-lista {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 8px 0;
    border-bottom: 1px dotted #ccc;
}
.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--color-azul);
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px solid #eee;
}

/* --- GRILLA DE PRODUCTOS --- */
.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.producto-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--color-azul);
}

.img-container {
    height: 180px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-bottom: 1px solid #f9f9f9;
}

.img-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.info-container {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.info-container h3 {
    font-size: 1rem;
    color: #444;
    margin-bottom: 10px;
    font-weight: 600;
}

.precio {
    font-size: 1.4rem;
    color: var(--color-rojo);
    font-weight: bold;
    margin-bottom: 10px;
}

/* --- BOTONES --- */
.btn {
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s;
    width: 100%;
    display: block;
    font-size: 0.9rem;
}

.btn-azul { background: var(--color-azul); color: white; }
.btn-azul:hover { background: #001a38; }

.btn-whatsapp { background: var(--color-verde); color: white; font-size: 1.1rem; }
.btn-whatsapp:hover { background: #128C7E; }

.btn-vaciar {
    background: transparent;
    color: #999;
    font-size: 0.8rem;
    margin-top: 10px;
}
.btn-vaciar:hover { color: red; text-decoration: underline; }

/* --- RESPONSIVE (CELULARES) --- */
@media (max-width: 768px) {
    .sidebar-carrito {
        order: -1; /* Pone el carrito ARRIBA de todo en celular */
        flex: 1 1 100%; /* Ocupa todo el ancho */
        position: static; /* Ya no es sticky */
        margin-bottom: 20px;
    }
    .layout-tienda { flex-direction: column; }
}