/* ================================================================
   UNIVERSUM CONSULTING GROUP — Hoja de estilos personalizada
   Versión: 3.0 | Paleta oficial de marca
   Colores: Blanco, Gris marca #231F20, Rojo/guinda #CE181E
   ================================================================ */


/* ----------------------------------------------------------------
   1. VARIABLES CSS — Paleta oficial de marca
   ---------------------------------------------------------------- */
:root {
    /* Colores de marca exactos */
    --red:        #CE181E;   /* Rojo / guinda — color de acento */
    --red-dark:   #a81218;   /* Rojo oscuro para hover */
    --brand:      #231F20;   /* Gris oscuro — color principal de texto e íconos */

    /* Escala de blancos y grises neutros */
    --white:      #ffffff;
    --off-white:  #f7f7f7;   /* Fondo alterno de secciones */
    --gray-light: #eeeeee;   /* Bordes muy sutiles */
    --gray-mid:   #999999;   /* Texto secundario */
    --gray-text:  #555555;   /* Texto de párrafos */

    /* Alias semánticos */
    --color-text:       var(--brand);
    --color-text-muted: var(--gray-text);
    --color-border:     #e2e2e2;

    /* Tipografía */
    --font-sans: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --line-height-base: 1.75;

    /* Espaciado */
    --sp-xs:  0.5rem;
    --sp-sm:  1rem;
    --sp-md:  2rem;
    --sp-lg:  4rem;
    --sp-xl:  7rem;

    /* Layout */
    --container-max: 1140px;
    --navbar-h:      68px;

    /* Efectos */
    --shadow-sm:  0 2px 8px  rgba(35, 31, 32, 0.07);
    --shadow-md:  0 4px 20px rgba(35, 31, 32, 0.10);
    --shadow-lg:  0 10px 40px rgba(35, 31, 32, 0.14);
    --radius:     6px;
    --radius-lg:  12px;
    --transition: 0.26s ease;
}


/* ----------------------------------------------------------------
   2. RESET
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: var(--white);
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-dark); }
ul  { list-style: none; }


/* ----------------------------------------------------------------
   3. CONTAINER
   ---------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--sp-md);
}


/* ----------------------------------------------------------------
   4. BOTONES
   Primario: rojo sólido — el principal call-to-action de la marca
   Contorno: borde oscuro — acción secundaria sobre fondos claros
   ---------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.85rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    white-space: nowrap;
}

/* Rojo — acción principal */
.btn-primary {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--red-dark);
    border-color: var(--red-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(206, 24, 30, 0.30);
    text-decoration: none;
}

/* Contorno oscuro — acción secundaria */
.btn-outline {
    background: transparent;
    color: var(--brand);
    border-color: var(--brand);
}

.btn-outline:hover,
.btn-outline:focus-visible {
    background: var(--brand);
    color: var(--white);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Contorno blanco — sobre el footer oscuro */
.btn-outline-white {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.55);
}

.btn-outline-white:hover {
    background: rgba(255,255,255,0.10);
    border-color: var(--white);
    color: var(--white);
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-full { width: 100%; padding-top: 0.88rem; padding-bottom: 0.88rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }


/* ----------------------------------------------------------------
   5. NAVBAR
   Blanca con borde inferior sutil, siempre visible.
   Al hacer scroll gana sombra para marcar la separación.
   ---------------------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 900;
    height: var(--navbar-h);
    background: var(--white);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}

/* Al hacer scroll: sombra suave + borde */
.navbar.scrolled {
    border-bottom-color: var(--color-border);
    box-shadow: 0 2px 12px rgba(35, 31, 32, 0.07);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--sp-md);
}

/* Logo del navbar: oculto mientras el hero logo esté en pantalla.
   main.js agrega .hero-out al navbar cuando el hero logo sale del viewport. */
