/* =========================
   CURRENCY CALCULATOR
   ========================= */

.currency-calculator {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0;
}

.currency-calculator *,
.currency-calculator *::before,
.currency-calculator *::after {
    box-sizing: border-box;
}

.currency-layout {
    position: relative;
    z-index: 10;
    overflow: visible;
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(360px, 1.1fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.currency-rate-card,
.currency-converter-card,
.currency-chart-card {
    border: 1px solid #dfe3e7;
    border-radius: 14px;
    background-color: #f8f9fb;
    box-shadow: 0 18px 42px -34px rgba(28, 37, 46, .55);
}

.currency-rate-card {
    min-height: 220px;
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    text-align: center;
}

.currency-rate-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 13px;
    margin-bottom: 16px;
    border-radius: 999px;
    background-color: rgba(255, 72, 91, .08);
    color: var(--color-accent, #ff485b);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.currency-rate-value {
    color: #222c38;
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.02em;
}

.currency-rate-text {
    max-width: 320px;
    margin-top: 13px;
    color: #667482;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.currency-converter-card {
    position: relative;
    z-index: 2;
    overflow: visible;
    padding: 22px;
}

.currency-row {
    margin-bottom: 12px;
}

.currency-label {
    display: block;
    margin-bottom: 8px;
    color: #273340;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
}

.currency-input-group {
    display: grid;
    grid-template-columns: minmax(120px, .85fr) minmax(210px, 1.15fr);
    overflow: visible;
    border: 1px solid #d9dee3;
    border-radius: 9px;
    background-color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.currency-input-group:focus-within {
    border-color: rgba(255, 72, 91, .5);
    box-shadow: 0 0 0 3px rgba(255, 72, 91, .12);
}

.currency-calculator .currency-input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 16px;
    border: 0;
    border-radius: 9px 0 0 9px;
    background-color: #fff;
    color: #222c38;
    font-family: inherit;
    font-size: 18px;
    font-weight: 900;
    line-height: 52px;
    outline: none;
    box-shadow: none;
}

.currency-calculator .currency-input:focus,
.currency-calculator .currency-input:active,
.currency-calculator .currency-input:hover {
    border: 0;
    outline: none;
    background-color: #fff;
    box-shadow: none;
}

.currency-calculator .currency-input::-webkit-outer-spin-button,
.currency-calculator .currency-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.currency-calculator .currency-input[type="number"] {
    -moz-appearance: textfield;
}

.currency-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
}

.currency-custom-select {
    position: relative;
    z-index: 3;
    min-width: 0;
    height: 52px;
}

.currency-custom-select.is-open {
    z-index: 100;
}

.currency-custom-trigger {
    position: relative;
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 38px 0 14px;
    border: 0;
    border-left: 1px solid #d9dee3;
    border-radius: 0 9px 9px 0;
    background-color: #fff;
    color: #273340;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-align: left;
    cursor: pointer;
    outline: none;
    box-shadow: none;
}

.currency-custom-trigger:hover {
    color: var(--color-accent, #ff485b);
}

.currency-custom-trigger:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(255, 72, 91, .18);
}

.currency-custom-trigger::before,
.currency-custom-trigger::after {
    content: "";
    position: absolute;
    top: 23px;
    width: 6px;
    height: 6px;
    background-repeat: no-repeat;
    background-size: 6px 6px;
    pointer-events: none;
}

.currency-custom-trigger::before {
    right: 20px;
    background-image: linear-gradient(45deg, transparent 50%, #667482 50%);
}

.currency-custom-trigger::after {
    right: 14px;
    background-image: linear-gradient(135deg, #667482 50%, transparent 50%);
}

.currency-custom-arrow {
    display: none;
}

.currency-custom-current {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.currency-custom-text,
.currency-option-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.currency-custom-flag,
.currency-fast-flag,
.currency-option-flag {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 18px;
    background-color: #eef1f4;
}

.currency-custom-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 110;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #dfe3e7;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 22px 48px -24px rgba(28, 37, 46, .55);
}

.currency-custom-select.is-open .currency-custom-dropdown {
    display: block;
}

.currency-custom-option {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background-color: transparent;
    color: #273340;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.currency-custom-option:hover {
    background-color: rgba(255, 72, 91, .08);
    color: var(--color-accent, #ff485b);
}

.currency-custom-option.is-active {
    background-color: var(--color-accent, #ff485b);
    color: #fff;
}

.currency-option-text {
    min-width: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    overflow: hidden;
}

.currency-option-code {
    flex: 0 0 auto;
    font-weight: 900;
}

.currency-fast-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 10px 0 16px;
}

.currency-fast-button {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid #dfe3e7;
    border-radius: 999px;
    background-color: #fff;
    color: #667482;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}

.currency-fast-button:hover {
    border-color: rgba(255, 72, 91, .42);
    color: var(--color-accent, #ff485b);
    box-shadow: 0 10px 22px -18px rgba(28, 37, 46, .45);
}

.currency-fast-button.is-active {
    border-color: var(--color-accent, #ff485b);
    background-color: var(--color-accent, #ff485b);
    color: #fff;
}

.currency-swap {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px auto 16px;
    border: 1px solid #dfe3e7;
    border-radius: 50%;
    background-color: #fff;
    color: var(--color-accent, #ff485b);
    font-family: inherit;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 22px -18px rgba(28, 37, 46, .45);
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.currency-swap:hover {
    border-color: var(--color-accent, #ff485b);
    background-color: var(--color-accent, #ff485b);
    color: #fff;
    transform: rotate(180deg);
    box-shadow: 0 16px 28px -18px rgba(255, 72, 91, .7);
}

.currency-button {
    width: 100%;
    height: 50px;
    margin-top: 4px;
    padding: 0 18px;
    border: 1px solid var(--color-accent, #ff485b);
    border-radius: 9px;
    background-color: var(--color-accent, #ff485b);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    text-align: center;
    transition: background-color .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}

.currency-button:hover {
    border-color: var(--color-accent-dark, #e73b50);
    background-color: var(--color-accent-dark, #e73b50);
    box-shadow: 0 14px 28px -18px rgba(255, 72, 91, .7);
}

.currency-button:active {
    transform: translateY(1px);
    box-shadow: none;
}

.currency-button:focus {
    outline: none;
}

.currency-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 72, 91, .14);
}

.currency-chart-card {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 22px;
}

.currency-chart-title {
    margin: 0 0 18px;
    color: #222c38;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
}

.currency-periods {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 18px;
}

.currency-period-button {
    min-height: 30px;
    padding: 6px 12px;
    border: 1px solid #dfe3e7;
    border-radius: 999px;
    background-color: #fff;
    color: #667482;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}

.currency-period-button:hover {
    border-color: rgba(255, 72, 91, .42);
    color: var(--color-accent, #ff485b);
    box-shadow: 0 10px 22px -18px rgba(28, 37, 46, .45);
}

.currency-period-button.is-active {
    border-color: var(--color-accent, #ff485b);
    background-color: var(--color-accent, #ff485b);
    color: #fff;
}

.currency-chart-card canvas {
    display: block;
    width: 100%;
    max-width: 100%;
}

.currency-calculator .currency-input:-webkit-autofill,
.currency-calculator .currency-input:-webkit-autofill:focus,
.currency-calculator .currency-input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: #222c38;
    transition: background-color 9999s ease-in-out;
}

@media (max-width: 900px) {
    .currency-layout {
        grid-template-columns: 1fr;
    }

    .currency-rate-card {
        min-height: 180px;
    }
}

@media (max-width: 575px) {
    .currency-layout {
        gap: 14px;
        margin-bottom: 14px;
    }

    .currency-rate-card,
    .currency-converter-card,
    .currency-chart-card {
        border-radius: 11px;
        padding: 16px;
    }

    .currency-rate-value {
        font-size: 34px;
    }

    .currency-rate-text {
        font-size: 13px;
    }

    .currency-input-group {
        grid-template-columns: 1fr;
    }

    .currency-calculator .currency-input {
        height: 48px;
        line-height: 48px;
        border-radius: 9px 9px 0 0;
        border-bottom: 1px solid #d9dee3;
        font-size: 17px;
    }

    .currency-custom-select {
        height: 48px;
    }

    .currency-custom-trigger {
        height: 48px;
        border-left: 0;
        border-radius: 0 0 9px 9px;
    }

    .currency-custom-trigger::before,
    .currency-custom-trigger::after {
        top: 21px;
    }

    .currency-custom-dropdown {
        max-height: 280px;
    }

    .currency-chart-title {
        font-size: 18px;
        text-align: left;
    }

    .currency-periods {
        justify-content: flex-start;
        margin-bottom: 14px;
    }

    .currency-period-button {
        min-height: 28px;
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* =========================================================
   FIX: currency calculator under mobile menu
   ========================================================= */

@media only screen and (max-width: 860px) {
    .mainmenu_open .currency-calculator,
    .mainmenu_open .currency-layout,
    .mainmenu_open .currency-rate-card,
    .mainmenu_open .currency-converter-card,
    .mainmenu_open .currency-chart-card,
    .mainmenu_open .currency-custom-select,
    .mainmenu_open .currency-custom-select.is-open,
    .mainmenu_open .currency-custom-dropdown {
        position: relative !important;
        z-index: 0 !important;
    }

    .mainmenu_open .currency-custom-dropdown {
        display: none !important;
    }
}