html[lang^="ar"] body {
    font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[lang^="ar"] body :is(h1, h2, h3, h4, h5, h6) {
    font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[lang^="ar"] .company-body {
    --company-font-sans: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --company-font-serif: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html[dir="rtl"] body {
    text-align: right;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
}

html[dir="rtl"] [dir="ltr"],
html[dir="rtl"] [data-ltr] {
    direction: ltr;
    unicode-bidi: isolate;
}

.language-switcher {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
}

.language-switcher-details {
    position: relative;
}

.language-switcher-trigger {
    display: inline-flex;
    min-width: 7rem;
    min-height: 2.75rem;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    padding: .5rem .8rem;
    border: 1px solid #e7d8cf;
    border-radius: 999px;
    color: #302925;
    background: linear-gradient(145deg, #fff 0%, #fcf8f5 100%);
    box-shadow: 0 2px 8px rgb(63 42 31 / 5%), inset 0 1px 0 rgb(255 255 255 / 85%);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
    list-style: none;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.language-switcher-trigger::-webkit-details-marker {
    display: none;
}

.language-switcher-trigger:hover,
.language-switcher-details[open] > .language-switcher-trigger {
    border-color: #c9a995;
    background: #fffaf6;
    box-shadow: 0 4px 12px rgb(63 42 31 / 9%);
    transform: translateY(-1px);
}

.language-switcher-trigger:focus-visible,
.language-switcher-option:focus-visible {
    border-color: #a87558;
    outline: 3px solid rgb(168 117 88 / 20%);
    outline-offset: 2px;
}

.language-switcher-trigger svg {
    width: .9rem;
    height: .9rem;
    flex: 0 0 auto;
    color: #78675e;
    transition: transform .18s ease;
}

.language-switcher-details[open] .language-switcher-trigger svg {
    transform: rotate(180deg);
}

.language-switcher-code {
    display: inline-grid;
    min-width: 1.8rem;
    height: 1.35rem;
    place-items: center;
    border-radius: 999px;
    color: #8b5f48;
    background: #f3e8e0;
    font-size: .62rem;
    font-weight: 750;
    letter-spacing: .04em;
}

.language-switcher-menu {
    position: absolute;
    z-index: 100;
    top: calc(100% + .55rem);
    right: 0;
    display: grid;
    width: max-content;
    min-width: 100%;
    gap: .2rem;
    padding: .4rem;
    border: 1px solid #eadbd2;
    border-radius: 1rem;
    background: #fffdfa;
    box-shadow: 0 16px 36px rgb(49 35 27 / 16%), 0 3px 8px rgb(49 35 27 / 6%);
    animation: language-menu-enter .16s ease-out both;
}

.language-switcher-menu form {
    margin: 0;
}

.language-switcher-option {
    display: flex;
    width: 100%;
    min-height: 2.65rem;
    align-items: center;
    gap: .65rem;
    padding: .45rem .6rem;
    border: 1px solid transparent;
    border-radius: .7rem;
    color: #3e342e;
    background: transparent;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: start;
    white-space: nowrap;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}

.language-switcher-option:hover {
    border-color: #f0e3da;
    color: #593a2b;
    background: #f8f0eb;
}

.language-switcher-option[aria-current="true"] {
    color: #593a2b;
    background: #f4e9e1;
    font-weight: 700;
}

.language-switcher-check {
    width: 1rem;
    height: 1rem;
    margin-inline-start: auto;
    color: #9a6d51;
}

html[dir="rtl"] .language-switcher-menu {
    right: auto;
    left: 0;
}

@keyframes language-menu-enter {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .language-switcher-trigger,
    .language-switcher-trigger svg,
    .language-switcher-menu,
    .language-switcher-option {
        transition: none;
        animation: none;
    }
}

@media (max-width: 760px) {
    .language-switcher-trigger {
        min-width: 6.3rem;
        min-height: 2.55rem;
        font-size: .78rem;
    }
}

.notification-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.notification-trigger {
    position: relative;
    display: flex;
    list-style: none;
    cursor: pointer;
}

.notification-trigger::-webkit-details-marker {
    display: none;
}

.notification-trigger:focus-visible {
    outline: 3px solid rgb(168 117 88 / 24%);
    outline-offset: 3px;
}

.notification-panel {
    position: absolute;
    z-index: 120;
    top: calc(100% + .8rem);
    right: -.5rem;
    width: min(23rem, calc(100vw - 2rem));
    max-height: min(72vh, 34rem);
    overflow: auto;
    border: 1px solid #eadbd2;
    border-radius: 1.1rem;
    color: #302925;
    background: #fffdfa;
    box-shadow: 0 20px 50px rgb(49 35 27 / 18%), 0 3px 10px rgb(49 35 27 / 7%);
    animation: language-menu-enter .16s ease-out both;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.05rem .85rem;
    border-bottom: 1px solid #f0e6df;
}

.notification-panel-header > div {
    display: grid;
    gap: .2rem;
}

.notification-panel-header strong {
    color: #2e2723;
    font-size: .95rem;
}

.notification-panel-header > div > span {
    color: #89796f;
    font-size: .72rem;
}

.notification-panel-count {
    display: inline-grid;
    min-width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    padding: 0 .4rem;
    border-radius: 999px;
    color: #fff;
    background: #9d7056;
    font-size: .7rem;
    font-weight: 700;
}

.notification-list {
    padding: .35rem;
}

.notification-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .15rem .25rem;
    border-radius: .8rem;
}

.notification-item:hover {
    background: #faf4ef;
}

.notification-item.is-unread {
    background: #fcf7f3;
}

.notification-item-link {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: flex-start;
    gap: .65rem;
    padding: .7rem .45rem;
    color: inherit;
    text-decoration: none;
}

.notification-item-link:focus-visible,
.notification-panel-footer a:focus-visible,
.notification-page-item a:focus-visible {
    border-radius: .5rem;
    outline: 2px solid #a87558;
    outline-offset: 2px;
}

.notification-item-dot {
    width: .48rem;
    height: .48rem;
    flex: 0 0 auto;
    margin-top: .35rem;
    border-radius: 50%;
    background: transparent;
}

.notification-item.is-unread .notification-item-dot,
.notification-page-item.is-unread > .notification-item-dot {
    background: #ae7958;
    box-shadow: 0 0 0 3px #f2e5db;
}

.notification-item-copy {
    display: grid;
    min-width: 0;
    gap: .35rem;
}

.notification-item-copy strong {
    overflow: hidden;
    color: #38302b;
    font-size: .77rem;
    font-weight: 600;
    line-height: 1.45;
    text-overflow: ellipsis;
}

.notification-item-copy time,
.notification-page-copy time {
    color: #928278;
    font-size: .68rem;
}

.notification-item form {
    flex: 0 0 auto;
    margin: 0 .35rem 0 0;
}

.notification-mark-read {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border: 1px solid #eadbd2;
    border-radius: 50%;
    color: #8c634c;
    background: #fff;
    cursor: pointer;
}

.notification-mark-read::before {
    width: .48rem;
    height: .48rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    content: "";
}

.notification-mark-read:hover {
    border-color: #bc967d;
    background: #f8eee7;
}

.notification-empty {
    margin: 0;
    padding: 1.5rem 1rem;
    color: #89796f;
    font-size: .82rem;
    text-align: center;
}

.notification-panel-footer {
    padding: .75rem 1rem;
    border-top: 1px solid #f0e6df;
    text-align: center;
}

.notification-panel-footer a {
    color: #8b5c43;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
}

.notification-panel-footer a:hover {
    color: #553526;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.notification-page {
    padding: 1.4rem;
}

.notification-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.notification-page-heading h2 {
    margin: 0;
    font-size: 1.15rem;
}

.notification-page-heading p {
    margin: .3rem 0 0;
}

.notification-page-item {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem .5rem;
    border-top: 1px solid #eee3dc;
}

.notification-page-copy {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: .4rem;
}

.notification-page-copy strong {
    overflow-wrap: anywhere;
    font-size: .86rem;
}

.notification-page-item form {
    margin: 0;
}

html[dir="rtl"] .notification-panel {
    right: auto;
    left: -.5rem;
}

html[dir="rtl"] .notification-item form {
    margin-right: 0;
    margin-left: .35rem;
}

/* ============================================================
   Storefront RTL fixes (shop / catalog / product / cart / home)
   ============================================================ */

/* Arabic script must never use letter-spacing — it breaks joining. */
html[dir="rtl"] body,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] p,
html[dir="rtl"] a,
html[dir="rtl"] span,
html[dir="rtl"] strong,
html[dir="rtl"] small,
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .wordmark,
html[dir="rtl"] .brand-mark,
html[dir="rtl"] .button,
html[dir="rtl"] .mini-button {
    letter-spacing: 0 !important;
}

/* Arabic needs more vertical room. */
html[dir="rtl"] .hero h1 {
    line-height: 1.35;
    max-width: 480px;
}

html[dir="rtl"] h2 {
    line-height: 1.5;
}

html[dir="rtl"] .hero-copy > p:not(.eyebrow),
html[dir="rtl"] .philosophy-copy > p:not(.eyebrow) {
    line-height: 1.9;
}

/* Hero: mirror layout — copy on the right, photo on the left. */
html[dir="rtl"] .hero-copy {
    padding: 60px 9% 60px 4%;
    text-align: right;
}

html[dir="rtl"] .hero-full .hero-copy {
    background: linear-gradient(270deg, #eee2d9 0%, #eee2d9e8 58%, transparent 100%);
}

html[dir="rtl"] .hero-photo {
    right: auto;
    left: 0;
}

html[dir="rtl"] .hero-photo img,
html[dir="rtl"] .hero-photo img.banner-artwork {
    right: auto;
    left: 0;
}

/* Directional arrow icons (SVG) must point left in RTL. */
html[dir="rtl"] .button .icon {
    transform: scaleX(-1);
}

/* Badges / floating controls are physical — mirror them. */
html[dir="rtl"] .product-tag {
    left: auto;
    right: 8px;
}

html[dir="rtl"] .wish-button {
    right: auto;
    left: 8px;
}

html[dir="rtl"] .catalog-grid .product-tag {
    left: auto;
    right: 10px;
}

html[dir="rtl"] .catalog-grid .wish-button {
    right: auto;
    left: 9px;
}

html[dir="rtl"] .bag-count {
    right: auto;
    left: -3px;
    transform: translate(-20%, -15%);
}

/* Promo cards: photo right in LTR → left in RTL. */
html[dir="rtl"] .promo-photo {
    right: auto;
    left: 0;
}

html[dir="rtl"] .promo-visual {
    right: auto;
    left: 35px;
}

/* Philosophy / bundle decorations. */
html[dir="rtl"] .philosophy-copy {
    padding: 40px 40px 40px 12%;
    text-align: right;
}

html[dir="rtl"] .bundle-card .icon {
    right: auto;
    left: 20px;
}

/* Account/bag alignment used physical right — use logical start. */
html[dir="rtl"] .bag-line-side {
    text-align: left;
}

html[dir="rtl"] .catalog-sort select {
    padding: 9px 11px 9px 30px;
}

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

/* Toasts + modals anchored with physical right. */
html[dir="rtl"] .toast-region {
    right: auto;
    left: 24px;
}

html[dir="rtl"] .modal-close {
    right: auto;
    left: 16px;
}

html[dir="rtl"] .quick-view h1 {
    margin: 0 0 10px 25px;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .notification-panel {
        width: min(21rem, calc(100vw - 1.5rem));
    }

    html[dir="rtl"] .notification-panel {
        left: -.25rem;
    }

    .notification-page-item {
        flex-wrap: wrap;
    }

    .notification-page-item form {
        margin-inline-start: auto;
    }

    /* Mobile hero: photo was offset to the right — mirror to left. */
    html[dir="rtl"] .hero-photo {
        right: auto;
        left: -15%;
    }

    html[dir="rtl"] .hero-copy {
        padding: 55px 7% 55px 20px;
    }

    html[dir="rtl"] .toast-region {
        right: auto;
        left: 16px;
    }
}
