/* ==========================================================================
   Marony — site header (logo, navigation, actions, language pill, mobile drawer)
   Shared by every page that renders front.home.header (and the toast of the
   product card buttons): the home page and the
   category page. Also holds the brand tokens, container and buttons those
   pages build on, so it loads before any page stylesheet. Namespaced `mh-`;
   logical properties serve Arabic RTL and English LTR alike.
   ========================================================================== */

:root {
    /* Brand: the logo purple and its tints, nude and soft gray */
    --mh-primary: #532740;
    --mh-primary-600: #62304C;
    --mh-primary-700: #43203A;
    --mh-primary-900: #2B1424;
    --mh-primary-50: #F7EFF4;
    --mh-primary-100: #EEDDE7;
    --mh-nude: #E6D3C3;
    --mh-nude-100: #F1E6DC;
    --mh-nude-50: #F9F4EF;
    --mh-gray: #F5F4F6;
    --mh-gray-200: #ECE9ED;
    --mh-gray-300: #DDD8DE;
    --mh-text: #231A21;
    --mh-muted: #6E6470;
    --mh-white: #FFFFFF;
    --mh-star: #E9B949;

    --mh-font: 'Tajawal', 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mh-radius-sm: 10px;
    --mh-radius: 16px;
    --mh-radius-lg: 24px;
    --mh-shadow-sm: 0 2px 8px rgba(43, 20, 36, .06);
    --mh-shadow: 0 12px 32px rgba(43, 20, 36, .10);
    --mh-shadow-lg: 0 24px 60px rgba(43, 20, 36, .18);
    --mh-ease: cubic-bezier(.22, .61, .36, 1);

    --mh-container: 1240px;
    --mh-gutter: 16px;
    --mh-header-h: 64px;
    --mh-section-y: 56px;
}

@media (min-width: 768px) {
    :root { --mh-gutter: 24px; --mh-section-y: 72px; }
}

@media (min-width: 992px) {
    :root { --mh-gutter: 32px; --mh-header-h: 80px; --mh-section-y: 88px; }
}

/* Large desktops and 4K: widen the canvas and scale type instead of leaving empty margins */
@media (min-width: 1920px) {
    :root { --mh-container: 1480px; }
}

@media (min-width: 2560px) {
    :root { --mh-container: 1840px; --mh-header-h: 100px; --mh-section-y: 120px; }
}

html { scroll-padding-top: calc(var(--mh-header-h) + 12px); }

.mh-container {
    width: 100%;
    max-width: calc(var(--mh-container) + var(--mh-gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--mh-gutter);
}

.mh-skip {
    position: absolute;
    inset-inline-start: 16px;
    top: -60px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: var(--mh-radius-sm);
    background: var(--mh-primary);
    color: var(--mh-white);
    text-decoration: none;
    transition: top .2s var(--mh-ease);
}
.mh-skip:focus { top: 12px; color: var(--mh-white); }

.mh-header a:focus-visible,
.mh-header button:focus-visible,
.mh-drawer a:focus-visible,
.mh-drawer button:focus-visible {
    outline: 3px solid var(--mh-nude);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--mh-primary);
}

/* ---------- Buttons ---------- */

.mh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 44px;
    padding: .7rem 1.4rem;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    font-size: .95rem;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .25s var(--mh-ease), color .25s var(--mh-ease),
                border-color .25s var(--mh-ease), transform .25s var(--mh-ease), box-shadow .25s var(--mh-ease);
}
.mh-btn:hover { transform: translateY(-2px); }
.mh-btn:active { transform: translateY(0); }
.mh-btn[disabled] { opacity: .7; cursor: progress; transform: none; }

.mh-btn--sm { min-height: 40px; padding: .5rem 1.1rem; font-size: .9rem; }


/* Header "Sign in" (Figma): 184 x 48, radius 10, padding 24, gap 8, #532740;
   Cairo Bold 16px / 100%, white, centred. The width is fixed, so the padding
   is the inline room around the content, which the 136px inside easily fits. */
