/* =========================================
   1. VARIABLES & CONFIGURACIÓN GLOBAL
   ========================================= */
:root {
    --bg-color: #0c090c;
    /* Fondo principal */
    --second-bg-color: #292923;
    /* Fondo secundario */
    --text-color: #fff;
    /* Texto principal */
    --main-color: #ffda10;
    /* Acento (Amarillo) */

    /* Background animado (ajustables) */
    --bg-blob-speed-1: 18s;
    --bg-blob-speed-2: 26s;
    --bg-blob-blur-1: 60px;
    --bg-blob-blur-2: 90px;
    --bg-blob-brightness: 1.25;
    --bg-noise-opacity: 0.06;
    --bg-noise-speed: 12s;

    /* Capas Z-Index */
    --z-back: -1;
    --z-base: 0;
    --z-content: 1;
    --z-ui: 10;
    --z-fixed: 100;
    --z-modal: 10000;
    --z-toast: 9999;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Reset Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    border: none;
    outline: none;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    /* Empuja el footer hacia abajo */
    width: 100%;
}

/* =========================================
   1.5 BACKGROUND ANIMADO (Manchas difuminadas)
   ========================================= */
.page-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.page-bg::before,
.page-bg::after {
    content: "";
    position: absolute;
    width: 70vmax;
    height: 70vmax;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 218, 16, 0.30), transparent 35%),
        radial-gradient(circle at 70% 70%, rgba(255, 218, 16, 0.18), transparent 35%);
    filter: blur(var(--bg-blob-blur-1)) brightness(var(--bg-blob-brightness)) saturate(1.4);
    transform: translate3d(0, 0, 0);
    mix-blend-mode: screen;
    opacity: 1;
    animation: bg-blob-move var(--bg-blob-speed-1) linear infinite;
    z-index: 0;
}

.page-bg::after {
    right: -10%;
    top: 15%;
    filter: blur(var(--bg-blob-blur-2)) brightness(var(--bg-blob-brightness)) saturate(1.6);
    animation-duration: var(--bg-blob-speed-2);
    opacity: 0.95;
    z-index: 0;
}

/* Capa de ruido SVG (overlay) */
.page-bg-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: var(--bg-noise-opacity);
    background-image: url("data:image/svg+xml;utf8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='600'%20height='600'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20baseFrequency='0.9'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'%20fill='white'/%3E%3C/svg%3E");
    background-size: 200% 200%;
    background-repeat: repeat;
    animation: noise-pan var(--bg-noise-speed) linear infinite;
    z-index: 1;
}

@keyframes noise-pan {
    0% {
        background-position: 0% 0%;
    }

    50% {
        background-position: 50% 50%;
    }

    100% {
        background-position: 0% 0%;
    }
}

/* Mantener contenido encima */
.header,
main,
.footer,
.section {
    position: relative;
    z-index: 1;
}

