/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Foco visible para todo elemento interactivo (teclado).
   #60a5fa sobre los fondos navy del sitio supera 5:1 de contraste. */
:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Red de seguridad del loader: si el JS falla o está deshabilitado, la
   pantalla de carga no puede quedar tapando el contenido de forma indefinida. */
#pageLoader {
    animation: loaderFailsafe 0.4s ease-out 3s forwards;
}

@keyframes loaderFailsafe {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Glassmorphism navbar */
.glass {
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a1628;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Tipografía ultra ligera para títulos grandes */
.ultra-light {
    font-weight: 200;
}

/* Mobile menu */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobile-menu:not(.hidden) {
    animation: slideDown 0.3s ease-out;
}

/* Acordeones (FAQ, Base normativa, etc.) */
details>summary {
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

details>summary::after {
    content: '\2304';
    float: right;
    font-size: 1rem;
}

details[open]>summary::after {
    content: '\2303';
}

/* Animación de entrada suave (política de privacidad) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.section-card {
    transition: all 0.3s ease;
}

.section-card:hover {
    transform: translateX(8px);
}

.section-number {
    font-size: 4rem;
    font-weight: 100;
    opacity: 0.1;
    position: absolute;
    left: -20px;
    top: -20px;
    line-height: 1;
}

/* Hero de portada */
@keyframes zoomSlow {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.08);
    }
}

.hero-image {
    animation: zoomSlow 25s ease-in-out infinite alternate;
}

/* Carrusel de logos de clientes (portada) */
@keyframes scrollClientsPingPong {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-380%);
    }
}

.animate-scroll-clients {
    animation: scrollClientsPingPong 20s linear infinite alternate;
    will-change: transform;
    cursor: grab;
}

.animate-scroll-clients:hover {
    animation-play-state: paused;
}

.client-logo-item {
    height: 55px;
    width: auto;
    object-fit: contain;
    max-width: 100%;
}

@media (min-width: 768px) {
    .client-logo-item {
        height: 75px;
    }

    .animate-scroll-clients {
        animation: scrollClientsPingPong 20s linear infinite alternate;
    }

    @keyframes scrollClientsPingPong {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(-125%);
        }
    }
}

@media (min-width: 1024px) {
    .client-logo-item {
        height: 95px;
    }

    .animate-scroll-clients {
        animation: scrollClientsPingPong 25s linear infinite alternate;
    }

    @keyframes scrollClientsPingPong {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(-50%);
        }
    }
}

.logo-container {
    padding: 10px 0;
}

/* Banner de cookies */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner-enter {
    animation: slideUp 0.5s ease-out;
}

/* Publicaciones: animación sutil de íconos */
@keyframes pulse-subtle {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.animate-pulse-subtle {
    animation: pulse-subtle 3s ease-in-out infinite;
}

/* Respeta la preferencia de movimiento reducido del usuario */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
