/*
 * NHR Global Shell v2 — Header + Footer.
 * Namespaced to .nhr-global-* so accepted page-level UI remains isolated.
 */

:root {
    --nhr-shell-purple: #605dba;
    --nhr-shell-purple-deep: #4f4ca9;
    --nhr-shell-teal: #4ecdc4;
    --nhr-shell-navy: #0d0b21;
    --nhr-shell-text: #19233a;
    --nhr-shell-muted: #667085;
    --nhr-shell-border: #e6e8f0;
    --nhr-shell-header-height: 80px;
    --nhr-shell-container: 1440px;
}

.nhr-global-container {
    width: min(calc(100% - 64px), var(--nhr-shell-container));
    margin-inline: auto;
}

.nhr-global-skip-link {
    position: fixed;
    top: 12px;
    inset-inline-start: 12px;
    z-index: 10001;
    transform: translateY(-180%);
    padding: .7rem 1rem;
    border-radius: .65rem;
    background: #fff;
    color: var(--nhr-shell-purple);
    font-size: .875rem;
    font-weight: 800;
    box-shadow: 0 14px 34px rgba(13, 11, 33, .18);
    transition: transform .18s ease;
}

.nhr-global-skip-link:focus {
    transform: translateY(0);
}

/* Header */
.nhr-global-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    min-height: var(--nhr-shell-header-height);
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid rgba(226, 229, 238, .95);
    box-shadow: 0 5px 18px rgba(26, 31, 54, .035);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.admin-bar .nhr-global-header {
    top: 32px;
}

.nhr-global-header__inner {
    width: min(calc(100% - 48px), var(--nhr-shell-container));
    min-height: var(--nhr-shell-header-height);
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.nhr-global-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: .72rem;
    flex: 0 0 auto;
    text-decoration: none;
}

.nhr-global-brand__mark {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex: 0 0 auto;
}

.nhr-global-brand__copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.nhr-global-brand__copy strong {
    color: var(--nhr-shell-purple);
    font-size: clamp(1.05rem, 1.25vw, 1.42rem);
    font-weight: 850;
    letter-spacing: -.025em;
    white-space: nowrap;
}

.nhr-global-brand__copy small {
    margin-top: .24rem;
    color: #687084;
    font-size: .69rem;
    font-weight: 550;
    white-space: nowrap;
}

.nhr-global-nav {
    margin-inline: auto;
    display: flex;
    align-items: stretch;
    align-self: stretch;
    gap: clamp(.7rem, 1.05vw, 1.35rem);
    white-space: nowrap;
}

.nhr-global-nav__link {
    position: relative;
    min-height: var(--nhr-shell-header-height);
    display: inline-flex;
    align-items: center;
    color: #3d4658;
    font-size: .925rem;
    font-weight: 570;
    text-decoration: none;
    transition: color .18s ease;
}

.nhr-global-nav__link::after {
    content: '';
    position: absolute;
    inset-inline: .05rem;
    bottom: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--nhr-shell-purple), #8078e8);
    opacity: 0;
    transform: scaleX(.55);
    transition: opacity .18s ease, transform .18s ease;
}

.nhr-global-nav__link:hover,
.nhr-global-nav__link:focus-visible,
.nhr-global-nav__link.is-active {
    color: var(--nhr-shell-purple);
}

.nhr-global-nav__link.is-active {
    font-weight: 750;
}

.nhr-global-nav__link.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

.nhr-global-header__actions {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex: 0 0 auto;
}

.nhr-global-language {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding-inline: .45rem;
    color: #4d5668;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    transition: color .18s ease;
}

.nhr-global-language i {
    color: #6b7280;
    font-size: .85rem;
}

.nhr-global-language:hover,
.nhr-global-language:focus-visible {
    color: var(--nhr-shell-purple);
}