/* Movimiento suave */
@keyframes bg-blob-move {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(12vw, -8vh) rotate(180deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {

    .page-bg::before,
    .page-bg::after {
        animation: none;
        filter: blur(40px);
    }

    .page-bg-noise {
        animation: none;
    }
}

@media (max-width: 768px) {

    /* Optimización móvil: reducir carga gráfica */
    .page-bg::before,
    .page-bg::after {
        filter: blur(40px);
        width: 90vmax;
        /* Aumentar tamaño para reducir repetición de render */
    }
}

/* =========================================
   2. COMPONENTES UI (Reutilizables)
   ========================================= */
/* Botón General (CTA) */
.btn {
    display: inline-block;
    padding: 1rem 2.8rem;
    background: var(--main-color);
    border-radius: 4rem;
    box-shadow: 0 0 1rem var(--main-color);
    font-size: 1rem;
    color: var(--second-bg-color);
    font-weight: 600;
    letter-spacing: 1px;
    transition: .5s ease;
    cursor: pointer;
}

.btn:hover {
    box-shadow: none;
    background: transparent;
    border: 2px solid var(--main-color);
    color: var(--main-color);
}

/* Títulos de Sección */
.heading {
    text-align: center;
    font-size: 4rem;
    margin-bottom: 3rem;
}

.heading span {
    color: var(--main-color);
}

/* Contenedores de Video (YouTube) */
.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 1.5rem;
    margin: 0 auto 2rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Texto Informativo Centrado */
.info-text {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    /* Reducido para mejor proporción */
    line-height: 1.8;
}

/* Etiquetas de Categoría */
.category-tag {
    color: var(--main-color);
    font-size: 1.5rem;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Mensajes de Formulario */
.form-message {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.form-message.success {
    display: block;
    background: rgba(37, 211, 102, 0.2);
    color: #25d366;
    border: 1px solid #25d366;
}

.form-message.error {
    display: block;
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid #ff4444;
}

/* =========================================
   3. LAYOUT PRINCIPAL (Header, Nav, Footer)
   ========================================= */
/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 64px;
    padding: 1.2rem 3%;
    background: transparent;
    /* Navbar transparente por defecto */
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    /* Centrar logo + nav */
    align-items: center;
    gap: 0.75rem;
    z-index: var(--z-fixed);
    transition: background 0.3s, box-shadow 0.3s, padding 0.25s;
}

.header.scrolled {
    background: rgba(18, 18, 18, 0.6);
    /* Fondo más suave y a tono con la página */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Al hacer scroll reducir el logo al tamaño actual */
.header.scrolled .logo-img {
    height: 48px;
    /* tamaño “actual” al scrollear */
    max-width: 180px;
}

.logo {
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0;
    cursor: pointer;
    font-size: 2.5rem;
    color: var(--text-color);
    font-weight: 600;
    margin-right: 1.25rem;
    /* Espacio entre logo y nav centrado */
}

.logo-img {
    height: 92px;
    /* Más grande en desktop */
    width: auto;
    display: block;
    max-width: 320px;
    object-fit: contain;
    transition: height 0.25s ease, max-width 0.25s ease, transform 0.25s ease;
}

/* Navbar */
.navbar {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    justify-content: center;
}

.navbar a {
    font-size: 1.7rem;
    color: var(--main-color);
    margin: 0;
    transition: .3s;
}

.navbar a:hover,
.navbar a.active {
    color: var(--text-color);
}

#menu-icon {
    font-size: 3.6rem;
    color: var(--text-color);
    display: none;
    cursor: pointer;
}

/* Footer */
.footer {
    display: none;
    /* Se activa con JS */
    background: var(--second-bg-color);
    padding: 1.5rem 9%;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 8rem;
    /* Espacio superior */
    animation: fadeIn 0.5s ease;
}

.footer.visible {
    display: flex;
}

.footer-text p {
    font-size: 1.4rem;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a,
.footer-social button,
.footer-iconTop a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 3.5rem;
    height: 3.5rem;
    background: transparent;
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    /* Iconos redondos */
    color: var(--main-color);
    transition: .5s ease;
}

/* Ajuste específico para el botón de subir (puede ser cuadrado con bordes redondeados) */
.footer-iconTop a {
    width: auto;
    height: auto;
    padding: .8rem;
    border-radius: .8rem;
    border: none;
    /* El botón de subir original tenía fondo lleno */
    background: var(--main-color);
    color: var(--second-bg-color);
}

.footer-social a:hover,
.footer-social button:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    box-shadow: 0 0 1rem var(--main-color);
}

.footer-iconTop a:hover {
    box-shadow: 0 0 1rem var(--main-color);
}

.footer-social a i,
.footer-social button i {
    font-size: 1.8rem;
}

.footer-iconTop a i {
    font-size: 2.4rem;
}

.footer-social button {
    cursor: pointer;
}

.footer-social button:focus {
    outline: 3px solid rgba(255, 218, 16, 0.25);
    box-shadow: 0 0 0 4px rgba(255, 218, 16, 0.08);
}

/* Icono pergamino en footer (SVG) */
.footer-social .icon-scroll {
    width: 1.6rem;
    height: 1.6rem;
    display: inline-block;
    vertical-align: middle;
    color: var(--main-color);
}

/* =========================================
   10.5 MODAL TÉRMINOS Y CONDICIONES
   ========================================= */
.terms-modal {
    /* Copiado y adaptado del modal de correos */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.terms-modal.active {
    opacity: 1;
    visibility: visible;
}

.terms-modal-content {
    background: var(--second-bg-color);
    border: 2px solid var(--main-color);
    border-radius: 1.2rem;
    padding: 2.5rem 2rem;
    max-width: 900px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.25s ease;
    box-shadow: 0 0 30px rgba(255, 218, 16, 0.28);
}

.terms-modal.active .terms-modal-content {
    transform: scale(1);
}

.terms-modal-close {
    /* Reutiliza controles visuales */
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 2.8rem;
    /* Más visible */
    cursor: pointer;
    width: 3.8rem;
    height: 3.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 5;
}

.terms-modal-close:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    transform: rotate(90deg);
}

.terms-modal-close:focus {
    outline: 3px solid rgba(255, 218, 16, 0.25);
    box-shadow: 0 0 0 4px rgba(255, 218, 16, 0.08);
}

/* Utilidad accesible */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.terms-modal-content h2 {
    font-size: 2.2rem;
    margin-bottom: 1.2rem;
    text-align: center;
}

.terms-modal-content h2 span {
    color: var(--main-color);
}

.terms-body {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-color);
}

.terms-section {
    margin: 1.2rem 0;
    padding: 1rem;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 218, 16, 0.04);
}

