/* ============================================================
   npc-translator.css — CORE (structure + neutral defaults only)
   ------------------------------------------------------------
   Shops restyle by overriding the --npc-tr-* token VALUES in their own
   stylesheet (see Design §8). Never edit these rules on a shop branch.
   Colour literals appear only as var() fallbacks.
   ============================================================ */

.npc-tr,
.npc-tr-banner,
.npc-tr-progress {
    --npc-tr-fg: var(--npc-tr-shop-fg, currentColor);
    --npc-tr-bg: transparent;
    --npc-tr-border: color-mix(in srgb, currentColor 35%, transparent);
    --npc-tr-active-bg: var(--m-accent, #222);
    --npc-tr-active-fg: var(--m-accent-contrast, #fff);
    --npc-tr-radius: 999px;
    --npc-tr-font: var(--font-default, inherit);
    --npc-tr-size: 12px;
    --npc-tr-banner-bg: var(--npc-tr-shop-banner-bg, #1f1f1f); /* always dark-neutral: light accents fail WCAG with white text */
    --npc-tr-banner-fg: var(--npc-tr-shop-banner-fg, #fff);
    --npc-tr-banner-accent: var(--m-accent, #888);            /* 3px stripe only */
    --npc-tr-banner-radius: 10px;
    --npc-tr-banner-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    --npc-tr-z: 1032;                                          /* above sticky header (1029) and bottom nav (1031), below modals (1040) */
    --npc-tr-offset-bottom: 0px;
    --npc-tr-touch: 32px;
    --npc-tr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
}

/* the mobile drawer — and, on phones, the header — sit on the app-bar surface */
.npc-tr--zone-menu { --npc-tr-fg: var(--m-header-fg, currentColor); }

@media (max-width: 767.98px) {
    .npc-tr--zone-header { --npc-tr-fg: var(--m-header-fg, currentColor); }
}

@media (max-width: 767.98px) {
    .npc-tr,
    .npc-tr-banner,
    .npc-tr-progress {
        --npc-tr-offset-bottom: calc(var(--m-bottomnav-h, 0px) + env(safe-area-inset-bottom, 0px));
        --npc-tr-touch: var(--m-touch-min, 44px);
    }
}

.npc-tr__sr {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* ---------- switcher (shared) ---------- */

.npc-tr {
    display: inline-flex !important;   /* theme list/float rules must not reach it */
    float: none !important;
    align-items: center;
    gap: 0;
    vertical-align: middle;
    font-family: var(--npc-tr-font);
    font-size: var(--npc-tr-size);
    line-height: 1;
    color: var(--npc-tr-fg);
}

.npc-tr button,
.npc-tr select {
    font: inherit;
    color: inherit;
    margin: 0;
    cursor: pointer;
}

.npc-tr button:focus-visible,
.npc-tr select:focus-visible,
.npc-tr-banner__btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Segmented: EN | ES */
.npc-tr--segmented {
    padding: 2px;
    border: 1px solid var(--npc-tr-border);
    border-radius: var(--npc-tr-radius);
    background: var(--npc-tr-bg);
}

.npc-tr__opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: var(--npc-tr-touch);
    min-height: calc(var(--npc-tr-touch) - 6px);
    padding: 0 10px;
    border: 0;
    border-radius: var(--npc-tr-radius);
    background: transparent;
    font-weight: 600;
    letter-spacing: .04em;
}

/* Tap target: on phones the segment grows its hit area to --npc-tr-touch without growing the pill. */
.npc-tr__opt,
.npc-tr-banner__btn { position: relative; }

@media (max-width: 767.98px) {
    .npc-tr__opt::after,
    .npc-tr-banner__btn::after {
        content: "";
        position: absolute;
        inset-inline: 0;
        top: 50%;
        height: var(--npc-tr-touch);
        transform: translateY(-50%);
    }
}

.npc-tr__opt[aria-pressed="true"] {
    background: var(--npc-tr-active-bg);
    color: var(--npc-tr-active-fg);
}

/* Text link */
.npc-tr__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--npc-tr-touch);
    padding: 0 4px;
    border: 0;
    background: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Icon (globe + current target code) — icon drawn on our own ::after, never ::before */
.npc-tr__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: var(--npc-tr-touch);
    min-height: var(--npc-tr-touch);
    padding: 0 6px;
    border: 0;
    background: none !important;
    background-image: none !important;
}

.npc-tr__icon::after {
    content: "";
    order: -1;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    background-image: none !important;
    transform: none !important;
    -webkit-mask: var(--npc-tr-icon) center / contain no-repeat;
    mask: var(--npc-tr-icon) center / contain no-repeat;
}

.npc-tr__code {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .04em;
}

/* Dropdown */
.npc-tr__select {
    min-height: var(--npc-tr-touch);
    padding: 0 8px;
    border: 1px solid var(--npc-tr-border);
    border-radius: 6px;
    background: var(--npc-tr-bg);
}

/* Flags (optional; inline SVG, no image requests) */
.npc-tr__flag {
    display: inline-block;
    width: 16px;
    height: 11px;
    border-radius: 2px;
    background-size: cover;
    box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent);
}

.npc-tr__flag--en {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'%3E%3Cpath fill='%23fff' d='M0 0h16v11H0z'/%3E%3Cpath fill='%23b22234' d='M0 0h16v1H0zm0 2h16v1H0zm0 2h16v1H0zm0 2h16v1H0zm0 2h16v1H0zm0 2h16v1H0z'/%3E%3Cpath fill='%233c3b6e' d='M0 0h7v6H0z'/%3E%3C/svg%3E");
}

.npc-tr__flag--es {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'%3E%3Cpath fill='%23aa151b' d='M0 0h16v11H0z'/%3E%3Cpath fill='%23f1bf00' d='M0 3h16v5H0z'/%3E%3C/svg%3E");
}

/* ---------- placements ---------- */

.header-selectors-wrapper .npc-tr--zone-header { margin-inline-start: 8px; }

/* The mobile-menu entry lives in the top-menu <ul>; the header switcher covers desktop. */
.npc-tr-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    list-style: none;
}

@media (min-width: 768px) {
    .npc-tr-menu-item { display: none !important; }
}

.npc-tr-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-block: 12px;
}

