/* Fixed top bar: USD / ETB / language — storefront + admin (top-right, same band as before) */

:root {
    /* Bottom edge of locale strip ≈ safe-area + vertical padding + control row */
    --store-top-locale: calc(2.55rem + env(safe-area-inset-top, 0px));
    --site-header-fixed-height: 4.05rem;
}

@media (max-width: 768px) {
    :root {
        --store-top-locale: calc(2.75rem + env(safe-area-inset-top, 0px));
        --site-header-fixed-height: 5.35rem;
    }
}

.floating-locale-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: max(0.4rem, env(safe-area-inset-top, 0px)) max(1rem, 5%) 0.42rem;
    box-sizing: border-box;
    background: rgba(255, 253, 248, 0.94);
    border-bottom: 1px solid rgba(18, 18, 18, 0.08);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .floating-locale-bar {
    background: rgba(22, 22, 26, 0.94);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* Storefront / product: toolbar lives inside the main header row */
.floating-locale-bar.floating-locale-bar--inline {
    position: static;
    left: auto;
    right: auto;
    z-index: auto;
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: nowrap;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    flex-shrink: 0;
}

[data-theme="dark"] .floating-locale-bar.floating-locale-bar--inline {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Admin + login: only the locale strip */
body.admin-app.has-floating-locale-bar {
    padding-top: var(--store-top-locale);
}

body.admin-app.has-floating-locale-bar .admin-sidebar {
    top: calc(var(--store-top-locale) + 0.75rem);
}

/* Self-contained controls (admin pages do not load style.css) */
.floating-locale-bar .currency-switch {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem;
    border-radius: 9999px;
    border: 1px solid rgba(18, 18, 18, 0.1);
    background: rgba(255, 255, 255, 0.65);
}

[data-theme="dark"] .floating-locale-bar .currency-switch {
    background: rgba(35, 35, 40, 0.75);
    border-color: rgba(255, 255, 255, 0.1);
}

.floating-locale-bar .currency-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #1a1a1a;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    padding: 0.34rem 0.56rem;
    border-radius: 9999px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
}

[data-theme="dark"] .floating-locale-bar .currency-btn {
    color: #f1f5f9;
}

.floating-locale-bar .currency-btn.active {
    background: var(--accent-color, #4b0082);
    color: #fff;
}

.floating-locale-bar .currency-btn:hover {
    transform: translateY(-1px);
}

html[lang="am"] .floating-locale-bar .currency-btn {
    font-family: 'Noto Serif Ethiopic', 'Plus Jakarta Sans', system-ui, sans-serif;
}

.floating-locale-bar .lang-toggle-btn {
    background-color: var(--accent-color, #4b0082);
    color: #fff;
    border: none;
    padding: 0.42rem 0.72rem;
    border-radius: 9999px;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(75, 0, 130, 0.22);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.floating-locale-bar .lang-toggle-btn:hover {
    filter: brightness(1.08);
    transform: scale(1.04);
}

html[lang="am"] .floating-locale-bar .lang-toggle-btn {
    font-family: 'Noto Serif Ethiopic', 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 0.82rem;
}

/* Inline header toolbar: match site accent (loads after fixed-bar rules; storefront defines --accent-color in style.css) */
.header .floating-locale-bar.floating-locale-bar--inline .currency-btn.active {
    background: var(--accent-color, #4b0082);
    color: #fff;
}

.header .floating-locale-bar.floating-locale-bar--inline .lang-toggle-btn {
    background-color: var(--accent-color, #4b0082);
    box-shadow: 0 4px 10px rgba(75, 0, 130, 0.22);
}

.header .floating-locale-bar.floating-locale-bar--inline .lang-toggle-btn:hover {
    filter: brightness(1.06);
    transform: scale(1.03);
}