.terms-section h3 {
    margin-bottom: .6rem;
    color: var(--main-color);
}

.terms-section ul {
    margin-left: 1.2rem;
    list-style: disc;
}

.terms-section p {
    margin-bottom: .6rem;
}

/* Nota de aceptación al final */
.terms-accept-note {
    background: rgba(255, 218, 16, 0.03);
    border-left: 4px solid rgba(255, 218, 16, 0.12);
}

.terms-accept-note p {
    font-weight: 600;
}

@media (max-width: 640px) {
    .terms-body {
        font-size: 1.4rem;
    }
}

@media (max-width: 640px) {
    .terms-modal-content {
        padding: 1.6rem;
    }

    .terms-body {
        font-size: 1.4rem;
    }
}

/* =========================================
   10.6 AVISO DE COOKIES
   ========================================= */
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 2.4rem;
    transform: translateX(-50%) translateY(30px);
    width: min(900px, 94%);
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid rgba(255, 218, 16, 0.35);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    border-radius: 1.4rem;
    padding: 1.6rem 2rem;
    opacity: 0;
    visibility: hidden;
    z-index: var(--z-toast);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(6px);
}

.cookie-banner.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.cookie-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-banner-text h3 {
    font-size: 1.8rem;
    margin-bottom: 0.6rem;
    color: var(--main-color);
}

.cookie-banner-text p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.cookie-banner-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.8rem 1.8rem;
    border-radius: 2rem;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.3s ease;
}

.cookie-btn-accept {
    background: var(--main-color);
    color: var(--second-bg-color);
    border-color: var(--main-color);
}

.cookie-btn-accept:hover {
    background: transparent;
    color: var(--main-color);
}

.cookie-btn-reject {
    background: transparent;
    color: var(--text-color);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.cookie-btn-reject:hover {
    border-color: var(--main-color);
    color: var(--main-color);
}

/* Botón Flotante WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 40px;
    left: 40px;
    /* Izquierda */
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 40px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    transform: scale(1.1);
}

/* Sistema SPA (Secciones) */
.section {
    display: none;
    padding-top: 8rem;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

section.home.active {
    display: flex;
}

/* =========================================
   4. SECCIÓN HOME (Slider)
   ========================================= */
.home {
    width: 100%;
    min-height: 100vh;
    position: relative;
    padding: 0;
    overflow: hidden;
    align-items: center;
}

.home-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 9%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.home-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    filter: brightness(0.4);
}

.home-content {
    z-index: 20;
    max-width: 60rem;
}

.home-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.home-content h3 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--main-color);
    margin-bottom: 1rem;
}

.home-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.slider-navigation {
    position: absolute;
    bottom: 40px;
    right: 50px;
    display: flex;
    gap: 20px;
    z-index: 30;
}

.nav-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--text-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
}

.nav-btn:hover {
    background: var(--main-color);
    border-color: var(--main-color);
    color: var(--second-bg-color);
}

.nav-btn i {
    font-size: 1.5rem;
}

/* =========================================
   5. CARRUSEL CLIENTES
   ========================================= */
.clients-carousel-wrapper {
    width: 100%;
    margin-bottom: 3rem;
    padding: 1.5rem 5% 1rem 5%;
    background: linear-gradient(135deg, rgba(255, 218, 16, 0.02) 0%, transparent 100%);
    border-radius: 1.5rem;
}

.carousel-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.carousel-title span {
    color: var(--main-color);
}

