html { scroll-behavior: smooth; }

/* El atributo hidden debe ganar a los display de las clases utilitarias */
[hidden] { display: none !important; }

/* Header azul de marca (el logo es blanco, por eso el fondo es de color) */
.site-header {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.site-header.scrolled {
    background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
    box-shadow: 0 8px 30px -8px rgba(37, 99, 235, 0.45);
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.gradient-bg {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
}

/* Iconos inline convertidos desde Material Symbols a SVG (viewBox propio de Material).
   vertical-align: middle conserva su alineación con el texto; es ignorado dentro de flex. */
svg[viewBox="0 -960 960 960"] {
    vertical-align: middle;
}

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

.section-animate {
    animation: fadeInUp 0.8s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #60a5fa;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

/* Floating WhatsApp button (estilo Joinchat) */
.whatsapp-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 9999px;
    background-color: #25D366;
    color: #ffffff;
    box-shadow: 0 6px 20px -4px rgba(37, 211, 102, 0.6);
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}
.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.08);
    box-shadow: 0 10px 28px -6px rgba(18, 140, 126, 0.6);
}
.whatsapp-float-icon {
    width: 34px;
    height: 34px;
    position: relative;
    z-index: 1;
}
/* Pulso animado detrás del botón */
.whatsapp-float-pulse {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background-color: #25D366;
    opacity: 0.55;
    z-index: 0;
    animation: whatsappPulse 2s ease-out infinite;
}
@keyframes whatsappPulse {
    0%   { transform: scale(1);   opacity: 0.55; }
    70%  { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(1.6); opacity: 0; }
}
@media (max-width: 640px) {
    .whatsapp-float {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
    }
    .whatsapp-float-icon {
        width: 30px;
        height: 30px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .whatsapp-float-pulse { animation: none; }
}

/* ============================================================
   Popup promocional — 25% de descuento por WhatsApp
   ============================================================ */
.promo-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.promo-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.promo-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 24px;
    padding: 40px 28px 28px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.promo-overlay.is-open .promo-card {
    transform: translateY(0) scale(1);
}
.promo-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #F1F5F9;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.promo-close:hover {
    background: #E2E8F0;
    color: #0F172A;
}
.promo-close svg { width: 20px; height: 20px; }
.promo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.12);
    color: #25D366;
}
.promo-badge svg { width: 40px; height: 40px; }
.promo-discount {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    color: #25D366;
    margin-bottom: 8px;
}
.promo-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 10px;
}
.promo-text {
    font-size: 0.95rem;
    color: #64748B;
    line-height: 1.55;
    margin-bottom: 22px;
}
.promo-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    border-radius: 9999px;
    background: #25D366;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.25s ease;
}
.promo-cta:hover {
    background: #128C7E;
    transform: translateY(-2px);
}
.promo-cta svg { width: 22px; height: 22px; }
.promo-later {
    display: block;
    margin: 12px auto 0;
    border: none;
    background: none;
    color: #94A3B8;
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
}
.promo-later:hover { color: #64748B; }
.promo-note {
    margin-top: 14px;
    font-size: 0.75rem;
    color: #94A3B8;
    line-height: 1.5;
}
/* Chip con la bandera y el país detectado */
.promo-country {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: #EFF6FF;
    color: #1E40AF;
    font-size: 0.8rem;
    font-weight: 700;
}
.promo-country .fi {
    width: 20px;
    height: 15px;
    border-radius: 2px;
}
@media (max-width: 480px) {
    .promo-card { padding: 36px 20px 24px; }
    .promo-discount { font-size: 2.4rem; }
    .promo-title { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
    .promo-overlay, .promo-card { transition: opacity 0.2s ease; }
    .promo-card { transform: none; }
}

/* ============================================================
   Barra fija inferior de contacto por WhatsApp
   ============================================================ */
.cta-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 56px 12px 20px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid #E2E8F0;
    box-shadow: 0 -8px 30px -12px rgba(15, 23, 42, 0.25);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 0.35s ease, visibility 0.35s ease;
}
.cta-bar.is-visible {
    transform: translateY(0);
    visibility: visible;
}
.cta-bar-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0F172A;
    line-height: 1.3;
}
.cta-bar-flag {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}
.cta-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 11px 22px;
    border-radius: 9999px;
    background: #25D366;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.25s ease;
}
.cta-bar-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
}
.cta-bar-btn svg { width: 20px; height: 20px; }
.cta-bar-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #94A3B8;
    cursor: pointer;
}
.cta-bar-close:hover { background: #F1F5F9; color: #0F172A; }
.cta-bar-close svg { width: 16px; height: 16px; }
/* El botón flotante sube para no chocar con la barra */
body.has-cta-bar .whatsapp-float { bottom: 92px; }
@media (max-width: 640px) {
    .cta-bar {
        gap: 10px;
        padding: 10px 44px 10px 14px;
    }
    .cta-bar-text { font-size: 0.8rem; }
    .cta-bar-btn { padding: 10px 16px; font-size: 0.85rem; }
    body.has-cta-bar .whatsapp-float { bottom: 84px; }
}

/* Etiqueta junto al botón flotante (solo escritorio) */
.whatsapp-float-label {
    position: absolute;
    right: 72px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 9999px;
    background: #ffffff;
    color: #0F172A;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 6px 20px -6px rgba(15, 23, 42, 0.35);
}
@media (max-width: 768px) {
    .whatsapp-float-label { display: none; }
}

/* Pulso suave en los botones principales de WhatsApp para destacarlos */
.cta-attention {
    animation: ctaAttention 2.8s ease-out infinite;
}
@keyframes ctaAttention {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    55%      { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .cta-attention { animation: none; }
    .cta-bar { transition: none; }
}
