/* =============================================================================
   Nuvei Theme Variant Toggle (sidebar pill)
   Lives inside the sidebar (.custom-well.blankbg.sidebar-nav), below #mCSB_1.
   Independent from the dark/light mode switch.
   ============================================================================= */

/* Pull the toggle to the bottom of the sidebar by laying out the well as a
   flex column with the menu and the toggle pinned at opposite ends. Scoped
   via :has() so other custom-well usages stay untouched. */
.custom-well.blankbg.sidebar-nav:has(> .nuvei-design-toggle) {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-height: 0;
}

/* Keep the scrollable documentation menu constrained within the flex column so
   its items always scroll/clip inside #list-manual instead of overflowing down
   behind the pinned "New Design" toggle / language bar. Without min-height:0 a
   flex item defaults to its content's min height and can overflow its track. */
.custom-well.blankbg.sidebar-nav:has(> .nuvei-design-toggle) > #list-manual {
    min-height: 0;
    overflow-y: auto;
}

.nuvei-design-toggle {
    align-items: center;
    background: transparent;
    border: 1px solid var(--heading-color, #1B0657);
    border-radius: 100px;
    box-sizing: border-box;
    color: var(--heading-color, #1B0657);
    display: flex;
    font-family: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    gap: 12px;
    justify-content: space-between;
    line-height: 1.2;
    max-width: 160px;
    padding: 6px 10px 6px 14px;
    position: relative;
    width: 100%;
    z-index: 1;
    margin-left: 30px;
    margin-bottom: 15px;
}

.nuvei-design-toggle:has(.nuvei-design-toggle-switch[aria-pressed="false"]) {
    margin-left: 0;
}

.nuvei-design-toggle-label {
    color: var(--heading-color, #1B0657);
    flex: 0 0 auto;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    user-select: none;
    white-space: nowrap;
}

.nuvei-design-toggle-switch {
    align-items: center;
    -webkit-appearance: none;
    appearance: none;
    background: var(--heading-color, #1B0657) !important;
    border: 1px solid var(--heading-color, #1B0657);
    border-radius: 100px;
    box-sizing: border-box;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 4px;
    height: 20px;
    min-height: 20px;
    justify-content: flex-end;
    line-height: 1;
    margin: 0;
    min-width: 44px;
    padding: 1px 3px;
    transition: background-color 0.18s ease, justify-content 0.18s ease;
}

.nuvei-design-toggle-switch[aria-pressed="false"] {
    background: #FFFFFF;
    justify-content: flex-start;
}

.nuvei-design-toggle-switch[aria-pressed="false"] .nuvei-design-toggle-state {
    color: var(--sidebar-bgr);
}

.nuvei-design-toggle-switch[aria-pressed="false"] .nuvei-design-toggle-knob {
    background: var(--sidebar-bgr);
}

.nuvei-design-toggle-switch:focus-visible {
    outline: 2px solid #0C98D4;
    outline-offset: 2px;
}

.nuvei-design-toggle-state {
    color: var(--text-marked);
    font-family: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 0 1px;
    text-transform: uppercase;
    user-select: none;
}
/* old theme */
.nuvei-theme-old .nuvei-design-toggle-state {
    padding: 1px 3px 0 0;
}

.nuvei-design-toggle-knob {
    background: var(--sidebar-bgr);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.10);
    display: block;
    flex: 0 0 14px;
    height: 14px;
    width: 14px;
}

/* Dark-mode tweaks (label readable on dark sidebar) */
body.theme-dark .nuvei-design-toggle,
body.theme-dark .nuvei-design-toggle-label {
    color: #E8E5F2;
}

body.theme-dark .nuvei-design-toggle-switch[aria-pressed="false"] {
    background: rgba(255, 255, 255, 0.18);
}

@media (prefers-reduced-motion: reduce) {
    .nuvei-design-toggle-switch {
        transition: none;
    }
}

@media (max-width: 600px) {
    .nuvei-design-toggle {
        padding: 10px 12px;
    }
}
