/* ─── Language Switcher — Apoing ─────────────────────────────────────────── */

.ls-wrap { position: relative; display: inline-block; }

/* ── Pill trigger — light salmon, NOT primary orange ───────────────────── */
.ls-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FFF3EE;
    color: #C95710;
    border: 1.5px solid #F9C5A0;
    border-radius: 20px;
    padding: 5px 10px 5px 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    transition: background .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
}
.ls-trigger:hover       { background: #FFE8D9; border-color: #F47D44; box-shadow: 0 2px 8px rgba(244,125,68,.18); }
.ls-trigger:focus-visible { outline: 2px solid #F47D44; outline-offset: 3px; }

/* ── Clock SVG — the whole <svg> rotates (HTML element, not SVG-internal) */
.ls-clock { flex-shrink: 0; }

@keyframes ls-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(540deg); } /* 1.5 vueltas */
}
.ls-clock.ls-anim {
    animation: ls-spin 0.85s ease-out;
    transform-origin: center; /* center of the 18×18 SVG box = clock pivot  */
}
/* Las manecillas se colorean en naranja mientras gira */
.ls-clock.ls-anim line {
    stroke: #F47D44;
}
@media (prefers-reduced-motion: reduce) {
    .ls-clock.ls-anim { animation: none; }
}

/* ── Chevron rotates when open ─────────────────────────────────────────── */
.ls-chevron { flex-shrink: 0; transition: transform .2s; }
.ls-trigger[aria-expanded="true"] .ls-chevron { transform: rotate(180deg); }

/* ── Panel — position set by JS via getBoundingClientRect() ────────────── */
.ls-panel {
    display: none;
    position: fixed;
    top: 0; left: 0; /* overridden in positionPanel() */
    background: #fff;
    border: 1px solid #EDE8E4;
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(0,0,0,.13);
    min-width: 260px;
    z-index: 9999;
    overflow: hidden;
    animation: ls-fadein .15s ease;
}
.ls-panel.ls-open { display: block; }

@keyframes ls-fadein {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Panel header ──────────────────────────────────────────────────────── */
.ls-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFF3EE;
    padding: 14px 16px;
    border-bottom: 1px solid #F9DDD0;
}
.ls-panel-head-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #F9C5A0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #F47D44;
}
.ls-panel-head-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.25;
}
.ls-panel-head-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* ── Chips list ────────────────────────────────────────────────────────── */
.ls-chips { display: flex; flex-direction: column; gap: 0; padding: 8px; }

.ls-chip {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none !important;
    color: #1e293b !important;
    transition: background .12s;
}
.ls-chip:hover     { background: #FFF5EF; }
.ls-chip--active   { background: #FFF5EF; }

/* ── Code badge  (ES / MX / EN) ────────────────────────────────────────── */
.ls-chip-code {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F1F5F9;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .03em;
    border: 1.5px solid transparent;
    transition: background .12s, color .12s, border-color .12s;
}
.ls-chip--active   .ls-chip-code,
.ls-chip--detected .ls-chip-code {
    background: #FFF3EE;
    color: #F47D44;
    border-color: #F9C5A0;
}

/* ── Chip text ─────────────────────────────────────────────────────────── */
.ls-chip-info { flex: 1; min-width: 0; }
.ls-chip-name { font-size: 13px; font-weight: 600; display: block; }
.ls-chip-meta { font-size: 11px; color: #94a3b8; }

/* ── Active checkmark ───────────────────────────────────────────────────── */
.ls-chip-check {
    color: #F47D44;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0;
    margin-left: auto;
}
.ls-chip--active .ls-chip-check { opacity: 1; }

/* ── "TU ZONA" / "YOUR ZONE" badge ────────────────────────────────────── */
.ls-chip-badge {
    font-size: 9px;
    font-weight: 700;
    background: #F47D44;
    color: #fff;
    border-radius: 20px;
    padding: 3px 7px;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
}

/* ── Backdrop ───────────────────────────────────────────────────────────── */
.ls-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 9998;
}
.ls-backdrop.ls-open { display: block; }

/* ── Mobile: bottom sheet ──────────────────────────────────────────────── */
@media (max-width: 767px) {
    .ls-panel {
        position: fixed !important;
        bottom: 0;
        left: 0 !important;
        right: 0;
        top: auto !important;
        border-radius: 20px 20px 0 0;
        min-width: unset;
        box-shadow: 0 -4px 40px rgba(0,0,0,.2);
        animation: ls-slideup .22s ease;
    }
    .ls-panel::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: #e2e8f0;
        border-radius: 2px;
        margin: 10px auto 0;
    }
    @keyframes ls-slideup {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    @media (prefers-reduced-motion: reduce) {
        .ls-panel { animation: none; }
    }
}
