* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    min-height: 100vh;
    display: flex; 
    flex-direction: column; 
}

main {
    flex-grow: 1; 
}


/* HEADER */
.header {
    background-color: #00B5E2; /* CAMBIO DE COLOR: Cian/Azul */ 
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center; 
    justify-content: space-between; 
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.logo p {
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- BOTÓN QUIÉNES SOMOS (ESTILO PASTIILA) --- */
.btn-quienes-somos {
    text-decoration: none;
    color: #333; 
    font-weight: 700; 
    padding: 8px 20px; 
    border-radius: 20px; 
    background-color: #fff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); 
    transition: all 0.2s ease; 
    font-size: 15px; 
    white-space: nowrap; 
    
    margin: 0 auto; 
    flex-shrink: 0; 
}

.btn-quienes-somos:hover {
    background-color: #f0f0f0; 
    box-shadow: 0 3px 8px rgba(0,0,0,0.2); 
    transform: translateY(-1px); 
}
/* ----------------------------------------------- */

/* Contenedor del botón de filtros + menú */
.filtros-wrapper {
    position: relative; 
}

/* BOTÓN CARRITO */
.cart-button {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background-color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cart-button #cart-count {
    background-color: #3483fa;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}

/* BOTÓN FILTROS */
.btn-filtros {
    border: none;
    background-color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    white-space: nowrap; 
}

/* BARRA DEL BUSCADOR + FILTROS (Desktop) */
.filtros {
    padding: 12px 20px;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: center; 
    gap: 15px; 
}

.filtros-buscador {
    flex-grow: 1; 
    max-width: 600px; 
}

.filtros-buscador input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* MENÚ DESPLEGABLE DE FILTROS (debajo del botón "Filtros") */
.filtros-contenido {
    position: absolute;
    top: calc(100% + 6px);
    right: 0; 
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 230px;
    z-index: 120;
}

.filtros-contenido select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* LISTA DE PRODUCTOS */
.contenedor {
    padding: 20px;
}

.lista-productos {
    display: grid;
    /* Grid default para escritorio */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
}

/* TARJETA PRODUCTO */
.tarjeta-producto {
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
    cursor: pointer;
}

.tarjeta-producto:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.tarjeta-producto img {
    max-width: 100%;
    height: 170px;
    object-fit: contain;
    margin: 0 auto;
}

.tarjeta-producto h3 {
    font-size: 16px;
    font-weight: 600;
}

.descripcion {
    font-size: 14px;
    color: #555;
}

.precio {
    font-size: 18px;
    font-weight: 700;
    color: #00a650; /* verde precio */
}

.envios {
    font-size: 12px;
    color: #666;
}

.envios span {
    display: inline-block;
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 2px 4px 0 0;
}

.stock {
    font-size: 13px;
    color: #777;
}

/* CONTENEDOR DE BOTONES EN LA TARJETA */
.btn-agregar-contenedor {
    margin-top: auto;
}

.acciones-producto {
    display: flex;
    gap: 8px;
}

.acciones-producto button {
    flex: 1;
}

/* BOTONES GENERALES */
.btn-agregar {
    width: 100%;
    border: none;
    background-color: #3483fa;
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-agregar:hover {
    background-color: #2968c8;
}

.btn-comprar-ahora {
    width: 100%;
    border: none;
    background-color: #00a650;
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-comprar-ahora:hover {
    background-color: #008f4f;
}

/* Botón cuando el producto está agotado */
.btn-agotado {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
}

/* Botón principal genérico */
.btn-principal {
    text-decoration: none;
    display: inline-block;
    background-color: #00a650;
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-principal:hover {
    background-color: #008f4f;
}

.btn-secundario {
    background-color: #e0e0e0;
    color: #333;
    padding: 8px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-secundario:hover {
    background-color: #ccc;
}

.deshabilitado {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* CLASE GENERAL PARA OCULTAR */
.oculto {
    display: none !important;
}

/* CARRITO (PANEL LATERAL) */
.carrito-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 90;
}

.carrito-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 8px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.carrito-header {
    padding: 15px 15px 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.carrito-header h2 {
    font-size: 18px;
}

.btn-cerrar-carrito {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

.carrito-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.carrito-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.carrito-item-info h4 {
    font-size: 14px;
    font-weight: 600;
}

.carrito-precio-unitario {
    font-size: 13px;
    color: #555;
}

.carrito-item-controles {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.btn-cantidad {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    cursor: pointer;
}

.btn-eliminar {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    margin-left: auto;
}

.carrito-cantidad {
    min-width: 20px;
    text-align: center;
}

.carrito-subtotal {
    font-weight: 600;
}

.carrito-footer {
    border-top: 1px solid #eee;
    padding: 10px 15px 15px;
}

.carrito-total-text {
    font-weight: 600;
    margin-bottom: 10px;
}

.carrito-envio {
    margin-bottom: 10px;
    font-size: 13px;
}

.carrito-envio label {
    display: block;
    margin-bottom: 4px;
}

.carrito-envio select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.carrito-acciones {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.carrito-acciones .btn-principal,
.carrito-acciones .btn-secundario {
    flex: 1;
}

.carrito-ayuda {
    font-size: 11px;
    color: #777;
}

/* DETALLE DE PRODUCTO (MODAL) */
.detalle-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 80;
}

.detalle-panel {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 81;
    padding: 15px;
}

.detalle-panel-contenido {
    background-color: #fff;
    max-width: 900px;
    width: 100%;
    max-height: 95vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
}

.detalle-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detalle-header h2 {
    font-size: 18px;
}

.btn-cerrar-detalle {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

.detalle-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr);
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
}

.detalle-imagen-contenedor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px; 
}

.detalle-imagen-contenedor img {
    max-width: 100%;
    height: auto;
    display: block;
    max-height: 350px;
    object-fit: contain;
}

.detalle-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.detalle-precio {
    font-size: 22px;
    font-weight: 700;
    color: #00a650;
}

.detalle-stock {
    font-size: 13px;
    color: #777;
}

.detalle-descripcion {
    margin-top: 4px;
}

.detalle-lista {
    padding-left: 18px;
}

.detalle-lista li {
    margin-bottom: 2px;
}

.detalle-envios-titulo {
    margin-top: 6px;
    font-weight: 600;
}

.detalle-envios {
    padding-left: 18px;
    font-size: 13px;
}

.detalle-envios li {
    margin-bottom: 2px;
}

.detalle-botones {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

/* FOOTER */
footer {
    margin-top: auto;
}


/* Controles Carrusel */
.detalle-imagen-controles {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.detalle-nav {
    border-radius: 50%;
    border: 1px solid #ccc;
    background-color: #ffffff;
    padding: 8px 14px;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.detalle-nav:hover {
    filter: brightness(0.95);
}

.detalle-indicador {
    font-size: 13px;
    color: #555;
}


/* Ocultar el botón de filtros en el header (se usa solo el de la barra de búsqueda) */
.header .filtros-wrapper {
    display: none;
}


/* --- SECCIÓN QUIÉNES SOMOS / CONTACTO (Para quienes-somos.html) --- */
.contenedor-quienes-somos {
    padding: 20px;
    flex-grow: 1; 
    display: flex; 
    flex-direction: column;
}

.quienes-somos {
    display: grid; /* Mantenemos el grid para las columnas en desktop */
    grid-template-columns: 1.5fr 1fr; 
    gap: 40px; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 30px; 
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); 
    flex-grow: 1; /* Permite que el contenedor del contenido crezca */
    min-height: 100%; 
}

/* Hacemos que la información de contacto crezca */
.info-contacto {
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
    justify-content: space-between; 
}

/* Hacemos que el mapa crezca */
.mapa-ubicacion {
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
    justify-content: space-between; 
}

/* Hacemos que el iframe del mapa tome la altura disponible */
.mapa-ubicacion iframe {
    width: 100%;
    flex-grow: 1; /* El iframe ocupa el espacio restante */
    height: auto; /* Desactivamos la altura fija para que flex-grow funcione */
    min-height: 200px; /* Altura mínima para que no desaparezca */
    display: block;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-bottom: 10px; 
}

.quienes-somos h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.quienes-somos h3 {
    font-size: 16px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 600;
}

.descripcion-somos {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.redes-contacto {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.redes-contacto p {
    font-size: 14px;
    margin-bottom: 6px;
}

/* Estilos de botones de redes */
.btn-red-whatsapp, .btn-red-facebook, .btn-red-instagram, .btn-red-tiktok {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    margin-bottom: 10px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.2s;
}

.btn-red-whatsapp {
    background-color: #25d366;
    color: white;
}
.btn-red-whatsapp:hover { opacity: 0.9; }

.btn-red-facebook {
    background-color: #1877f2;
    color: white;
}
.btn-red-facebook:hover { opacity: 0.9; }

/* INSTAGRAM */
.btn-red-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
    color: white;
}
.btn-red-instagram:hover { opacity: 0.9; }

/* TIKTOK */
.btn-red-tiktok {
    background-color: #000000; 
    color: white;
}
.btn-red-tiktok:hover { opacity: 0.9; }


.btn-red-whatsapp img, .btn-red-facebook img, .btn-red-instagram img, .btn-red-tiktok img {
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
}

.nota-mapa {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}


/* RESPONSIVE */
@media (max-width: 800px) {
    .detalle-body {
        grid-template-columns: 1fr;
    }
}

/* AJUSTE RESPONSIVE para Quiénes Somos */
@media (max-width: 768px) {
    .quienes-somos {
        grid-template-columns: 1fr; 
        gap: 20px;
        display: flex; 
        flex-direction: column; 
    }
    
    .contenedor-quienes-somos {
        padding: 10px;
    }

    /* En móvil, el mapa también debe estirarse */
    .mapa-ubicacion iframe {
        min-height: 200px; 
    }
}


/* === MODIFICACIÓN PARA MÓVILES (600PX O MENOS) === */
@media (max-width: 600px) { 
    
    /* 1. HEADER: Ajuste de posición del botón QUIÉNES SOMOS */
    .header {
        flex-direction: row; 
        align-items: center; 
        padding: 10px 15px;
        justify-content: space-between; 
    }

    .logo {
        text-align: left;
        margin-bottom: 0;
        flex-grow: 1; 
        min-width: unset;
    }
    
    .logo h1 {
        font-size: 20px; 
    }
    
    .logo p {
        font-size: 12px;
    }
    
    .btn-quienes-somos {
        padding: 6px 15px; 
        font-size: 13px;
        margin: 0 auto; 
        flex-shrink: 0; 
    }

    /* 2. BARRA DE BUSCADOR + FILTROS: MANTENEMOS EN FILA Y AJUSTAMOS TAMAÑOS */
    .filtros {
        padding: 10px 15px;
        flex-direction: row; 
        gap: 8px; 
        align-items: center; 
    }
    
    .filtros-buscador {
        max-width: 100%;
        flex-grow: 1; 
    }
    
    .filtros-buscador input {
        padding: 6px 8px; 
        font-size: 13px;
    }
    
    .filtros .filtros-wrapper {
        width: auto; 
        flex-shrink: 0; 
    }
    
    .btn-filtros {
        padding: 6px 10px; 
        font-size: 13px;
    }
    
    /* El menú desplegable de filtros se alinea a la derecha del botón */
    .filtros-contenido {
        right: 0;
        left: auto; 
        width: 200px; 
        min-width: unset;
        max-width: unset;
    }


    /* 3. Ajustes de la lista de productos (para que sean 2 columnas) */
    .lista-productos {
        grid-template-columns: 1fr 1fr; 
        gap: 10px;
    }
    
    .contenedor {
        padding: 10px; 
    }
    
    .tarjeta-producto {
        padding: 8px; 
    }
    
    .tarjeta-producto img {
        height: 120px; 
    }

    .acciones-producto {
        flex-direction: column; 
        gap: 4px;
    }
    .acciones-producto button {
        padding: 6px 8px;
        font-size: 13px;
    }
}
/* ============================================================= */






/* === MODIFICACIÓN PARA MÓVILES (600PX O MENOS) === */
@media (max-width: 600px) { 
    
    /* 1. HEADER: Apilamos el logo y los elementos de la derecha, y dejamos espacio */
    .header {
        /* ... (resto sin cambios) ... */
        padding: 10px 15px; /* Reducimos el padding */
        flex-wrap: wrap; /* Permitimos que los elementos se envuelvan a la línea de abajo */
    }
    
    /* 2. LOGO: Ocupa su espacio y empuja el carrito a la derecha */
    .logo {
        flex-grow: 1; /* Permite que empuje al botón Quiénes Somos */
        margin-right: 10px; /* Separación del carrito */
    }
    
    /* 3. BOTÓN QUIÉNES SOMOS: Lo forzamos a la siguiente línea y lo alineamos a la izquierda */
    .btn-quienes-somos {
        /* Revertimos el centrado automático del header */
        margin: 5px 0 0 0; /* Margen superior para separarlo de la línea de arriba */
        width: 100%; /* Ocupa todo el ancho disponible */
        order: 10; /* Lo empujamos al final del flex-flow */
        
        /* Mantenemos el estilo pastilla pero reducimos el tamaño en móvil */
        padding: 6px 15px; 
        font-size: 13px;
        text-align: center; 
    }
    
    /* 4. HEADER RIGHT (CARRITO): Permite que el carrito se mantenga a la derecha, en la línea superior */
    .header-right {
        order: 5; /* Aseguramos que se mantenga a la derecha del logo */
        flex-shrink: 0;
    }

    /* ... (resto de estilos de móvil sin cambios) ... */
}