.nav-logo img {
    height: 36px;
    width: auto;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.navbar.hero-out .nav-logo img {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-links { display: flex; align-items: center; gap: 0; }

.nav-link {
    display: block;
    padding: 0.5rem 1.1rem;
    color: var(--brand);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    border-radius: var(--radius);
    transition: all var(--transition);
    position: relative;
}

.nav-link:hover { color: var(--red); background: rgba(206,24,30,0.05); text-decoration: none; }

/* Enlace activo — color rojo + línea roja inferior */
.nav-link.active { color: var(--red); }

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px; left: 50%;
    transform: translateX(-50%);
    width: 20px; height: 2px;
    background: var(--red);
    border-radius: 2px;
}

/* Botón hamburguesa — solo en móvil */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--brand);
    border-radius: 2px;
    transition: all var(--transition);
}


/* ----------------------------------------------------------------
   6. HERO
   Fondo blanco limpio. La franja roja en la parte superior
   introduce el color de acento desde el primer momento.
   ---------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--white);
    /* Desplazamiento para que el hero quede debajo de la navbar fija */
    padding-top: var(--navbar-h);
    overflow: hidden;
}

/* Canvas de red de partículas — ocupa todo el hero, detrás del contenido */
#heroCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* los clicks pasan al contenido */
}

/* Franja roja decorativa en la parte superior — sello de marca */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: var(--red);
    z-index: 4;
}

/* Fondo suavemente degradado de blanco a gris muy claro */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 90% 70% at 50% 110%, var(--off-white) 0%, var(--white) 60%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 640px;
    padding: var(--sp-lg) var(--sp-md);
    animation: heroEntrance 0.8s ease both;
}

/* Logo SVG del hero — grande, centrado y sin límite de pixelado (SVG) */
.hero-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto var(--sp-md);
    width: min(640px, 90vw);
}

.hero-logo img {
    width: 100%;
    height: auto;
}

.hero-title {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    font-weight: 200;
    color: var(--brand);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: var(--sp-xs);
}

/* Línea roja decorativa bajo el título */
.hero-title-accent {
    display: block;
    width: 48px; height: 3px;
    background: var(--red);
    margin: 0.8rem auto 1.4rem;
    border-radius: 2px;
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--gray-mid);
    margin-bottom: var(--sp-md);
    font-weight: 300;
    letter-spacing: 0.01em;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Indicador de scroll */
.hero-scroll-indicator {
    position: absolute;
    bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: indicatorBounce 2.4s ease infinite;
}

.scroll-arrow {
    width: 18px; height: 18px;
    border-right: 2px solid var(--red);
    border-bottom: 2px solid var(--red);
    transform: rotate(45deg);
    margin: 0 auto;
}


/* ----------------------------------------------------------------
   7. SECCIONES COMPARTIDAS
   ---------------------------------------------------------------- */
.section { padding: var(--sp-xl) 0; }
.section-white { background: var(--white); }
.section-alt   { background: var(--off-white); }

/* Cabecera de sección */
.section-header { text-align: center; margin-bottom: var(--sp-lg); }

/* Etiqueta pequeña en rojo */
.section-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: clamp(1.8rem, 3.8vw, 2.6rem);
    font-weight: 700;
    color: var(--brand);
    line-height: 1.15;
    margin-bottom: var(--sp-sm);
}

/* Línea roja bajo el título de sección */
.section-divider {
    width: 48px; height: 3px;
    background: var(--red);
    margin: 0 auto;
    border-radius: 2px;
}


/* ----------------------------------------------------------------
   8. NOSOTROS
   ---------------------------------------------------------------- */
.nosotros-content { max-width: 820px; margin: 0 auto; }

.nosotros-content p {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    margin-bottom: 1.6rem;
    text-align: justify;
}

.nosotros-content p:last-child { margin-bottom: 0; }


/* ----------------------------------------------------------------
   9. CARRUSEL DE SERVICIOS — sobre fondo blanco/off-white
   ---------------------------------------------------------------- */
.carousel-wrapper {
    display: grid;
    grid-template-columns: 56px 1fr 56px;
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 0 1.2rem;
    max-width: 820px;
    margin: 0 auto;
}

