/* =========================================================
   NOSOTROS CUSTOM STYLES - LA NONNA RÚSTICA
   Premium Organizational CSS for History Page
   ========================================================= */

/* Hero Editorial Section */
.hero-editorial {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-secundario);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-editorial-img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.4;
    mix-blend-mode: multiply;
    transform: scale(1.1);
    animation: slowZoom 20s infinite alternate linear;
}

@keyframes slowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.hero-editorial-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 1rem;
    max-width: 1000px;
}

.editorial-title {
    font-size: clamp(4rem, 10vw, 8rem);
    font-family: var(--fuente-titulos);
    line-height: 0.9;
    margin-bottom: 2rem;
    font-weight: 400;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.editorial-subtitle {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    color: var(--color-dorado);
    display: block;
    margin-bottom: 2.5rem;
    font-weight: 700;
}

.hero-editorial-p {
    font-size: 1.6rem;
    font-style: italic;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.95;
    line-height: 1.6;
    font-family: var(--fuente-premium);
}

.heritage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    padding: 10rem 5%;
    background: var(--color-fondo);
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.stat-item {
    text-align: center;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 3rem 2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

.stat-item:hover {
    transform: translateY(-15px);
    background: white;
    box-shadow: var(--sombra-fuerte);
}

.stat-item h3 {
    font-family: var(--fuente-titulos);
    font-size: 5.5rem;
    color: var(--color-principal);
    line-height: 1;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.stat-item p {
    color: var(--color-secundario);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Stacked Sticky Layout (Ultra Premium) */
.history-stack-container {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    padding: 5rem 5%;
    background: var(--color-surface);
    gap: 4rem;
    position: relative;
}

.history-text-col {
    flex: 1;
    padding-top: 20vh;
    padding-bottom: 20vh;
}

.history-img-col {
    flex: 1;
    position: sticky;
    top: 20vh;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-img-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--sombra-fuerte);
}

.history-img-wrapper.active-img {
    opacity: 1;
    transform: translateY(0) scale(1);
    z-index: 2;
}

.history-img-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.history-node {
    margin-bottom: 30vh;
    opacity: 0.3;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

.history-node.focus {
    opacity: 1;
}

.history-year {
    font-size: clamp(3.5rem, 7vw, 7rem);
    font-family: var(--fuente-titulos);
    color: var(--color-principal);
    display: block;
    margin-bottom: 1.5rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -2px;
}

.history-node h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: var(--color-secundario);
    font-family: var(--fuente-titulos);
    position: relative;
    display: inline-block;
}

.history-node h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--color-dorado);
    transition: width 0.5s ease;
}

.history-node.focus h2::after {
    width: 100px;
}

.history-node p {
    font-size: 1.3rem;
    line-height: 1.9;
    color: var(--color-texto-claro);
    max-width: 550px;
    font-family: var(--fuente-principal);
    font-weight: 400;
}

/* Philosophy Section */
.philosophy-banner {
    width: 100%;
    height: 60vh;
    background-image: url('https://images.unsplash.com/photo-1515443961218-a51367888e4b?q=80&w=1920&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

@media (max-width: 1024px) {
    .philosophy-banner {
        background-attachment: scroll;
    }
}

.philosophy-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(26, 39, 68, 0.4), rgba(26, 39, 68, 0.95));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 3rem;
    backdrop-filter: blur(2px);
}

.philosophy-icon {
    margin-bottom: 2.5rem;
    filter: drop-shadow(0 0 20px var(--color-dorado));
}

.philosophy-quote {
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-family: var(--fuente-premium);
    font-style: italic;
    max-width: 1000px;
    line-height: 1.1;
    text-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.philosophy-btn {
    margin-top: 4rem;
    transform: scale(1.3);
    box-shadow: 0 15px 40px rgba(193, 18, 31, 0.4);
}

/* Footer Nosotros Overrides */
.footer-nosotros {
    margin-top: 0;
    padding-top: 6rem;
}

.footer-nosotros-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    text-align: left;
}

.footer-nosotros-col {
    flex: 1;
    min-width: 250px;
    margin-bottom: 2rem;
}

.footer-nosotros-logo-wrapper {
    flex: 1;
    min-width: 300px;
    margin-bottom: 2rem;
}

.footer-nosotros-logo {
    margin-left: 0;
}

.footer-nosotros-slogan {
    font-family: var(--fuente-titulos);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.footer-nosotros-title {
    color: var(--color-dorado);
    margin-bottom: 1.5rem;
    font-family: var(--fuente-titulos);
}

.footer-nosotros-info {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.footer-nosotros-bottom {
    margin-top: 4rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
}

@media (max-width: 600px) {
    .philosophy-quote { font-size: 1.8rem; }
    .footer-nosotros-content { flex-direction: column; }
}

/* Desktop specific: Hide mobile images */
.mobile-img-container {
    display: none;
}

/* =========================================================
   NOSOTROS MOBILE BASIC - LA NONNA RÚSTICA
   ULTRA-SIMPLE LINEAR TIMELINE (100% STABLE)
   ========================================================= */

@media (max-width: 900px) {
    /* 1. Remove sticky behavior and flex complexity */
    body .history-stack-container {
        display: block !important;
        padding: 2rem 0 !important;
        background: #fff !important;
    }
    
    /* 2. Hide the complex sticky column */
    body .history-img-col {
        display: none !important;
    }

    /* 3. Style the linear text nodes */
    body .history-text-col {
        display: block !important;
        width: 100% !important;
        padding: 0 5% !important;
        margin: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    body .history-node {
        margin-bottom: 5rem !important; 
    }

    body .history-node h2 {
        font-size: 2.2rem !important;
        color: var(--color-secundario);
        margin: 1.5rem 0 !important;
        line-height: 1.2;
        text-align: center;
    }
    
    body .history-year {
        font-size: 5rem !important;
        color: var(--color-principal);
        opacity: 0.15;
        font-family: 'Cinzel', serif;
        font-weight: 900;
        display: block;
        text-align: center;
        margin-bottom: -1rem;
    }

    body .history-node p {
        font-size: 1.15rem !important;
        line-height: 1.7 !important;
        text-align: center;
        margin-top: 1rem !important;
        color: #444 !important;
        max-width: 100% !important;
    }

    /* 4. Show the image containers in place */
    body .mobile-img-container {
        display: block !important;
        width: 100% !important;
        aspect-ratio: 16 / 10 !important;
        margin: 1.5rem 0 !important;
        border-radius: 20px !important;
        overflow: hidden !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
        background: #eee;
    }

    body .mobile-img-container img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    /* 5. Subtle Professional Animations (Mobile Only) */
    .mobile-reveal {
        opacity: 0;
        transform: translateY(15px); /* Even subtler */
        transition: opacity 1s cubic-bezier(0.2, 1, 0.3, 1), 
                    transform 1s cubic-bezier(0.2, 1, 0.3, 1);
        will-change: transform, opacity;
    }

    .mobile-reveal.active {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    /* Staggered Delays for a premium feel */
    .history-node .history-year { transition-delay: 0.1s; }
    .history-node h2 { transition-delay: 0.2s; }
    .history-node .mobile-img-container { transition-delay: 0.3s; }
    .history-node p { transition-delay: 0.4s; }
}

/* 6. Mobile Header Refinement: Hide Cart */
@media (max-width: 900px) {
    body .nav-cart-wrapper, 
    body .global-nav-actions .nav-cart-wrapper {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}