.nhr-global-store {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding-inline: 1.25rem;
    border-radius: .7rem;
    background: linear-gradient(135deg, var(--nhr-shell-purple) 0%, #6e68d8 100%);
    color: #fff;
    box-shadow: 0 11px 24px -10px rgba(96, 93, 186, .7);
    font-size: .875rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.nhr-global-store i {
    font-size: .68rem;
}

.nhr-global-store:hover,
.nhr-global-store:focus-visible {
    color: #fff;
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -10px rgba(96, 93, 186, .82);
}

.nhr-global-menu-toggle {
    width: 46px;
    height: 46px;
    display: none;
    place-items: center;
    border: 1px solid var(--nhr-shell-border);
    border-radius: .7rem;
    background: #fff;
    color: #3f4758;
    cursor: pointer;
}

/* Override the legacy full-screen menu while preserving main.js behavior. */
#mobile-menu.nhr-global-mobile-menu {
    position: fixed;
    inset: var(--nhr-shell-header-height) 0 0;
    width: 100%;
    height: calc(100dvh - var(--nhr-shell-header-height));
    z-index: 999;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    background: rgba(13, 11, 33, .42);
    opacity: 0;
    visibility: hidden;
    transform: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.admin-bar #mobile-menu.nhr-global-mobile-menu {
    inset-block-start: calc(var(--nhr-shell-header-height) + 32px);
    height: calc(100dvh - var(--nhr-shell-header-height) - 32px);
}

#mobile-menu.nhr-global-mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.nhr-global-mobile-menu__panel {
    width: min(100%, 420px);
    height: 100%;
    padding: 1.05rem 1rem 1.4rem;
    overflow-y: auto;
    background: rgba(255, 255, 255, .99);
    box-shadow: -18px 0 50px rgba(13, 11, 33, .14);
    transform: translateX(22px);
    transition: transform .22s ease;
}

[dir="rtl"] .nhr-global-mobile-menu__panel {
    box-shadow: 18px 0 50px rgba(13, 11, 33, .14);
    transform: translateX(-22px);
}

#mobile-menu.nhr-global-mobile-menu.active .nhr-global-mobile-menu__panel,
[dir="rtl"] #mobile-menu.nhr-global-mobile-menu.active .nhr-global-mobile-menu__panel {
    transform: translateX(0);
}

.nhr-global-mobile-menu__panel nav {
    display: grid;
}

#mobile-menu .nhr-global-mobile-menu__link {
    margin: 0;
    min-height: 55px;
    padding: .75rem .85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #eef0f5;
    color: #30394c;
    font-size: 1rem;
    font-weight: 700;
    opacity: 1;
    transform: none;
    text-align: start;
    text-decoration: none;
    animation: none;
}

#mobile-menu .nhr-global-mobile-menu__link i {
    color: #a0a5b4;
    font-size: .75rem;
}

#mobile-menu .nhr-global-mobile-menu__link.is-active {
    color: var(--nhr-shell-purple);
}

#mobile-menu .nhr-global-mobile-menu__link.is-active i {
    color: var(--nhr-shell-purple);
}

.nhr-global-mobile-menu__actions {
    padding-top: 1.2rem;
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: .7rem;
}

.nhr-global-mobile-menu__actions > a {
    min-height: 48px;
    padding: .7rem .85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: 1px solid var(--nhr-shell-border);
    border-radius: .72rem;
    color: #414a5d;
    font-size: .84rem;
    font-weight: 800;
    text-decoration: none;
}

.nhr-global-mobile-menu__actions .nhr-global-mobile-menu__store {
    border-color: transparent;
    background: var(--nhr-shell-purple);
    color: #fff;
}

/* Footer */
.nhr-global-footer {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #0d1027;
    color: #fff;
}

.nhr-global-footer__grid-pattern {
    position: absolute;
    inset: 0;
    z-index: -3;
    opacity: .18;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 88%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 88%);
}

.nhr-global-footer__glow {
    position: absolute;
    z-index: -2;
    border-radius: 999px;
    filter: blur(110px);
    pointer-events: none;
}

.nhr-global-footer__glow--one {
    width: 360px;
    height: 360px;
    inset-block-start: -180px;
    inset-inline-start: -130px;
    background: rgba(96, 93, 186, .25);
}

.nhr-global-footer__glow--two {
    width: 310px;
    height: 310px;
    inset-block-end: -190px;
    inset-inline-end: -120px;
    background: rgba(78, 205, 196, .12);
}

.nhr-global-footer__main {
    padding-block: 3.9rem 3.35rem;
    display: grid;
    grid-template-columns: minmax(270px, 1.45fr) repeat(4, minmax(145px, .8fr));
    gap: clamp(2rem, 3vw, 3.2rem);
}

.nhr-global-footer__logo {
    display: inline-flex;
    align-items: center;
    gap: .72rem;
    color: #fff;
    text-decoration: none;
}

.nhr-global-footer__logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.nhr-global-footer__logo span,
.nhr-global-footer__logo strong,
.nhr-global-footer__logo small {
    display: block;
}

.nhr-global-footer__logo strong {
    color: #fff;
    font-size: 1.03rem;
    font-weight: 850;
}

.nhr-global-footer__logo small {
    margin-top: .2rem;
    color: #9ca3b7;
    font-size: .68rem;
    font-weight: 600;
}

.nhr-global-footer__brand > p {
    max-width: 390px;
    margin: 1.15rem 0 1.3rem;
    color: #aab0c1;
    font-size: .79rem;
    line-height: 1.78;
}

