/**
 * Kinetic Seven - Global Layout y Estructura App Shell Grid
 * Resuelve la retícula base de Header Superior + Barra Lateral.
 */

/* =========================================
   1. RESET Y BASE (No-Line & Clean Canvas)
   ========================================= */
html,
body {
    margin: 0;
    padding: 0;
    background-color: var(--k-surface-1);
    color: var(--k-text-med);
    font-family: var(--k-font-body);
    /* Soft scrolling para las anclas fijas */
    scroll-behavior: smooth;
    line-height: 1.6;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* =========================================
   2. TOPBAR FIJO (Glassmorphism Header)
   ========================================= */
.k-topbar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Altura fluida auto */
    background-color: rgba(19, 19, 19, 0.85);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-bottom: 0px;
    /* Cero bordes sólidos según manual de marca */
    box-shadow: 0 4px 20px rgba(230, 33, 23, 0.1);
    /* Efecto leve de elevación */
    z-index: 1000;
}

/* Fix WP Admin Bar overlap */
html.k-body-surface.admin-bar .k-topbar-fixed,
body.admin-bar .k-topbar-fixed {
    top: 32px;
}

@media screen and (max-width: 782px) {

    html.k-body-surface.admin-bar .k-topbar-fixed,
    body.admin-bar .k-topbar-fixed {
        top: 46px;
    }
}

.k-topbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    /* Menor padding vertical (py-4) */
    max-width: none;
    margin: 0 auto;
}

.k-brand-zone {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.k-brand-text {
    font-family: var(--k-font-display);
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--k-text-med);
    text-decoration: none;
    letter-spacing: -0.05em;
    line-height: 1.1;
    font-style: italic;
    /* Signature estilo 'Seven' */
}

/* =========================================
   3. APP SHELL GRID (Dos Columnas Base)
   ========================================= */
.k-app-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    padding-top: 95px;
    /* Ajustado al nuevo alto aproximado del header con logo */
    min-height: 100vh;
}

/* =========================================
   3.1. COMPATIBILIDAD ELEMENTOR FULL WIDTH
   ========================================= */
.k-elementor-fw-grid {
    display: block;
    /* Se rompe el grid 280px 1fr para un lienzo total */
    padding-top: 95px;
    /* Se conserva el margen contra el topbar nav */
    min-height: 100vh;
}

/* =========================================
   4. SIDEBAR LATERAL (Navegación Anclada)
   ========================================= */
.k-sidebar-fixed {
    background-color: var(--k-surface-2);
    /* Elevamos a surface-2 */
    border-right: 0px;
    /* Quitamos bordes físicos */
    position: relative;
}

.k-sidebar-inner {
    position: sticky;
    top: 95px;
    height: calc(100vh - 95px);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* =========================================
   5. CONTENIDO PRINCIPAL (Main Fluid Column)
   ========================================= */
.k-main-area {
    width: 100%;
    min-width: 0;
    /* Previene collapse/desborde en CSS Grid de hijos flex de Elementor */
    position: relative;
    /* Fija punto de referencia a JS de Elementor */
}

.k-main-inner-container {
    width: 100%;
    /* Forzar expansión para evitar colapso de la zona de drop de Elementor en Grid */
    padding: 4rem;
    /* Aire profundo interior */
    max-width: 1100px;
    /* Ancho cómodo de lectura */
    margin: 0 auto;
    /* Centrar el contenido dentro del panel principal */
    position: relative;
    /* Define coordenadas 0,0 para estiramiento JS de Elementor Editor */
}

/* Acople Frontal: Evitar franja vacía gris visible entre el hero de la portada y la parrilla Elementor */
.home .k-main-inner-container {
    padding-top: 0 !important;
}

/* =========================================
   6. HERO CAROUSEL FULL-SCREEN (PORTADA)
   ========================================= */
.k-hero-viewport {
    width: 100%;
    max-width: 100vw;
    height: 85vh;
    height: 85svh;
    min-height: 85vh;
    /* Reduced from 100vh so it doesn't take the full screen height */
    min-height: 85svh;
    position: relative;
    overflow: hidden;
    background-color: var(--k-surface-0);
}

.k-hero-swiper {
    position: absolute;
    /* Para que swiper ocupe todo el espacio padre */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.swiper-slide {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
}

.k-slide-content-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Enviar todo el texto abajo */
    padding: 2rem 4rem 2rem 4rem;
    /* Texto muy al borde inferior */
    z-index: 10;
}

/* Efecto oscurecedor/Vignette sobre el slide (Legibilidad) - Ajustado */
.k-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Gradiente menos agresivo para dejar ver la imagen perdiendo menos espacio vertical al final */
    background: linear-gradient(90deg, rgba(10, 10, 10, 0.65) 0%, rgba(10, 10, 10, 0.3) 50%, rgba(10, 10, 10, 0.05) 100%),
        linear-gradient(180deg, transparent 65%, var(--k-surface-0) 100%);
    z-index: 5;
}