.clients-carousel {
    width: 100%;
    height: 110px;
    background: transparent;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.slide-track {
    display: flex;
    width: calc(180px * 34);
    /* Ajuste según cantidad de logos */
    animation: scroll 50s linear infinite;
    align-items: center;
}

.slide {
    width: 180px;
    min-width: 180px;
    height: 90px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
}

.slide img {
    width: 180px;
    height: 90px;
    object-fit: contain;
    filter: grayscale(100%) brightness(200%);
    transition: 0.3s;
    opacity: 0.7;
    display: block;
}

.slide:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.08);
}

/* Tooltip nombre cliente */
.logo-tooltip {
    position: absolute;
    left: 50%;
    bottom: -2.2rem;
    transform: translateX(-50%);
    background: rgba(44, 44, 44, 0.97);
    color: #fff;
    font-size: 1rem;
    padding: 0.25rem 0.8rem;
    border-radius: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, bottom 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.slide:hover .logo-tooltip {
    opacity: 1;
    bottom: -2.7rem;
}

/* Controles del carrusel (flechas de navegación) */
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    position: relative;
}

.carousel-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--main-color), rgba(255, 218, 16, 0.7));
    border: 2px solid var(--main-color);
    color: var(--bg-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 218, 16, 0.3);
    flex-shrink: 0;
    z-index: 10;
}

.carousel-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 218, 16, 0.6);
    background: linear-gradient(135deg, rgba(255, 218, 16, 0.9), var(--main-color));
}

.carousel-btn:active {
    transform: scale(0.95);
}

.carousel-btn-slower i,
.carousel-btn-faster i {
    display: block;
    font-weight: bold;
}

.carousel-btn-slower:hover,
.carousel-btn-faster:hover {
    background: linear-gradient(135deg, rgba(255, 218, 16, 0.95), var(--main-color));
}

/* =========================================
   6. SECCIÓN NOSOTROS (About)
   ========================================= */
.about-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    padding: 0 5%;
}

.about-img {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.about-img img {
    width: 100%;
    max-width: 550px;
    border-radius: 2rem;
    border: 2px solid var(--main-color);
    box-shadow: 0 0 20px rgba(255, 218, 16, 0.2);
    transition: all 0.4s ease-out;
    transform: translateY(0);
    will-change: transform;
}

.about-img img:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 0 35px rgba(255, 218, 16, 0.5);
}

.about-img-info {
    background: linear-gradient(135deg, var(--second-bg-color) 0%, rgba(41, 41, 35, 0.8) 100%);
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    border: 2px solid var(--main-color);
    box-shadow: 0 0 15px rgba(255, 218, 16, 0.15);
    text-align: center;
    width: 100%;
    max-width: 550px;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.about-img-info:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(255, 218, 16, 0.3);
    border-color: rgba(255, 218, 16, 0.8);
}

.about-img-name {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--main-color);
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.5px;
}

.about-img-role {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-weight: 400;
}

.about-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-content h3 {
    font-size: 2.6rem;
    margin-bottom: 0;
    color: var(--text-color);
    line-height: 1.3;
}

.about-paragraphs {
    max-width: 500px;
}

.about-content p {
    font-size: 1.3rem;
    line-height: 1;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.about-content p+p {
    margin-top: 1.5rem;
}

.about-content .btn {
    align-self: flex-start;
    margin-top: 0.5rem;
}

/* =========================================
   7. SECCIÓN SERVICIOS
   ========================================= */
/* Grid Principal */
.services-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    padding: 0 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.service-box {
    position: relative;
    overflow: hidden;
    background: var(--second-bg-color);
    padding: 2.5rem;
    border-radius: 2rem;
    text-align: center;
    border: 1px solid transparent;
    transition: 0.4s ease;
    z-index: 0;
    display: flex;
    flex-direction: column;
}

/* Difuminado interior amarillo (suave) */
.service-box::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 218, 16, 0.18) 0%, rgba(255, 218, 16, 0.08) 16%, transparent 45%),
        radial-gradient(circle at 80% 75%, rgba(255, 218, 16, 0.12) 0%, transparent 35%);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(.2, .8, .2, 1);
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 0;
}

/* Asegurar que el contenido siempre esté por encima del difuminado */
.service-box>* {
    position: relative;
    z-index: 1;
}

