/* ============================================================
   Veloura Internationalization / RTL
============================================================ */

html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    font-family: "Cairo", sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    font-family: "Cairo", sans-serif;
    letter-spacing: 0;
}

html[dir="rtl"] .page-eyebrow,
html[dir="rtl"] .product-category,
html[dir="rtl"] .skin-analysis-eyebrow {
    letter-spacing: 0.04em;
}

html[dir="rtl"] .page-eyebrow::before,
html[dir="rtl"] .skin-analysis-eyebrow::before {
    order: 2;
}

html[dir="rtl"] .global-search-form {
    padding-inline: 14px 7px;
}

html[dir="rtl"] .global-search-submit:hover {
    transform: translateX(-1px);
}

html[dir="rtl"] .dropdown-menu-end {
    --bs-position: start;
}

html[dir="rtl"] .bi-arrow-right::before {
    transform: scaleX(-1);
}

html[dir="rtl"] .bi-arrow-left::before {
    transform: scaleX(-1);
}

html[dir="rtl"] .product-card,
html[dir="rtl"] .cart-item,
html[dir="rtl"] .order-card,
html[dir="rtl"] .skin-question-card,
html[dir="rtl"] .skin-recommendation-card {
    text-align: right;
}

html[dir="rtl"] .skin-question-choice:hover {
    transform: translateX(-3px);
}

html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] .global-search-input {
    text-align: right;
}

html[dir="rtl"] .language-preference-options {
    direction: rtl;
}

html[dir="rtl"] .language-option-check {
    margin-inline: 0 0.65rem;
}


/* ============================================================
   Dashboard Language Preference
============================================================ */

.dashboard-language-card {
    position: relative;
    overflow: hidden;
    margin-top: 28px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(195, 161, 106, 0.14),
            transparent 16rem
        ),
        var(--surface);
    box-shadow: var(--shadow-sm);
}

.dashboard-language-card::after {
    position: absolute;
    inset-block-start: -70px;
    inset-inline-end: -70px;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(97, 96, 61, 0.09);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.dashboard-language-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 20px;
}

.dashboard-language-header h2 {
    margin-bottom: 8px;
    font-size: 1.55rem;
}

.dashboard-language-header p {
    max-width: 620px;
    margin: 0;
}

.dashboard-language-icon {
    display: grid;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(97, 96, 61, 0.13);
    border-radius: 16px;
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.72);
    font-size: 1.2rem;
}

.language-preference-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.language-option {
    position: relative;
    cursor: pointer;
}

