/* ==========================================================================
   ROOT & VARIABLES
   ========================================================================== */
:root {
    --primary-color:     #ffe401;
    --secondary-color:   #fc8f00;
    --white:             #ffffff;
    --cinematic-dark:    #1a1a1a;
    --cinematic-gold:    #d4a017;
    --cinematic-red:     #a61c1c;
    --silent-film:       #8a8a8a;
    --text-muted:        #cccccc;
    --shadow-soft:       0 8px 24px rgba(0,0,0,0.35);
}

/* ==========================================================================
   BASE & RESET + ANTI-DESBORDE
   ========================================================================== */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;           /* ← el más importante para evitar scroll horizontal */
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', system-ui, sans-serif;
    background: var(--primary-color);
    color: #333;
    line-height: 1.6;
}

/* ==========================================================================
   HEADER & NAV
   ========================================================================== */
.header1 {
    width: 100%;
    background: var(--primary-color);
}

#topbar,
#logo,
#mainav {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

#topbar ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0.8rem 0;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    color: #fff;
    gap: 1.8rem;
}

#topbar ul li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#topbar ul li i {
    color: #007bff;
}

#logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    flex-wrap: wrap;
    gap: 1.5rem;
}

#mainav {
    background: #b1b127;
    position: relative;
    z-index: 100;
}

#mainav .menu-toggle {
    display: none;
    color: white;
    font-size: 1.6rem;
    padding: 1rem;
    cursor: pointer;
}

#mainav > ul.clear {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 1rem 0;
    gap: 1.5rem;
    margin: 0;
}

#mainav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.8rem 1.2rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

#mainav ul li a:hover,
#mainav ul li.active a {
    background: #e9811a;
}

/* Dropdowns */
#mainav ul li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #444;
    min-width: 220px;
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
    z-index: 200;
}

#mainav ul li:hover > ul {
    display: block;
}

#mainav ul li ul li a {
    display: block;
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
}

#mainav ul li ul li a:hover {
    background: #e9811a;
}

/* ==========================================================================
   CARRUSEL
   ========================================================================== */
.carousel {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.carousel-images {
    display: flex;
    height: 100%;
    transition: transform 0.7s ease-in-out;
    will-change: transform;           /* Mejora rendimiento en animación */
}

.carousel-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

#pageintro {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    background: rgba(0,0,0,0.45);
    padding: 2rem;
}

#pageintro h3 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 1rem;
    text-shadow: 0 3px 12px rgba(0,0,0,0.8);
}

#pageintro p {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    max-width: 720px;
    margin: 0 auto 1.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

/* ==========================================================================
   SERVICIOS VIRTUALES (optimizado - sin bokeh pesado por defecto)
   ========================================================================== */
.wrapper.row3.servicios-virtuales {
    position: relative;
    padding: 5rem 1.5rem;
    background: linear-gradient(135deg, #141414 0%, #282828 50%, #141414 100%);
    color: var(--white);
    text-align: center;
    overflow: hidden;
}

/* Grano de película ligero (opcional - bajo costo) */
.servicios-virtuales::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    animation: filmGrainLight 12s steps(5) infinite;
}

@keyframes filmGrainLight {
    0%,100% { transform: translate(0,0); }
    50%     { transform: translate(2px, -2px); }
}

/* Título */
.servicios-virtuales .heading {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--cinematic-gold);
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(212,160,23,0.4);
    margin-bottom: 1.5rem;
    position: relative;
}

.servicios-virtuales .heading::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cinematic-gold), transparent);
}

/* Botón */
.servicios-virtuales .btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: linear-gradient(90deg, var(--cinematic-gold), #c6891a);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.35s ease;
}

.servicios-virtuales .btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(212,160,23,0.4);
}

/* Grid tarjetas */
.servicios-virtuales .icon-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    list-style: none;
    margin-top: 2.5rem;
}

.servicios-virtuales article {
    background: rgba(40,40,40,0.9);
    border-radius: 12px;
    padding: 2.2rem 1.6rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s ease;
    border: 1px solid rgba(212,160,23,0.12);
}

.servicios-virtuales article:hover {
    transform: translateY(-12px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}

.servicios-virtuales .icono-grande {
    font-size: 3.8rem;
    color: var(--cinematic-gold);
    margin-bottom: 1.2rem;
    transition: all 0.4s ease;
}

.servicios-virtuales article:hover .icono-grande {
    color: var(--cinematic-red);
    transform: scale(1.12);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    #mainav .menu-toggle { display: block; }
    #mainav > ul.clear {
        display: none;
        flex-direction: column;
        padding: 1rem;
    }
    #mainav > ul.clear.active { display: flex; }
    #mainav ul li { margin: 0.8rem 0; }
    #mainav ul li ul { position: static; background: #555; }
}

@media (max-width: 768px) {
    #topbar ul, #logo { flex-direction: column; gap: 1rem; text-align: center; }
    .wrapper.row3.servicios-virtuales { padding: 3.5rem 1rem; }
    .carousel { height: 60vh; }
    .carousel-images img { height: 100%; }
}

@media (max-width: 480px) {
    .servicios-virtuales .heading { font-size: 2rem; }
    .icono-grande { font-size: 3rem; }
}