/* Language picker (pill + popup) — 2026-11-24, every website template. Markup: template/_language_pill.php, _language_picker.php.
   Colours come from the Website Theme variables (--primary, --heading, --text-light, --border, --surface, --bg-light). */

/* ---------- pill (adapts to light or dark bars through currentColor) ---------- */
.lp-pill {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 9px;
    border: 1px solid color-mix(in srgb, currentColor 28%, transparent); border-radius: 999px;
    background: color-mix(in srgb, currentColor 8%, transparent); color: inherit;
    font: 600 12.5px/1 inherit; letter-spacing: .02em; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, transform .15s;
}
.lp-pill:hover, .lp-pill:focus-visible { background: color-mix(in srgb, currentColor 16%, transparent); border-color: color-mix(in srgb, currentColor 45%, transparent); }
.lp-pill:focus-visible { outline: 2px solid color-mix(in srgb, currentColor 55%, transparent); outline-offset: 2px; }
.lp-pill .bi-globe2 { font-size: 14px; }
.lp-pill-code { min-width: 18px; text-align: center; }
.lp-pill-chev { font-size: 10px; opacity: .7; transition: transform .2s; }
.lp-pill[aria-expanded="true"] .lp-pill-chev { transform: rotate(180deg); }
/* in the main navigation bar (template 7) */
.lp-pill--nav { align-self: center; height: 38px; padding: 0 12px; margin-right: 10px; font-size: 13px; color: var(--heading, #0f172a); border-color: var(--border, #e2e8f0); background: var(--surface, #fff); }
.lp-pill--nav:hover { color: var(--primary, #1479c4); border-color: var(--primary, #1479c4); background: var(--surface, #fff); }
.lp-mobile-row { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.lp-pill--mobile { height: 36px; color: var(--heading, #0f172a); border-color: var(--border, #e2e8f0); background: var(--bg-light, #f6f8fb); }
@media (max-width: 991.98px) { .lp-pill--nav { display: none; } }
@media (min-width: 992px) { .lp-mobile-row { display: none; } }

/* ---------- popup ---------- */
.lp-modal { --lp-p: var(--primary, #1479c4); --lp-text: var(--heading, #0f172a); --lp-muted: var(--text-light, #64748b); --lp-line: var(--border, #e2e8f0); --lp-surface: var(--surface, #fff); --lp-soft: var(--bg-light, #f6f8fb); }
.lp-modal .modal-dialog { max-width: 720px; }
.lp-modal .modal-content { border: 0; border-radius: 20px; overflow: hidden; background: var(--lp-surface); box-shadow: 0 30px 80px rgba(15, 23, 42, .28); }
.lp-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 14px; }
.lp-head-ico { flex: 0 0 44px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; font-size: 20px;
    background: linear-gradient(135deg, var(--lp-p), color-mix(in srgb, var(--lp-p) 60%, #7c3aed)); box-shadow: 0 8px 20px color-mix(in srgb, var(--lp-p) 35%, transparent); }
.lp-head-text { flex: 1; min-width: 0; }
.lp-head .modal-title { margin: 2px 0 3px; font-size: 19px; font-weight: 700; color: var(--lp-text); }
.lp-head p { margin: 0; font-size: 13.5px; color: var(--lp-muted); }
.lp-head .btn-close { flex-shrink: 0; margin: 2px 0 0; padding: 10px; border-radius: 10px; background-color: var(--lp-soft); opacity: .8; }
.lp-head .btn-close:hover { opacity: 1; }

.lp-search { position: relative; margin: 0 22px 6px; }
.lp-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--lp-muted); font-size: 14px; pointer-events: none; }
.lp-search input { width: 100%; height: 44px; padding: 0 14px 0 40px; border: 1px solid var(--lp-line); border-radius: 12px; background: var(--lp-soft); font-size: 14px; color: var(--lp-text); }
.lp-search input:focus { outline: 0; background: var(--lp-surface); border-color: var(--lp-p); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lp-p) 15%, transparent); }

.lp-body { padding: 10px 22px 18px; }
.lp-sec { margin: 12px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--lp-muted); }
.lp-sec[hidden], .lp-grid[hidden] { display: none; }
.lp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lp-opt { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--lp-line); border-radius: 12px; background: var(--lp-surface); color: var(--lp-text); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.lp-opt[hidden] { display: none; }
.lp-opt:hover { border-color: color-mix(in srgb, var(--lp-p) 50%, var(--lp-line)); background: color-mix(in srgb, var(--lp-p) 4%, var(--lp-surface)); }
.lp-opt:focus-visible { outline: 0; border-color: var(--lp-p); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lp-p) 18%, transparent); }
.lp-opt-code { flex: 0 0 34px; display: inline-flex; align-items: center; justify-content: center; height: 34px; border-radius: 10px; background: var(--lp-soft); color: var(--lp-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .03em; }
.lp-opt-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.lp-opt-text b { font-size: 14px; font-weight: 600; color: var(--lp-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-opt-text b[dir="rtl"] { text-align: left; }
.lp-opt-text small { font-size: 12px; color: var(--lp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-opt-tick { position: absolute; top: 8px; right: 8px; font-size: 14px; color: var(--lp-p); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.lp-opt.active { border-color: var(--lp-p); background: color-mix(in srgb, var(--lp-p) 7%, var(--lp-surface)); box-shadow: 0 0 0 1px var(--lp-p) inset; }
.lp-opt.active .lp-opt-code { background: var(--lp-p); color: #fff; }
.lp-opt.active .lp-opt-tick { opacity: 1; transform: none; }

.lp-empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 26px 10px; color: var(--lp-muted); font-size: 14px; }
.lp-empty[hidden] { display: none; }
.lp-foot { display: flex; align-items: center; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--lp-line); background: var(--lp-soft); font-size: 12px; color: var(--lp-muted); }

/* hide Google's own bar / tooltip so only our picker shows */
body > .skiptranslate, iframe.goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

@media (max-width: 767.98px) {
    .lp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lp-modal .modal-dialog { margin: 0; max-width: none; min-height: 100%; display: flex; align-items: flex-end; }
    .lp-modal .modal-content { border-radius: 20px 20px 0 0; max-height: 88vh; }
    .lp-modal.fade .modal-dialog { transform: translateY(40px); }
    .lp-modal.show .modal-dialog { transform: none; }
    .lp-head { padding: 18px 16px 12px; }
    .lp-search { margin: 0 16px 6px; }
    .lp-body { padding: 8px 16px 16px; }
    .lp-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
}
@media (max-width: 359.98px) { .lp-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .lp-pill, .lp-opt, .lp-opt-tick, .lp-pill-chev { transition: none; } }