.language-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.language-option-card {
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    transition:
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.language-option:hover .language-option-card {
    border-color: rgba(97, 96, 61, 0.38);
    transform: translateY(-1px);
}

.language-option input:checked + .language-option-card {
    border-color: var(--primary);
    background: #F2EEDF;
    box-shadow: 0 0 0 3px rgba(97, 96, 61, 0.07);
}

.language-option-check {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(97, 96, 61, 0.25);
    border-radius: 50%;
    color: transparent;
    background: var(--white);
    transition:
        color var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.language-option input:checked
+ .language-option-card
.language-option-check {
    border-color: var(--primary);
    color: var(--white);
    background: var(--primary);
}

.language-option-copy {
    display: grid;
    gap: 2px;
}

.language-option-copy strong {
    color: var(--text-primary);
    font-size: 0.92rem;
}

.language-option-copy small {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.dashboard-language-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-language-note {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.73rem;
}


@media (max-width: 575px) {
    .dashboard-language-card {
        padding: 22px 18px;
    }

    .dashboard-language-header {
        flex-direction: column-reverse;
    }

    .language-preference-options {
        grid-template-columns: 1fr;
    }

    .dashboard-language-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-language-actions .btn {
        width: 100%;
    }
}

/* ============================================================
   Full Arabic / RTL hardening
============================================================ */
html[dir="rtl"] {
    text-align: right;
}

html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] .container,
html[dir="rtl"] .card,
html[dir="rtl"] .dropdown-menu,
html[dir="rtl"] .modal-content,
html[dir="rtl"] .offcanvas,
html[dir="rtl"] .product-info,
html[dir="rtl"] .product-tabs,
html[dir="rtl"] .product-reviews-section,
html[dir="rtl"] .checkout-layout,
html[dir="rtl"] .checkout-card,
html[dir="rtl"] .order-card,
html[dir="rtl"] .returns-page,
html[dir="rtl"] .skin-analysis-page,
html[dir="rtl"] .oura-page,
html[dir="rtl"] .account-page,
html[dir="rtl"] .dashboard-page {
    text-align: right;
}

html[dir="rtl"] .dropdown-menu,
html[dir="rtl"] .dropdown-item {
    text-align: right;
}

html[dir="rtl"] .dropdown-item .bi,
html[dir="rtl"] .nav-link .bi,
html[dir="rtl"] .btn .bi,
html[dir="rtl"] button .bi,
html[dir="rtl"] a .bi {
    margin-inline-start: 0;
}

/* Bootstrap physical spacing helpers are authored for LTR in a number of
   legacy templates. Neutralize the common icon helpers under RTL. */
html[dir="rtl"] .me-1,
html[dir="rtl"] .me-2,
html[dir="rtl"] .me-3,
html[dir="rtl"] .me-4 {
    margin-right: 0 !important;
}

html[dir="rtl"] .me-1 { margin-left: .25rem !important; }
html[dir="rtl"] .me-2 { margin-left: .5rem !important; }
html[dir="rtl"] .me-3 { margin-left: 1rem !important; }
html[dir="rtl"] .me-4 { margin-left: 1.5rem !important; }

html[dir="rtl"] .ms-1,
html[dir="rtl"] .ms-2,
html[dir="rtl"] .ms-3,
html[dir="rtl"] .ms-4 {
    margin-left: 0 !important;
}

html[dir="rtl"] .ms-1 { margin-right: .25rem !important; }
html[dir="rtl"] .ms-2 { margin-right: .5rem !important; }
html[dir="rtl"] .ms-3 { margin-right: 1rem !important; }
html[dir="rtl"] .ms-4 { margin-right: 1.5rem !important; }

html[dir="rtl"] .text-start {
    text-align: right !important;
}

html[dir="rtl"] .text-end {
    text-align: left !important;
}

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[inputmode="numeric"],
html[dir="rtl"] .tracking-number,
html[dir="rtl"] .driver-phone-link,
html[dir="rtl"] .order-number,
html[dir="rtl"] .sku-value {
    direction: ltr;
    text-align: left;
    unicode-bidi: embed;
}

html[dir="rtl"] .product-detail-title,
html[dir="rtl"] .product-detail-subline,
html[dir="rtl"] .product-short-description,
html[dir="rtl"] .product-detail-fact-copy,
html[dir="rtl"] .product-detail-assurance,
html[dir="rtl"] .product-personalization-slot {
    text-align: right;
}

html[dir="rtl"] .product-detail-price,
html[dir="rtl"] .product-detail-price-card {
    direction: rtl;
}

html[dir="rtl"] .product-detail-actions,
html[dir="rtl"] .product-detail-assurance,
html[dir="rtl"] .product-detail-facts {
    direction: rtl;
}

html[dir="rtl"] .global-search-icon {
    inset-inline-start: 14px;
    inset-inline-end: auto;
}

html[dir="rtl"] .global-search-submit .bi-arrow-right::before,
html[dir="rtl"] .returns-primary-button .bi-arrow-right::before,
html[dir="rtl"] .home-section-link .bi-arrow-right::before {
    transform: scaleX(-1);
}

html[dir="rtl"] .beauty-assistant-panel,
html[dir="rtl"] .beauty-assistant-message,
html[dir="rtl"] .assistant-message {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .beauty-assistant-form textarea {
    text-align: right;
}

html[dir="rtl"] .toast-container,
html[dir="rtl"] .toast {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .form-check {
    padding-right: 1.5em;
    padding-left: 0;
}

html[dir="rtl"] .form-check .form-check-input {
    float: right;
    margin-right: -1.5em;
    margin-left: 0;
}

html[dir="rtl"] table th,
html[dir="rtl"] table td {
    text-align: right;
}

html[dir="rtl"] .pagination {
    direction: rtl;
}

html[dir="rtl"] .breadcrumb {
    direction: rtl;
}

html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-right: 0;
    padding-left: var(--bs-breadcrumb-item-padding-x);
}

html[dir="rtl"] .alert-dismissible {
    padding-right: var(--bs-alert-padding-x);
    padding-left: 3rem;
}

html[dir="rtl"] .alert-dismissible .btn-close {
    right: auto;
    left: 0;
}

html[dir="rtl"] .product-rating-star,
html[dir="rtl"] .rating-summary-stars,
html[dir="rtl"] .product-review-rating {
    direction: ltr;
    unicode-bidi: isolate;
}

@media (max-width: 767px) {
    html[dir="rtl"] .navbar-main-links,
    html[dir="rtl"] .navbar-icons {
        align-items: stretch;
        text-align: right;
    }
}