.service-box:hover {
    border-color: var(--main-color);
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24), 0 0 30px rgba(255, 218, 16, 0.06);
}

.service-box:hover::before {
    opacity: 1;
    transform: scale(1);
}

.service-box i {
    font-size: 5rem;
    color: var(--main-color);
    margin-bottom: 1rem;
}

.service-box h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.service-box p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.service-box .view-service-btn {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Vista Detalle (Tech Specs) */
.details-header {
    text-align: center;
    margin-bottom: 3rem;
}

.details-header .back-btn-service {
    margin-bottom: 4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.service-icon-large i {
    font-size: 6rem;
    color: var(--main-color);
    margin-top: 1rem;
    opacity: 0.8;
}

.service-details-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

.service-description-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.service-description-col>.btn,
.service-description-col>a {
    align-self: flex-start;
}

.service-description-col p {
    font-size: 1.6rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Contenedor de botones */
.service-buttons-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Espaciado entre botones en la columna de descripción */
.service-description-col .btn {
    padding: 0.8rem 1.5rem;
    background: var(--main-color);
    color: var(--second-bg-color);
    border: 2px solid var(--main-color);
    box-shadow: none;
    white-space: nowrap;
}

.service-description-col .btn:hover {
    background: transparent;
    color: var(--main-color);
    box-shadow: none;
}

.service-description-col .btn+.btn {
    margin-left: 0;
}

.tech-specs-card {
    background: var(--second-bg-color);
    padding: 3rem;
    border-radius: 2rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-description-col h3,
.tech-specs-card h3 {
    font-size: 2.4rem;
    margin-bottom: 2rem;
    color: var(--main-color);
    border-bottom: 2px solid var(--second-bg-color);
    padding-bottom: 1rem;
    display: inline-block;
    width: 100%;
}

.tech-specs-card ul {
    list-style: none;
    flex-grow: 1;
}

.tech-specs-card li {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    line-height: 1.4;
}

/* Icono de lista en specs */
.tech-specs-card li::before {
    content: '>';
    font-family: monospace;
    color: var(--main-color);
    font-weight: 700;
    margin-top: 2px;
}

/* =========================================
   8. SECCIÓN PORTAFOLIO
   ========================================= */
/* Botón Reset */
.portfolio-reset-container {
    text-align: center;
    margin-bottom: 2rem;
    display: none;
}

.portfolio-reset-container.visible {
    display: block;
    animation: fadeIn 0.5s ease;
}

.btn-reset {
    background: transparent;
    border: 2px solid var(--main-color);
    color: var(--main-color);
    padding: 0.8rem 2.5rem;
    border-radius: 2rem;
    font-size: 1.4rem;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
}

.btn-reset:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(199, 209, 53, 0.2);
}

/* Grid Portafolio */
.portfolio-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    padding: 0 5%;
}

.portfolio-box {
    position: relative;
    border-radius: 2rem;
    box-shadow: 0 0 1rem var(--bg-color);
    overflow: hidden;
    display: flex;
    height: 300px;
}

.portfolio-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s ease;
}

.portfolio-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.1), var(--main-color));
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 0 4rem;
    transform: translateY(100%);
    transition: 0.5s ease;
}

.portfolio-box {
    cursor: pointer;
    /* Indica que todo el box es clickeable */
}

.portfolio-box:hover img {
    transform: scale(1.1);
}

.portfolio-box:hover .portfolio-layer {
    transform: translateY(0);
}

.portfolio-layer h4 {
    font-size: 1.3rem;
    /* Reducido a 1.3rem para mejor proporción */
    color: var(--text-color);
    /* Cambiar a blanco */
    margin-bottom: 0.5rem;
    /* Limitar el título a 2 líneas máximo */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.portfolio-layer p {
    font-size: 1.6rem;
    margin: .3rem 0 1rem;
    color: var(--bg-color);
}

.portfolio-layer a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 5rem;
    height: 5rem;
    background: var(--text-color);
    border-radius: 50%;
}

.portfolio-layer a i {
    font-size: 2rem;
    color: var(--bg-color);
}

/* Detalle de Proyecto */
.details-header .back-btn {
    display: inline-block;
    margin-bottom: 2rem;
}

.details-content h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--main-color);
}

#detail-desc {
    margin-bottom: 1.6rem;
}

/* Galería Grid Multimedia */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-item {
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: 1rem;
    border: 3px solid var(--second-bg-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: #000;
}

.gallery-item img,
.gallery-item iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
}

