/* Shared fee breakdown (eVisa info + application review) */

/* Modern Fees Section — breakdown then total */

.fees-section {
    margin-top: 1rem;
}

.fees-card-modern {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e8ecf0;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    padding: 1.25rem 1.15rem 1.3rem;
}

.fees-section--v2 .fees-hero {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.15rem 1.05rem;
    margin: 0;
    min-height: 4.25rem;
    background: #eef4ff;
    border: 1px solid #dbe6ff;
    border-radius: 14px;
    text-align: start;
    box-sizing: border-box;
}

.fees-section--v2 .fees-hero-label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: #111827;
    line-height: 1.3;
    flex: 0 1 auto;
    min-width: 0;
}

/* GM Arabic alef side-bearing on المبلغ المستحق */

html[dir="rtl"] .fees-section--v2 .fees-hero-label {
    margin-inline-end: -0.28em;
}

.fees-section--v2 .fees-hero-amounts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex: 0 0 auto;
    margin-inline-start: auto;
    text-align: end;
}

.fees-section--v2 .fees-hero-usd {
    margin: 0;
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.28rem;
    color: var(--primary-color, #296ff9);
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
}

.fees-section--v2 .fees-hero-usd-value {
    font-size: clamp(1.4rem, 4vw, 1.7rem);
    letter-spacing: -0.02em;
}

.fees-section--v2 .fees-hero-usd-suffix {
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.8;
}

.fees-section--v2 .fees-hero-iqd {
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 1.65rem);
    font-weight: 800;
    color: var(--primary-color, #296ff9);
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
    line-height: 1.15;
    text-align: end;
}

.fees-section--v2 .fees-hero-iqd-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: inherit;
    font: inherit;
    max-width: 100%;
}

.fees-section--v2 .fees-hero-iqd-arrow {
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.fees-section--v2 .fees-hero-iqd-toggle.is-open .fees-hero-iqd-arrow {
    transform: rotate(180deg);
}

.fees-section--v2.fees-section--fx .fees-hero-usd,
.fees-section--v2.fees-section--iqd .fees-hero-usd {
    margin-top: 0.15rem;
    font-size: 0.92rem;
}

.fees-section--v2.fees-section--fx .fees-hero-usd-value,
.fees-section--v2.fees-section--iqd .fees-hero-usd-value {
    font-size: 1.05rem;
}

.fees-section--v2.fees-section--fx .fees-hero-usd[hidden],
.fees-section--v2.fees-section--iqd .fees-hero-usd[hidden] {
    display: none !important;
}

.fees-section--v2.fees-section--fx .fees-hero-amounts,
.fees-section--v2.fees-section--iqd .fees-hero-amounts {
    align-items: flex-end;
}

.fees-section--v2 .fees-hero-rate {
    margin: 0.55rem 0 0;
    font-size: 0.68rem;
    color: #9ca3af;
    line-height: 1.3;
    text-align: center;
}

.fees-section--v2 .fees-hero-rate[hidden] {
    display: none !important;
}

.fees-section--v2 .fees-rate-formula {
    display: inline;
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

.fees-section--v2 .fees-iqd-unit {
    unicode-bidi: isolate;
}

.fees-section--v2 .fees-iqd-disclaimer {
    margin: 0.65rem 0 0;
    max-width: none;
    font-size: 0.68rem;
    line-height: 1.45;
    color: #9ca3af;
    text-align: center;
}

.fees-section--v2 .fees-breakdown-title {
    margin: 0 0 0.65rem;
    font-size: 0.98rem;
    font-weight: 750;
    color: #111827;
    letter-spacing: 0;
}

.fees-section--v2 .fees-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Two fee items side-by-side: label+amount in each cell */

.fees-section--v2 .fees-list--pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.fees-section--v2 .fees-list--pair .fee-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.45rem;
    padding: 0.75rem 0.8rem;
    background: #f5f7fb;
    border: 1px solid #e8ecf2;
    border-radius: 12px;
    min-width: 0;
}

.fees-section--v2 .fees-list--pair .fee-info {
    width: 100%;
    min-width: 0;
}

.fees-section--v2 .fees-list--pair .fee-name {
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 550;
    color: #374151;
}

.fees-section--v2 .fees-list--pair .fee-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #111827;
    justify-self: start;
    text-align: start;
    min-width: 0;
}

html[dir="rtl"] .fees-section--v2 .fees-list--pair .fee-row {
    align-items: flex-start;
}

html[dir="rtl"] .fees-section--v2 .fees-list--pair .fee-value {
    text-align: start;
}

.fees-header {
    margin-bottom: 1.5rem;
    text-align: left;
}

.fees-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.fees-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}

