/* ==========================================================================
   SECCIÓN HERO (PRINCIPAL) - SWIPER CON EFECTO PREMIUM
   ========================================================================== */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh; /* Altura visible real en navegadores móviles */
    overflow: hidden;
    background-color: var(--color-dark);
}

.hero-swiper {
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* ── EFECTO KEN BURNS: las imágenes se mueven lentamente como si fueran video ──
   La imagen se duplica en un pseudo-elemento (hereda el background inline)
   y se anima con zoom/paneo continuo; el degradado y el texto quedan encima. */
.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    z-index: 0;
    will-change: transform;
}

/* Cada slide con un movimiento distinto para que el carrusel se sienta filmado */
.hero-slide:nth-child(3n + 1)::after {
    animation: hero-kenburns-a 20s ease-in-out infinite alternate;
}

.hero-slide:nth-child(3n + 2)::after {
    animation: hero-kenburns-b 24s ease-in-out infinite alternate;
}

.hero-slide:nth-child(3n)::after {
    animation: hero-kenburns-c 22s ease-in-out infinite alternate;
}

@keyframes hero-kenburns-a {
    from { transform: scale(1) translate(0, 0); }
    to   { transform: scale(1.14) translate(1.5%, -1%); }
}

@keyframes hero-kenburns-b {
    from { transform: scale(1.14) translate(-1.5%, 1%); }
    to   { transform: scale(1) translate(0, 0); }
}

@keyframes hero-kenburns-c {
    from { transform: scale(1) translate(0, 0); }
    to   { transform: scale(1.12) translate(-1.5%, 1.2%); }
}

/* En slides con video de fondo, la capa Ken Burns taparía el video: ocultarla */
.hero-slide.has-video::after {
    display: none;
}

/* Accesibilidad: sin movimiento si el usuario lo tiene desactivado */
@media (prefers-reduced-motion: reduce) {
    .hero-slide::after {
        animation: none;
    }
}

/* Superposición de degradado para mejorar contraste del texto */
.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(5, 12, 26, 0.85) 0%,
        rgba(5, 12, 26, 0.4) 55%,
        rgba(5, 12, 26, 0.8) 100%
    );
    z-index: 1;
}

/* Video de Fondo */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    color: var(--color-bg-white);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-tag {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ff8a1f; /* Naranja más luminoso: mejor visibilidad sobre las fotos */
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55); /* Legible sobre zonas claras de la foto */
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.8s ease 0.3s;
}

.hero-title {
    font-size: 3.6rem; /* Sora es más ancha que Segoe: compensar para mantener 2 líneas */
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 24px;
    max-width: 800px;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.45);
    transform: translateY(40px);
    opacity: 0;
    transition: all 0.8s ease 0.5s;
}

/* Palabra destacada: naranja sólido y luminoso (sin borde ni transparencia),
   máxima legibilidad sobre las fotos */
.hero-title span {
    color: #ff8a1f;
    -webkit-text-fill-color: #ff8a1f;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.55);
}

.hero-desc {
    font-size: 1.2rem;
    font-weight: 400;
    max-width: 600px;
    margin-bottom: 40px;
    color: #e2e9f2; /* Un punto más claro para mejor contraste sobre la foto */
    line-height: 1.8;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
    transform: translateY(40px);
    opacity: 0;
    transition: all 0.8s ease 0.7s;
}

.hero-actions {
    display: flex;
    gap: 16px;
    transform: translateY(40px);
    opacity: 0;
    transition: all 0.8s ease 0.9s;
}

/* Animaciones del Swiper Activo */
.swiper-slide-active .hero-tag,
.swiper-slide-active .hero-title,
.swiper-slide-active .hero-desc,
.swiper-slide-active .hero-actions {
    transform: translateY(0);
    opacity: 1;
}

/* Indicador de Deslizamiento */
.hero-scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-bg-white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 5;
    opacity: 0.8;
}

.hero-scroll-line {
    width: 2px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.hero-scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: var(--color-accent-gradient);
    animation: scroll-hint-anim 2s infinite ease-in-out;
}

@keyframes scroll-hint-anim {
    0% {
        top: -20px;
    }
    50% {
        top: 20px;
    }
    100% {
        top: 60px;
    }
}

/* ==========================================================================
   SECCIÓN NOSOTROS (QUÍNES SOMOS)
   ========================================================================== */
.about-section {
    padding: 100px 0;
    background-color: var(--color-bg-white);
    overflow: hidden;
}

.about-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-visual {
    position: relative;
    padding: 30px;
}

.about-img-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.about-img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.about-visual:hover .about-img {
    transform: scale(1.03);
}

/* Caja Decorativa de Acento */
.about-deco-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    border: 5px solid rgba(255, 122, 0, 0.15);
    border-radius: var(--radius-lg);
    z-index: 1;
    transition: var(--transition-smooth);
}

.about-visual:hover .about-deco-box {
    transform: translate(-10px, -10px);
}

/* Insignia / Badge con Contador */
.about-badge {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: var(--color-primary);
    color: var(--color-bg-white);
    padding: 24px 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-glass);
}

.badge-num {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-accent);
    line-height: 1;
}

.badge-text {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.3;
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.about-desc {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 30px;
}

/* ==========================================================================
   SECCIÓN SERVICIOS (CSS GRID PREMIUM)
   ========================================================================== */
.services-section {
    padding: 100px 0;
    background-color: var(--color-bg-light);
}

.services-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.services-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    padding: 40px 30px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    border-top: 4px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

/* Decoración interna del card */
.service-card::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 120px;
    height: 120px;
    background: rgba(255, 122, 0, 0.03);
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.service-icon-box {
    width: 70px;
    height: 70px;
    background: rgba(10, 29, 55, 0.05);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    transition: var(--transition-smooth);
    color: var(--color-primary);
}

.service-icon-box i {
    font-size: 1.8rem;
}

.service-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 15px;
    transition: var(--transition-fast);
}