.gallery-item img:hover {
    transform: scale(1.03);
    cursor: pointer;
}

/* Modal Galería Fullscreen */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.gallery-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.gallery-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-img {
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 1.2rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    background: #111;
    object-fit: contain;
}

.gallery-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2.8rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.gallery-modal-close:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
}

.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

/* Posicionamiento correcto según las clases usadas en JS */
.gallery-modal-nav.left {
    left: 2rem;
}

.gallery-modal-nav.right {
    right: 2rem;
}

/* Compatibilidad: conservar selectores prev/next si se usan en otras partes */
.gallery-modal-prev {
    left: 2rem;
}

.gallery-modal-next {
    right: 2rem;
}

.gallery-modal-nav:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
}

/* Botón vincular portfolio desde servicios */
.related-portfolio-btn {
    margin-top: 2rem;
    background: var(--main-color);
    border: 2px solid var(--main-color);
    color: var(--second-bg-color);
    padding: 0.8rem 1.5rem;
    display: inline-block;
}

.related-portfolio-btn:hover {
    background: transparent;
    color: var(--main-color);
}

/* =========================================
   9. SECCIÓN CONTACTO
   ========================================= */
.contact-wrapper {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

.contact-card {
    flex: 1;
    min-width: 300px;
    background: var(--second-bg-color);
    padding: 3rem;
    border-radius: 2rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 2px solid var(--main-color);
}

/* Tarjeta Cotiza Ya */
.quote-card {
    text-align: center;
    background: linear-gradient(145deg, var(--second-bg-color), #1a1a1a);
}

.card-icon i {
    font-size: 5rem;
    color: var(--main-color);
    margin-bottom: 1.5rem;
}

.quote-card h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--main-color);
}

.quote-card p {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.quote-card .small-text {
    font-size: 1.3rem;
    opacity: 0.8;
    margin-bottom: 3rem;
}

.btn-quote {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/* Tarjeta Hablemos (Form) */
.form-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.form-card p {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.4rem;
    opacity: 0.8;
}

#contact form {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

#contact form .input-box {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

#contact form .input-box input,
#contact form select {
    width: 49%;
    padding: 1.2rem;
    font-size: 1.4rem;
    color: var(--text-color);
    background: var(--bg-color);
    border-radius: .8rem;
    margin: .7rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
}

#contact form textarea {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.4rem;
    color: var(--text-color);
    background: var(--bg-color);
    border-radius: .8rem;
    margin: .7rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    resize: none;
}

/* Select con icono */
#contact form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 2rem;
}

#contact form .input-box input:focus,
#contact form select:focus,
#contact form textarea:focus {
    border-color: var(--main-color);
    background: #1a1d24;
}

.form-btn-container {
    margin-top: 2rem;
}

/* =========================================
   10. MODAL CORREOS CORPORATIVOS
   ========================================= */
.email-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.email-modal.active {
    opacity: 1;
    visibility: visible;
}

.email-modal-content {
    background: var(--second-bg-color);
    border: 2px solid var(--main-color);
    border-radius: 1.5rem;
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 0 30px rgba(255, 218, 16, 0.3);
}

.email-modal.active .email-modal-content {
    transform: scale(1);
}

.email-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 2.5rem;
    cursor: pointer;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.email-modal-close:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    transform: rotate(90deg);
}

.email-modal-content h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-color);
}

.email-modal-content h2 span {
    color: var(--main-color);
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.email-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-color);
    padding: 1.2rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 218, 16, 0.2);
    transition: all 0.3s ease;
}

.email-item:hover {
    border-color: var(--main-color);
    box-shadow: 0 0 15px rgba(255, 218, 16, 0.2);
    transform: translateY(-2px);
}

.email-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.email-text i {
    font-size: 2rem;
    color: var(--main-color);
}

.email-text span {
    font-size: 1.4rem;
    color: var(--text-color);
    word-break: break-all;
}

.email-copy-btn {
    background: transparent;
    border: 2px solid var(--main-color);
    color: var(--main-color);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.email-copy-btn:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    transform: scale(1.1);
}

.email-copy-btn i {
    font-size: 1.8rem;
}

/* =========================================
   11. ANIMACIONES
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-250px * 5));
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* =========================================
   12. MEDIA QUERIES (Responsivo)
   ========================================= */
