/* =======================================================================
   LANDING.CSS - KIKIBROWS PREMIUM LOOK
   ======================================================================= */

/* 1. CONFIGURACIÓN DE SECCIONES (Sticky / Full Height) */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    perspective: 1500px; /* Necesario para el efecto 3D de empuje */
    overflow-x: hidden;
    /* Optimización para iOS */
    -webkit-overflow-scrolling: touch;
}

.sticky-section {
    position: relative;
    height: 100vh; /* Ocupa toda la pantalla */
    width: 100%;
    overflow: hidden;
    z-index: 1;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Z-index escalonado para que cada sección 'pise' a la anterior */
#nosotros { z-index: 10; }
#inicio { z-index: 20; }
#galeria { z-index: 22; }
#contacto { z-index: 30; }

/* 2. CARRUSEL (Sección Inicio) */
/* .carousel-full-width reemplazado por clases Bootstrap w-100 h-100 */

.carousel-item {
    background-size: cover;
    background-position: center;
}

/* Hero carousel más pequeño que el de Nosotros */
#inicio {
    height: 70vh !important;
    min-height: 500px;
}

#homeCarousel .carousel-item {
    height: 70vh;
    min-height: 500px;
}

.bg-overlay-dark {
    background: rgba(0, 0, 0, 0.3);
    /* Layout (w, h, flex) manejado por clases Bootstrap: w-100 h-100 d-flex align-items-center justify-content-center */
}

.carousel-caption-custom {
    /* Fallback para navegadores sin soporte de backdrop-filter */
    background-color: rgb(253, 252, 250);
    /* Efecto blur para navegadores compatibles */
    background-color: rgba(253, 252, 250, 0.92);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 8px;
    padding: 3.5rem;
    max-width: 650px;
    color: var(--text-dark);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* Fallback para Android sin soporte de backdrop-filter */
@supports not (backdrop-filter: blur(15px)) {
    .carousel-caption-custom {
        background-color: rgba(253, 252, 250, 0.98);
    }
}

.carousel-caption-custom h1 {
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 2px;
}

.carousel-indicators [data-bs-target] {
    background-color: var(--primary-color);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 6px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.carousel-indicators [data-bs-target].active {
    opacity: 1;
}

/* 3. SECCIÓN NOSOTROS & CONTACTO */
.nosotros-content {
    background-color: var(--white);
    height: 100%;
}

.social-icons a {
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.social-icons a:hover {
    color: var(--accent-color) !important;
    transform: scale(1.15);
}

.contacto-block {
    /* Fallback para navegadores sin soporte de backdrop-filter */
    background-color: rgb(253, 252, 250);
    /* Efecto blur para navegadores compatibles */
    background-color: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    transition: transform 0.3s ease;
    border: 1px solid var(--border-light);
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

@supports not (backdrop-filter: blur(15px)) {
    .contacto-block {
        background-color: rgba(253, 252, 250, 0.98);
    }
}

.register-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 4px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Lato', sans-serif;
    text-decoration: none;
    display: inline-block;
}

.register-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 131, 90, 0.3);
}

/* 4. ANIMACIONES */
.animate-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
}

.animate-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Optimizaciones de rendimiento para animaciones */
.sticky-section {
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

/* Desactivar animaciones pesadas en móviles para mejor rendimiento */
@media (max-width: 767px) {
    .animate-up {
        opacity: 0;
        transform: none;
        transition: opacity 0.6s ease-out;
    }

    .animate-up.visible {
        opacity: 1;
        transform: none;
    }

    /* Desactivar efectos 3D en móviles */
    .sticky-section {
        will-change: auto;
        transform: none !important;
    }

    body {
        perspective: none;
    }

    /* Desactivar hover effects en móviles */
    .producto-card:hover {
        transform: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    }

    .register-button:hover {
        transform: none;
        box-shadow: none;
    }
}

/* 5. CARRUSEL DE CURSOS */
#cursos {
    z-index: 25;
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
    padding: 3rem 1.5rem !important;
    background-color: var(--light-bg);
    background-image: url('../img/IMG_0793.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
}

/* Overlay blanqueado/difuminado sobre la foto de fondo de Cursos
   (mismo tratamiento que el carrusel de Nosotros para legibilidad) */
#cursos::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(253, 252, 250, 0.62);
    z-index: 0;
}

#cursos > .container {
    position: relative;
    z-index: 1;
}

/* Carrusel de cursos */
.cursos-carousel {
    position: relative;
    padding: 2rem 0;
}

.cursos-carousel .carousel-inner {
    padding: 1rem 0;
}

.cursos-carousel .carousel-item {
    transition: transform 0.6s ease-in-out;
    height: auto;
}

/* Controles del carrusel (flechas) */
.cursos-carousel .carousel-control-prev,
.cursos-carousel .carousel-control-next {
    width: 5%;
    opacity: 1;
    z-index: 10;
}

.cursos-carousel .carousel-control-prev-icon,
.cursos-carousel .carousel-control-next-icon {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    background-size: 20px 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cursos-carousel .carousel-control-prev-icon:hover,
.cursos-carousel .carousel-control-next-icon:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(138, 131, 90, 0.3);
}

/* Ajustes responsivos para controles */
@media (max-width: 767px) {
    .cursos-carousel .carousel-control-prev,
    .cursos-carousel .carousel-control-next {
        width: 10%;
    }

    .cursos-carousel .carousel-control-prev-icon,
    .cursos-carousel .carousel-control-next-icon {
        width: 40px;
        height: 40px;
        background-size: 16px 16px;
    }
}

.productos-grid-container {
    width: 100%;
    padding: 1rem 0;
    max-width: 1400px;
    margin: 0 auto;
}

