/* --- VARIABLES ACTUALIZADAS: CAVI HOGAR --- */
:root {
    --primary: #2A9D8F;       /* Verde principal del logo */
    --secondary: #264653;     /* Verde oscuro/azulado para contrastes */
    --accent: #E7F3F1;        /* Fondo sutil verde claro */
    --bg-light: #FDFDFD;      /* Fondo general limpio */
    --text-dark: #2A363B;     /* Texto oscuro legible */
    --font-main: 'Quicksand', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); background-color: var(--bg-light); color: var(--text-dark); }

/* --- HEADER PC --- */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 50px; 
    background: #fff; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    position: relative; 
    z-index: 9999;
}
.logo a { font-size: 28px; font-weight: 700; color: var(--primary); text-decoration: none; }

.menu-toggle { 
    display: none; 
    background: none; 
    border: none; 
    color: var(--primary); 
    cursor: pointer; 
}

.nav-links { 
    display: flex; 
    align-items: center; 
}
.nav-links a { 
    margin-left: 25px; 
    text-decoration: none; 
    color: var(--text-dark); 
    font-weight: 600; 
    transition: color 0.3s; 
}
.nav-links a:hover { color: var(--primary); }
.cart-btn { 
    background: var(--primary); 
    padding: 8px 15px; 
    border-radius: 20px; 
    color: #fff !important;
}