/* Imagen de fondo del slide con compatibilidad Object Fit */
.k-slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* Evita que recorte la cabeza de las personas */
    z-index: 1;
}

/* Typografía dinámica interna del Hero */
.k-hero-viewport h1.k-heading-display {
    font-family: var(--k-hero-font-display, var(--k-font-display));
    margin: 0;
    /* Previene el terrible margen base de HTML en fuentes gigantes */
}

.k-hero-badge {
    display: inline-block;
    background-color: var(--k-primary);
    color: var(--k-text-high);
    padding: 0.3rem 1.2rem;
    font-family: var(--k-hero-font-body, var(--k-font-body));
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    /* Ajustado para estar muy cerca del título */
    align-self: flex-start;
}

.k-hero-subtitle {
    font-family: var(--k-hero-font-body, var(--k-font-body));
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--k-text-med);
    margin-bottom: 1rem;
    /* Acercar el botón al párrafo */
    margin-top: 0.5rem;
    /* Acercar el párrafo al título */
    max-width: 800px;
}

/* Botones en Hero */
.k-hero-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.k-hero-actions .k-btn {
    font-family: var(--k-hero-font-display, var(--k-font-display));
}

/* Paginador Swiper Color Custom */
.swiper-pagination-bullet {
    background-color: var(--k-text-low);
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background-color: var(--k-primary);
    opacity: 1;
}

/* =========================================
   7. HELPER CLASSES Layout
   ========================================= */
.k-grid-container {
    display: grid;
}

.k-flex {
    display: flex;
}

.k-gap-base {
    gap: 2rem;
}

.k-mt-2 {
    margin-top: 0.5rem;
}

.k-mt-4 {
    margin-top: 2rem;
}

.k-mb-2 {
    margin-bottom: 0.5rem;
}

.k-mb-4 {
    margin-bottom: 2rem;
}

.k-ml-4 {
    margin-left: 1rem;
}

.k-w-full {
    width: 100%;
}

/* Mobile Redesigned Navigation */
.k-mobile-bottom-nav {
    display: none;
}

/* Mobile Menu Overlay */
.k-mobile-menu-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(19, 19, 19, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    overflow-y: auto;
    padding: 100px 1.5rem 6rem 1.5rem;
    flex-direction: column;
}

.k-mobile-menu-overlay.k-open {
    display: flex;
}

.k-mobile-overlay-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.k-mobile-overlay-nav ul li a {
    color: var(--k-text-high);
    font-family: var(--k-font-display);
    font-size: 1.5rem;
    /* Aumentado para más cuerpo */
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0;
    /* Sin letter-spacing negativo */
    -webkit-font-smoothing: antialiased;
    -webkit-text-stroke: 0.04em currentColor;
}

.k-mobile-overlay-nav ul li.current-menu-item a {
    color: var(--k-primary);
}

.k-mobile-overlay-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.k-mobile-overlay-actions .k-btn {
    width: 100%;
}

/* Mobile Reponsividad Crítica */
.k-mobile-menu-toggle {
    display: none;
}

