/* =================================================================
   STYLES.CSS - INDEX PAGE
   Imports + Estilos específicos de la Home
   ================================================================= */

/* -----------------------------------------------------------------
   IMPORTS - Sistema Modular
   ----------------------------------------------------------------- */
@import url('styles/_tokens.css');
@import url('styles/_reset.css');
@import url('styles/_nav.css');
@import url('styles/_components.css');
@import url('styles/_utilities.css');


/* -----------------------------------------------------------------
   HERO (Index)
   ----------------------------------------------------------------- */
.hero-scroll-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    cursor: pointer;
    transition: transform var(--duration-normal) ease;
}

.hero-scroll-trigger:hover {
    transform: translateY(5px);
    opacity: 0.8;
}

.scroll-label {
    font-family: var(--font-family);
    font-size: var(--text-caption);
    font-weight: var(--font-extrabold);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--text-on-dark);
    opacity: 0.8;
}

.scroll-icon-container {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: 2px solid var(--border-medium-on-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-dark);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
}

/* -----------------------------------------------------------------
   SERVICIOS (Index)
   ----------------------------------------------------------------- */
.service-list-item {
    position: relative;
    padding: var(--space-8) var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-medium);
    margin-bottom: var(--space-4);
    background-color: transparent;
    transition: all var(--duration-slow) var(--ease-smooth);
    overflow: hidden;
}

@media (min-width: 1024px) {
    .service-list-item {
        padding: var(--space-12) var(--space-10);
        margin-bottom: var(--space-6);
    }
}

/* Service Multi-Color Assignment */
.service-list-item:nth-child(1),
.service-list-item:nth-child(4) {
    --service-accent: var(--bunker-lavanda);
    --service-glow: rgba(173, 173, 214, 0.25);
}

.service-list-item:nth-child(2),
.service-list-item:nth-child(5) {
    --service-accent: var(--bunker-oliva);
    --service-glow: rgba(154, 177, 124, 0.25);
}

.service-list-item:nth-child(3),
.service-list-item:nth-child(6) {
    --service-accent: var(--bunker-beige);
    --service-glow: rgba(232, 225, 208, 0.25);
}

.service-list-item.active,
.service-list-item:hover {
    border-color: var(--service-accent);
    transform: scale(1.01);
    box-shadow: 0 20px 40px -10px var(--service-glow);
    z-index: 10;
    cursor: pointer;
}

@media (min-width: 1024px) {

    .service-list-item.active,
    .service-list-item:hover {
        transform: scale(1.02);
    }
}

.service-bg-absolute {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    visibility: hidden;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.service-bg-absolute img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    transition: transform 6s ease;
    filter: grayscale(100%);
}

.service-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: background-color var(--duration-slow) ease;
    mix-blend-mode: multiply;
}

.service-list-item.active .service-bg-absolute,
.service-list-item:hover .service-bg-absolute {
    opacity: 1;
    visibility: visible;
}

.service-list-item.active .service-bg-absolute img,
.service-list-item:hover .service-bg-absolute img {
    transform: scale(1);
}

.arrow-orb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border-medium);
    border-radius: 50%;
    transition: all var(--duration-slow) var(--ease-smooth);
    background-color: transparent;
    color: var(--bunker-negro);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .arrow-orb {
        width: 3.5rem;
        height: 3.5rem;
    }
}

.arrow-orb svg {
    width: 1rem;
    height: 1rem;
    transition: transform var(--duration-slow) ease;
}