/* --- MENÚ DESPLEGABLE PARA CELULARES --- */
@media (max-width: 850px) {
    .navbar { padding: 15px 20px; }
    .menu-toggle { display: block; }
    
    .nav-links {
        display: none; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    
    .nav-links.active { display: flex; }
    
    .nav-links a {
        margin: 0;
        padding: 15px 20px;
        text-align: center;
        border-bottom: 1px solid #f5f5f5;
        font-size: 18px;
    }
    
    .cart-btn {
        background: var(--secondary);
        color: #fff !important;
        border-radius: 0;
    }

    main { padding: 30px 20px; }
    .grid-container { gap: 20px; }
}

/* --- Layout & Utilities Generales --- */
main { min-height: 70vh; padding: 40px 50px; }
h1, h2 { color: var(--primary); margin-bottom: 20px; }
.btn { display: inline-block; background: var(--primary); color: #fff; padding: 12px 25px; text-decoration: none; border-radius: 25px; font-weight: 700; transition: 0.3s; border: none; cursor: pointer; }
.btn:hover { background: var(--secondary); }

.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-top: 30px; }
.card { background: #fff; padding: 20px; border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); text-align: center; border: 1px solid #f0f0f0; }
.img-placeholder { background: #f1f3f5; height: 200px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #adb5bd; margin-bottom: 15px; border: 2px dashed #dee2e6; }

/* --- Footer --- */
.footer { background: #fff; padding: 40px 50px 20px; border-top: 1px solid #eaeaea; }
.footer-container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-section h4 { margin-bottom: 15px; color: var(--primary); }
.footer-section a { text-decoration: none; color: var(--text-dark); }
.map-placeholder { background: #e9ecef; padding: 20px; border-radius: 10px; text-align: center; color: #6c757d; }
.footer-bottom { text-align: center; margin-top: 30px; font-size: 14px; color: #777; }
@media (max-width: 850px) { .footer { padding: 30px 20px 20px; } }

/* --- WhatsApp --- */
.whatsapp-btn { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; border-radius: 50%; box-shadow: 0 4px 10px rgba(0,0,0,0.15); transition: transform 0.3s; background: #25D366; display: flex; align-items: center; justify-content: center; color: white; z-index: 9999; }
.whatsapp-btn:hover { transform: scale(1.1); }

/* --- ESTILOS EN MODO OSCURO TRASLADADOS DEL HEADER --- */
body { background-color: #1e1a0a; color: #f5f0db; }
.navbar { background: #151207 !important; border-bottom: 1px solid #3d3514; box-shadow: 0 2px 10px rgba(0,0,0,0.4) !important; }
.logo a { color: var(--primary) !important; }
.nav-links a { color: #f5f0db !important; }
.nav-links a:hover { color: var(--primary) !important; }
.cart-btn { background: var(--primary) !important; color: #151207 !important; font-weight: 700; }
.menu-toggle { color: var(--primary) !important; }

@media (max-width: 850px) {
    .nav-links { background: #151207 !important; box-shadow: 0 5px 10px rgba(0,0,0,0.5) !important; }
    .nav-links a { border-bottom: 1px solid #3d3514 !important; color: #f5f0db !important; }
    .cart-btn { background: var(--primary) !important; color: #151207 !important; }
}

/* --- ESTILOS UNIFICADOS DEL PIE DE PÁGINA (DARK MODE) --- */
.site-footer {
    background: #151207; /* Fondo oscuro idéntico a la barra de navegación */
    color: #f5f0db;
    padding: 40px 20px;
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid #3d3514;
}

.footer-instagram-container {
    margin-bottom: 20px;
}

.btn-instagram-footer {
    color: var(--primary) !important; /* Acento unificado usando la variable del sitio */
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2d270f; /* Caja integrada a la paleta marrón oscura */
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid #4a3f18;
    transition: transform 0.2s;
}

.btn-instagram-footer:hover {
    transform: scale(1.05);
}

.footer-copyright {
    margin: 0;
    font-size: 14px;
    color: #b5af9a;
}

/* --- BOTÓN FLOTANTE DE WHATSAPP CON SAFE AREA DE IPHONE --- */
.whatsapp-btn-float {
    position: fixed;
    /* Adapta el botón de forma automática si existe la barra inferior de Safari en iOS */
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 29px;
    background: #25D366;
    color: white;
    width: 69px;
    height: 69px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    text-decoration: none;
    z-index: 99998;
    box-sizing: border-box;
    transition: transform 0.2s;
    margin: 0;
    padding: 0;
}

.whatsapp-btn-float:hover {
    transform: scale(1.1);
}


/* --- COMPONENTES ADICIONALES MODO OSCURO DE LA TIENDA --- */
.tienda-section {
    padding: 20px 10px;
}
.tienda-subtitle {
    margin-bottom: 25px; 
    color: #bbb;
}
.badge-destacado {
    position: absolute; 
    top: 10px; 
    left: 10px; 
    background: var(--primary); 
    color: white; 
    padding: 4px 12px; 
    font-size: 11px; 
    font-weight: 700; 
    border-radius: 20px; 
    z-index: 50; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.txt-categoria {
    font-size: 13px; 
    color: var(--primary); 
    font-weight: 700; 
    text-transform: uppercase;
}
.producto-titulo {
    margin: 5px 0 10px; 
    font-size: 1.3rem; 
    color: white;
}
.producto-descripcion {
    font-size: 14px; 
    color: #ccc; 
    margin-bottom: 15px; 
    height: 40px; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
}
.card-footer-action {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-top: auto; 
    gap: 10px;
}
.producto-precio {
    color: var(--primary); 
    font-weight: bold; 
    font-size: 1.4rem; 
    white-space: nowrap;
}
.msg-alerta-filtros {
    text-align: center; 
    width: 100%; 
    padding: 40px 0; 
    color: #888;
}

/* --- OPTIMIZACIÓN DE RENDERIZADO Y CLS --- */
.carousel-container {
    position: relative; 
    height: 250px; 
    background: #151207; 
    border-radius: 12px; 
    overflow: hidden; 
    margin-bottom: 15px;
    aspect-ratio: 300 / 250; /* Reserva de espacio exacta en layout */
}
.carousel-slide {
    position: absolute; 
    width: 100%; 
    height: 100%; 
    opacity: 0; 
    z-index: 0;
    transition: opacity 0.4s ease;
}
.carousel-slide.active {
    opacity: 1 !important;
    z-index: 1 !important;
}
.carousel-slide img {
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

/* --- AGRANDADO DE ZONAS TÁCTILES MÍNIMAS (44X44PX) --- */
.carousel-arrow {
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(21,18,7,0.8); 
    color: white; 
    border: none; 
    width: 44px !important; 
    height: 44px !important; 
    border-radius: 50%; 
    font-weight: bold; 
    cursor: pointer; 
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-arrow.prev { left: 10px; }
.carousel-arrow.next { right: 10px; }

.modal-nav-arrow {
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(0,0,0,0.6); 
    color: white; 
    border: none; 
    width: 46px !important; 
    height: 46px !important; 
    border-radius: 50%; 
    font-size: 18px; 
    font-weight: bold; 
    cursor: pointer; 
    z-index: 100000;
}
#modalPrevBtn { left: 15px; }
#modalNextBtn { right: 15px; }

/* --- COMPONENTE DE NOTIFICACIONES TOAST NO BLOQUEANTE --- */
#toast-container {
    position: fixed; 
    top: 20px; 
    right: 20px; 
    z-index: 100005; 
    display: flex; 
    flex-direction: column; 
    gap: 10px;
}
.toast-alert-item {
    background: #2A9D8F; 
    color: white; 
    padding: 14px 24px; 
    border-radius: 8px; 
    font-weight: 600; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
    font-size: 14px;
    animation: slideInToast 0.3s ease forwards;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.toast-alert-item.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}
@keyframes slideInToast {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- BOTÓN FLOTANTE CARRITO COMPLEMENTARIO --- */
.carrito-btn-float {
    position: fixed; 
    bottom: 99px; 
    right: 29px; 
    background: #2A9D8F; 
    color: white; 
    width: 69px; 
    height: 69px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 35px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.4); 
    text-decoration: none; 
    z-index: 99998; 
    box-sizing: border-box; 
    transition: transform 0.2s;
}
.carrito-btn-float:hover {
    transform: scale(1.1);
}

/* --- DISEÑO COMPACTO DEL MODAL --- */
.modal-body-wrapper {
    background: #2d270f; 
    border: 1px solid #3d3514; 
    width: 100%; 
    max-width: 900px; 
    border-radius: 16px; 
    overflow: hidden; 
    display: grid; 
    grid-template-columns: 1.2fr 1fr; 
    position: relative; 
    max-height: 90vh; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.modal-close-btn {
    position: absolute; 
    top: 15px; 
    right: 20px; 
    color: #f5f0db; 
    font-size: 35px; 
    font-weight: bold; 
    cursor: pointer; 
    z-index: 100000; 
    line-height: 1;
    background: none;
    border: none;
}
.modal-visual-column {
    position: relative; 
    background: #151207; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    height: 100%; 
    min-height: 300px; 
    max-height: 50vh;
}
#imgModal {
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    max-height: 50vh;
}
#modalContador {
    position: absolute; 
    bottom: 15px; 
    color: white; 
    font-size: 14px; 
    font-weight: 600; 
    background: rgba(0,0,0,0.7); 
    padding: 4px 12px; 
    border-radius: 20px;
}
.modal-info-column {
    padding: 25px 20px; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    overflow-y: auto; 
    text-align: left; 
    box-sizing: border-box;
}
#modalProdNombre { color: white; font-size: 1.6rem; margin-bottom: 10px; font-weight: 700; line-height: 1.2; }
#modalProdPrecio { color: var(--primary); font-weight: 700; font-size: 1.6rem; margin-bottom: 15px; }
.modal-descripcion-container { border-top: 1px solid #3d3514; padding-top: 15px; margin-bottom: 20px; }
.modal-descripcion-container h4 { font-size: 14px; text-transform: uppercase; color: var(--primary); margin-bottom: 8px; font-weight: 700; }
#modalProdDescripcion { font-size: 14px; color: #f5f0db; line-height: 1.5; white-space: pre-line; }
/* --- ESTILOS COMPLEMENTARIOS CARRITO MODO OSCURO --- */
.carrito-section-wrapper {
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 20px 10px;
}
.section-subtitle {
    color: #bbb; 
    margin-bottom: 30px;
}
.table-carrito-global {
    width: 100%; 
    border-collapse: collapse; 
    text-align: left;
}
.div-separador-medios-pago {
    margin-top: 30px; 
    padding-top: 20px; 
    border-top: 2px solid #3d3514;
}
.label-medio-pago-title {
    font-weight: 700; 
    font-size: 16px; 
    display: block; 
    margin-bottom: 15px;
}
.margin-top-15 {
    margin-top: 15px;
}
.carrito-actions-footer {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 15px;
}
.btn-volver {
    width: auto; 
    padding: 12px 30px; 
    display:inline-block; 
    text-decoration:none; 
    border-radius:25px; 
    font-weight:700;
}
.btn-finalizer {
    background: #25D366; 
    width: auto; 
    padding: 15px 35px; 
    font-size: 1.1rem; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    color: white; 
    border:none; 
    border-radius:25px; 
    cursor:pointer; 
    font-weight:700; 
    font-family:inherit;
}
.success-icon, .empty-cart-icon {
    font-size: 60px; 
    margin-bottom: 20px;
}

/* Clases específicas para el Toast de Error */
.toast-error {
    background: #e76f51 !important; /* Tonalidad rojiza para denotar advertencia */
}
/* --- COMPONENTES ADICIONALES DE INFORMACIÓN COMERCIAL EN EL FOOTER --- */
.footer-info-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 30px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.footer-info-block {
    flex: 1;
    min-width: 250px;
}

.footer-info-block h4 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
}

.footer-info-block p {
    margin: 4px 0;
    font-size: 14px;
    color: #e5dfc9;
    line-height: 1.5;
}

.footer-link-tel {
    color: #e5dfc9;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-link-tel:hover {
    color: var(--primary);
}

/* Ajuste responsivo extra para pantallas muy chicas */
@media screen and (max-width: 650px) {
    .footer-info-grid {
        flex-direction: column;
        gap: 25px;
    }
}

/* --- PÁGINA DE INICIO / NOSOTROS --- */
.home-hero,
.home-about,
.home-values,
.home-cta {
    width: min(1180px, 100%);
    margin-inline: auto;
}

.home-hero {
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    align-items: center;
    gap: clamp(35px, 6vw, 85px);
    padding: 45px 0 70px;
}

.home-eyebrow {
    display: inline-block;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.home-hero h1 {
    max-width: 720px;
    font-size: clamp(2.7rem, 6vw, 5.8rem);
    line-height: .98;
    letter-spacing: -.055em;
    margin-bottom: 26px;
}

.home-hero__content > p {
    max-width: 650px;
    color: #d8d1b9;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.75;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.btn-secondary {
    background: transparent;
    color: #f5f0db;
    border: 1px solid #5b512c;
}

.btn-secondary:hover {
    background: #2d270f;
    color: #fff;
}

.home-hero__visual {
    position: relative;
    min-width: 0;
}

.home-hero__visual::before {
    content: "";
    position: absolute;
    inset: -22px 30px 35px -22px;
    border: 1px solid #514722;
    border-radius: 28px;
}

.home-hero__visual img {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 24px;
    background: #fff;
}

.home-hero__badge {
    position: absolute;
    right: -18px;
    bottom: -25px;
    width: min(280px, 80%);
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--primary);
    color: #10201d;
    box-shadow: 0 15px 40px rgba(0,0,0,.35);
}

.home-hero__badge strong,
.home-hero__badge span {
    display: block;
}

.home-hero__badge span {
    margin-top: 4px;
    font-size: .86rem;
}

.home-about {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
    gap: clamp(35px, 7vw, 100px);
    padding: 90px 0;
    border-top: 1px solid #3d3514;
}

.home-about h2,
.home-cta h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.08;
}

.home-about__copy {
    color: #ddd6c0;
    font-size: 1.08rem;
    line-height: 1.8;
}

.home-about__copy p + p {
    margin-top: 20px;
}

.home-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding-bottom: 90px;
}

.home-value {
    padding: 28px;
    background: #27220e;
    border: 1px solid #433918;
    border-radius: 18px;
}

.home-value > span {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 22px;
    border-radius: 50%;
    background: rgba(42,157,143,.14);
    color: var(--primary);
    font-size: 1.3rem;
}

.home-value h3 {
    margin-bottom: 10px;
    color: #fff;
}

.home-value p {
    color: #bdb59d;
    line-height: 1.65;
}

.home-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 50px;
    border-radius: 24px;
    background: #2d270f;
    border: 1px solid #4a3f18;
}

@media (max-width: 850px) {
    .home-hero {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 20px 0 65px;
    }
    .home-hero__visual {
        width: min(580px, calc(100% - 12px));
        margin: 15px auto 0;
    }
    .home-about {
        grid-template-columns: 1fr;
        padding: 70px 0;
    }
    .home-values {
        grid-template-columns: 1fr;
        padding-bottom: 70px;
    }
    .home-cta {
        align-items: flex-start;
        flex-direction: column;
        padding: 32px 24px;
    }
}

@media (max-width: 520px) {
    main { padding-inline: 16px; overflow-x: clip; }
    .home-hero h1 { font-size: clamp(2.45rem, 13vw, 3.7rem); }
    .home-actions { flex-direction: column; }
    .home-actions .btn { width: 100%; text-align: center; }
    .home-hero__visual::before { inset: -10px 18px 22px -10px; }
    .home-hero__badge { right: -5px; bottom: -30px; }
    .whatsapp-btn-float,
    .carrito-btn-float {
        right: 16px;
        width: 58px;
        height: 58px;
        font-size: 28px;
    }
    .carrito-btn-float { bottom: 88px; }
}