.mh-btn--login {
    box-sizing: border-box;
    /* Pinned: the actions row can neither stretch nor squeeze it */
    flex: 0 0 184px;
    width: 184px;
    min-width: 184px;
    max-width: 184px;
    min-height: 0;
    height: 48px;
    gap: 8px;
    padding: 0 24px;
    border: 0;
    border-radius: 10px;
    background: #532740;
    color: #FFFFFF;
    font-family: 'Cairo', var(--mh-font, sans-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}
.mh-btn--login i { font-size: 16px; line-height: 1; }
.mh-btn--login:hover,
.mh-btn--login:focus-visible { background: #43203A; color: #FFFFFF; }
.mh-btn--login:focus-visible { outline: 2px solid #532740; outline-offset: 2px; }

.mh-btn--outline { background: transparent; color: var(--mh-primary); border-color: var(--mh-primary-100); }
.mh-btn--outline:hover { background: var(--mh-primary-50); border-color: var(--mh-primary); color: var(--mh-primary); }



[dir="rtl"] .mh-btn .fa-arrow-left,
[dir="ltr"] .mh-btn .fa-arrow-right { transition: transform .25s var(--mh-ease); }
[dir="rtl"] .mh-btn:hover .fa-arrow-left { transform: translateX(-4px); }
[dir="ltr"] .mh-btn:hover .fa-arrow-right { transform: translateX(4px); }

/* ---------- Header (1440 × 80 on desktop) ---------- */

/* Cairo, as in the design, for everything in the header and the drawer */
.mh-header,
.mh-drawer.offcanvas { font-family: 'Cairo', var(--mh-font); }

.mh-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--mh-header-h);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(160%) blur(10px);
    border-block-end: 1px solid var(--mh-gray-200);
    transition: box-shadow .3s var(--mh-ease);
}
.mh-header.is-scrolled { box-shadow: var(--mh-shadow-sm); }

.mh-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mh-header__logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.mh-header__logo img { height: calc(var(--mh-header-h) - 10px); width: auto; }

.mh-nav { flex: 1; display: none; }
.mh-nav__list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(8px, 2.2vw, 36px);
    margin: 0;
    padding: 0;
    list-style: none;
}
.mh-nav__link {
    position: relative;
    display: inline-block;
    padding: 8px 4px;
    color: var(--mh-text);
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s var(--mh-ease);
}
.mh-nav__link::after {
    content: '';
    position: absolute;
    inset-inline: 4px;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--mh-primary);
    transform: scaleX(0);
    transition: transform .25s var(--mh-ease);
}
.mh-nav__link:hover { color: var(--mh-primary); }
.mh-nav__link:hover::after,
.mh-nav__link.is-active::after { transform: scaleX(1); }
.mh-nav__link.is-active { color: var(--mh-primary); font-weight: 700; }

.mh-header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: auto;
}

.mh-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mh-primary);
    font-size: 1.15rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s var(--mh-ease), color .2s var(--mh-ease);
}
.mh-icon-btn:hover { background: var(--mh-primary-50); color: var(--mh-primary-700); }
/* The cart's bag (images/front/hero/fi_1656850.png, 90 × 90), a little larger than the 1.15rem font icons beside it */
.mh-cart-btn__icon { display: block; width: 22px; height: 22px; object-fit: contain; }

.mh-header .mh-cart-count.badge.bg-danger {
    position: absolute;
    top: 4px;
    inset-inline-end: 2px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid var(--mh-white);
    border-radius: 999px;
    background-color: var(--mh-primary) !important;
    color: var(--mh-white) !important;
    font-size: .68rem;
    font-weight: 700;
    line-height: 15px;
}

/* Notification bell (front.partials.notification-bell, bellStyle 'mh'): the cart's badge */
.mh-header .mh-bell__count.badge.bg-danger {
    position: absolute;
    top: 4px;
    inset-inline-end: 2px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid var(--mh-white);
    border-radius: 999px;
    background-color: var(--mh-primary) !important;
    color: var(--mh-white) !important;
    font-size: .68rem;
    font-weight: 700;
    line-height: 15px;
}
.mh-header .mh-bell__count.d-none { display: none !important; }
.mh-header .mh-bell .dropdown-menu { font-family: var(--mh-font, 'Cairo', sans-serif); text-align: start; }

