/* --- VARIABLES Y RESET --- */
:root {
    --orange: #F35820;
    --black: #1d1d1f;
    --light-gray: #F4F4F4;
    --white: #FFFFFF;
    --text-color: #333;
    --font-title: 'Ubuntu', sans-serif;
    --font-body: 'Nunito', sans-serif;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
    --brand-color: var(--orange);

}
/* ================================================================
   STICKY FOOTER FIX
   ================================================================ */
   html {
    height: 100%;
  }
  
  body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }
  
  main {
    flex-grow: 1; /* o flex: 1; */
  }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-body); color: var(--text-color); background-color: var(--white); line-height: 1.6;  }
/* Padding solo para la página con el banner inferior */
.page-home {
  padding-bottom: calc(55px + 20px + env(safe-area-inset-bottom)); 
}
body.menu-open { overflow: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
h1, h2, h3, h4, h5 { font-family: var(--font-title); font-weight: 700; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* --- HEADER (BLANCO SATINADO CON BORDE INFERIOR) --- */
.main-header {
    background: linear-gradient(180deg, #FFFFFF 0%, #F9F9F9 100%);
    color: var(--text-color);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; /* Capa más alta */
    border-bottom: 1px solid #EAEAEA;
}
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 40px; width: auto; }

/* --- BARRA DE BÚSQUEDA CON BORDE NARANJA --- */
.search-bar { flex-grow: 1; margin: 0 2rem; position: relative; }
.search-bar input { 
    width: 100%; 
    padding: 0.75rem 1rem 0.75rem 2.5rem; 
    border-radius: 50px; 
    border: 1px solid var(--orange); /* Borde naranja */
    font-family: var(--font-body); 
    font-size: 1rem; 
}
.search-bar .search-icon { 
    position: absolute; 
    left: 1rem; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--orange); /* Lupa naranja */
}

/* --- BOTONES DE MI CUENTA Y CARRITO --- */
.header-icons { display: flex; gap: 0.5rem; align-items: center; }
/* Estilo base (borde naranja) */
.header-icons .desktop-icon,
.header-icons .account-menu > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--orange); /* Borde naranja inactivo */
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
/* Hover (fondo naranja, texto y borde blanco) */
.header-icons .desktop-icon:hover,
.header-icons .account-menu > a:hover {
    background-color: var(--orange); /* Fondo naranja hover */
    color: var(--white); /* Texto blanco hover */
    border-color: var(--orange); 
}
.header-icons .icon { width: 24px; height: 24px; }
.mobile-menu-toggle { display: none; cursor: pointer; background: none; border: none; color: var(--text-color); padding: 0; }
.mobile-menu-toggle .icon { width: 28px; height: 28px; }

/* --- ESTILOS DEL MENÚ DE CUENTA Y DROPDOWN (TEXTO VISIBLE) --- */
.account-menu { 
    position: relative; 
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px); /* Importante que vuelva a tener el +10px */
    right: 0;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    width: 220px;
    z-index: 1100;
    padding: 0.5rem 0; /* Padding original */
    border: 1px solid #eee;
}
.account-menu:hover .dropdown-menu { display: block; }
.dropdown-menu .dropdown-item { color: var(--text-color); }
.dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s;
}
.dropdown-item:hover { background-color: var(--light-gray); }
.dropdown-divider { height: 1px; background-color: #eee; margin: 0.5rem 0; }
.account-menu::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px; /* Se posiciona en la brecha de 10px */
    height: 10px; /* Cubre exactamente esa brecha */
    background-color: transparent; /* Es totalmente invisible */
}

/* --- NAVEGACIÓN PRINCIPAL (SUBMENÚ GRIS, TEXTO NARANJA) --- */
.main-nav { 
    background-color: var(--light-gray); 
    padding: 0.5rem 0; 
    border-bottom: 1px solid #ddd; 
    position: relative; 
    z-index: 998;
    margin-top: 75px; /* <-- AÑADE ESTA LÍNEA (Altura aprox. del header) */
}
.main-nav ul { list-style: none; display: flex; justify-content: center; gap: 2rem; padding: 0; }
.main-nav .nav-item { position: static; }
.main-nav > .container > ul > li > a {
    font-family: var(--font-title);
    font-weight: 500;
    padding: 0.75rem 1.25rem; 
    position: relative;
    transition: color 0.2s, background-color 0.2s;
    color: var(--orange); 
    border-radius: 8px 8px 0 0; 
}
.main-nav > .container > ul > li:hover > a {
    background-color: var(--orange);
    color: var(--white);
}


