/* ========================================================================
   VARIABLES Y ESTILOS BASE
   ======================================================================== */
body {
    font-family: 'Montserrat', sans-serif;
    color: var(--color-secondary);
    background: var(--color-cream);
}

h1, h2, h3 {
    font-family: 'Castoro', serif;
    color: var(--color-secondary);
}

.container {
    max-width: var(--container-width);
    margin: auto;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-secondary);
}

/* ========================================================================
   EL MARCO FIJO (Efecto Passepartout)
   ======================================================================== */
.eredita-top-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    background-color: #EFE9E0;
    z-index: 11000; 
    pointer-events: none;
}

.eredita-page-frame {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    border-left: 24px solid #EFE9E0;
    border-right: 24px solid #EFE9E0;
    border-bottom: 0px solid #EFE9E0;
    border-top: none;
    z-index: 11000; 
    pointer-events: none;
}

/* ========================================================================
   SCROLLBAR PREMIUM (Flotante y elegante)
   ======================================================================== */
html {
    overflow-x: hidden;
    overflow-y: scroll; /* fuerza scrollbar siempre visible */
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(227, 193, 107, 0.8) #051320;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #051320;
}

::-webkit-scrollbar-thumb {
    background: rgba(227, 193, 107, 0.8);
    border-radius: 10px;
    border: 2px solid #051320;
}

::-webkit-scrollbar-thumb:hover {
    background: #E3C16B;
}

/* ========================================================================
   CURSOR PREMIUM EREDITÁ
   ======================================================================== */
body, html {
    cursor: url("data:image/svg+xml;utf8,<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'><circle cx='12' cy='12' r='4' fill='%23E3C16B'/></svg>") 12 12, auto;
}

a, button, .vino-card, .btn, input, textarea, select, .lang-globe-icon {
    cursor: url("data:image/svg+xml;utf8,<svg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'><circle cx='16' cy='16' r='14' stroke='%23E3C16B' stroke-width='1.5'/></svg>") 16 16, pointer !important;
}

p, h1, h2, h3, h4, h5, h6, span {
    cursor: text;
}

/* ========================================================================
   RITMO VERTICAL GLOBAL (BLINDADO)
   ======================================================================== */
main.site-main > section {
    padding: 120px 60px !important; 
    position: relative; 
}

main.site-main > section.eredita-hero {
    padding: 0 !important;
}

@media (max-width: 992px) {
    main.site-main > section {
        padding: 80px 0 !important; 
    }
    main.site-main > section.eredita-hero {
        padding: 0 !important;
    }
}

/* ========================================================================
   FOOTER PREMIUM
   ======================================================================== */
.eredita-footer {
    position: relative;
    background-color: #EFE9E0;
    padding: 20px 80px 24px;
    overflow: hidden;
}

.footer-il-izq,
.footer-il-der {
    position: absolute;
    bottom: -5px;
    max-width: 190px;
    height: auto;
    z-index: 1;
    opacity: 0.85;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.footer-il-izq { left: 0px; }
.footer-il-der { right: 0px; }

.footer-logo-wrap {
    margin-bottom: 16px;
}

.footer-logo-img {
    max-height: 100px;
    width: auto;
    mix-blend-mode: multiply;
}

.footer-fallback-title {
    font-family: 'Castoro', serif;
    font-size: 2rem;
    letter-spacing: 6px;
    color: #0A2037;
    text-decoration: none;
}

.footer-nav-center {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.footer-deco-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.footer-deco-line {
    display: block;
    width: 120px;
    height: 1px;
    background: rgba(10, 32, 55, 0.15);
}

.footer-deco-dot {
    font-family: 'Castoro', serif;
    color: #C5A059;
    font-size: 1.2rem;
    line-height: 1;
}

.footer-contact-row {
    margin-bottom: 16px;
}

.footer-copyright {
    position: relative;
    z-index: 10;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: rgba(10, 32, 55, 0.6);
    margin-bottom: 0;
    letter-spacing: 1px;
}

.footer-divider {
    position: relative;
    z-index: 10;
    border: none;
    border-top: 1px solid rgba(10, 32, 55, 0.12);
    margin: 0 0 14px 0;
}

.footer-contact-block {
    margin-bottom: 0;
}

.footer-address-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(10, 32, 55, 0.45);
    margin-bottom: 8px;
}

.footer-address-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    color: #0A2037;
    line-height: 1.7;
    margin: 0;
    font-style: normal;
}

ul.footer-nav-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 10px 40px !important;
    align-items: center;
    justify-content: center;
}

ul.footer-nav-list li {
    list-style-type: none !important;
    margin: 0 !important;
}

ul.footer-nav-list li a {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    color: #0A2037 !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none !important;
    font-weight: 500;
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}

ul.footer-nav-list li a:hover {
    color: #E3C16B !important;
    letter-spacing: 2px;
}

.footer-address-link {
    text-decoration: none !important;
    display: inline-block;
    transition: opacity 0.3s ease;
}

.footer-address-link:hover {
    opacity: 0.75;
}