.carousel-container {
    grid-column: 2; grid-row: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

/* El track se desliza con transform: translateX */
.carousel-track {
    display: flex;
    transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cada tarjeta ocupa el 100% del contenedor visible */
.carousel-track .service-card {
    min-width: 100%;
    max-height: 540px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--red) transparent;
}

.carousel-track .service-card::-webkit-scrollbar { width: 3px; }
.carousel-track .service-card::-webkit-scrollbar-thumb {
    background: var(--red);
    border-radius: 3px;
}

/* Botones de navegación prev / next */
.carousel-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--color-border);
    color: var(--brand);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    align-self: center;
    box-shadow: var(--shadow-sm);
}

.carousel-btn:hover {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(206, 24, 30, 0.25);
}

.carousel-btn:active { transform: scale(0.95); }
.carousel-btn:disabled { opacity: 0.30; cursor: default; transform: none; box-shadow: none; }

.carousel-prev { grid-column: 1; grid-row: 1; }
.carousel-next { grid-column: 3; grid-row: 1; }

/* Pie del carrusel: dots + contador */
.carousel-footer {
    grid-column: 1 / -1; grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.carousel-dots { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

.carousel-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gray-light);
    border: 2px solid var(--color-border);
    cursor: pointer;
    padding: 0;
    transition: all var(--transition);
}

/* Dot activo: rojo */
.carousel-dot.active {
    background: var(--red);
    border-color: var(--red);
    transform: scale(1.3);
}

.carousel-dot:hover:not(.active) {
    background: rgba(206, 24, 30, 0.20);
    border-color: var(--red);
}

.carousel-counter {
    color: var(--gray-mid);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.carousel-counter strong { color: var(--brand); }


/* ----------------------------------------------------------------
   10. TARJETAS DE SERVICIO — diseño claro sobre blanco
   ---------------------------------------------------------------- */
.service-card {
    background: var(--white);
    border: 1px solid var(--color-border);
    border-top: 3px solid transparent; /* Borde rojo aparece en activo */
    border-radius: var(--radius-lg);
    padding: 2rem 2.2rem;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-top-color var(--transition);
}

/* Tarjeta activa en el carrusel: borde rojo superior */
.carousel-track .service-card.is-active {
    border-top-color: var(--red);
}

/* Contenedor del ícono de servicio */
.service-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(206, 24, 30, 0.07); /* Tinte muy suave del rojo */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    margin-bottom: 1.1rem;
}

/* Los íconos PNG son oscuros, se muestran en su color natural */
.service-icon img {
    width: 32px; height: 32px;
    object-fit: contain;
    /* Sin filtro: los íconos son oscuros sobre fondo claro */
}

.service-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0.85rem;
    line-height: 1.4;
}

.service-card p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.6rem;
}

/* Bloque "Beneficios" */
.service-benefits {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--gray-light);
}

/* Etiqueta "Beneficios" en rojo */
.service-benefits h5 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--red);
    margin-bottom: 0.6rem;
}

/* Listas con viñeta roja cuadrada */
.service-list li,
.service-benefits ul li {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    padding: 0.2rem 0 0.2rem 1.2rem;
    position: relative;
    line-height: 1.55;
}

.service-list li::before,
.service-benefits ul li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.62rem;
    width: 5px; height: 5px;
    background: var(--red);
    border-radius: 1px;
    opacity: 0.75;
}


/* ----------------------------------------------------------------
   11. CONTACTO
   ---------------------------------------------------------------- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: var(--sp-lg);
    align-items: start;
    max-width: 880px;
    margin: 0 auto;
}

.contact-info p {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: var(--sp-md);
    line-height: 1.8;
}

/* Bloque de teléfono con acento rojo */
.contact-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--off-white);
    border-left: 4px solid var(--red);
    color: var(--brand);
    padding: 1rem 1.4rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 1.15rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.contact-phone svg { color: var(--red); flex-shrink: 0; }