.nhr-global-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.nhr-global-footer__social a {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: .62rem;
    background: rgba(255,255,255,.055);
    color: #c4c8d7;
    font-size: .78rem;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.nhr-global-footer__social a:hover,
.nhr-global-footer__social a:focus-visible {
    border-color: rgba(78,205,196,.35);
    background: rgba(78,205,196,.11);
    color: #fff;
    transform: translateY(-1px);
}

.nhr-global-footer__column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .67rem;
}

.nhr-global-footer__column h2 {
    margin: 0 0 .38rem;
    color: #fff;
    font-size: .82rem;
    font-weight: 850;
    letter-spacing: .01em;
}

.nhr-global-footer__column > a {
    color: #aab0c1;
    font-size: .76rem;
    line-height: 1.5;
    text-decoration: none;
    transition: color .18s ease;
}

.nhr-global-footer__column > a:hover,
.nhr-global-footer__column > a:focus-visible {
    color: #fff;
}

.nhr-global-footer__contact > a,
.nhr-global-footer__contact-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: .62rem;
    color: #aab0c1;
    font-size: .76rem;
    line-height: 1.55;
}

.nhr-global-footer__contact i {
    width: 14px;
    margin-top: .18rem;
    flex: 0 0 14px;
    color: var(--nhr-shell-teal);
    text-align: center;
}

/* Keep the contact row RTL while isolating the Saudi phone number as LTR. */
.nhr-global-footer__phone span {
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

html[dir="rtl"] .nhr-global-footer__contact > a,
html[dir="rtl"] .nhr-global-footer__contact-item {
    direction: rtl;
    text-align: right;
}

.nhr-global-footer__bottom {
    border-top: 1px solid rgba(255,255,255,.075);
    background: rgba(5, 7, 22, .16);
}

.nhr-global-footer__bottom-inner {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    color: #858ca2;
    font-size: .7rem;
}

.nhr-global-footer__bottom-inner p {
    margin: 0;
}

.nhr-global-footer__legal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.nhr-global-footer__legal a {
    color: #8f96aa;
    text-decoration: none;
    transition: color .18s ease;
}

.nhr-global-footer__legal a:hover,
.nhr-global-footer__legal a:focus-visible {
    color: #fff;
}

/* Global shell focus treatment */
.nhr-global-header a:focus-visible,
.nhr-global-header button:focus-visible,
.nhr-global-footer a:focus-visible,
.whatsapp-float:focus-visible {
    outline: 3px solid rgba(78, 205, 196, .72);
    outline-offset: 3px;
}

/* WhatsApp is part of the global shell, but remains a separate utility. */
.whatsapp-float {
    width: 54px;
    height: 54px;
    bottom: 28px;
    border: 3px solid rgba(255,255,255,.94);
    box-shadow: 0 12px 30px rgba(17, 24, 39, .20);
    font-size: 26px;
    animation: none;
}

html[dir="ltr"] .whatsapp-float { right: 28px; }
html[dir="rtl"] .whatsapp-float { left: 28px; }

@media (max-width: 1279px) {
    .nhr-global-nav,
    .nhr-global-language,
    .nhr-global-store {
        display: none;
    }

    .nhr-global-header__inner {
        width: min(calc(100% - 40px), var(--nhr-shell-container));
    }

    .nhr-global-menu-toggle {
        display: grid;
        margin-inline-start: auto;
    }
}

@media (max-width: 1100px) {
    .nhr-global-footer__main {
        grid-template-columns: 1.35fr repeat(2, 1fr);
    }

    .nhr-global-footer__brand {
        grid-row: span 2;
    }
}

@media (max-width: 782px) {
    .admin-bar .nhr-global-header {
        top: 46px;
    }

    .admin-bar #mobile-menu.nhr-global-mobile-menu {
        inset-block-start: calc(var(--nhr-shell-header-height) + 46px);
        height: calc(100dvh - var(--nhr-shell-header-height) - 46px);
    }
}