.footer-address-link:hover .footer-address-text {
    color: #0A2037;
}

/* ========================================================================
   🍷 DISEÑO DE COLECCIÓN (ESTILO RUTA 5) - BASE DESKTOP
   ======================================================================== */
.tracking-wide { letter-spacing: 0.1em; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.opacity-10 { opacity: 0.1; }
.opacity-80 { opacity: 0.8; }

/* Menú de Pestañas Scrollable (Preparado para móvil) */
.wine-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.wine-tabs-nav::-webkit-scrollbar { display: none; }

@media (min-width: 992px) {
    .wine-tabs-nav {
        justify-content: center;
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

.wine-tab-btn {
    flex: 0 0 auto;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.75rem 1.5rem;
    color: #666;
    background-color: transparent;
    border: 1px solid #333;
    transition: all 0.4s ease;
    border-radius: 4px;
}

.wine-tab-btn:hover {
    color: #999;
    border-color: #555;
}

.wine-tab-btn.active {
    color: var(--cepa-color) !important;
    border-color: var(--cepa-color) !important;
    background-color: color-mix(in srgb, var(--cepa-color) 15%, transparent) !important;
}

.wine-pane { display: none; animation: fadeIn 0.6s ease-in-out; }
.wine-pane.active { display: block; }
.wine-pane.active .transition-transform { animation: floatUp 0.8s cubic-bezier(0.16, 1, 0.3, 1); }

.wine-tag {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 1rem;
    color: #E3C16B;
    border: 1px solid rgba(227, 193, 107, 0.3);
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 30px;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ========================================================================
   📱 OPTIMIZACIÓN EXTREMA PARA MÓVILES (LETRAS GRANDES Y ESPACIOS)
   ======================================================================== */
@media (max-width: 767px) {
    
    /* 1. Pestañas más grandes y fáciles de tocar */
    .wine-tab-btn {
        font-size: 0.95rem !important;
        padding: 0.9rem 1.5rem !important;
    }

    /* 2. Título de la Cepa Gigante */
    .wine-pane h2 {
        font-size: 2rem !important;
    }

    /* 3. Texto descriptivo mucho más grande y legible */
    .wine-pane .text-white-50.font-italic {
        font-size: 1.25rem !important; 
        line-height: 1.6 !important;
        margin-bottom: 2rem !important;
    }
    
    /* 4. Etiquetas (Tags) más grandes */
    .wine-tag {
        font-size: 0.85rem !important;
        padding: 0.7rem 1.2rem !important;
    }

    /* 5. Aumento general en la caja técnica */
    .wine-tech-box {
        padding: 2rem 1.5rem !important;
    }
    
    .wine-tech-box h5, 
    .roadmap-card span.text-uppercase.font-weight-bold {
        font-size: 1.1rem !important; 
    }

    /* Letras pequeñas (D.O, Alcohol, Guarda) */
    .wine-tech-box .text-white-50,
    .roadmap-card .text-white-50 {
        font-size: 0.9rem !important; 
        letter-spacing: 0.15em !important;
    }

    /* Valores Técnicos (Valle Central, 14%) */
    .wine-tech-box .text-white.font-weight-bold,
    .roadmap-card .text-white {
        font-size: 1.2rem !important; 
        margin-top: 0.3rem !important;
    }

    /* Separación de las líneas punteadas */
    .wine-tech-box .d-flex.mb-4, 
    .wine-tech-box .d-flex.mb-2 {
        margin-bottom: 2rem !important; 
    }

    /* 6. Roadmap: Tarjetas limpias y ordenadas */
    .roadmap-card {
        padding: 2rem 1.5rem !important; 
    }

    .roadmap-card h3 {
        font-size: 2.2rem !important;
        margin-top: 0.5rem !important;
    }

    /* Evitar que "Suelo", "Guarda" y "Alcohol" se aplasten poniéndolos en bloque vertical */
    .roadmap-card .row > div {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 1.5rem !important;
    }

    .roadmap-card .text-right {
        text-align: left !important;
    }

    /* 7. Botella con protagonismo y brillo adaptado */
    .wine-bottle-img {
        max-height: 480px !important;
        width: auto;
        margin: 0 auto;
        display: block;
    }
    
    .glow-efect {
        width: 220px !important;
        height: 350px !important;
    }
}

/* ========================================================================
   🛡️ RESPIRACIÓN LATERAL MÓVIL (Salvando el marco de 24px)
   ======================================================================== */
@media (max-width: 767px) {
    
    /* 1. Sin marco: padding normal */
    .brand-hero .container,
    #wines-collection .container-fluid,
    #roadmap .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* 2. Ajuste fino al texto descriptivo de arriba (Expresivo, Redondo...) */
    .brand-hero span.d-block {
        font-size: 0.7rem !important;
        line-height: 1.6 !important;
        padding: 0 10px !important;
    }

    /* 3. Ajuste de la caja técnica para ganar espacio interior */
    .wine-tech-box {
        padding: 1.8rem 1.5rem !important;
    }
    
    /* 4. MEJORA UX MÓVIL: Pasamos las especificaciones (D.O., Alcohol) a 2 líneas limpias */
    .wine-tech-box .d-flex.align-items-baseline {
        flex-direction: column !important;
        align-items: flex-start !important;
        margin-bottom: 0.5rem !important; /* Reducimos el margen porque ahora apilan */
    }
    
    /* Ocultamos la línea punteada horizontal en móviles para evitar choques de texto */
    .wine-tech-box .flex-grow-1 {
        display: none !important; 
    }
    
    /* Alinear los valores (ej. Valle Central) a la izquierda debajo de su título */
    .wine-tech-box .text-right {
        text-align: left !important;
        margin-top: 4px !important;
        margin-bottom: 15px !important;
        font-size: 1.1rem !important;
    }
}

/* ========================================================================
   🖼️ REDUCCIÓN DEL MARCO CREMA EN MÓVILES (Más espacio de pantalla)
   ======================================================================== */
@media (max-width: 767px) {
    
    /* 1. Ocultamos el marco en mobile */
    .eredita-top-frame,
    .eredita-page-frame {
        display: none !important;
    }

    /* 2. Ajustamos los márgenes (sin marco en mobile: solo aire) */
    .brand-hero .container,
    #wines-collection .container-fluid,
    #roadmap .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Header: padding-right amplio para que el logo no quede debajo de globo+hamburguesa */
    .site-header .header-container {
        padding-left: 16px !important;
        padding-right: 110px !important;
    }

    /* 3. Pestañas (Tabs) adaptadas al nuevo margen */
    .wine-tabs-wrapper {
        margin-left: -16px !important;
        margin-right: -16px !important;
    }
    .wine-tabs-nav {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* 4. Footer sin borde inferior (marco oculto en mobile) */
    .eredita-footer {
        margin-bottom: 0 !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* 5. Cajas técnicas y Tarjetas de Ruta */
    .wine-tech-box, 
    .roadmap-card {
        padding: 2rem 1.5rem !important; 
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Ajuste fino al texto "Expresivo, Redondo..." */
    .brand-hero span.d-block {
        font-size: 0.65rem !important;
        letter-spacing: 0.25em !important;
        line-height: 1.8 !important;
    }
}

/* ========================================================================
   🌎 ESTILOS PREMIUM PARA EL MENÚ DE IDIOMAS (GLOBE DROPDOWN)
   ======================================================================== */
.header-lang {
    position: relative;
}

.header-lang .lang-dropdown {
    position: absolute;
    top: 150%; /* Lo bajamos un poco para que no tape el header */
    right: -10px; /* Alineado a la derecha del globo */
    background: #051320 !important; /* Azul oscuro Ereditá */
    border: 1px solid rgba(227, 193, 107, 0.3) !important; /* Borde dorado */
    padding: 12px 18px !important;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    min-width: 110px;
    z-index: 10000;
}

/* Separación entre los idiomas */
.header-lang .lang-dropdown li {
    margin-bottom: 12px !important;
}
.header-lang .lang-dropdown li:last-child {
    margin-bottom: 0 !important;
}

/* Alineación de la bandera con el texto */
.header-lang .lang-dropdown li a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    color: #FFF !important;
    font-size: 0.85rem !important;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

/* Hover: Dorado */
.header-lang .lang-dropdown li a:hover,
.header-lang .lang-dropdown li a.active {
    color: #E3C16B !important;
}

/* Bandera */
.header-lang .lang-dropdown li a img {
    width: 20px !important;
    height: auto !important;
    border-radius: 2px;
}


/* ========================================================================
   🍷 AJUSTE DE PESTAÑAS DE VINOS (EN BLOQUE PARA MÓVILES)
   ======================================================================== */
@media (max-width: 767px) {
    /* En lugar de deslizar, hacemos que caigan en una o dos líneas ordenadas */
    .wine-tabs-nav {
        flex-wrap: wrap !important;
        justify-content: center !important;
        overflow-x: visible !important;
        padding-bottom: 1.5rem !important;
        gap: 0.8rem !important;
    }

    .wine-tab-btn {
        flex: 1 1 calc(50% - 0.8rem) !important; /* Dos botones por fila perfectos */
        text-align: center;
        padding: 0.8rem 0.5rem !important;
        font-size: 0.8rem !important;
        border-radius: 4px !important;
    }
}



.eredita-page-frame,
.eredita-top-frame,
.eredita-page-frame::before,
.eredita-page-frame::after {
    pointer-events: none;
}

/* ==========================================
   AJUSTE GLOBAL PARA RESPETAR EL MARCO
   ========================================== */

body {
    padding-left: 24px;
    padding-right: 24px;
}

/* Hero debe compensar el marco */
.eredita-hero {
    height: calc(100vh - 24px);
}

/* Secciones con background fixed */
.seccion-vinos,
.seccion-contacto {
    background-attachment: scroll; /* evita bugs en mobile */
}

@media (max-width: 767px) {

    body {
        padding-top: 0px;
        padding-left: 0px;
        padding-right: 0px;
    }

    .eredita-hero {
        height: calc(100vh - 12px);
    }

}