@media (min-width: 768px) {
    .arrow-orb svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.service-list-item.active .arrow-orb svg,
.service-list-item:hover .arrow-orb svg {
    transform: rotate(-45deg);
}

/* --- Unified Service Styles (Dark Theme) --- */

.service-list-item .service-bg-overlay {
    background-color: rgba(18, 18, 18, 0.75);
}

.service-list-item.active .relative.z-10 div .service-title,
.service-list-item:hover .relative.z-10 div .service-title {
    color: var(--text-on-dark) !important;
}

.service-list-item.active .text-gray-400,
.service-list-item:hover .text-gray-400 {
    color: var(--service-accent) !important;
}

.service-list-item.active .arrow-orb,
.service-list-item:hover .arrow-orb {
    background-color: var(--service-accent) !important;
    color: var(--bunker-negro) !important;
    border-color: var(--service-accent) !important;
    transform: scale(1.1);
}

.service-list-item.active .tags,
.service-list-item:hover .tags {
    color: var(--text-on-dark) !important;
    border-color: var(--service-accent) !important;
}

/* Tags visibles en scroll/active */
@media (min-width: 1024px) {
    .service-list-item.active .flex.flex-wrap {
        opacity: 1 !important;
    }
}

/* MOBILE: Show overlays permanently for better contrast without hover */
@media (max-width: 1023px) {
    .service-list-item .service-bg-overlay {
        background-color: rgba(18, 18, 18, 0.85);
    }

    /* Text colors when active */
    .service-list-item.active .service-title {
        color: var(--text-on-dark) !important;
    }

    /* Pills/tags text color when active - ensuring proper contrast */
    .service-list-item.active .tags,
    .service-list-item.active .text-gray-500 {
        color: var(--text-on-dark) !important;
        border-color: rgba(255, 255, 255, 0.5) !important;
    }
}

/* =================================================================
   FAQ 2.0 (Clean System)
   ================================================================= */

/* Estilo base del contenedor */
.faq-item {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 1.5rem;
    /* rounded-2xl */
    background-color: transparent;
    transition: all 0.4s ease;
    overflow: hidden;
}

/* --- ESTADO ACTIVO (Abierto) --- */

/* 1. Expandir contenido (Grid trick) */
.faq-item.active .faq-body {
    grid-template-rows: 1fr !important;
}

/* 2. Rotar icono */
.faq-item.active .faq-icon {
    transform: rotate(45deg);
    background-color: #121212;
    color: white;
    border-color: #121212;
}

/* --- COLORES PERSONALIZADOS AL ABRIR --- */

/* Item 1: Lavanda */
.faq-item:nth-child(1).active {
    background-color: #ADADD6;
    /* var(--bunker-lavanda) */
    border-color: #ADADD6;
}

/* Item 2: Negro (Texto blanco manejado con clases group utility en HTML) */
.faq-item:nth-child(2).active {
    background-color: #121212;
    /* var(--bunker-negro) */
    border-color: #121212;
}

/* Excepción icono blanco para fondo negro */
.faq-item:nth-child(2).active .faq-icon {
    background-color: white;
    color: black;
    border-color: white;
}

/* Item 3: Oliva */
.faq-item:nth-child(3).active {
    background-color: #9AB17C;
    /* var(--bunker-oliva) */
    border-color: #9AB17C;
}

/* Item 4: Beige */
.faq-item:nth-child(4).active {
    background-color: #E8E1D0;
    /* var(--bunker-beige) */
    border-color: #E8E1D0;
}

/* Hover sutil en desktop */
@media (hover: hover) {
    .faq-item:hover {
        border-color: #121212;
    }
}


/* -----------------------------------------------------------------
   CASOS DE ÉXITO - STACK CARDS
   ----------------------------------------------------------------- */
article.sticky {
    position: sticky;
    margin: 0 auto var(--space-6) auto !important;
    width: 100%;
    max-width: 1200px;
    min-height: auto;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.15);
    transform-origin: center top;
    transition: transform var(--duration-normal) ease;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    article.sticky {
        flex-direction: row;
        min-height: 55vh;
        height: auto;
        border-radius: var(--radius-2xl);
    }
}

/* Z-index y posiciones */
article.sticky:nth-child(1) {
    z-index: 10;
    top: 6rem;
}

article.sticky:nth-child(2) {
    z-index: 20;
    top: 7rem;
}

article.sticky:nth-child(3) {
    z-index: 30;
    top: 8rem;
}

@media (min-width: 768px) {
    article.sticky:nth-child(1) {
        top: 8rem;
    }

    article.sticky:nth-child(2) {
        top: 10rem;
    }

    article.sticky:nth-child(3) {
        top: 10rem;
    }
}

/* Contenedor de contenido */
.case-content-wrapper {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    position: relative;
    flex-shrink: 0;
    z-index: 20;
}