@media (max-width: 1400px) {
    .logo {
        font-size: 2.2rem;
    }

    .logo-img {
        height: 38px;
        max-width: 140px;
    }

    /* Mantener tamaño móvil al scrollear */
    .header.scrolled .logo-img {
        height: 38px;
        max-width: 140px;
    }

    .navbar a {
        font-size: 1.5rem;
        margin-left: 2rem;
    }
}

@media (max-width: 1200px) {
    .services-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .navbar a {
        margin-left: 2rem;
        font-size: 1.5rem;
    }
}

@media (max-width: 991px) {
    .header {
        padding: 2rem 3%;
        justify-content: space-between;
        gap: 0;
    }

    #menu-icon {
        display: block;
        z-index: 10001;
    }

    .navbar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--second-bg-color);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.3s ease-in-out;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
        z-index: 10000;
    }

    .navbar.active {
        right: 0;
    }

    .navbar a {
        font-size: 2rem;
        margin: 1.5rem 0;
        margin-left: 0;
        display: block;
    }

    .home {
        padding: 0 3%;
    }

    .home-content h1 {
        font-size: 2.8rem;
    }

    .home-content h3 {
        font-size: 1.5rem;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
    }

    .about-img {
        align-items: center;
    }

    .about-img-info {
        max-width: 100%;
    }

    .about-content {
        align-items: center;
    }

    .about-content h3 {
        margin-top: 2rem;
    }

    .about-paragraphs {
        max-width: 100%;
    }

    .about-content .btn {
        align-self: center;
    }

    .footer {
        padding: 2rem 3%;
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 900px) {
    .contact-wrapper {
        flex-direction: column;
    }

    .slide {
        width: 120px;
        min-width: 120px;
        height: 60px;
        padding: 0 8px;
    }

    .slide img {
        width: 120px;
        height: 60px;
    }

    .slide-track {
        width: calc(120px * 34);
        animation-duration: 70s;
    }

    @keyframes scroll {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(calc(-120px * 17));
        }
    }

    .video-wrapper {
        max-width: 100vw;
        aspect-ratio: 16/9;
        margin: 1.5rem auto;
    }
}

@media (max-width: 800px) {
    .services-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .service-details-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Margen lateral para textos en móviles */
    .about-content,
    .about-paragraphs,
    .service-details-content,
    .details-content,
    .details-header {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .about-img-info,
    .service-description-col,
    .tech-specs-card {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }

    #contact form .input-box input,
    #contact form select {
        width: 100%;
    }

    .carousel-title {
        font-size: 2rem;
        margin-bottom: 1.2rem;
    }

    .clients-carousel-wrapper {
        padding: 1.5rem 3% 1rem 3%;
        margin-bottom: 2rem;
    }

    /* Modal responsive */
    .email-modal-content {
        padding: 2.5rem 2rem;
        max-width: 95%;
    }

    .email-modal-content h2 {
        font-size: 2rem;
    }

    .email-text span {
        font-size: 1.2rem;
    }

    .email-item {
        padding: 1rem 1.2rem;
    }
}

@media (max-width: 600px) {
    .video-wrapper {
        max-width: 100vw;
        aspect-ratio: 16/9;
        margin: 1rem auto;
        border-radius: 1rem;
    }

    .info-text {
        font-size: 1.4rem;
    }

    /* Modal nav responsive: acercar botones a los bordes y reducir tamaño */
    .gallery-modal-nav.left {
        left: 0.6rem;
    }

    .gallery-modal-nav.right {
        right: 0.6rem;
    }

    .gallery-modal-nav {
        font-size: 2.4rem;
        width: 3rem;
        height: 3rem;
    }
}

@media (max-width: 450px) {
    html {
        font-size: 80%;
    }

    .video-wrapper {
        max-width: 360px;
        margin: 1rem auto;
        padding-bottom: 56.25%;
    }

    .info-text {
        font-size: 1.4rem;
    }

    .whatsapp-float {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 30px;
    }

    .carousel-title {
        font-size: 1.6rem;
        letter-spacing: 1px;
    }

    /* Ajustes del cuadro de info de Claudio en móviles */
    .about-img-info {
        padding: 1.2rem 1.5rem;
    }

    .about-img-name {
        font-size: 1.5rem;
    }

    .about-img-role {
        font-size: 1rem;
    }
}