/* Formulario */
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.93rem;
    font-family: inherit;
    color: var(--brand);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    -webkit-appearance: none;
}

/* Focus: borde rojo con halo suave */
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(206, 24, 30, 0.10);
}

/* Campo inválido */
.form-group input.invalido,
.form-group textarea.invalido {
    border-color: var(--red);
    background: rgba(206, 24, 30, 0.04);
}

.form-group textarea { resize: vertical; min-height: 130px; }

/* Mensajes de respuesta del formulario */
.form-response {
    display: none;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    background: #fff8e1;
    border-left: 3px solid #f0a000;
    color: #7a4f00;
    font-size: 0.875rem;
    line-height: 1.5;
}

.form-success {
    padding: var(--sp-md);
    text-align: center;
    border-radius: var(--radius);
    background: #f0faf5;
    border: 1px solid #9ae6b4;
}


/* ----------------------------------------------------------------
   12. FOOTER — único elemento oscuro de la página
   ---------------------------------------------------------------- */
.footer {
    background: var(--brand);
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    padding: 2rem var(--sp-md);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

/* Línea roja decorativa arriba del footer */
.footer::before {
    content: '';
    display: block;
    width: 40px; height: 2px;
    background: var(--red);
    margin: 0 auto 1rem;
    border-radius: 2px;
}


/* ----------------------------------------------------------------
   13. MODAL DE VIDEO
   ---------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal.active { opacity: 1; pointer-events: all; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(35, 31, 32, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-container {
    position: relative; z-index: 1;
    width: 92%; max-width: 820px;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: scale(0.94);
    transition: transform var(--transition);
}

.modal.active .modal-container { transform: scale(1); }

.modal-close {
    position: absolute;
    top: -2.6rem; right: 0;
    background: none; border: none;
    color: rgba(255,255,255,0.70);
    font-size: 2.4rem; line-height: 1;
    cursor: pointer;
    transition: color var(--transition), transform var(--transition);
    z-index: 2;
}

.modal-close:hover { color: var(--white); transform: rotate(90deg); }

.modal-video { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.modal-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }


/* ----------------------------------------------------------------
   14. ANIMACIONES
   ---------------------------------------------------------------- */
@keyframes heroEntrance {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes indicatorBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* Scroll reveal — main.js agrega .visible al entrar al viewport */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible { opacity: 1; transform: translateY(0); }


/* ----------------------------------------------------------------
   15. DISEÑO RESPONSIVO
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
    :root { --sp-lg: 3rem; --sp-xl: 5rem; }
    .contact-wrapper { grid-template-columns: 1fr; gap: var(--sp-md); }
}

@media (max-width: 640px) {
    :root { --sp-lg: 2.5rem; --sp-xl: 4rem; }

    /* Menú hamburguesa */
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: fixed;
        top: var(--navbar-h); left: 0; right: 0;
        flex-direction: column;
        background: var(--white);
        border-top: 2px solid var(--red);
        padding: 0.5rem 0;
        box-shadow: var(--shadow-md);
        gap: 0;
    }

    .nav-links.open { display: flex; }
    .nav-link { padding: 0.85rem 1.5rem; border-radius: 0; border-bottom: 1px solid var(--gray-light); }
    .nav-link.active::after { display: none; }

    /* Carrusel en móvil: flechas debajo de la tarjeta */
    .carousel-wrapper {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .carousel-container { grid-column: 1 / -1; }
    .carousel-prev { grid-column: 1; grid-row: 2; justify-self: end; margin-right: 0.5rem; }
    .carousel-next { grid-column: 2; grid-row: 2; justify-self: start; margin-left: 0.5rem; }
    .carousel-footer { grid-column: 1 / -1; grid-row: 3; }

    .form-row { grid-template-columns: 1fr; }

    /* Hero */
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 280px; }
    .hero-logo { width: min(340px, 85vw); }

    .carousel-track .service-card { padding: 1.5rem; max-height: 65vh; }
}
