/* ============================================================
   MAIN.CSS — HEADER, FOOTER Y PRELOADER — ALFA 4.0
   Estilos globales para header, footer y preloader del subdominio alfa.azenis.com.gt
   100% CSP compatible
   Ruta: public_html/alfa/assets/css/main.css
   ============================================================ */

/* ============================================================
   1. VARIABLES Y RESET
   ============================================================ */
:root {
    --alfa-primary: #1A7A6B;
    --alfa-dark: #0F4A40;
    --alfa-light: #E8F5F2;
    --alfa-gold: #D4AF37;
    --alfa-gold-light: #E8C84A;
    --alfa-white: #FFFFFF;
    --alfa-black: #0A0A0A;
    --alfa-gray: #94A3B8;
    --alfa-gray-light: #E2E8F0;
    --alfa-gray-dark: #64748B;
    --alfa-font: 'Montserrat', sans-serif;
    --header-height: 70px;
    --header-height-mobile: 64px;
    --header-height-small: 56px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--alfa-font);
    background: var(--alfa-white);
    color: var(--alfa-black);
    padding-top: var(--header-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================================
   2. PRELOADER — ALFA 4.0
   ============================================================ */
.alfa-preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--alfa-dark, #0F4A40);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    opacity: 1;
    visibility: visible;
}

.alfa-preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    max-width: 400px;
    width: 100%;
}

.preloader-logo-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.preloader-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    z-index: 2;
    animation: preloaderPulse 2s ease-in-out infinite;
}

.preloader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--alfa-gold, #D4AF37);
    border-right-color: var(--alfa-gold, #D4AF37);
    animation: preloaderSpin 1.2s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

.preloader-ring::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: rgba(212, 175, 55, 0.4);
    border-left-color: rgba(212, 175, 55, 0.4);
    animation: preloaderSpin 0.8s cubic-bezier(0.6, 0, 0.4, 1) infinite reverse;
}

.preloader-title {
    font-family: var(--alfa-font, 'Montserrat', sans-serif);
    font-weight: 800;
    font-size: 1.8rem;
    color: var(--alfa-white, #FFFFFF);
    letter-spacing: 0.1em;
    margin: 0 0 4px 0;
    animation: preloaderFadeIn 0.8s ease-out;
}

.preloader-subtitle {
    font-family: var(--alfa-font, 'Montserrat', sans-serif);
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--alfa-gold, #D4AF37);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 0 0 32px 0;
    animation: preloaderFadeIn 1s ease-out 0.2s both;
}

.preloader-bar-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.preloader-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/* ✅ width: 0% por defecto (sin inline styles) */
.preloader-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--alfa-gold, #D4AF37), var(--alfa-gold-light, #E8C84A));
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.preloader-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    border-radius: 4px;
}

.preloader-steps {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 4px;
}

.preloader-steps .step {
    font-family: var(--alfa-font, 'Montserrat', sans-serif);
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.30);
    transition: all 0.4s ease;
    letter-spacing: 0.03em;
    position: relative;
}

.preloader-steps .step.active {
    color: var(--alfa-gold, #D4AF37);
    font-weight: 600;
}

.preloader-steps .step.done {
    color: rgba(212, 175, 55, 0.50);
}

.preloader-steps .step::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.4s ease;
}

.preloader-steps .step.active::after {
    background: var(--alfa-gold, #D4AF37);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.40);
}

.preloader-steps .step.done::after {
    background: rgba(212, 175, 55, 0.30);
}

.preloader-percent {
    font-family: var(--alfa-font, 'Montserrat', sans-serif);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--alfa-white, #FFFFFF);
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

/* ============================================================
   3. ANIMACIONES PRELOADER
   ============================================================ */
@keyframes preloaderSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes preloaderPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.85;
    }
}

@keyframes preloaderFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   4. HEADER — ALFA 4.0 (CON LÍNEA DORADA DEGRADADA)
   ============================================================ */
.alfa-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 74, 64, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0;
    transition: all var(--transition);
}

/* ✅ LÍNEA DORADA CON DEGRADADO EN LA PARTE INFERIOR */
.alfa-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(212, 175, 55, 0.15) 10%,
        var(--alfa-gold) 30%,
        var(--alfa-gold-light) 50%,
        var(--alfa-gold) 70%,
        rgba(212, 175, 55, 0.15) 90%,
        transparent 100%
    );
    opacity: 0.80;
}

