/* =============================================
   Shared Components — Lunith
   ============================================= */

/* --- WhatsApp FAB --- */
.whatsapp-wrapper {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999;
}

/* Label: absolutamente posicionado, no ocupa espacio en el layout */
.whatsapp-fab__label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: rgba(20, 20, 20, 0.85);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 8px 14px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.whatsapp-wrapper:hover .whatsapp-fab__label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

.whatsapp-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-fab:focus,
.whatsapp-fab:focus-visible,
.whatsapp-fab:active {
    outline: none;
    box-shadow: none;
}

.whatsapp-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-fab svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    display: block;
}

@media (max-width: 600px) {
    .whatsapp-wrapper {
        bottom: 18px;
        right: 18px;
    }

    .whatsapp-fab {
        width: 48px;
        height: 48px;
    }

    .whatsapp-fab svg {
        width: 24px;
        height: 24px;
    }

    .whatsapp-fab__label {
        display: none;
    }
}

/* =============================================
   Selector de país (Perú / España)
   ============================================= */

/* Visibilidad condicional de contenido por país.
   Sin país elegido se muestran ambos bloques: los buscadores (sin localStorage)
   indexan el contenido PE y ES completo; el visitante real no lo ve duplicado
   porque el modal de país cubre la pantalla hasta que elige. */
html[data-country="pe"] [data-country-only="es"] { display: none !important; }
html[data-country="es"] [data-country-only="pe"] { display: none !important; }

body.country-modal-open { overflow: hidden; }

.country-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(120% 120% at 50% 0%, rgba(0, 102, 255, 0.16), rgba(4, 7, 32, 0.92) 55%), rgba(4, 7, 32, 0.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.country-modal.is-open {
    display: flex;
    opacity: 1;
    animation: countryFade 0.35s ease;
}

@keyframes countryFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.country-modal__dialog {
    width: 100%;
    max-width: 520px;
    text-align: center;
    background: rgba(10, 18, 48, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 48px 44px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    animation: countryRise 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes countryRise {
    from { transform: translateY(18px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.country-modal__logo {
    height: 34px;
    width: auto;
    margin-bottom: 22px;
    opacity: 0.95;
}

.country-modal__title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 28px;
}

.country-modal__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.country-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 34px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.country-option:hover,
.country-option:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(0, 153, 255, 0.5);
    background: rgba(0, 102, 255, 0.08);
    box-shadow: 0 12px 34px rgba(0, 102, 255, 0.22);
    outline: none;
}

.country-option__flag {
    display: block;
    width: 56px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.country-option__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

@media (max-width: 480px) {
    .country-modal__dialog { padding: 34px 22px 30px; }
    .country-modal__grid { grid-template-columns: 1fr; }
}

/* Botón/chip para cambiar de país (nav / footer) */
.country-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.75);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.country-switch:hover {
    border-color: rgba(0, 153, 255, 0.5);
    color: #fff;
    background: rgba(0, 102, 255, 0.1);
}

.country-switch svg { width: 14px; height: 14px; opacity: 0.7; }

/* =============================================
   Consentimiento de cookies
   ============================================= */
.ck-banner {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 1500;
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e7eef8;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(4, 20, 80, 0.16);
    padding: 20px 22px;
    font-family: 'Inter', sans-serif;
    transform: translateY(140%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease, visibility 0.4s;
}
.ck-banner.is-visible { transform: translateY(0); opacity: 1; visibility: visible; }
.ck-banner__inner { display: flex; align-items: center; gap: 22px; }
.ck-banner__text strong { display: block; font-size: 0.98rem; font-weight: 700; color: #0a1024; margin-bottom: 3px; }
.ck-banner__text p { margin: 0; font-size: 0.85rem; line-height: 1.5; color: #47526b; }
.ck-banner__text a { color: #0066ff; font-weight: 600; }
.ck-banner__text a:hover { text-decoration: underline; }
.ck-banner__actions { display: flex; align-items: center; gap: 8px; flex: none; }

.ck-btn {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 100px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.ck-btn--primary { background: #0066ff; color: #fff; }
.ck-btn--primary:hover { background: #0052d6; transform: translateY(-1px); }
.ck-btn--ghost { background: #fff; color: #47526b; border-color: #d8e3f2; }
.ck-btn--ghost:hover { border-color: #0066ff; color: #0066ff; }

/* --- Modal de preferencias --- */
.ck-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Inter', sans-serif;
}
.ck-modal.is-open { display: flex; }
.ck-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 7, 32, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: ckFade 0.25s ease;
}
.ck-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 22px;
    padding: 36px 34px 30px;
    box-shadow: 0 30px 80px rgba(4, 7, 32, 0.35);
    animation: ckRise 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes ckFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ckRise { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ck-modal__close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.7rem;
    line-height: 1;
    color: #77839c;
    cursor: pointer;
    transition: color 0.2s ease;
}
.ck-modal__close:hover { color: #0a1024; }
.ck-modal__title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; color: #0a1024; margin: 0 0 8px; }
.ck-modal__lead { font-size: 0.9rem; line-height: 1.55; color: #47526b; margin: 0 0 22px; }

.ck-cats { display: flex; flex-direction: column; gap: 4px; }
.ck-cat { padding: 16px 0; border-top: 1px solid #e7eef8; }
.ck-cat:first-child { border-top: none; }
.ck-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ck-cat__name { font-size: 0.98rem; font-weight: 700; color: #0a1024; }
.ck-cat__req { font-size: 0.72rem; font-weight: 600; color: #34c759; margin-left: 6px; }
.ck-cat__desc { margin: 6px 0 0; font-size: 0.82rem; line-height: 1.5; color: #77839c; }

.ck-switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: none; }
.ck-switch input { opacity: 0; width: 0; height: 0; }
.ck-switch__slider {
    position: absolute;
    inset: 0;
    background: #d8e3f2;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.ck-switch__slider::before {
    content: "";
    position: absolute;
    height: 19px;
    width: 19px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(4, 7, 32, 0.2);
    transition: transform 0.2s ease;
}
.ck-switch input:checked + .ck-switch__slider { background: #0066ff; }
.ck-switch input:checked + .ck-switch__slider::before { transform: translateX(19px); }
.ck-switch input:disabled + .ck-switch__slider { background: #34c759; cursor: not-allowed; opacity: 0.85; }

.ck-modal__actions { display: flex; gap: 8px; margin-top: 26px; flex-wrap: wrap; }
.ck-modal__actions .ck-btn { flex: 1; min-width: 130px; text-align: center; }

@media (max-width: 620px) {
    .ck-banner { padding: 18px; }
    .ck-banner__inner { flex-direction: column; align-items: stretch; gap: 16px; }
    .ck-banner__actions { flex-wrap: wrap; }
    .ck-banner__actions .ck-btn { flex: 1; min-width: 96px; text-align: center; }
    .ck-modal__actions { flex-direction: column; }
}