/* Account menu: the profile icon opens a small card -- my account, notifications, sign out (red) */
.mh-account__menu {
    min-width: 220px;
    padding: 8px;
    border: 1px solid #EDE3E9;              /* a tint of the brand #532740 */
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(83, 39, 64, .12);
    font-family: var(--mh-font, 'Cairo', sans-serif);
    text-align: start;
}
.mh-account__menu .dropdown-divider { margin: 6px 4px; border-color: #EDE3E9; opacity: 1; }
.mh-account__menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #222222;
    font-weight: 500;
}
.mh-account__menu .dropdown-item i { width: 18px; text-align: center; color: var(--mh-primary); }
.mh-account__menu .dropdown-item:hover,
.mh-account__menu .dropdown-item:focus { background: var(--mh-primary-50); color: var(--mh-primary-700); }
.mh-account__menu form { margin: 0; }
.mh-account__menu .mh-account__logout,
.mh-account__menu .mh-account__logout i { color: #B3261E; }
.mh-account__menu .mh-account__logout:hover,
.mh-account__menu .mh-account__logout:focus { background: #FDECEC; color: #B3261E; }

/* Language switcher: "Eng | عربي" pill toggle, the active side filled in brand purple */
.mh-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    margin-inline-start: 4px;
    border: 1px solid var(--mh-gray-300);
    border-radius: 9999px;
    background: transparent;
    flex-shrink: 0;
}
.mh-lang-switch__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 34px;
    padding: 0 14px;
    border-radius: 9999px;
    background: transparent;
    color: #4A4A4A;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .25s var(--mh-ease), color .25s var(--mh-ease);
}
.mh-lang-switch__option:hover { color: var(--mh-primary); }
.mh-lang-switch__option.is-active,
.mh-lang-switch__option.is-active:hover {
    background: #532740;
    color: #FFFFFF;
    cursor: default;
}

/* The account (menu, or the sign-in button) follows the pill: the same 4px on that side as before it */
.mh-header__actions > .mh-lang-switch + .mh-account,
.mh-header__actions > .mh-lang-switch + .mh-btn { margin-inline-start: 4px; }

@media (max-width: 374.98px) {
    .mh-lang-switch__option { min-width: 40px; padding: 0 10px; font-size: .82rem; }
}

.mh-hide-sm { display: none !important; }

.mh-header__burger { margin-inline-start: -8px; }

@media (min-width: 576px) {
    .mh-hide-sm { display: inline-flex !important; }
}

@media (min-width: 992px) {
    .mh-header__burger { display: none; }
    .mh-nav { display: block; }
    .mh-header__actions { margin-inline-start: 0; }
    .mh-header__inner { gap: 24px; }
}

/* ---------- Mobile drawer ---------- */

.mh-drawer.offcanvas {
    width: min(340px, 88vw);
    border: 0 !important;
    background: var(--mh-white);
    transition: transform .35s var(--mh-ease);
}
.mh-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-block-end: 1px solid var(--mh-gray-200);
}
.mh-drawer__head img { height: 48px; width: auto; }
.mh-drawer__body { padding: 8px 0 24px; overflow-y: auto; }
.mh-drawer__list { list-style: none; margin: 0; padding: 0; }
.mh-drawer__list a,
.mh-drawer__list button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    border: 0;
    background: transparent;
    color: var(--mh-text);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 500;
    text-align: start;
    text-decoration: none;
}
.mh-drawer__list a:hover,
.mh-drawer__list button:hover,
.mh-drawer__list a.is-active { background: var(--mh-primary-50); color: var(--mh-primary); }
.mh-drawer__list a.is-active { font-weight: 700; box-shadow: inset -3px 0 0 var(--mh-primary); }
[dir="ltr"] .mh-drawer__list a.is-active { box-shadow: inset 3px 0 0 var(--mh-primary); }
.mh-drawer__list i { color: var(--mh-muted); font-size: .85rem; }
.mh-drawer__list--secondary { margin-top: 8px; padding-top: 8px; border-block-start: 1px solid var(--mh-gray-200); }
.mh-drawer__list--secondary a, .mh-drawer__list--secondary button { font-size: .95rem; justify-content: flex-start; }
.mh-drawer__list--secondary i { width: 22px; margin-inline-end: 10px; color: var(--mh-primary); }
.mh-lang-switch.mh-drawer__lang { display: flex; margin: 20px 20px 0; }
.mh-drawer__lang .mh-lang-switch__option { flex: 1; height: 40px; }

/* ---------- Toast ---------- */

.mh-toast {
    position: fixed;
    inset-inline: 16px;
    bottom: 20px;
    z-index: 1090;
    max-width: 420px;
    margin-inline: auto;
    padding: 14px 20px;
    border-radius: var(--mh-radius);
    background: var(--mh-primary-900);
    color: var(--mh-white);
    font-family: var(--mh-font);
    font-weight: 600;
    text-align: center;
    box-shadow: var(--mh-shadow-lg);
    animation: mh-toast-in .3s var(--mh-ease);
}
.mh-toast.is-error { background: #9B1C31; }

@keyframes mh-toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .mh-header *, .mh-drawer, .mh-toast {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