.alfa-header.scrolled {
    background: rgba(15, 74, 64, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.alfa-header.scrolled::after {
    opacity: 1;
}

.header-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* --- Logo vertical (solo imagen, sin texto) --- */
.alfa-logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.alfa-logo-container:hover {
    transform: scale(1.05);
}

.alfa-logo-img {
    height: 40px;
    width: auto;
    display: block;
    transition: filter var(--transition);
}

.alfa-logo-img:hover {
    filter: brightness(1.1);
}

/* ============================================================
   5. NAVEGACIÓN DESKTOP
   ============================================================ */
.alfa-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.alfa-nav-links li {
    position: relative;
}

.alfa-nav-links li a {
    font-family: var(--alfa-font);
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--alfa-gray-light);
    text-decoration: none;
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 4px;
    position: relative;
    display: inline-block;
}

.alfa-nav-links li a:hover {
    color: var(--alfa-gold);
    background: rgba(212, 175, 55, 0.06);
}

.alfa-nav-links li a.active-page {
    color: var(--alfa-gold);
    background: transparent;
}

.alfa-nav-links li a.active-page::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2.5px;
    background: var(--alfa-gold);
    border-radius: 2px;
    box-shadow: none;
}

/* ============================================================
   6. BOTÓN CTA EN HEADER
   ============================================================ */
.alfa-btn-header {
    background: var(--alfa-gold) !important;
    color: var(--alfa-black) !important;
    padding: 8px 22px !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    transition: all var(--transition) !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.20);
    position: relative;
    overflow: hidden;
    display: inline-block !important;
    margin-left: 4px !important;
}

.alfa-btn-header::before,
.alfa-btn-header::after {
    display: none !important;
}

.alfa-btn-header:hover {
    background: var(--alfa-gold-light) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.35);
    color: var(--alfa-black) !important;
}

/* ============================================================
   7. HAMBURGUESA
   ============================================================ */
.alfa-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
    margin-left: auto;
}

.alfa-hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--alfa-white);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.alfa-hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.alfa-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.alfa-hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================================
   8. OVERLAY MÓVIL
   ============================================================ */
.alfa-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    padding: 80px 24px 40px;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: flex-start;
}

.alfa-overlay.open {
    display: flex;
}

.alfa-overlay::-webkit-scrollbar {
    width: 4px;
}

.alfa-overlay::-webkit-scrollbar-track {
    background: transparent;
}

.alfa-overlay::-webkit-scrollbar-thumb {
    background: var(--alfa-gold);
    border-radius: 4px;
}

.alfa-overlay {
    scrollbar-width: thin;
    scrollbar-color: var(--alfa-gold) transparent;
}

.overlay-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: none;
    border: none;
    color: var(--alfa-white);
    font-size: 2rem;
    cursor: pointer;
    padding: 8px;
    transition: color var(--transition);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.overlay-close:hover {
    color: var(--alfa-gold);
    background: rgba(212, 175, 55, 0.10);
}

.alfa-overlay-links {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 400px;
}

