/**
 * cta-styles.css
 * Estilos para los CTAs (Call-to-Action) de conversión.
 * HOTFIX: Eliminada sección de z-index duplicada para resolver conflicto.
 *
 * @version 1.9.1
 * @date 2025-08-24
 * @author Baxahaun Venture Studio https://baxahaun.com
 * // PEV_REF: HOTFIX-ZINDEX-ICON-20250824
 */

/* ===============================================================
   1. VARIABLES CSS - Nuevos Colores Sólidos
   =============================================================== */

:root {
    /* Colores CTA sólidos según especificaciones */
    --cta-background: #003049;
    --cta-button-outline: #c1121f;
    --cta-button-filled: #780000;
    --cta-text-white: #ffffff;
    --cta-text-contrast-light: #ffffff;
    --cta-text-contrast-dark: #000000;
    
    /* Timing para animaciones */
    --cta-transition-speed: 0.3s;
    --cta-pulse-duration: 3s;
    --cta-teleprompter-speed: 2s;
}

/* ===============================================================
   2. Estilos Base Mobile-First (Sin Gradientes)
   =============================================================== */

.cta-chapter-end,
.cta-footer {
    background-color: var(--cta-background); /* Sólido #003049 */
    color: var(--cta-text-white);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 4px 16px rgba(0, 48, 73, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    
    /* Tamaños diferenciados */
    padding: 1.5rem;
    margin: 2rem auto;
}

/* CTA Capítulo: Reducido en tamaño */
.cta-chapter-end {
    max-width: 600px; /* Reducido de ~960px */
    padding: 1.25rem; /* Reducido */
    margin: 1.5rem auto; /* Reducido */
}

/* CTA Footer: Sin efectos, preparado para centrado desktop */
.cta-footer {
    border: 1px solid #00426f;
    margin-bottom: 2rem;
    max-width: 800px;
    /* Sin animaciones ni efectos especiales */
}

.cta-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.cta-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    align-items: center;
    position: relative;
    z-index: 2;
    margin-top: 1rem;
}

/* CTA Footer: Más espacio entre subtext y botón */
.cta-footer .cta-actions {
    margin-top: 3rem !important; /* Aumentado espacio específicamente para footer */
}

/* ===============================================================
   3. CTA Buttons - Estados Correctos con Efecto Slide
   =============================================================== */

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    /* ESTADO NORMAL: Outline rojo claro + fondo prussian blue */
    background-color: var(--cta-background); /* #003049 */
    border: 2px solid var(--cta-button-outline); /* #c1121f */
    color: var(--cta-text-white) !important; /* Texto blanco */
    
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    border-radius: var(--bs-border-radius);
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    
    /* Mobile-First: Área táctil mínima WCAG */
    min-height: 48px;
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1.5rem;
    
    /* Transición suave */
    transition: all 0.4s ease-in-out;
}

/* Pseudo-elemento para efecto de desplazamiento del fondo */
.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--cta-button-filled); /* #780000 */
    transition: left 0.6s ease-in-out;
    z-index: -1;
}

/* HOVER/FOCUS: Desplazamiento del fondo rojo oscuro */
.cta-button:hover::before,
.cta-button:focus::before {
    left: 0; /* Desliza desde izquierda */
}

.cta-button:hover,
.cta-button:focus {
    border-color: var(--cta-button-outline); /* Outline se mantiene igual */
    color: var(--cta-text-white) !important; /* Texto blanco */
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(193, 18, 31, 0.3);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(193, 18, 31, 0.2);
}

/* ===============================================================
   4. Efecto Teleprompter REAL - Solo CTA Capítulo
   =============================================================== */

.cta-chapter-end .cta-button {
    overflow: hidden;
}

.cta-chapter-end .cta-button .teleprompter-text {
    position: relative;
    display: inline-block;
    white-space: nowrap;
    animation: teleprompter-real 3s linear infinite;
}