.fees-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fees-section .fee-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.fees-section .fee-info {
    display: inline-flex;
    flex-direction: row; /* override global .fee-info { column } */
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}

.fees-section .fee-name {
    font-size: 0.88rem;
    color: var(--text-dark);
    font-weight: 400;
    flex: 0 1 auto; /* keep info icon beside the label */
    min-width: 0;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.fees-section .tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    flex-shrink: 0;
    margin-top: 0;
}

.fees-section .tooltip-container i {
    color: #9ca3af;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.fees-section .tooltip-container:hover i,
.fees-section .tooltip-container:focus-within i {
    color: var(--primary-color);
}

.fees-section .tooltip-text {
    visibility: hidden;
    width: max-content;
    max-width: min(220px, calc(100vw - 3rem));
    background-color: var(--text-dark);
    color: #fff;
    text-align: start;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 8px);
    /* Center on the icon so LTR/RTL pair cells stay inside the viewport */
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.35;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    white-space: normal;
    box-sizing: border-box;
}

/*
 * Hidden absolute tooltips still expand scrollWidth. On RTL mobile that shifts
 * the whole eVisa info page sideways (~90px) and clips the header/cards.
 */
.fees-section .tooltip-container:not(:hover):not(:focus-within):not(.is-open) .tooltip-text {
    display: none;
}

.fees-section .tooltip-container:hover .tooltip-text,
.fees-section .tooltip-container:focus-within .tooltip-text,
.fees-section .tooltip-container.is-open .tooltip-text {
    display: block;
    visibility: visible;
    opacity: 1;
}

.fees-section .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: 0;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-dark) transparent transparent transparent;
}

.fees-section .fee-value {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.88rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    justify-self: end;
    text-align: end;
    direction: ltr;
    unicode-bidi: isolate;
    min-width: 3.25rem;
}

.fees-section--v2 .fee-row {
    padding: 0.05rem 0;
}

.fees-section--v2 .tooltip-container {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    line-height: 1;
    color: inherit;
}

.fees-section--v2 .tooltip-container.is-open .tooltip-text {
    display: block;
    visibility: visible;
    opacity: 1;
}

.fees-divider {
    height: 1px;
    background: #e8ecf0;
    margin: 1rem 0 1rem;
    position: relative;
}

html[dir="rtl"] .fees-section--v2 .fees-hero {
    text-align: start;
}

html[dir="rtl"] .fees-section--v2 .fees-breakdown-title {
    text-align: start;
}

html[dir="rtl"] .fees-section--v2 .fees-iqd-disclaimer {
    text-align: center;
}

.fees-total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.75rem;
    padding-top: 0.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* RTL Support for Fees Section */

[dir="rtl"] .fees-card-modern {
    text-align: right;
}

[dir="rtl"] .fees-section .fee-info {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
}

html[dir="rtl"] .fees-section .fee-row .fee-info {
    flex: 1 1 auto;
    min-width: 0;
}

[dir="rtl"] .fees-section .tooltip-text {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    text-align: start;
}

[dir="rtl"] .fees-section .tooltip-text::after {
    left: 50%;
    right: auto;
    margin-right: 0;
    margin-left: 0;
    transform: translateX(-50%);
}

@media (max-width: 768px) {
/* Fees card — compact on mobile */

.fees-section {
        margin-top: 0.9rem;
    }

.fees-card-modern {
        padding: 1.15rem 1rem 1.2rem;
        border-radius: 16px;
    }

.fees-section--v2 .fees-hero {
        padding: 1.05rem 0.95rem;
        min-height: 4rem;
        gap: 0.55rem;
        border-radius: 12px;
    }

.fees-section--v2 .fees-hero-label {
        font-size: 0.88rem;
    }

.fees-section--v2 .fees-hero-usd-value {
        font-size: clamp(1.35rem, 6vw, 1.6rem);
    }

.fees-section--v2 .fees-hero-iqd {
        font-size: 0.82rem;
    }

.fees-section--v2 .fees-list--pair {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

.fees-section--v2 .fees-list--pair .fee-row {
        padding: 0.65rem 0.7rem;
        gap: 0.35rem;
    }

.fees-section--v2 .fees-list--pair .fee-name {
        font-size: 0.75rem;
    }

.fees-section--v2 .fees-list--pair .fee-value {
        font-size: 0.98rem;
    }

.fees-section--v2 .fees-breakdown-title {
        font-size: 0.92rem;
        margin-bottom: 0.55rem;
    }

.fees-divider {
        margin: 0.9rem 0 0.9rem;
    }

.fees-section--v2 .fees-iqd-disclaimer {
        margin-top: 0.55rem;
        font-size: 0.64rem;
    }
}