.npc-tr-footer__note {
    font-size: 12px;
    opacity: .75;
}

/* ---------- progress bar ---------- */

.npc-tr-progress {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: var(--npc-tr-z);
    height: 2px;
    pointer-events: none;
    background: var(--npc-tr-banner-accent);
    transform-origin: left;
    transform: scaleX(0);
    opacity: 0;
    transition: opacity .2s ease;
}

.npc-tr-progress.is-active {
    opacity: 1;
    animation: npc-tr-progress 1.2s ease-in-out infinite;
}

@keyframes npc-tr-progress {
    0% { transform: scaleX(0); }
    60% { transform: scaleX(.8); }
    100% { transform: scaleX(1); opacity: .4; }
}

/* ---------- banner / indicator ---------- */

.npc-tr-banner {
    z-index: var(--npc-tr-z);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    padding: 10px 14px;
    border-top: 3px solid var(--npc-tr-banner-accent);
    background: var(--npc-tr-banner-bg);
    color: var(--npc-tr-banner-fg);
    font-family: var(--npc-tr-font);
    font-size: 14px;
    line-height: 1.35;
    box-sizing: border-box;
}

.npc-tr-banner__text { min-width: 0; }

.npc-tr-banner__actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.npc-tr-banner__btn {
    min-height: var(--npc-tr-touch);
    padding: 0 14px;
    border: 1px solid color-mix(in srgb, var(--npc-tr-banner-fg) 45%, transparent);
    border-radius: 999px;
    background: transparent;
    color: var(--npc-tr-banner-fg);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.npc-tr-banner__btn--primary {
    border-color: var(--npc-tr-banner-fg);
    background: var(--npc-tr-banner-fg);
    color: var(--npc-tr-banner-bg);
}

.npc-tr-banner--top-bar {
    position: sticky;
    top: 0;
    width: 100%;
    border-top: 0;
    border-bottom: 3px solid var(--npc-tr-banner-accent);
}

.npc-tr-banner--bottom-bar {
    position: fixed;
    inset-inline: 0;
    bottom: var(--npc-tr-offset-bottom);
}

.npc-tr-banner--bottom-left,
.npc-tr-banner--bottom-right {
    position: fixed;
    bottom: calc(var(--npc-tr-offset-bottom) + 12px);
    max-width: min(380px, calc(100vw - 24px));
    justify-content: flex-start;
    border-radius: var(--npc-tr-banner-radius);
    box-shadow: var(--npc-tr-banner-shadow);
}

.npc-tr-banner--bottom-left { inset-inline-start: 12px; }
.npc-tr-banner--bottom-right { inset-inline-end: 12px; }

/* the indicator is compact: one line on phones */
.npc-tr-banner--indicator { flex-wrap: nowrap; padding-block: 6px; font-size: 13px; }
.npc-tr-banner--indicator .npc-tr-banner__btn { min-height: 32px; }

/* docked while the footer switcher is on screen (it shows the same state) */
.npc-tr-banner--indicator { transition: opacity .2s ease, visibility .2s ease; }
.npc-tr-banner--indicator.is-docked { opacity: 0; visibility: hidden; }

/* the theme's back-to-top button and the accessibility button step up above a bottom banner
   (--npc-tr-float-h = banner height + 12px gap, set by npc-translator.js) */
html.npc-tr-float--bottom-right #backTop,
html.npc-tr-float--bottom-right .at-trigger--right,
html.npc-tr-float--bottom-left .at-trigger--left,
html.npc-tr-float--bottom-bar #backTop,
html.npc-tr-float--bottom-bar .at-trigger {
    margin-bottom: var(--npc-tr-float-h, 0px) !important;
    transition: margin-bottom .2s ease;
}

/* ---------- Google Website Translator chrome (free provider) ---------- */

.goog-te-banner-frame,
iframe.skiptranslate,
.skiptranslate > iframe,
#goog-gt-tt,
.goog-te-balloon-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf { display: none !important; }

body { top: 0 !important; }

font[style*="background-color"] { background-color: transparent !important; box-shadow: none !important; }

@media (prefers-reduced-motion: reduce) {
    .npc-tr-progress,
    .npc-tr-progress.is-active { animation: none; transition: none; }
}