/* Contenedor del carrusel */
.productos-grid {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.producto-card {
    /* Fallback para navegadores sin soporte de backdrop-filter */
    background-color: rgb(253, 252, 250);
    /* Efecto blur para navegadores compatibles */
    background-color: rgba(253, 252, 250, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 450px;
}

@supports not (backdrop-filter: blur(15px)) {
    .producto-card {
        background-color: rgba(253, 252, 250, 0.98);
    }
}

.producto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.producto-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--border-light);
}

.producto-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.producto-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
}

.producto-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.producto-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1.25rem;
    font-family: 'Cormorant Garamond', serif;
}

.producto-card .register-button {
    margin-top: auto;
    text-decoration: none;
}

/* Responsivo para tablets y móviles */
@media (max-width: 767px) {
    #cursos {
        padding: 2.5rem 1rem !important;
    }

    .producto-card {
        min-height: 400px;
    }

    .carousel-caption-custom {
        padding: 2rem 1.5rem;
        max-width: 90%;
    }

    .carousel-caption-custom h1 {
        font-size: 1.75rem;
    }

    .carousel-caption-custom .lead {
        font-size: 1rem;
    }

    .cursos-carousel {
        padding: 1rem 0;
    }

    #inicio {
        height: 60vh !important;
        min-height: 450px;
    }

    #homeCarousel .carousel-item {
        height: 60vh;
        min-height: 450px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    #cursos {
        padding: 2rem 0.75rem !important;
    }

    .carousel-caption-custom {
        padding: 1.5rem 1rem;
    }

    .carousel-caption-custom h1 {
        font-size: 1.5rem;
    }

    .producto-card {
        min-height: 420px;
    }

    #inicio {
        height: 55vh !important;
        min-height: 400px;
    }

    #homeCarousel .carousel-item {
        height: 55vh;
        min-height: 400px;
    }
}

/* 5b. SECCIÓN GALERÍA (mobile-first) */
#galeria {
    z-index: 22;
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
    padding: 3rem 1.5rem !important;
    background-color: var(--light-bg);
}

.galeria-grid-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tile base: misma altura por breakpoint, recorte con object-fit para una grilla pareja */
.galeria-img {
    width: 100%;
    height: 200px;              /* Móvil (default): 2 columnas (col-6) */
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

.galeria-img:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Imagen destacada: ancho completo en móvil, algo más alta para darle protagonismo */
.galeria-img-feature {
    height: 240px;
}

/* Tablet: la destacada sigue a todo el ancho (col-12), el resto en pares (col-6) */
@media (min-width: 768px) {
    .galeria-img,
    .galeria-img-feature {
        height: 260px;
    }
}

/* Escritorio: grilla tipo bento. Destacada col-lg-6 + 6 tiles col-lg-3 (dos filas de 12) */
@media (min-width: 992px) {
    .galeria-img,
    .galeria-img-feature {
        height: 300px;
    }
}

/* Desactivar hover en móviles para mejor rendimiento */
@media (max-width: 767px) {
    .galeria-img:hover {
        transform: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    }
}

/* 6. CARRUSEL DE FONDO - NOSOTROS */
.nosotros-bg-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.nosotros-bg-carousel .carousel-inner,
.nosotros-bg-carousel .carousel-item {
    height: 100%;
}

/* La imagen de cada capa se define inline en el HTML (background-image)
   para que la URL se resuelva relativa al documento y no al archivo CSS */
.nosotros-slide-blur,
.nosotros-slide-main {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
}

/* Relleno difuminado de los costados (recorte lateral permitido) */
.nosotros-slide-blur {
    background-size: cover;
    filter: blur(24px) brightness(0.96);
    transform: scale(1.12); /* evita bordes transparentes por el blur */
}

/* Foto completa: nunca se recorta verticalmente (cumple "vertical no") */
.nosotros-slide-main {
    background-size: contain;
}

/* En móvil la foto llena la sección (sin bandas difuminadas que dejan
   espacio vacío sobre el texto); el recorte es lateral, no vertical. */
@media (max-width: 767px) {
    .nosotros-slide-main {
        background-size: cover;
    }
}

/* Overlay suave para que el texto sea legible sin perder la estética.
   Menos opacidad para que las fotos se vean (antes se veían lavadas/blancas). */
.nosotros-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 252, 250, 0.40);
    z-index: 1;
}

/* Capa de contenido por encima del overlay.
   Layout en columna definido localmente (no depende de utilidades de Bootstrap):
   título arriba + cuerpo centrado en el espacio restante. */
.nosotros-content-layer {
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Título arriba; cuerpo (texto + botón) centrado en el espacio restante */
#nosotros .nosotros-title-block {
    padding-top: 9vh;
    width: 100%;
}
#nosotros .nosotros-body-block {
    margin-top: auto;
    margin-bottom: auto;
    width: 100%;
}

/* Reducir el tamaño del párrafo (no del título) */
#nosotros .nosotros-content-layer p.lead {
    font-size: 1.05rem;
    line-height: 1.7;
}

@media (max-width: 767px) {
    #nosotros .nosotros-title-block { padding-top: 7vh; }
    #nosotros .nosotros-content-layer p.lead { font-size: 0.95rem; }
}

/* Indicadores del carrusel nosotros */
#nosotrosCarousel .carousel-indicators {
    z-index: 3;
}


/* 7. FONDO IMAGEN - CONTACTO */
/* El .contacto-block ya tiene backdrop-filter y rgba que le dan contraste suficiente */
#contacto {
    background-color: transparent;
}

#contacto::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(253, 252, 250, 0.45);
    z-index: 0;
}

#contacto .container {
    position: relative;
    z-index: 1;
}