/* Mega Menú (hereda los colores base) */
.mega-menu { position: absolute; top: 100%; left: 0; right: 0; width: 100%; max-width: 1200px; margin: 0 auto; background-color: var(--white); box-shadow: 0 8px 20px rgba(0,0,0,0.1); padding: 2.5rem; border-radius: 0 0 var(--border-radius) var(--border-radius); opacity: 0; visibility: hidden; transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s; z-index: 999; transform: translateY(-10px); }
.has-megamenu:hover .mega-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-menu-content { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2rem; }
.mega-menu-content.layout-with-image {
    grid-template-columns: repeat(3, 1fr) 1.5fr; 
    align-items: start; 
}
.mega-menu-column h5 { color: #888; font-size: 0.9rem; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.5px; }
.mega-menu-column h4 { font-size: 1rem; margin-bottom: 1rem; }
.mega-menu-column ul { list-style: none; display: flex; flex-direction: column; gap: 0.8rem; padding: 0; }
.mega-menu-column a { font-family: var(--font-body); font-size: 0.95rem; font-weight: 400; }
.mega-menu-column a:hover { color: var(--orange); }
.mega-menu-column.promo-image {
    display: flex;
    align-items: center;
    justify-content: center;
}
.mega-menu-column.promo-image a {
    display: block;
    border-radius: var(--border-radius);
    overflow: hidden; 
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}
.mega-menu-column.promo-image a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}
.mega-menu-column.promo-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* --- MENÚ MÓVIL Y SUBMENÚ --- */
#menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 2998; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s; }
#menu-overlay.open { opacity: 1; visibility: visible; }
#mobile-nav { position: fixed; top: 0; left: 0; width: 85%; max-width: 320px; height: 100%; background-color: var(--white); z-index: 2999; transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); display: flex; flex-direction: column; }
#mobile-nav.open { transform: translateX(0); }
.mobile-nav-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--light-gray); }
.mobile-nav-header h4 { font-size: 1.5rem; }
#close-menu-btn { background: none; border: none; cursor: pointer; color: var(--text-color); padding: 0; }
.mobile-nav-body { padding: 1rem; overflow-y: auto; }
.mobile-nav-link { display: flex; align-items: center; padding: 0.8rem 0.5rem; font-size: 1.1rem; font-weight: bold; color: var(--text-color); border-radius: 8px; transition: background-color 0.2s; }
.mobile-nav-link:hover { background-color: var(--light-gray); }
.mobile-nav-link i { margin-right: 1rem; width: 24px; height: 24px; color: #555; }
.mobile-nav-link.main-category { justify-content: space-between; font-size: 1.2rem; }
.mobile-nav-divider { border: none; border-top: 1px solid #eee; margin: 1rem 0; }
.mobile-submenu { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; background-color: #f9f9f9; border-radius: 8px; margin: -0.5rem 0.5rem 0.5rem; }
.mobile-submenu.open { max-height: 500px; }
.submenu-link { display: block; padding: 0.7rem 1.5rem; font-size: 1rem; font-weight: normal; color: #555; }
.toggle-icon { transition: transform 0.3s ease; }
.toggle-icon.open { transform: rotate(90deg); }

/* --- ESTILOS DEL MODAL (POPUP) --- */
.modal { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 2000; 
    display: none; 
    align-items: center; 
    justify-content: center; 
    padding: 1rem; 
}
.modal.open { display: flex; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); }
.modal-content { 
    position: relative; 
    background-color: var(--white); 
    border-radius: var(--border-radius); 
    width: 100%; 
    max-width: 450px; 
    z-index: 2001; 
    animation: slide-down 0.3s ease-out; 
    display: flex; 
    flex-direction: column;
    max-height: 95vh; 
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid #eee; }
.modal-header h3 { font-size: 1.25rem; margin: 0; }
.modal-close { background: none; border: none; font-size: 2rem; line-height: 1; color: #888; cursor: pointer; }
.modal-body { 
    padding: 1.5rem 1.5rem 1.25rem; 
    overflow-y: auto; 
}
.form-group { margin-bottom: 0.8rem; } 
.separator { margin: 1.25rem 0; } 
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 700; font-size: 0.9rem;}
.form-control { width: 100%; padding: 0.8rem 1rem; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; font-family: var(--font-body); }
.form-help { text-align: right; font-size: 0.9rem; margin-top: -0.5rem; margin-bottom: 1.5rem; }
.form-help a { color: var(--orange); text-decoration: underline; }
.btn { display: block; width: 100%; text-align: center; padding: 1rem; border: none; border-radius: 50px; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: background-color 0.2s, transform 0.2s; }
.btn-primary { background-color: var(--orange); color: var(--white); }
.btn-primary:hover { background-color: #d94a1a; transform: scale(1.02); }
.modal-footer { padding: 1.25rem 1.5rem; text-align: center; background-color: var(--light-gray); border-top: 1px solid #eee; border-radius: 0 0 var(--border-radius) var(--border-radius); }
.modal-footer a { color: var(--orange); font-weight: 700; text-decoration: underline; }
@keyframes slide-down { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.register-view,
.registration-fields {
    display: none;
}
.modal-content.show-register .register-view,
.modal-content.show-register .registration-fields {
    display: block;
}
.modal-content.show-register .login-view {
    display: none;
}
.btn-google { display: flex; align-items: center; justify-content: center; gap: 0.75rem; background-color: var(--white); color: #333; border: 1px solid #ddd; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.btn-google:hover { background-color: #f9f9f9; }
.btn-google img { width: 18px; height: 18px; }
.separator { display: flex; align-items: center; text-align: center; color: #aaa; margin: 1.5rem 0; }
.separator::before,
.separator::after { content: ''; flex: 1; border-bottom: 1px solid #eee; }
.separator:not(:empty)::before { margin-right: .5em; }
.separator:not(:empty)::after { margin-left: .5em; }
.form-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.form-row .form-group { flex: 1; min-width: 150px; }

/* ========================================================== */
/* ===== ESTILOS PARA EL FOOTER ===== */
/* ========================================================== */
.new-main-footer {
    background-color: #F9F9F9; 
    color: #555;
    padding: 4rem 0 1.5rem;
    border-top: 1px solid #EAEAEA;
}
.new-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 2rem;
    margin-bottom: 2rem;
}
.new-footer-column h4 {
    font-family: var(--font-title);
    color: var(--black);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}
.new-footer-column ul {
    list-style: none;
    padding: 0;
}
.new-footer-column ul li {
    margin-bottom: 0.75rem;
}
.new-footer-column ul a {
    color: #555;
    font-family: var(--font-body);
    font-weight: 500;
    transition: color 0.2s;
}
.new-footer-column ul a:hover {
    color: var(--orange); 
}
.locations-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.locations-list i {
    width: 16px;
    height: 16px;
    color: var(--orange);
}
.footer-divider {
    border: none;
    border-top: 1px solid #EAEAEA;
    margin: 2rem 0;
}
.new-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-logo img {
    height: 35px;
    width: auto;
    opacity: 0.8;
}
.footer-social-icons {
    display: flex;
    gap: 0.75rem;
}
.footer-social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ddd;
    color: #888;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}
.footer-social-icons a:hover {
    color: var(--orange);
    border-color: var(--orange);
    transform: translateY(-2px);
}
.new-footer-sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #888;
}
.footer-legal-links a {
    color: #888;
    margin: 0 0.5rem;
    text-decoration: underline;
}
.footer-legal-links a:hover {
    color: var(--orange);
}

/* --- Ajustes Responsive Generales para Header/Footer --- */
@media (max-width: 992px) {
    .search-bar { 
        display: none; 
    }
    .header-icons .desktop-icon, 
    .header-icons .account-menu { 
        display: none; 
    }
    .main-nav { 
        display: none; 
    }
    .mobile-menu-toggle { 
        display: block; 
    }
}
@media (max-width: 480px) {
    .header-content { 
        flex-wrap: wrap; 
        justify-content: space-between; 
    }
    .logo { 
        flex-basis: 50%; 
    }
    .header-icons { 
        flex-basis: 50%; 
        justify-content: flex-end; 
    }
    .search-bar { 
        display: block; 
        flex-basis: 100%; 
        margin: 1rem 0 0; 
        order: 3; 
    }
    .new-footer-grid {
        grid-template-columns: 1fr; 
    }
    .new-footer-bottom, .new-footer-sub {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    .locations-list {
        column-count: 2; 
        column-gap: 1.5rem;
    }
    .locations-list li {
       break-inside: avoid; 
    }
    .new-footer-grid {
        display: flex; 
        flex-direction: column;
        gap: 0; 
    }
    .new-footer-column {
        border-bottom: 1px solid #EAEAEA;
    }
    .new-footer-column:last-of-type {
        border-bottom: none;
    }
    .new-footer-column ul {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
        padding: 0 1rem; 
    }
    .new-footer-column h4 {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        padding: 1rem 0;
        margin: 0;
    }
    .new-footer-column h4::after {
        content: '';
        display: inline-block;
        width: 18px;
        height: 18px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23F35820' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-chevron-down'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-size: contain;
        transition: transform 0.3s ease;
    }
    .new-footer-column.active ul {
        max-height: 500px; 
        padding: 0.5rem 1rem 1.5rem; 
    }
    .new-footer-column.active h4::after {
        transform: rotate(180deg);
    }
}
@media (min-width: 769px) {
    .locations-list {
        column-count: 2; 
        column-gap: 1.5rem; 
    }
    .locations-list li {
       break-inside: avoid; 
    }
    .locations-list a {
        display: inline-flex; 
        align-items: center;
        gap: 0.5rem;
    }
}
.visually-hidden {
  position:absolute!important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ========================================================== */
/* ===== ESTILOS PARA EL NUEVO BUSCADOR INTERACTIVO ===== */
/* ========================================================== */
#search-results-container {
    display: none; 
    position: absolute;
    top: calc(100% + 8px); 
    left: 0;
    width: 100%;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15); 
    border: 1px solid #EAEAEA;
    z-index: 1001; 
    max-height: 450px; 
    overflow-y: auto; 
}
#search-results-container.active {
    display: block; 
}
.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--light-gray);
    transition: background-color 0.2s ease-in-out;
    cursor: pointer;
}
.search-result-item:hover {
    background-color: #f9f9f9;
}
.search-result-item:last-child {
    border-bottom: none; 
}
.search-result-image img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 1rem;
    border-radius: 8px;
}
.search-result-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
}
.search-result-name {
    font-family: var(--font-title);
    font-weight: 500;
    font-size: 1rem;
    color: var(--black);
    margin-bottom: 4px;
}
.search-result-pricing {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}
.search-result-pricing .old-price {
    text-decoration: line-through;
    color: #888;
}
.search-result-pricing .sale-price {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
}
.search-results-footer {
    display: block;
    text-align: center;
    padding: 1rem;
    font-family: var(--font-title);
    font-weight: 700;
    color: var(--orange);
    background-color: #fdfdfd;
}
.search-results-footer:hover {
    text-decoration: underline;
}
.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: #888;
}

/* --- ESTILOS PARA EL BANNER INFERIOR (MARQUESINA) --- */
/* Código CORREGIDO */
.bottom-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--white);
  
  /* CORRECCIÓN: Separamos el padding de arriba y abajo */
  padding-top: 0.75rem; 
  /* Aquí sumamos tu padding original (0.75rem) + el área segura del celular */
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); 
  
  z-index: 998;
  border-top: 1px solid #eee;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  overflow: hidden;
  white-space: nowrap;
  
  /* CORRECCIÓN ADICIONAL: Evita parpadeos en Chrome Android al hacer scroll */
  transform: translateZ(0); 
  -webkit-transform: translateZ(0);
}
.bottom-banner-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
}
.bottom-banner .banner-item {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 40px;
    font-family: 'Poppins', sans-serif;
    color: var(--black);
    font-weight: 500;
    font-size: 0.9rem;
    vertical-align: middle;
    background-color: transparent !important; 
    border: none !important; 
    padding: 0 !important; 
    box-shadow: none !important; 
}
.bottom-banner .banner-item svg {
    stroke: var(--orange);
    background-color: transparent;
    border: none;
    box-shadow: none;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
/* --- FIX PARA HEADER STICKY --- */
html, body {
    overflow-x: clip !important;
}
/* =================================== */
/* ESTILOS PARA EL CARRITO DESLIZABLE  */
/* =================================== */

/* El fondo oscuro semi-transparente */
.cart-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  
  /* El panel del carrito */
  .cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px; /* Ancho del carrito */
    background: #fff;
    z-index: 3001;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
  
    /* ESTA ES LA PARTE CLAVE: lo esconde fuera de la pantalla */
    transform: translateX(100%); 
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s ease;
  
    /* Estilos para que el contenido se vea bien */
    display: flex;
    flex-direction: column;
  }
  
  /* --- ESTADO ABIERTO --- */
  /* Cuando el carrito (o su contenedor) tiene la clase .is-open */
  
  .cart-drawer-root.is-open .cart-drawer-backdrop {
    opacity: 1;
    visibility: visible;
  }
  
  .cart-drawer-root.is-open .cart-drawer {
    transform: translateX(0); /* Lo trae de vuelta a la pantalla */
    visibility: visible;
  }
  body.cart-open { overflow: hidden; }
  .cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--orange);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
  }
  .desktop-icon {
    position: relative; /* Necesario para posicionar el contador */
  }

  /* Layout general del drawer para que copie la referencia */