@media (min-width: 768px) {
    .case-content-wrapper {
        padding: var(--space-12);
        width: 45%;
    }
}

@media (min-width: 1024px) {
    .case-content-wrapper {
        padding: var(--space-16);
        width: 45%;
    }
}

/* Contenedor de imagen */
.case-image-wrapper {
    position: relative;
    overflow: hidden;
    display: none;
    width: 0;
    height: 0;
}

@media (min-width: 768px) {
    .case-image-wrapper {
        display: block;
        width: 55%;
        min-height: 400px;
        height: auto;
        flex-shrink: 0;
        align-self: stretch;
    }
}

.case-image-wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

article.sticky:hover .case-image-wrapper img {
    transform: scale(1.1);
}

/* Thumbnail mobile */
.case-thumbnail-mobile {
    width: 5rem;
    height: 5rem;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: block;
}

@media (min-width: 768px) {
    .case-thumbnail-mobile {
        display: none;
    }
}

.case-thumbnail-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tipografía cards */
article.sticky h3 {
    font-size: var(--text-h2) !important;
    font-weight: var(--font-extrabold);
    line-height: var(--leading-tight) !important;
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
    article.sticky h3 {
        font-size: var(--text-display) !important;
        margin-bottom: var(--space-6);
    }
}

article.sticky p {
    font-size: var(--text-small) !important;
    line-height: var(--leading-normal) !important;
    font-weight: var(--font-medium);
    margin-bottom: var(--space-6);
    color: var(--text-secondary);
}

@media (min-width: 768px) {
    article.sticky p {
        font-size: var(--text-body) !important;
        line-height: 1.7 !important;
    }
}

@media (min-width: 1024px) {
    article.sticky p {
        font-size: var(--text-body-lg) !important;
        line-height: var(--leading-relaxed) !important;
        margin-bottom: 0 !important;
    }
}

/* Tags unificados */
article.sticky span.inline-block {
    padding: var(--space-1) var(--space-3) !important;
    border-radius: var(--radius-full);
    font-size: var(--text-micro) !important;
    font-weight: var(--font-bold);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
}

@media (min-width: 768px) {
    article.sticky span.inline-block {
        font-size: var(--text-caption) !important;
        padding: var(--space-2) var(--space-4) !important;
    }
}

/* Botón CTA */
article.sticky button.btn-magnetic {
    width: 3rem !important;
    height: 3rem !important;
    border-radius: var(--radius-full);
    transition: all var(--duration-normal) ease;
}

@media (min-width: 768px) {
    article.sticky button.btn-magnetic {
        width: 6rem !important;
        height: 6rem !important;
    }
}

article.sticky button.btn-magnetic svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

@media (min-width: 768px) {
    article.sticky button.btn-magnetic svg {
        width: 2rem !important;
        height: 2rem !important;
    }
}

/* Mobile optimizations */
@media (max-width: 767px) {
    article.sticky {
        margin-bottom: var(--space-6) !important;
        min-height: auto;
        height: auto;
    }

    .case-content-wrapper {
        padding: var(--space-6) !important;
    }
}

/* =========================================
   OPTIMIZACIÓN MOBILE (Performance)
   ========================================= */
@media (max-width: 1024px) {

    /* 1. Desactivar Blur costoso en móviles */
    .hero-scroll-trigger .scroll-icon-container,
    .main-nav-dynamic.scrolled,
    .gallery-card .card-tag {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Reemplazo visual: Fondo sólido con ligera transparencia */
    .main-nav-dynamic.scrolled {
        background: rgba(255, 255, 255, 0.98) !important;
    }

    .hero-scroll-trigger .scroll-icon-container {
        background: rgba(255, 255, 255, 0.1) !important;
    }

    /* 2. Sombras más simples */

}

/* =================================================================
   FAQ SECTION - PERFORMANCE OPTIMIZED (Zero Lag)
   ================================================================= */

/* --- 1. CONFIGURACIÓN DE LA SECCIÓN --- */
.pure-faq-section {
    width: 100%;
    padding: 100px 24px;
    background-color: #ffffff;
    font-family: 'Manrope', sans-serif;
    box-sizing: border-box;
    color: #121212;
}

/* --- 2. CABECERA --- */
.pure-faq-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 80px auto;
}

