/* =====================================================================
   site-extras.css
   Menú superior (mega-menu + idiomas), corrección del footer y
   selectores de País / Teléfono con banderas (flag-icons).
   Cargar DESPUÉS de styleitinerary.css
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. MENÚ SUPERIOR
--------------------------------------------------------------------- */
.nav {
    --teal: #0e7c6b;
    --nav-gold: #d4a017;
    position: relative;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 68px;
    padding: 0 32px;
    background: #0f1a24;
    color: #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-logo .nav-logo-icon { color: var(--nav-gold); flex-shrink: 0; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item { position: relative; }

.nav-link {
    display: flex;
    align-items: center;
    padding: 24px 13px;
    color: #e9e9e9;
    text-decoration: none;
    font-size: .86rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s;
}
.nav-link:hover,
.nav-item:hover > .nav-link,
.nav-item.open > .nav-link { color: var(--nav-gold); }

/* Mega dropdown */
.mega-drop {
    position: absolute;
    top: 100%;
    left: 0;
    display: grid;
    gap: 2px 22px;
    padding: 18px 20px;
    background: #fff;
    color: #222;
    border-radius: 0 0 12px 12px;
    border-top: 3px solid var(--nav-gold);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s;
}
.mega-drop.cols-1 { grid-template-columns: 1fr; min-width: 400px; max-height: 76vh; overflow-y: auto; }
.mega-drop.cols-2 { grid-template-columns: repeat(2, minmax(240px, 1fr)); min-width: 540px; }
.mega-drop.cols-3 { grid-template-columns: repeat(3, minmax(160px, 1fr)); min-width: 540px; }

/* Los menús de la derecha abren hacia la izquierda para no salirse */
#ni-multi-country .mega-drop,
#ni-attr .mega-drop { left: auto; right: 0; }

.nav-item:hover > .mega-drop,
.nav-item:focus-within > .mega-drop,
.nav-item.open > .mega-drop {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.mega-col-title {
    grid-column: 1 / -1;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--nav-gold);
}

.mega-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    color: #333;
    text-decoration: none;
    font-size: .85rem;
    line-height: 1.3;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.mega-link:hover { background: #f5f1e6; color: var(--teal); }
.mega-link.featured { font-weight: 600; }
.mega-link .fa-check { color: var(--teal); font-size: .75rem; }

.days-badge {
    margin-left: auto;
    padding: 2px 9px;
    font-size: .68rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--teal);
    background: rgba(14, 124, 107, .1);
    border-radius: 20px;
}

/* Selector de idioma */
.lang-wrap { position: relative; flex-shrink: 0; }
.lang-btn {
    padding: 8px 14px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 20px;
    font-size: .82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .2s;
}
.lang-btn:hover { border-color: var(--nav-gold); }
.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(170px, 1fr));
    gap: 2px;
    width: 380px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: .2s;
}
.lang-wrap.open .lang-dropdown { opacity: 1; visibility: visible; transform: none; }
.lang-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    color: #333;
    text-decoration: none;
    font-size: .84rem;
    border-radius: 6px;
}
.lang-link:hover { background: #f5f1e6; }
.lang-link .fi { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }

/* Hamburguesa */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: 0;
    cursor: pointer;
}
.hamburger span { display: block; width: 24px; height: 2px; background: #fff; transition: .25s; }
.nav.menu-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.menu-open .hamburger span:nth-child(2) { opacity: 0; }
.nav.menu-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Móvil / tablet */
@media (max-width: 1150px) {
    .nav { padding: 0 16px; }
    .hamburger { display: flex; order: 3; }
    .lang-wrap { margin-left: auto; }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: calc(100vh - 68px);
        overflow-y: auto;
        background: #0f1a24;
        border-top: 1px solid rgba(255, 255, 255, .08);
        display: none;
    }
    .nav.menu-open .nav-menu { display: flex; }

    .nav-link { padding: 15px 20px; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, .06); }

    .mega-drop,
    #ni-multi-country .mega-drop,
    #ni-attr .mega-drop {
        position: static;
        min-width: 0 !important;
        max-height: none;
        grid-template-columns: 1fr !important;
        border-radius: 0;
        border-top: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }
    .nav-item:hover > .mega-drop,
    .nav-item:focus-within > .mega-drop { display: none; }
    .nav-item.open > .mega-drop,
    #ni-multi-country.open > .mega-drop,
    #ni-attr.open > .mega-drop { display: grid; }

    .lang-dropdown { width: min(380px, calc(100vw - 32px)); }
}
@media (max-width: 480px) {
    .nav-logo { font-size: .9rem; }
    .lang-dropdown { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   2. FOOTER — más ancho y logo en una sola línea
--------------------------------------------------------------------- */
.super-footer .footer-container {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 32px;
    padding-right: 32px;
    display: grid;
    grid-template-columns: minmax(400px, 2fr) 1fr 1fr 1.2fr;
    gap: 48px;
}
.super-footer .footer-bottom { max-width: 1440px; padding-left: 32px; padding-right: 32px; }
.super-footer .footer-col:last-child { grid-column: auto; }
.footer-brand .brand-desc { max-width: 400px; }

.footer-brand .footer-logo {
    display: inline-flex !important;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    white-space: nowrap;
    font-size: 1.25rem;
    text-decoration: none;
}
.footer-logo .nav-logo-icon { flex-shrink: 0; }
.footer-logo .logo-white,
.footer-logo .logo-gold {
    display: inline !important;
    white-space: nowrap;
    width: auto !important;
    float: none !important;
    margin: 0 !important;
}

@media (max-width: 1100px) {
    .super-footer .footer-container { grid-template-columns: repeat(2, 1fr); gap: 36px; }
}
@media (max-width: 640px) {
    .super-footer .footer-container { grid-template-columns: 1fr; padding-left: 20px; padding-right: 20px; }
    .super-footer .footer-bottom { padding-left: 20px; padding-right: 20px; }
    .footer-brand .footer-logo { white-space: normal; flex-wrap: wrap; font-size: 1.1rem; }
}

/* ---------------------------------------------------------------------
   3. SELECTOR DE PAÍS con bandera
--------------------------------------------------------------------- */
.country-picker-wrap { position: relative; }
.country-picker-display { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.cp-flag { display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; line-height: 1; }
.cp-flag .fi,
.cp-item .fi,
.phone-flag-btn .fi,
.phone-drop .fi {
    width: 24px;
    height: 18px;
    background-size: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    flex-shrink: 0;
}
.cp-text.placeholder { color: #999; }

.country-picker-dropdown,
.phone-drop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .15);
    display: none;
}
.country-picker-wrap.open .country-picker-dropdown { display: flex; flex-direction: column; max-height: 320px; }
.phone-wrap.open .phone-drop { display: block; }
.country-picker-wrap.open .country-picker-display { border-color: var(--jade, #0e7c6b); }
.country-picker-wrap.open .cp-arrow { transform: rotate(180deg); }

.cp-search {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid #eee;
    border-radius: 10px 10px 0 0;
    font-size: .9rem;
    outline: none;
}
.cp-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.cp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: .88rem;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
}
.cp-item:hover,
.cp-item.active { background: #f5f1e6; }
.cp-item .cp-dial { margin-left: auto; color: #999; font-size: .8rem; }
.cp-empty { padding: 12px; color: #999; font-size: .85rem; text-align: center; }

/* ---------------------------------------------------------------------
   4. TELÉFONO con bandera + código
--------------------------------------------------------------------- */
.phone-wrap { position: relative; display: flex; align-items: stretch; }
.phone-flag-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    background: #f7f7f7;
    border: 1px solid var(--border, #ddd);
    border-right: 0;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
    font-size: .88rem;
    color: #333;
    white-space: nowrap;
}
.phone-flag-btn .fa-chevron-down { font-size: .6rem; color: #888; }
.phone-flag-btn .ph-globe { font-size: 1.05rem; }
.phone-wrap .form-input { flex: 1; min-width: 0; border-radius: 0 5px 5px 0 !important; }
.phone-drop { right: auto; width: 100%; min-width: 280px; }

/* El prefijo ya aparece dentro del campo; el botón muestra solo la bandera */
#phoneDial { display: none; }
.phone-flag-btn .fi { width: 26px; height: 19px; }

/* ---------------------------------------------------------------------
   5. BOTÓN "Request Trip" del menú de pestañas
   Al bajar la página: fondo amarillo + texto negro
   (la clase .scrolled la añade el script de index.html)
--------------------------------------------------------------------- */
.tabs-nav .tab-btn.request-btn {
    transition: background-color .35s ease, color .35s ease;
}
.tabs-nav.scrolled .tab-btn.request-btn,
.tabs-nav.scrolled .tab-btn.request-btn.active {
    background-color: #f1c40f !important;   /* mismo amarillo del botón Request Trip */
    color: #000000 !important;
    border-bottom-color: #d4a017 !important;
}
.tabs-nav.scrolled .tab-btn.request-btn:hover {
    background-color: #d4a017 !important;
    color: #000000 !important;
}

/* ---------------------------------------------------------------------
   6. FORMULARIO — Selector de categoría de hotel
--------------------------------------------------------------------- */
.hotel-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hotel-cat {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 16px 10px 14px; text-align: center; cursor: pointer;
    background: #fff; border: 1px solid var(--border, #e5e0d3); border-radius: 8px;
    transition: border-color .25s, box-shadow .25s, transform .25s;
}
.hotel-cat::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    border-radius: 8px 8px 0 0; background: var(--tier-color);
}
.hotel-cat:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(11,37,69,.08); }
.hotel-cat input { position: absolute; opacity: 0; pointer-events: none; }
.hc-name  { font-family: 'Cinzel', serif; font-weight: 600; font-size: .95rem; color: var(--navy, #0b2545); }
.hc-stars { color: var(--gold-deep, #d4a017); font-size: .8rem; letter-spacing: 2px; }
.hc-desc  { font-size: .7rem; color: var(--muted, #6b7280); }
.hc-tag {
    position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
    padding: 2px 9px; border-radius: 10px; white-space: nowrap;
    background: var(--navy, #0b2545); color: var(--gold, #f1c40f);
    font-size: .55rem; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
}
.hotel-cat:has(input:checked) {
    border-color: var(--tier-color); background: #fdfbf3;
    box-shadow: 0 0 0 2px var(--tier-color);
}
.hotel-cat:has(input:checked)::after {
    content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: .6rem;
    background: var(--tier-color); color: #fff;
}
.hotel-cat:has(input:focus-visible) { outline: 2px solid var(--jade, #0e6655); outline-offset: 2px; }
@media (max-width: 640px) { .hotel-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; } }

/* ---------------------------------------------------------------------
   7. FOOTER — Badges / Certificaciones, Copyright y Cookie banner
      (igual que en el index principal)
--------------------------------------------------------------------- */
.super-footer .footer-bottom { margin-top: 26px; }
.super-footer .footer-bottom .footer-copy { font-size: .72rem; color: #888; margin: 0; line-height: 1.6; }
.super-footer .footer-bottom .footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.super-footer .footer-bottom .footer-links a { font-size: .72rem; color: #888; text-decoration: none; }
.super-footer .footer-bottom .footer-links a:hover { color: var(--gold, #f1c40f); }

@media (max-width: 640px) {
    .super-footer .footer-bottom { flex-direction: column; text-align: center; }
    .super-footer .footer-bottom .footer-links { justify-content: center; }
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 1600;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 22px;
    background: #0b2545;
    color: #fff;
    border: 1px solid rgba(241,196,15,.35);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    font-family: 'Montserrat', sans-serif;
    transform: translateY(140%);
    opacity: 0;
    visibility: hidden;
    transition: transform .45s ease, opacity .45s ease, visibility .45s;
}
.cookie-banner.visible { transform: none; opacity: 1; visibility: visible; }
.cookie-banner .cookie-text { margin: 0; font-size: .82rem; line-height: 1.55; color: rgba(255,255,255,.88); }
.cookie-banner .cookie-text a { color: #f1c40f; text-decoration: underline; }
.cookie-banner .cookie-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-banner button {
    flex: 1 1 auto;
    padding: 11px 18px;
    border-radius: 8px;
    font: 600 .8rem/1 'Montserrat', sans-serif;
    letter-spacing: .03em;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.cookie-banner .btn-cookie-accept { background: #f1c40f; color: #000; border: 1.5px solid #f1c40f; }
.cookie-banner .btn-cookie-accept:hover { background: #d4a017; border-color: #d4a017; }
.cookie-banner .btn-cookie-reject { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.4); }
.cookie-banner .btn-cookie-reject:hover { border-color: #fff; }
/* Mientras el aviso está visible, el botón de WhatsApp sube para no taparse */
body.cookie-open .wa-widget { bottom: calc(var(--cookie-h, 0px) + 36px); transition: bottom .3s; }
@media (max-width: 640px) {
    .cookie-banner { left: 12px; right: 12px; bottom: 12px; max-width: none; padding: 16px; }
    body.cookie-open .wa-widget { bottom: calc(var(--cookie-h, 0px) + 24px); }
}

/* ---------------------------------------------------------------------
   8. MÓVIL — la barra superior no se sale de la pantalla
      (logo + idioma + ☰ caben siempre; el ☰ ya no queda cortado)
--------------------------------------------------------------------- */
@media (max-width: 640px) {
    .nav { gap: 10px; }
    .nav .nav-logo { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .nav .lang-wrap, .nav .hamburger { flex-shrink: 0; }
    .nav .lang-btn { padding: 6px 10px; }
}
body { overflow-x: clip; }   /* evita scroll lateral sin romper la barra de pestañas fija */

/* ---------------------------------------------------------------------
   9. SELECTOR DE IDIOMA — panel ordenado y centrado
      Escritorio: 3 columnas bajo el botón.
      Móvil: panel centrado en la pantalla, 2 columnas (3 si cabe),
      bandera + idioma centrados en cada casilla.
--------------------------------------------------------------------- */
html body .nav .lang-wrap .lang-dropdown {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 540px !important;
    gap: 4px !important;
    padding: 14px !important;
    border-radius: 14px !important;
}
html body .nav .lang-wrap .lang-link {
    justify-content: flex-start;
    padding: 9px 10px !important;
    white-space: nowrap;
}

@media (max-width: 768px) {
    html body .nav .lang-wrap { position: static !important; }
    html body .nav .lang-wrap .lang-dropdown {
        position: fixed !important;
        top: 76px !important;
        left: 50% !important;
        right: auto !important;
        width: calc(100vw - 24px) !important;
        max-width: 520px !important;
        max-height: calc(100vh - 96px) !important;
        overflow-y: auto !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        padding: 14px !important;
        margin: 0 !important;
        transform: translate(-50%, 8px) !important;
        box-shadow: 0 18px 50px rgba(0, 0, 0, .45) !important;
        z-index: 2000 !important;
    }
    html body .nav .lang-wrap.open .lang-dropdown { transform: translate(-50%, 0) !important; }
    html body .nav .lang-wrap .lang-link {
        flex-direction: row;
        justify-content: center !important;
        align-items: center !important;
        text-align: left;
        gap: 8px !important;
        padding: 11px 6px !important;
        font-size: .86rem !important;
        white-space: normal !important;
        line-height: 1.2;
        border: 1px solid #f0ebe0;
        border-radius: 10px !important;
    }
    html body .nav .lang-wrap .lang-link .fi { width: 22px !important; height: 22px !important; }
}
@media (min-width: 480px) and (max-width: 768px) {
    html body .nav .lang-wrap .lang-dropdown { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