@media (max-width: 767px) {
    :root {
        --nhr-shell-header-height: 68px;
    }

    .nhr-global-container {
        width: min(calc(100% - 32px), var(--nhr-shell-container));
    }

    .nhr-global-header__inner {
        width: calc(100% - 28px);
        gap: .75rem;
    }

    .nhr-global-brand__mark {
        width: 36px;
        height: 36px;
    }

    .nhr-global-brand__copy strong {
        font-size: 1rem;
    }

    .nhr-global-brand__copy small {
        font-size: .59rem;
    }

    .nhr-global-menu-toggle {
        width: 42px;
        height: 42px;
    }

    #mobile-menu.nhr-global-mobile-menu {
        justify-content: stretch;
    }

    .nhr-global-mobile-menu__panel {
        width: 100%;
        box-shadow: none;
    }

    .nhr-global-footer__main {
        padding-block: 3rem 2.7rem;
        grid-template-columns: 1fr 1fr;
        gap: 2rem 1.4rem;
    }

    .nhr-global-footer__brand {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .nhr-global-footer__contact {
        grid-column: 1 / -1;
    }

    .nhr-global-footer__brand > p {
        max-width: 34rem;
    }

    .nhr-global-footer__bottom-inner {
        padding-block: 1.15rem;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: .65rem;
    }

    .whatsapp-float {
        width: 48px;
        height: 48px;
        bottom: 18px;
        font-size: 23px;
    }

    html[dir="ltr"] .whatsapp-float { right: 18px; }
    html[dir="rtl"] .whatsapp-float { left: 18px; }
}

@media (max-width: 520px) {
    .nhr-global-brand__copy small {
        display: none;
    }

    .nhr-global-footer__main {
        grid-template-columns: 1fr;
    }

    .nhr-global-footer__brand,
    .nhr-global-footer__contact {
        grid-column: auto;
    }

    .nhr-global-mobile-menu__actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nhr-global-header *,
    .nhr-global-footer *,
    .nhr-global-skip-link,
    .whatsapp-float {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* G3 — Responsive, accessibility and interaction hardening. */
html {
    scroll-padding-top: calc(var(--nhr-shell-header-height) + 24px);
}

.nhr-global-footer__column > a,
.nhr-global-footer__contact > a,
.nhr-global-footer__contact-item,
.nhr-global-footer__legal a {
    overflow-wrap: anywhere;
}

.nhr-global-footer__ltr {
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

/* The menu is fully removed from sequential focus while visually closed. */
#mobile-menu.nhr-global-mobile-menu[aria-hidden="true"] {
    pointer-events: none;
}

#mobile-menu.nhr-global-mobile-menu[aria-hidden="false"] {
    pointer-events: auto;
}

/* Keep the full desktop navigation usable at the narrow edge of the XL breakpoint. */
@media (min-width: 1280px) and (max-width: 1399px) {
    .nhr-global-header__inner {
        width: min(calc(100% - 32px), var(--nhr-shell-container));
        gap: 1rem;
    }

    .nhr-global-brand__copy small {
        display: none;
    }

    .nhr-global-nav {
        gap: .72rem;
    }

    .nhr-global-nav__link {
        font-size: .86rem;
    }

    .nhr-global-header__actions {
        gap: .45rem;
    }

    .nhr-global-store {
        padding-inline: .95rem;
    }
}

@media (max-width: 767px) {
    .nhr-global-footer__column > a,
    .nhr-global-footer__contact > a {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
    }

    .nhr-global-footer__social a {
        width: 40px;
        height: 40px;
    }

    .nhr-global-footer__legal {
        gap: .35rem 1rem;
    }

    .nhr-global-footer__legal a {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 380px) {
    .nhr-global-brand__copy strong {
        font-size: .92rem;
    }

    .nhr-global-header__inner {
        width: calc(100% - 20px);
    }

    .nhr-global-menu-toggle {
        width: 40px;
        height: 40px;
    }
}

@media (prefers-contrast: more) {
    .nhr-global-header {
        border-bottom-color: #a9afbf;
    }

    .nhr-global-nav__link,
    .nhr-global-language {
        color: #20283a;
    }

    .nhr-global-footer__column > a,
    .nhr-global-footer__contact > a,
    .nhr-global-footer__contact-item,
    .nhr-global-footer__legal a,
    .nhr-global-footer__brand > p {
        color: #d7dbea;
    }
}

@media (forced-colors: active) {
    .nhr-global-nav__link.is-active::after {
        background: Highlight;
    }

    .nhr-global-store,
    .nhr-global-mobile-menu__actions .nhr-global-mobile-menu__store {
        border: 1px solid ButtonText;
    }
}

/* G3.1 — Mobile header distribution + WhatsApp utility cleanup. */
@media (max-width: 1279px) {
    /* Keep the brand at inline-start and the menu control at inline-end in both LTR and RTL. */
    .nhr-global-header__inner {
        justify-content: space-between;
    }

    .nhr-global-header__actions {
        margin-inline-start: 0;
    }

    .nhr-global-menu-toggle {
        margin-inline-start: 0;
        flex: 0 0 auto;
    }
}

/* Remove the decorative white ring around the floating WhatsApp action. */
.whatsapp-float {
    border: 0;
    box-shadow: 0 10px 26px rgba(17, 24, 39, .18);
}

