/* ============================================================
   INICIO PAGE — Estilos propios de la vista principal
   ============================================================ */

/* ── Theme Images (logo animado) ─────────────────────────── */
.theme-image {
    display: none;
    width: 30px;
    height: auto;
    margin: 0 -0.2rem 0.5rem -0.2rem;
    vertical-align: middle;
    animation: jump 0.9s ease-in-out infinite;
}

@media (max-width: 768px) {
    .theme-image { width: 20px; }
}

@media (max-width: 480px) {
    .theme-image { width: 19px; }
}

@keyframes jump {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-0.5rem); }
}

[data-bs-theme="light"] .theme-image.light { display: inline; }
[data-bs-theme="dark"]  .theme-image.dark  { display: inline; }

/* ── Keyboard Keys Animation ─────────────────────────────── */
.key {
    display: inline-block;
    letter-spacing: 0.1vw;
    transition: transform 0.2s;
}

@keyframes pressDown1 { 30%, 40%, 100% { transform: translateY(0); } 35% { transform: translateY(10px); } }
@keyframes pressDown2 { 70%, 80%, 100% { transform: translateY(0); } 75% { transform: translateY(10px); } }
@keyframes pressDown3 { 30%, 40%, 100% { transform: translateY(0); } 35% { transform: translateY(10px); } }
@keyframes pressDown4 { 40%, 50%, 100% { transform: translateY(0); } 45% { transform: translateY(10px); } }
@keyframes pressDown5 { 20%, 30%, 100% { transform: translateY(0); } 25% { transform: translateY(10px); } }
@keyframes pressDown6 { 60%, 70%, 100% { transform: translateY(0); } 65% { transform: translateY(10px); } }
@keyframes pressDown7 { 10%, 20%, 100% { transform: translateY(0); } 15% { transform: translateY(10px); } }
@keyframes pressDown8 { 35%, 45%, 100% { transform: translateY(0); } 40% { transform: translateY(10px); } }

.key:nth-child(1) { animation: pressDown1 2.0s infinite; }
.key:nth-child(2) { animation: pressDown2 3.0s infinite; }
.key:nth-child(3) { animation: pressDown3 4.0s infinite; }
.key:nth-child(4) { animation: pressDown4 2.5s infinite; }
.key:nth-child(5) { animation: pressDown5 2.5s infinite; }
.key:nth-child(6) { animation: pressDown6 3.5s infinite; }
.key:nth-child(7) { animation: pressDown7 2.2s infinite; }
.key:nth-child(8) { animation: pressDown8 3.2s infinite; }

/* ── Subtitle Scroll Animation ───────────────────────────── */
.animation-subtitle {
    height: 60px;
    overflow: hidden;
}

.animation-subtitle > div > div {
    padding: 0.5rem 1rem;
    height: 3.5rem;
    margin-bottom: 3rem;
    display: inline-block;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    transition: transform 0.3s ease;
}

.animation-subtitle div:first-child {
    animation: text-animation 8s infinite;
}

.first  p { background-color: #CD921E; }
.second p { background-color: #c10528; }
.third  p { background-color: #054b2b; }

@keyframes text-animation {
    0%,  10% { margin-top: 0;        transform: scale(1);    }
    20%, 30% { margin-top: -3.62rem; transform: scale(1.05); }
    40%, 60% { margin-top: -8.14rem; transform: scale(1);    }
    70%, 80% { margin-top: -3.62rem; transform: scale(1.05); }
    90%, 100%{ margin-top: 0;        transform: scale(1);    }
}

/* ── Layout base ─────────────────────────────────────────── */
html,
.body-custom {
    height: 100%;
}

.body-custom {
    margin: 0;
}

.container-custom {
    text-align: center;
    color: black;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    width: 100%;
    margin-top: 20px;
}

section {
    padding-top: 0.5rem !important;
    padding-bottom: 0.1rem !important;
    position: relative;
    display: flex;
    flex-flow: column;
    align-items: center;
}

section div.container h1 { margin: 15px 0 0 0; }
section div.container h3 { margin: 0 0 25px 0; }

section.slide-option {
    margin: 0 0 1px 0;
}

section.slide-option .no-marg {
    margin: 0;
}

/* ── Highway Slider — Infinite Scroll (MEJORADO) ─────────── */

/*
 * Estructura esperada:
 *   <div id="infinite" class="highway-slider">
 *     <div class="highway-barrier">
 *       <ul class="highway-lane">
 *         <li class="highway-car"><img ...></li>
 *         ...  (JS duplica los items para el loop sin fin)
 *       </ul>
 *     </div>
 *   </div>
 */

.highway-slider {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.highway-barrier {
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Fade degradado en los bordes para suavizar la entrada/salida */
.highway-barrier::before,
.highway-barrier::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 10;
    pointer-events: none;
}

.highway-barrier::before {
    left: 0;
    background: linear-gradient(to right, var(--bs-body-bg, #fff), transparent);
}

.highway-barrier::after {
    right: 0;
    background: linear-gradient(to left, var(--bs-body-bg, #fff), transparent);
}

.highway-lane {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.highway-car {
    flex-shrink: 0;
    width: 236px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 8px;
}

.highway-car img {
    width: 250px;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* ── #infinite — el slider principal ────────────────────── */
#infinite {
    height: 242px;
    margin: 0 auto;
    max-width: 100%;
}

#infinite .highway-barrier {
    height: 100%;
}

/* La animación va en el UL, no en cada LI */
#infinite .highway-lane {
    height: 100%;
    /* width se calcula por JS: 180px × (items originales × 2) */
    animation: slideInfinite 30s linear infinite;
    will-change: transform;
}

/* Pausa al hover */
#infinite:hover .highway-lane {
    animation-play-state: paused;
}

/* translateX se actualiza por JS con --slider-offset */
@keyframes slideInfinite {
    0%   { transform: translateX(0); }
    100% { transform: translateX(var(--slider-offset, calc(-180px * 11))); }
}

/* Respeto por prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    #infinite .highway-lane {
        animation: none;
    }
}

/* ── Botones (z-index sobre el slider) ───────────────────── */
.btn {
    position: relative;
    z-index: 2;
}

/* ============================================================
   SECCIONES DE CONTENIDO
   ============================================================ */

/* Icono de feature grande (56×56) */
.inicio-feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icono de feature pequeño (42×42) */
.inicio-feature-icon-sm {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Card con efecto hover suave */
.card-inicio-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-inicio-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.13) !important;
}

/* Estadísticas — número grande */
.inicio-stat {
    line-height: 1.1;
    letter-spacing: -0.5px;
}

/* Paso numerado (círculo) */
.inicio-step {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Card visual del mapa de Perú */
.inicio-peru-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    max-width: 400px;
}

/* Color de texto de la marca */
.text-pnp {
    color: #205135 !important;
}

/* Responsive: reducir display-5 en móvil para estadísticas */
@media (max-width: 576px) {
    .inicio-stat.display-5 {
        font-size: 2rem;
    }
}