@media (max-width: 992px) {
    .k-app-grid {
        grid-template-columns: 1fr;
    }

    .k-app-grid,
    .k-elementor-fw-grid {
        padding-bottom: 80px;
    }

    /* Evitar superposicion */
    .k-sidebar-fixed {
        display: none;
    }

    .k-topbar-container {
        padding: 1rem 1.5rem;
        justify-content: space-between;
    }

    .k-main-inner-container {
        padding: 2rem 1.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* Centrado global */
        text-align: center;
    }

    .k-topbar-container .k-top-nav-zone {
        display: none;
    }

    /* Completamente oculto en móvil */
    .k-topbar-container .k-mobile-menu-toggle {
        display: block;
        margin-left: auto;
        background: transparent;
        border: none;
        cursor: pointer;
    }

    .k-hamburger-line {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--k-text-high);
        margin: 5px 0;
        transition: var(--k-transition);
    }

    .k-mobile-menu-toggle.k-active .k-hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .k-mobile-menu-toggle.k-active .k-hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .k-mobile-menu-toggle.k-active .k-hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Responsive Hero adjustments */
    .k-hero-viewport {
        min-height: auto;
        /* Dejar que fluya en movil */
        height: 65vh;
        /* Altura más controlada y menor para no generar tanto espacio vacío debajo */
    }

    .k-slide-content-wrapper {
        padding: 95px 1.5rem 2rem 1.5rem;
        /* 95px top padding para no recortar la palabra debajo del header (Topbar) */
        align-items: flex-start;
        /* Izquierda como landing */
        text-align: left;
        /* Izquierda como landing */
        justify-content: center;
        /* Centrado en el espacio restante */
    }

    .k-brand-text {
        font-size: 1.1rem;
    }

    .k-slide-content-wrapper h1.k-heading-display {
        font-size: 2.25rem;
        /* Reducido para evitar overflows */
        line-height: 0.9;
        word-break: break-word;
        hyphens: none;
        margin-bottom: 0.5rem;
        /* Ajustar el margen verde 1 */
    }

    .k-slide-content-wrapper .k-hero-subtitle {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        /* Ajustar el margen verde 2 */
        line-height: 1.3;
    }

    .k-hero-actions.k-mt-4 {
        margin-top: 1rem;
        /* Bajar el margen excesivo de 2rem (k-mt-4) a 1rem */
    }

    .k-hero-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 320px;
    }

    .k-hero-actions .k-btn {
        width: 100%;
        text-align: center;
    }

    /* Fixed Bottom Nav Bar */
    .k-mobile-bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: rgba(19, 19, 19, 0.95);
        backdrop-filter: blur(12px) saturate(160%);
        -webkit-backdrop-filter: blur(12px) saturate(160%);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        z-index: 1000;
        padding: 0.75rem 0;
    }

    .k-mobile-bottom-nav ul,
    .k-mobile-bottom-nav-list {
        display: flex;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .k-mobile-bottom-nav ul li,
    .k-mobile-bottom-nav-list li {
        margin: 0;
        padding: 0;
    }

    .k-mobile-bottom-nav ul a,
    .k-mobile-bottom-nav-list a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: rgba(229, 226, 225, 0.5);
        /* Text low */
        text-decoration: none;
        font-family: var(--k-font-display);
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        transition: color 0.3s ease;
    }

    /* Fuerza a ocultar texto y usar iconos grandes para menú inferior en caso de tener font-size grande */
    .k-mobile-bottom-nav ul a,
    .k-mobile-bottom-nav-list a {
        font-size: 0;
    }

    .k-mobile-bottom-nav ul a .material-symbols-outlined,
    .k-mobile-bottom-nav-list a .material-symbols-outlined,
    .k-mobile-bottom-nav ul a i,
    .k-mobile-bottom-nav-list a i {
        font-size: 24px;
        margin-bottom: 2px;
    }

    .k-mobile-bottom-nav ul a span:not(.material-symbols-outlined),
    .k-mobile-bottom-nav-list a span:not(.material-symbols-outlined) {
        display: none;
    }

    .k-mobile-bottom-nav ul a:hover,
    .k-mobile-bottom-nav ul a:active,
    .k-mobile-bottom-nav ul .current-menu-item a,
    .k-mobile-bottom-nav-list a:hover,
    .k-mobile-bottom-nav-list a:active,
    .k-mobile-bottom-nav-list .current-menu-item a {
        color: var(--k-primary);
    }
}