.service-card p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
}

.service-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-link i {
    transition: var(--transition-fast);
}

/* Hover de la Tarjeta */
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-top-color: var(--color-accent);
}

.service-card:hover .service-icon-box {
    background: var(--color-accent-gradient);
    color: var(--color-bg-white);
    transform: rotate(5deg) scale(1.05);
}

.service-card:hover h3 {
    color: var(--color-accent);
}

.service-card:hover .service-link {
    color: var(--color-accent);
}

.service-card:hover .service-link i {
    transform: translateX(5px);
}

.service-card:hover::after {
    transform: scale(1.5);
    background: rgba(255, 122, 0, 0.06);
}

/* ==========================================================================
   SECCIÓN PROYECTOS DESTACADOS
   ========================================================================== */
.projects-section {
    padding: 100px 0;
    background-color: var(--color-bg-white);
}

.projects-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.projects-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 50px;
}

.projects-swiper-controls {
    display: flex;
    gap: 12px;
}

.swiper-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition-smooth);
}

.swiper-nav-btn:hover {
    background: var(--color-primary);
    color: var(--color-bg-white);
}

/* Tarjeta del Proyecto en Swiper */
.project-slide-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--color-bg-white);
    transition: var(--transition-smooth);
}

.project-card-img-box {
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
}

.project-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.project-card-category {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--color-accent-gradient);
    color: var(--color-bg-white);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.project-card-info {
    padding: 30px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.project-card-info h3 {
    font-size: 1.25rem;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 12px;
}

.project-card-info p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    height: 72px; /* Forzar altura para uniformidad en cards */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Hover en card */
.project-slide-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.project-slide-card:hover .project-card-img {
    transform: scale(1.08);
}

/* ==========================================================================
   SECCIÓN CONTACTO Y MAPA (CON GLASSMORMIPHM)
   ========================================================================== */
.contact-section {
    position: relative;
    padding: 100px 0;
    background-color: var(--color-dark);
    /* Imagen de fondo conceptual */
    background-image: linear-gradient(135deg, rgba(5, 12, 26, 0.95) 0%, rgba(5, 12, 26, 0.85) 100%), url('https://images.unsplash.com/photo-1541888946425-d81bb19240f5?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.contact-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}

.contact-info-side {
    color: var(--color-bg-white);
}

.contact-info-side p {
    color: var(--color-text-light);
    margin-bottom: 40px;
    font-size: 1.1rem;
    max-width: 500px;
}

.map-wrapper {
    width: 100%;
    height: 380px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-lg);
}

.map-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   SOPORTE RESPONSIVE (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .about-img {
        height: 400px;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    /* background-attachment: fixed no funciona en iOS/Android */
    .contact-section {
        background-attachment: scroll;
    }
}

@media (max-width: 768px) {
    /* Hero Swiper Responsivo */
    .hero-content {
        padding-top: var(--header-height); /* Evitar que el texto quede bajo el header fijo */
    }

    .hero-title {
        font-size: 2rem !important;
        line-height: 1.25;
        margin-bottom: 18px;
    }
    
    .hero-desc {
        font-size: 0.95rem !important;
        line-height: 1.6;
        margin-bottom: 30px;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .hero-actions a {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    /* Nosotros Responsivo */
    .about-section {
        padding: 60px 0;
    }
    
    .about-visual {
        padding: 0;
        margin-bottom: 30px;
    }
    
    .about-img {
        height: 320px;
    }
    
    .about-deco-box {
        display: none; /* Eliminar caja decorativa para evitar overflow horizontal en móviles */
    }
    
    .about-badge {
        padding: 12px 18px;
        bottom: 10px;
        right: 10px;
        gap: 10px;
    }
    
    .badge-num {
        font-size: 2rem;
    }
    
    .badge-text {
        font-size: 0.75rem;
    }
    
    /* Servicios Responsivo */
    .services-section {
        padding: 60px 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .service-card {
        padding: 30px 24px;
    }
    
    /* Proyectos Responsivo */
    .projects-section {
        padding: 60px 0;
    }
    
    .projects-header-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    /* Contacto & Mapa Responsivo */
    .contact-section {
        padding: 60px 0;
    }
    
    .map-wrapper {
        height: 250px;
    }
    
    /* Formulario Glassmorphism */
    .glassmorphism-form {
        padding: 30px 20px !important;
        margin: 0 auto;
        width: 100%;
    }

    .hero-scroll-hint {
        bottom: 16px;
    }

    .hero-scroll-line {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.7rem !important;
    }

    .hero-tag {
        font-size: 0.75rem;
        letter-spacing: 2.5px;
        margin-bottom: 14px;
    }

    .hero-desc {
        font-size: 0.9rem !important;
        margin-bottom: 24px;
    }

    .about-section,
    .services-section,
    .projects-section,
    .contact-section {
        padding: 50px 0;
    }

    .about-img {
        height: 260px;
    }

    .badge-num {
        font-size: 1.6rem;
    }

    .project-card-img-box {
        height: 220px;
    }

    .project-card-info {
        padding: 24px 20px;
    }

    .contact-info-side p {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .map-wrapper {
        height: 220px;
    }
}