.cart-drawer { display:flex; flex-direction:column; }
.cart-scroll { flex:1; overflow:auto; }

/* Header del drawer */
.cart-header{
  position: sticky; top: 0; background:#fff; z-index: 1;
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:16px; border-bottom:1px solid #eee;
}
.cart-header strong{ font-size:1.1rem; }
.cart-close{ background:none; border:0; color:var(--orange); font-weight:700; cursor:pointer; }

/* Banner “envío gratis” */
.free-ship{
  display:flex; align-items:center; gap:8px;
  padding:10px 12px; margin:12px 16px 0;
  border:1px solid #e6f5e6; background:#f6fff6; color:#149e55;
  border-radius:12px; font-weight:700;
}
.free-ship svg{ stroke:#149e55; }

/* Rejilla de sugeridos (2 columnas) */
.recos-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:12px 16px; }
.reco-card{ border:1px solid #eee; border-radius:12px; padding:10px; display:flex; flex-direction:column; gap:6px; }
.reco-card img{ width:100%; height:80px; object-fit:contain; }
.reco-card .name{ font-size:.9rem; line-height:1.2; height:2.2rem; overflow:hidden; }
.reco-card .price{ font-weight:800; }
.btn-outline{
  border:1px solid var(--orange); background:#fff; color:var(--orange);
  border-radius:999px; padding:8px 10px; font-weight:700; cursor:pointer;
}
.btn-outline:hover{ background:var(--orange); color:#fff; }

/* Lista de ítems */
.cart-items{ display:flex; flex-direction:column; gap:12px; padding:16px; }
.cart-item{
  display:grid; grid-template-columns:64px 1fr auto; gap:12px; align-items:center;
  border-bottom:1px solid #f2f2f2; padding-bottom:12px;
}
.cart-item img{ width:64px; height:64px; object-fit:contain; border:1px solid #eee; border-radius:8px; }
.cart-item .title{ font-weight:800; }
.cart-item .attrs{ font-size:.85rem; color:#777; margin-top:2px; }
.cart-item .controls{ display:flex; align-items:center; gap:8px; margin-top:6px; }
.cart-item input[type="number"]{
  width:70px; padding:6px 8px; border:1px solid #ddd; border-radius:8px;
}
.btn-link{ background:none; border:0; color:#888; text-decoration:underline; cursor:pointer; }
.cart-empty{ color:#666; padding:16px; }

/* Footer pegado con CTA */
.cart-footer{
  position: sticky; bottom:0; background:#fff; border-top:1px solid #eee;
  padding:16px; box-shadow:0 -6px 16px rgba(0,0,0,.05);
}
.cart-footer .cart-row{ display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.cart-footer .cart-row.small{ font-size:.9rem; color:#666; }
.cart-footer .cart-row.total{ font-size:1.05rem; margin-top:6px; }
.cart-footer .btn-primary{ margin-top:12px; border-radius:12px; padding:14px 16px; font-weight:800; }

/* Z-index altos ya ajustados (mantener) */
.cart-drawer-backdrop{ z-index:3000; }
.cart-drawer{ z-index:3001; }
body.cart-open{ overflow:hidden; }
/* Botones base para todo el sitio (asegura consistencia) */
.btn-primary{
    background-color: var(--orange);
    color:#fff;
    border: 1px solid var(--orange);
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 800;
    cursor:pointer;
  }
  .btn-primary:hover{ background-color:#d94a1a; }
  
  .btn-secondary{
    background:#fff;
    color: var(--orange);
    border:1px solid var(--orange);
    border-radius:12px;
    padding:8px 12px;
    font-weight:700;
    cursor:pointer;
  }
  .btn-secondary:hover{ background: var(--orange); color:#fff; }
  
  .btn-outline{
    border:1px solid var(--orange);
    background:#fff;
    color:var(--orange);
    border-radius:999px;
    padding:8px 10px;
    font-weight:700;
    cursor:pointer;
  }
  .btn-outline:hover{ background:var(--orange); color:#fff; }
  
  .btn-link{
    background:none; border:0; color:#888; text-decoration:underline; cursor:pointer;
  }
  /* ========================================================== */
/* ===== AJUSTE FINAL CONTADOR CARRITO MÓVIL ===== */
/* ========================================================== */

/* 1. Asegura que el enlace principal (el <a>) sea un contenedor flexible
      que distribuya el espacio entre el contenido y el contador. */
.mobile-nav-link.with-counter {
    display: flex;
    justify-content: space-between; /* CLAVE: empuja el contador al final */
    align-items: center;
    width: 100%;
  }
  
  /* 2. Agrupa el ícono y el texto para que permanezcan juntos. */
  .mobile-nav-link .mobile-link-content {
    display: flex;
    align-items: center;
    gap: 1rem; /* Espacio entre el ícono y el texto "Mi Carrito" */
  }
  
  /* 3. ¡LA CORRECCIÓN PRINCIPAL! Anulamos la posición absoluta
        del contador para que se comporte como un elemento normal. */
  .mobile-nav-link .cart-count {
    position: static; /* Esto lo devuelve al flujo normal del documento */
    /* Reseteamos los valores de posición por si acaso */
    top: auto;
    right: auto;
  }
  /* ========================================================== */
/* ===== LÓGICA PARA VISTAS DE LOGIN/REGISTRO EN MODAL ===== */
/* ========================================================== */

/* 1. Por defecto, ocultamos todo lo que solo pertenece al registro */
.modal-content .register-view,
.modal-content .registration-fields {
  display: none;
}

/* 2. Cuando el modal recibe la clase 'show-register'... */
.modal-content.show-register .register-view,
.modal-content.show-register .registration-fields {
  display: block; /* ...mostramos los elementos de registro */
}

/* 3. Y al mismo tiempo, ocultamos los elementos de login */
.modal-content.show-register .login-view {
  display: none;
}
/* === Popup de Crédito (global) === */
.credit-popup-overlay {
    position: fixed;
    inset: 0;                 /* top:0 right:0 bottom:0 left:0 */
    display: none;            /* se habilita con .is-visible */
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.5);
    z-index: 5000;            /* DEBE ser mayor al drawer/backdrop */
  }
  
  .credit-popup-overlay.is-visible {
    display: flex;
  }
  
  .credit-popup-modal {
    width: min(560px, 92vw);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    overflow: hidden;
  }
  
  .credit-popup-header,
  .credit-popup-body,
  .credit-popup-footer {
    padding: 16px 20px;
  }
  
  .credit-option {
    border: 1px solid #eee;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    background: #fff;
  }
  
  .credit-option.is-selected {
    border-color: var(--brand-color, #F35900);
    box-shadow: 0 0 0 3px rgba(243, 89, 0, .08);
  }
  
  .credit-option-header {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
  }
  
  .credit-option-body {
    padding: 0 16px 14px 48px;
  }
  
  .credit-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
  }
  
  .credit-popup-footer {
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }
  
  .close-btn {
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }
  .cart-drawer { z-index: 1000; }
  .cart-drawer-backdrop { z-index: 900; }
  
  /* Cuando el drawer no está abierto, que no intercepte clics */
  #cart-backdrop { pointer-events: none; opacity: 0; }
  .cart-drawer-root.is-open #cart-backdrop { pointer-events: auto; opacity: .6; }
  /* ——— Visual de radios ——— */
.credit-option .radio{
    width: 18px; height: 18px;
    border: 2px solid #cfd4dc;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
  }
  .credit-option.is-selected .radio{
    border-color: var(--brand-color, #F35900);
  }
  .credit-option.is-selected .radio::after{
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 8px; height: 8px;
    background: var(--brand-color, #F35900);
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }
  
  /* ——— Jerarquía tipográfica del popup ——— */
  .credit-popup-header h3{
    margin: 0;
    font-weight: 800;
    font-size: 20px;
    color: var(--brand-color, #F35900);
  }
  .credit-option .title{
    font-weight: 700;
    color: #111;
  }
  .credit-option .subtitle{
    font-size: 13px;
    color: #67728a;
  }
  
  /* ——— Cajas y estados ——— */
  .credit-option{
    transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
  }
  .credit-option.is-selected{
    border-color: var(--brand-color, #F35900);
    box-shadow: 0 0 0 3px rgba(243, 89, 0, .08);
    background: #fff;
  }
  /* ===== Select de cuotas (flecha + tema Celred) ===== */
  .credit-option-body select,
  #mp-installments{
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  
    width: 100%;
    height: 44px;
    padding: 0 40px 0 12px;            /* espacio para la flecha */
    border: 1.5px solid #e6e8ef;
    border-radius: 12px;
    background-color: #fff;
    font: inherit;
    color: var(--black);
    cursor: pointer;
  
    /* Flecha (chevron) naranja */
    background-image: url("data:image/svg+xml;utf8,\
    <svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23F35820' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
    <polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
  }
  
  .credit-option-body select:hover,
  #mp-installments:hover{
    border-color: var(--brand-color);
  }
  
  .credit-option-body select:focus,
  #mp-installments:focus{
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(243,88,32,.16);
    outline: none;
  }
  
  /* Estado deshabilitado */
  .credit-option-body select:disabled,
  #mp-installments:disabled{
    color: #9aa1ac;
    background-color: #f6f7fb;
    cursor: not-allowed;
    background-image: url("data:image/svg+xml;utf8,\
    <svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239aa1ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
    <polyline points='6 9 12 15 18 9'/></svg>");
  }
  
  /* Oculta la flecha vieja en IE/Edge antiguos */
  #mp-installments::-ms-expand{ display:none; }
  
  /* 2) REALCE del "Total a pagar" (vuelve a destacar) */
  .credit-option-body .total-display{
    margin-top: 12px;
    font-weight: 900;
    font-size: 1.15rem;                 /* más grande */
    color: var(--brand-color);          /* naranja Celred */
    background: rgba(243,88,32,.06);    /* leve fondo para destacar */
    padding: 8px 10px;
    border-radius: 10px;
    display: inline-block;              /* se ve como “badge” */
  }
  
  /* 3) Comportamiento del modal en tamaños grandes/pequeños */
  .credit-popup-modal{
    width: min(600px, 92vw);            /* un poquito más ancho en desktop */
  }
  
  .credit-popup-body{
    max-height: clamp(320px, 62vh, 70vh);
    overflow-y: auto;
  }
  
  /* iOS: evita zoom al enfocar selects/inputs (>=16px) */
  @media (max-width: 480px){
    .credit-popup-modal{ width: 96vw; border-radius: 14px; }
    .credit-option-body select,
    #mp-installments{ font-size: 16px; }
  }
  
  /* 4) Asegurar z-index por encima del carrito */
  .credit-popup-overlay{ z-index: 5000; }
  .cart-drawer{ z-index: 1000; }
  .cart-drawer-backdrop{ z-index: 900; }
  /* === Unificar estilo del botón "Pagar a Crédito" en el cart drawer === */
/* Mantiene el mismo look que en la página de producto (durazno + hover suave) */

.cart-footer-actions #go-checkout-credit{
  background: #fff1e9 !important;
  color: var(--brand-color, #F35900) !important;
  border: 1.5px solid #fff1e9 !important;
  border-radius: 12px;
  font-weight: 800;
}

/* Hover / focus alineado al de producto */
.cart-footer-actions #go-checkout-credit:hover,
.cart-footer-actions #go-checkout-credit:focus-visible{
  background: #ffeadb !important;
  color: var(--brand-color, #F35900) !important;
  border-color: #ffeadb !important;
  outline: none;
}
/* === FORMULARIO LEAD & ÉXITO === */
.lead-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}
.lead-modal {
  background: #fff; width: 90%; max-width: 400px;
  border-radius: 20px; padding: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  position: relative; animation: slideUp 0.3s ease;
  font-family: 'Nunito', sans-serif;
}
.lead-close {
  position: absolute; top: 15px; right: 15px; background: none; border: none; 
  font-size: 1.5rem; color: #aaa; cursor: pointer; transition: color 0.2s;
}
.lead-close:hover { color: #333; }

.lead-title { text-align: center; color: #F35900; margin: 0 0 10px 0; font-size: 1.4rem; font-weight: 800; }
.lead-subtitle { text-align: center; color: #666; font-size: 0.95rem; margin-bottom: 20px; line-height: 1.4; }

.lead-field { margin-bottom: 15px; }
.lead-field label { display: block; font-size: 0.85rem; font-weight: 700; color: #333; margin-bottom: 5px; }
.lead-field input, .lead-field select {
  width: 100%; padding: 12px; border: 1px solid #e0e0e0; border-radius: 10px;
  font-size: 1rem; transition: border-color 0.2s; background: #f9f9f9;
}
.lead-field input:focus, .lead-field select:focus { border-color: #F35900; background: #fff; outline: none; }

.btn-lead {
  width: 100%; background: #F35900; color: white; border: none;
  padding: 14px; border-radius: 10px; font-weight: 800; font-size: 1rem;
  cursor: pointer; margin-top: 10px; transition: transform 0.1s, background 0.2s;
}
.btn-lead:hover { background: #d64d00; transform: translateY(-1px); }
.btn-lead:active { transform: translateY(1px); }

/* Estado de Éxito */
.lead-success-view { text-align: center; padding: 20px 0; }
.success-icon { 
  width: 70px; height: 70px; background: #dcfce7; color: #16a34a; 
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px auto;
}
.success-icon svg { width: 40px; height: 40px; stroke-width: 3; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* === RESUMEN DE PRODUCTO EN MODAL === */
.lead-summary {
  display: flex;
  align-items: center;
  gap: 15px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 20px;
}

.lead-summary-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
  padding: 2px;
  flex-shrink: 0;
  display: block;
}

.lead-summary-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lead-summary-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 4px 0;
  line-height: 1.2;
  display: -webkit-box;
  
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-summary-price {
  font-size: 0.9rem;
  color: #F35900; /* Tu color de marca */
  font-weight: 800;
}

.lead-subtitle.mini {
  font-size: 0.85rem;
  margin-bottom: 15px;
  margin-top: -5px;
}

/* === ACTUALIZACIÓN: RESUMEN DESPLEGABLE & SALIDA === */

/* Detalles ocultos del resumen */
.lead-summary-details {
  display: none; /* Oculto por defecto */
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e0e0e0;
  animation: fadeIn 0.2s ease;
}
.lead-summary-details.open { display: block; }

.lead-item-row {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; color: #555; margin-bottom: 6px;
}
.lead-item-row strong { color: #333; }

/* Botón para desplegar */
.lead-toggle-btn {
  background: none; border: none; padding: 0;
  color: #F35900; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; margin-top: 4px; display: flex; align-items: center; gap: 4px;
}
.lead-toggle-btn:hover { text-decoration: underline; }

/* Overlay de Confirmación de Salida */
.exit-confirm-layer {
  position: absolute; inset: 0; /* Cubre todo el modal blanco */
  background: rgba(255, 255, 255, 0.98);
  z-index: 20; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px;
  animation: fadeIn 0.2s ease;
}
.exit-icon {
  font-size: 3rem; margin-bottom: 15px; display: block;
}
.btn-stay {
  width: 100%; background: #F35900; color: white; border: none;
  padding: 12px; border-radius: 10px; font-weight: 700; cursor: pointer;
  margin-top: 20px; margin-bottom: 10px;
}
.btn-exit {
  background: none; border: none; color: #999; font-size: 0.9rem;
  cursor: pointer; text-decoration: underline;
}
.btn-exit:hover { color: #333; }

/* ====================================================
   CORRECCIÓN CRÍTICA: SUPERPOSICIÓN Y VISIBILIDAD
   ==================================================== */

/* 1. Hacer que el Carrito sea la capa SUPREMA */
.cart-drawer-root {
    position: relative;
    z-index: 99999 !important; /* Encima de todo el universo */
}
.cart-drawer-backdrop {
    z-index: 99999 !important;
}
.cart-drawer {
    z-index: 100000 !important;
}

/* 2. Ocultar la barra flotante del celular cuando el carrito está abierto */
/* Esto evita que se crucen y limpia la pantalla para el pago */
body.cart-open #mobile-cta-root {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* 3. Asegurar imagen del modal en iPhone */
.lead-summary-img {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important; /* Fuerza bruta para que no desaparezca */
    object-fit: contain;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    display: block;
}

/* ========================================================== */
/* FIX POSICIÓN CHAT (LUCIDBOT) EN MÓVIL */
/* ========================================================== */
@media (max-width: 768px) {
    /* Identificamos el contenedor del chat de LucidBot */
    /* Nota: Lucidbot suele usar IDs dinámicos, pero intentamos forzar el contenedor común */
    #lucidbot-container, 
    .lucidbot-launcher,
    iframe[title*="chat"], /* Selector genérico por si cambia el ID */
    div[style*="z-index: 2147483647"] { /* Selector agresivo para iframes flotantes */
        
        /* Lo subimos 140px del fondo para que flote ENCIMA de tus barras de compra */
        bottom: 140px !important; 
    }
}