.alfa-overlay-links li {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.alfa-overlay.open .alfa-overlay-links li {
    opacity: 1;
    transform: translateY(0);
}

.alfa-overlay.open .alfa-overlay-links li:nth-child(1) { transition-delay: 0.05s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(2) { transition-delay: 0.10s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(3) { transition-delay: 0.15s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(4) { transition-delay: 0.20s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(5) { transition-delay: 0.25s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(6) { transition-delay: 0.30s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(7) { transition-delay: 0.35s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(8) { transition-delay: 0.40s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(9) { transition-delay: 0.45s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(10) { transition-delay: 0.50s; }
.alfa-overlay.open .alfa-overlay-links li:nth-child(11) { transition-delay: 0.55s; }

.alfa-overlay-links li a {
    font-family: var(--alfa-font);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--alfa-white);
    text-decoration: none;
    transition: color var(--transition);
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.alfa-overlay-links li a:hover {
    color: var(--alfa-gold);
}

.alfa-overlay-links li:last-child a {
    border-bottom: none;
}

.overlay-cta {
    background: var(--alfa-gold) !important;
    color: var(--alfa-black) !important;
    padding: 12px 32px !important;
    border-radius: 50px;
    font-weight: 700 !important;
    font-size: 1rem !important;
    margin-top: 16px;
    display: inline-block !important;
    border-bottom: none !important;
    text-align: center !important;
    transition: all var(--transition);
}

.overlay-cta:hover {
    background: var(--alfa-gold-light) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.30);
}

/* ============================================================
   9. FOOTER — ALFA 4.0 (CON LÍNEA DORADA DEGRADADA)
   ============================================================ */
.alfa-footer {
    background: var(--alfa-dark);
    padding: 24px 0 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
    position: relative;
}

/* ✅ LÍNEA DORADA CON DEGRADADO EN LA PARTE SUPERIOR */
.alfa-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(212, 175, 55, 0.15) 10%,
        var(--alfa-gold) 30%,
        var(--alfa-gold-light) 50%,
        var(--alfa-gold) 70%,
        rgba(212, 175, 55, 0.15) 90%,
        transparent 100%
    );
    opacity: 0.60;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    font-family: var(--alfa-font);
    font-size: 0.85rem;
    color: var(--alfa-gray-light);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--alfa-gold);
}

.footer-sep {
    color: var(--alfa-gray);
    opacity: 0.4;
    font-size: 0.8rem;
}

.footer-bottom {
    font-family: var(--alfa-font);
    font-size: 0.75rem;
    color: var(--alfa-gray);
    opacity: 0.6;
}

/* ============================================================
   10. RESPONSIVE
   ============================================================ */

/* --- Preloader responsive --- */
@media (max-width: 768px) {
    .preloader-logo-wrapper {
        width: 80px;
        height: 80px;
    }
    
    .preloader-logo {
        width: 48px;
        height: 48px;
    }
    
    .preloader-title {
        font-size: 1.5rem;
    }
    
    .preloader-subtitle {
        font-size: 0.7rem;
        margin-bottom: 24px;
    }
    
    .preloader-steps .step {
        font-size: 0.55rem;
    }
    
    .preloader-percent {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .preloader-logo-wrapper {
        width: 64px;
        height: 64px;
    }
    
    .preloader-logo {
        width: 38px;
        height: 38px;
    }
    
    .preloader-title {
        font-size: 1.2rem;
    }
    
    .preloader-subtitle {
        font-size: 0.6rem;
        margin-bottom: 20px;
    }
    
    .preloader-steps .step {
        font-size: 0.5rem;
    }
    
    .preloader-percent {
        font-size: 0.9rem;
    }
}

/* --- Header/Footer responsive --- */
@media (max-width: 1024px) {
    .alfa-nav-links {
        gap: 4px;
    }
    
    .alfa-nav-links li a {
        font-size: 0.72rem;
        padding: 6px 8px;
    }
    
    .alfa-btn-header {
        padding: 6px 14px !important;
        font-size: 0.7rem !important;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: var(--header-height-mobile);
    }

    .alfa-header {
        height: var(--header-height-mobile);
    }

    .alfa-nav-links {
        display: none;
    }
    
    .alfa-hamburger {
        display: flex;
    }
    
    .alfa-logo-img {
        height: 32px;
    }
    
    .alfa-overlay {
        padding: 70px 20px 30px;
    }
    
    .alfa-overlay-links li a {
        font-size: 1.1rem;
        padding: 8px 0;
    }
    
    .footer-links {
        gap: 6px;
    }
    
    .footer-links a {
        font-size: 0.8rem;
    }
    
    .footer-sep {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: var(--header-height-small);
    }

    .alfa-header {
        height: var(--header-height-small);
    }
    
    .alfa-logo-img {
        height: 28px;
    }
    
    .header-container {
        padding: 0 12px;
    }
    
    .alfa-hamburger {
        gap: 4px;
    }
    
    .alfa-hamburger span {
        width: 22px;
        height: 2px;
    }
    
    .alfa-overlay {
        padding: 60px 16px 20px;
    }
    
    .alfa-overlay-links li a {
        font-size: 1rem;
        padding: 8px 0;
    }
    
    .overlay-cta {
        font-size: 0.9rem !important;
        padding: 10px 24px !important;
    }
    
    .footer-links {
        gap: 4px;
    }
    
    .footer-links a {
        font-size: 0.75rem;
    }
    
    .footer-sep {
        font-size: 0.65rem;
    }
    
    .footer-container {
        gap: 10px;
        padding: 0 12px;
    }
}

/* ============================================================
   11. UTILIDADES Y ACCESIBILIDAD
   ============================================================ */

body.overlay-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--alfa-gold);
    outline-offset: 2px;
}

::selection {
    background: var(--alfa-gold);
    color: var(--alfa-black);
}

::-moz-selection {
    background: var(--alfa-gold);
    color: var(--alfa-black);
}

/* ============================================================
   FIN DE MAIN.CSS
   ============================================================ */