@keyframes teleprompter-real {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ===============================================================
   5. Efecto Pulso - Más Evidente Solo CTA Capítulo
   =============================================================== */

@keyframes pulse-enhanced {
    0% { 
        box-shadow: 0 4px 16px rgba(0, 48, 73, 0.3), 0 0 0 0 rgba(193, 18, 31, 0.8);
    }
    50% { 
        box-shadow: 0 4px 16px rgba(0, 48, 73, 0.3), 0 0 0 15px rgba(193, 18, 31, 0);
    }
    100% { 
        box-shadow: 0 4px 16px rgba(0, 48, 73, 0.3), 0 0 0 0 rgba(193, 18, 31, 0);
    }
}

.cta-chapter-end {
    animation: pulse-enhanced var(--cta-pulse-duration) ease-in-out infinite;
}

/* Pausar animaciones en hover para mejor UX */
.cta-chapter-end:hover {
    animation-play-state: paused;
}

/* ===============================================================
   6. Tipografía - Tamaños Reducidos para CTA Capítulo
   =============================================================== */

/* CTA Capítulo: Tipografía reducida */
.cta-chapter-end .cta-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 600;
    font-size: 1.4rem; /* Reducido de ~1.8rem */
    color: var(--cta-text-white);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.cta-chapter-end .cta-subtitle {
    font-size: 1rem; /* Reducido de ~1.1rem */
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.cta-chapter-end .cta-text {
    font-size: 0.95rem; /* Reducido de ~1.1rem */
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.cta-chapter-end .cta-subtext {
    font-size: 0.9rem; /* Reducido de ~1rem */
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    margin: 0 0 1.25rem 0;
    line-height: 1.5;
}

/* CTA Footer: Sin cambios tipográficos */
.cta-footer .cta-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--cta-text-white);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.cta-footer .cta-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 2rem;
    line-height: 1.5;
}

/* ===============================================================
   7. RESPONSIVE DESIGN - Progressive Enhancement
   =============================================================== */

/* Tablets - 768px+ */
@media (min-width: 768px) {
    .cta-chapter-end,
    .cta-footer {
        flex-direction: row;
        text-align: left;
        align-items: center;
        padding: 2rem;
    }
    
    /* CTA Footer: Centrado específico en desktop */
    .cta-footer {
        margin-left: auto;
        margin-right: auto;
        text-align: center; /* Forzar centrado en desktop */
        flex-direction: column; /* Mantener vertical en desktop */
    }
    
    .cta-content {
        flex: 1;
        margin-right: 2rem;
    }
    
    /* CTA Footer: Sin margin-right en desktop */
    .cta-footer .cta-content {
        margin-right: 0;
    }
    
    .cta-actions {
        flex-direction: column;
        width: auto;
        min-width: 200px;
    }
    
    .cta-button {
        width: auto;
        min-width: 180px;
        max-width: 280px;
    }
    
    /* Ajustes tipográficos para tablet */
    .cta-chapter-end .cta-title {
        font-size: 1.5rem; /* Incremento moderado para tablet */
    }
    
    .cta-chapter-end .cta-subtitle {
        font-size: 1.05rem;
    }
}

/* Desktop - 992px+ */
@media (min-width: 992px) {
    .cta-chapter-end {
        padding: 2rem;
        max-width: 700px; /* Aumentado ligeramente para desktop */
    }
    
    .cta-button {
        min-width: 220px;
        max-width: 300px;
        font-size: 1.05rem;
    }
    
    /* Tipografía desktop para CTA capítulo */
    .cta-chapter-end .cta-title {
        font-size: 1.6rem; /* Controlado, no demasiado grande */
    }
    
    .cta-chapter-end .cta-subtitle {
        font-size: 1.1rem;
    }
    
    .cta-chapter-end .cta-text {
        font-size: 1rem;
    }
    
    .cta-chapter-end .cta-subtext {
        font-size: 0.95rem;
    }
}

/* Large Desktop - 1200px+ */
@media (min-width: 1200px) {
    .cta-actions {
        flex-direction: row;
        gap: 1.5rem;
    }
    
    .cta-button {
        flex: 0 0 auto;
    }
}