.pure-faq-tag {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #121212;
    margin-bottom: 24px;
    text-transform: uppercase;
    opacity: 0.6;
}

.pure-faq-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: #121212;
    margin: 0 0 30px 0;
}

@media (min-width: 768px) {
    .pure-faq-title {
        font-size: 5rem;
    }
}

@media (min-width: 1024px) {
    .pure-faq-title {
        font-size: 6.5rem;
    }
}

.pure-faq-desc {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #374151;
    /* High contrast gray */
    font-weight: 500;
    max-width: 650px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .pure-faq-desc {
        font-size: 1.25rem;
    }
}

/* --- 3. CONTENEDOR FAQ --- */
.pure-faq-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- 4. ITEM INDIVIDUAL (Tarjeta) --- */
.pure-faq-item {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.4);
    /* High contrast border */
    border-radius: 24px;
    overflow: hidden;
    /* OPTIMIZACIÓN: Solo animar lo necesario, no 'all' */
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    /* Prepara el navegador para pintar cambios */
    transform: translateZ(0);
}

/* --- 5. BOTÓN DE LA PREGUNTA --- */
.pure-faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: #121212;
    font-family: inherit;
    transition: color 0.3s ease;
    position: relative;
    z-index: 2;
}

.pure-faq-question span {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .pure-faq-question span {
        font-size: 1.5rem;
    }
}

/* Icono (+) */
.pure-faq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid #e5e7eb;
    /* Keep light gray for icon circle */
    border-radius: 50%;
    margin-left: 24px;
    flex-shrink: 0;
    color: #121212;
    background: transparent;
    /* OPTIMIZACIÓN: Transiciones específicas */
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
        background-color 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease;
}

.pure-faq-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
}

/* --- 6. ANIMACIÓN DE APERTURA (Grid System Optimizado) --- */
.pure-faq-answer-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    /* OPTIMIZACIÓN: Aceleración de hardware para el grid */
    will-change: grid-template-rows;
    /* Curva de animación más ágil al inicio */
    transition: grid-template-rows 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.pure-faq-inner {
    overflow: hidden;
    min-height: 0;
    opacity: 0;
    transform: translateY(-5px);
    /* Movimiento más sutil */
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* El texto */
.pure-faq-inner p {
    margin: 0;
    padding: 0 32px 32px 32px;
    font-size: 1rem;
    line-height: 1.7;
    color: #1f2937;
    /* Gray 800 - Very dark gray for max contrast */
    /* Renderizado de texto optimizado */
    -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
    .pure-faq-inner p {
        font-size: 1.125rem;
    }
}

/* --- 7. ESTADOS ACTIVOS (OPEN) --- */

.pure-faq-item.active {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

/* Abrir Grid */
.pure-faq-item.active .pure-faq-answer-wrapper {
    grid-template-rows: 1fr;
}

/* Mostrar Contenido */
.pure-faq-item.active .pure-faq-inner {
    opacity: 1;
    transform: translateY(0);
    /* Pequeño delay para que aparezca justo cuando el grid abre un poco */
    transition-delay: 0.05s;
}

/* Rotar Icono */
.pure-faq-item.active .pure-faq-icon {
    transform: rotate(45deg);
    border-color: transparent;
    background-color: #121212;
    color: #ffffff;
}

/* --- 8. COLORES DE MARCA --- */

/* Item 1: Lavanda */
.pure-faq-item:nth-child(1).active {
    background-color: #ADADD6;
}

/* Item 2: Negro */
.pure-faq-item:nth-child(2).active {
    background-color: #121212;
}

.pure-faq-item:nth-child(2).active .pure-faq-question {
    color: #ffffff;
}

.pure-faq-item:nth-child(2).active .pure-faq-inner p {
    color: #d1d5db;
}

.pure-faq-item:nth-child(2).active .pure-faq-icon {
    background-color: #ffffff;
    color: #121212;
}

/* Item 3: Oliva */
.pure-faq-item:nth-child(3).active {
    background-color: #9AB17C;
}

/* Item 4: Beige */
.pure-faq-item:nth-child(4).active {
    background-color: #E8E1D0;
}