/* ==========================================================================
   SITE HEADER + FOOTER (partials/_header.html, partials/_footer.html)
   White bar: brand mark, five section links, compact icon tools and the
   orange "أضف إعلانك" button. Footer: one row with brand, copyright, links.
   Loaded on every page after style.css / yojad-header.css.
   ========================================================================== */

:root {
    --sh-bg: #ffffff;
    --sh-ink: #0f172a;
    --sh-text: #334155;
    --sh-muted: #64748b;
    --sh-line: #e2e8f0;
    --sh-chip: #f1f5f9;
    --sh-accent: #ff6001;
    --sh-accent-hover: #e65600;
    --sh-accent-text: #d14f00;
    --sh-brand: #4b315e;
}
[data-theme='dark'] {
    --sh-bg: #1a171f;
    --sh-ink: #f1f5f9;
    --sh-text: #cbd5e1;
    --sh-muted: #94a3b8;
    --sh-line: #2f2b36;
    --sh-chip: #2a2631;
    --sh-accent-text: #ff8c42;
}

/* ---- Bar ---- */
.sh {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1040;
    padding: 0 !important;            /* main.js sets inline padding on scroll */
    background: var(--sh-bg);
    border-bottom: 1px solid var(--sh-line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06) !important;
    font-family: 'Cairo', sans-serif;
}
.sh-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 68px;
}

/* ---- Brand (logo image; light/dark artwork swaps with the theme) ---- */
.sh-brand { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.sh-logo { display: block; width: auto; object-fit: contain; }
.sh-brand .sh-logo { height: 46px; max-width: 200px; }
.sh-logo--dark { display: none; }
[data-theme='dark'] .sh-logo--light { display: none; }
[data-theme='dark'] .sh-logo--dark { display: block; }

/* ---- Section links (Redesigned Pill Track — Horizontally Scrollable on Desktop) ---- */
.sh-nav {
    display: none;
    align-items: center;
    gap: .24rem;
    padding: .28rem .35rem;
    border-radius: 14px;
    background: var(--sh-chip);
    border: 1px solid var(--sh-line);
    font-size: .82rem;
    font-weight: 700;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    cursor: grab;
    user-select: none;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color .2s ease;
}
.sh-nav:hover {
    scrollbar-color: rgba(100, 116, 139, .35) transparent;
}
.sh-nav.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}
.sh-nav.is-dragging .sh-nav-link {
    pointer-events: none;
}
.sh-nav::-webkit-scrollbar {
    height: 3px;
}
.sh-nav::-webkit-scrollbar-track {
    background: transparent;
    margin: 0 8px;
}
.sh-nav::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
}
.sh-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, .38);
}
.sh-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: .38rem;
    padding: .42rem .72rem;
    border-radius: 10px;
    color: var(--sh-text);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.sh-nav-icon {
    font-size: .76rem;
    color: var(--sh-muted);
    opacity: .85;
    transition: color .2s ease, transform .2s ease, opacity .2s ease;
}
.sh-nav-link:hover {
    background: var(--sh-bg);
    color: var(--sh-ink);
    box-shadow: 0 2px 6px -2px rgba(15, 23, 42, .08);
}
.sh-nav-link:hover .sh-nav-icon {
    color: var(--sh-accent);
    opacity: 1;
    transform: translateY(-1px);
}
.sh-nav-link.is-active {
    background: var(--sh-bg);
    color: var(--sh-accent-text);
    font-weight: 800;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .12), 0 0 0 1px rgba(255, 96, 1, .2);
}
.sh-nav-link.is-active .sh-nav-icon {
    color: var(--sh-accent);
    opacity: 1;
}
.sh-nav-link--store .sh-nav-icon {
    color: #7c3aed;
}
.sh-nav-link--store.is-active {
    color: #6d28d9;
    box-shadow: 0 2px 8px -2px rgba(124, 58, 237, .22), 0 0 0 1px rgba(124, 58, 237, .28);
}
[data-theme='dark'] .sh-nav-link--store.is-active {
    color: #c4b5fd;
}
.sh-nav-link--store.is-active .sh-nav-icon {
    color: #7c3aed;
}
@media (min-width: 992px) { .sh-nav { display: flex; } }

/* ---- Actions (Redesigned Utility Cluster & CTA) ---- */
.sh-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-shrink: 0;
}
.sh-tools-group {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .22rem;
    border-radius: 12px;
    background: var(--sh-chip);
    border: 1px solid var(--sh-line);
}
.sh-divider {
    width: 1px;
    height: 24px;
    background: var(--sh-line);
    margin: 0 .1rem;
    flex-shrink: 0;
}
.sh-desktop { display: none !important; }
@media (min-width: 992px) { .sh-desktop { display: inline-flex !important; } }

.sh-icon {
    position: relative;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--sh-text);
    font-size: .88rem;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.sh-icon:hover,
.sh-icon[aria-expanded='true'] {
    background: var(--sh-bg);
    color: var(--sh-accent-text);
    box-shadow: 0 2px 6px -2px rgba(15, 23, 42, .1);
}
.sh-icon--text,
.sh-icon--pill {
    width: auto;
    min-width: 36px;
    padding: 0 .55rem;
    gap: .32rem;
    font-size: .76rem;
    font-weight: 800;
}
.sh-icon--pill .current-country {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.sh-flag-svg {
    display: block;
    width: 22px;
    height: 16px;
    border-radius: 3.5px;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .12), 0 1px 2px rgba(15, 23, 42, .08);
    flex-shrink: 0;
}
[data-theme='dark'] .sh-flag-svg {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 1px 3px rgba(0, 0, 0, .35);
}
.sh-icon--pill .current-country .sh-flag-svg {
    width: 22px;
    height: 16px;
    border-radius: 3.5px;
}
.sh-pill-code {
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: var(--sh-ink);
}
.sh-caret {
    font-size: .58rem;
    color: var(--sh-muted);
    transition: transform .2s ease;
}
.sh-icon[aria-expanded='true'] .sh-caret {
    transform: rotate(180deg);
}
.sh-globe-icon {
    font-size: .78rem;
    color: var(--sh-brand);
}
[data-theme='dark'] .sh-globe-icon {
    color: #c4b5fd;
}
.sh-icon.dropdown-toggle::after { display: none; }

/* Header Dropdown Menus (Country & Language) */
.sh .sh-dropdown-menu {
    min-width: 185px;
    padding: .4rem;
    border-radius: 14px;
    border: 1px solid var(--sh-line);
    background: var(--sh-bg);
    box-shadow: 0 18px 38px -12px rgba(15, 23, 42, .22);
}
.sh .sh-dropdown-title {
    padding: .35rem .65rem .45rem;
    font-size: .72rem;
    font-weight: 800;
    color: var(--sh-muted);
    border-bottom: 1px dashed var(--sh-line);
    margin-bottom: .3rem;
}
.sh .sh-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .48rem .7rem;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--sh-text);
    transition: background-color .15s ease, color .15s ease;
}
.sh .sh-dropdown-menu .dropdown-item:hover {
    background: var(--sh-chip);
    color: var(--sh-ink);
}
.sh .sh-dropdown-menu .dropdown-item.active {
    background: rgba(255, 96, 1, .1);
    color: var(--sh-accent-text);
    font-weight: 800;
}
.sh .country-flag,
.country-flag-large,
.country-flag-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}
.country-flag-large .sh-flag-svg {
    width: 24px;
    height: 17px;
}
.sh .country-name {
    flex: 1;
}
.sh .country-check {
    color: var(--sh-accent);
    font-size: .75rem;
}

.sh-badge {
    position: absolute;
    top: 1px;
    inset-inline-end: -1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--sh-bg);
    border-radius: 999px;
    background: var(--sh-accent);
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    line-height: 13px;
    text-align: center;
}
.sh .header-theme-toggle .theme-icon-light { color: #f59e0b; }
.sh .header-theme-toggle .theme-icon-dark { display: none; color: #a78bfa; }
[data-theme='dark'] .sh .header-theme-toggle .theme-icon-light { display: none; }
[data-theme='dark'] .sh .header-theme-toggle .theme-icon-dark { display: inline; }

.sh-avatar {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: .1rem;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, .8);
    border-radius: 11px;
    background: linear-gradient(135deg, #6d28d9, var(--sh-brand));
    color: #fff;
    font-size: .85rem;
    font-weight: 900;
    box-shadow: 0 4px 10px -3px rgba(75, 49, 94, .35);
    transition: transform .2s ease, box-shadow .2s ease;
}
.sh-avatar:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, .22);
}

.sh-login {
    display: none;
    align-items: center;
    gap: .4rem;
    padding: .46rem .85rem;
    border-radius: 10px;
    border: 1px solid var(--sh-line);
    background: var(--sh-bg);
    color: var(--sh-ink);
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s ease;
}
.sh-login i {
    color: var(--sh-brand);
    font-size: .8rem;
}
[data-theme='dark'] .sh-login i {
    color: #c4b5fd;
}
.sh-login:hover {
    border-color: var(--sh-accent);
    color: var(--sh-accent-text);
    background: rgba(255, 96, 1, .04);
    transform: translateY(-1px);
}
.sh-login:hover i {
    color: var(--sh-accent);
}
@media (min-width: 576px) { .sh-login { display: inline-flex; } }

/* أضف إعلانك — quick-add trigger restyled as the orange header button */
.sh-cta-wrap { display: none; }
@media (min-width: 768px) { .sh-cta-wrap { display: block; } }
.sh .sh-cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .52rem 1.05rem;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #ff6a00 0%, #e04f00 100%);
    color: #fff;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 6px 16px -6px rgba(255, 96, 1, .65), 0 0 0 1px rgba(255, 255, 255, .15) inset;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.sh .sh-cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 10px 20px -6px rgba(255, 96, 1, .8);
    color: #fff;
}
.sh .sh-cta .quick-add-trigger-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, .95);
    color: var(--sh-accent);
    font-size: .62rem;
    transition: transform .25s ease;
}
.sh .sh-cta:hover .quick-add-trigger-icon {
    transform: rotate(90deg);
}

/* Hamburger (mobile / tablet): soft chip with staggered bars that morph into an X.
   !important throughout: legacy .hamburger rules in mobile-fixes.css use it too. */
.sh .sh-burger {
    position: relative;
    width: 42px !important;
    height: 42px !important;
    display: inline-flex;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 0 11px !important;
    margin: 0 !important;
    margin-inline-start: .15rem !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--sh-chip) !important;
    transform: none !important;
    transition: background-color .2s ease, box-shadow .2s ease;
}
.sh .sh-burger:hover { background: rgba(255, 96, 1, .1) !important; }
.sh .sh-burger:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 96, 1, .3); }
.sh .sh-burger span {
    display: block !important;
    height: 2.5px !important;
    min-height: 2.5px !important;
    margin: 0 !important;
    border-radius: 3px !important;
    background: var(--sh-ink) !important;
    box-shadow: none !important;
    transform: none;
    transition: transform .3s cubic-bezier(.65, 0, .35, 1), opacity .2s ease, width .3s ease, background-color .2s ease !important;
}
.sh .sh-burger span:nth-child(1) { width: 20px !important; }
.sh .sh-burger span:nth-child(2) { width: 13px !important; }
.sh .sh-burger span:nth-child(3) { width: 17px !important; }
.sh .sh-burger:hover span { width: 20px !important; background: var(--sh-accent-text) !important; }
.sh .sh-burger.active { background: var(--sh-accent) !important; }
.sh .sh-burger.active span { width: 20px !important; background: #fff !important; }
.sh .sh-burger.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg) !important; }
.sh .sh-burger.active span:nth-child(2) { opacity: 0 !important; transform: scaleX(0) !important; }
.sh .sh-burger.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg) !important; }
@media (min-width: 1200px) { .sh .sh-burger { display: none; } }

/* Dropdowns opened from the bar */
.sh .dropdown-menu {
    margin-top: .5rem !important;
    border: 1px solid var(--sh-line);
    border-radius: 12px;
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, .25);
    font-size: .85rem;
}
.sh .notif-dropdown { width: min(360px, calc(100vw - 24px)); }
.sh .header-user-section .dropdown-menu { max-height: calc(100vh - 90px); overflow-y: auto; min-width: 250px; }

/* Small screens: compact brand */
@media (max-width: 575.98px) {
    .sh-row { min-height: 60px; gap: .5rem; }
    .sh-brand .sh-logo { height: 36px; max-width: 140px; }
    .sh-icon { width: 34px; height: 34px; }
    .sh-actions { gap: .15rem; }
}

/* ---- Search bar under the header ---- */
.sh-search {
    display: none;
    position: fixed;
    top: var(--fixed-header-height, 68px);
    right: 0;
    left: 0;
    z-index: 1039;
    padding: .75rem 0;
    background: var(--sh-bg);
    border-bottom: 1px solid var(--sh-line);
    box-shadow: 0 10px 24px -14px rgba(15, 23, 42, .3);
}
.sh-search.is-open { display: block; }
.sh-search-form {
    display: flex;
    align-items: center;
    gap: .6rem;
    max-width: 720px;
    margin: 0 auto;
    padding: .35rem .35rem .35rem .9rem;
    border-radius: 12px;
    background: var(--sh-chip);
}
[dir='rtl'] .sh-search-form { padding: .35rem .9rem .35rem .35rem; }
.sh-search-form i { color: var(--sh-muted); }
.sh-search-form input { flex: 1; min-width: 0; height: 38px; border: 0; outline: 0; background: transparent; color: var(--sh-ink); font-size: .9rem; }
.sh-search-form button {
    padding: 0 1.2rem;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: var(--sh-accent);
    color: #fff;
    font-size: .85rem;
    font-weight: 800;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
/* Restored compact footer (base layout in style.css) re-coloured to match the
   header: same background, border, text and accent tokens, so the header's
   light/dark logo artwork works here too. */
footer.ft {
    background: var(--sh-bg);
    border-top: 1px solid var(--sh-line);
    color: var(--sh-text);
}
[data-theme='dark'] footer.ft,
[data-bs-theme='dark'] footer.ft { background: var(--sh-bg); }
footer.ft .ft-logo { height: 46px; max-width: 200px; object-fit: contain; }
footer.ft .sh-logo--dark { display: none; }
[data-theme='dark'] footer.ft .sh-logo--light { display: none; }
[data-theme='dark'] footer.ft .sh-logo--dark { display: block; }
footer.ft .ft-desc,
footer.ft .ft-desc p { color: var(--sh-muted) !important; }
footer.ft .ft-nl-label { color: var(--sh-ink); }
footer.ft .ft-nl-input {
    border-color: var(--sh-line);
    background: var(--sh-chip);
    color: var(--sh-ink);
}
footer.ft .ft-nl-input::placeholder { color: var(--sh-muted); }
footer.ft .ft-nl-input:focus { border-color: var(--sh-accent); }
footer.ft .ft-nl-btn { background: var(--sh-accent); }
footer.ft .ft-nl-btn:hover { background: var(--sh-accent-hover); }
footer.ft .ft-links,
footer.ft .ft-bottom { border-top-color: var(--sh-line); }
footer.ft .ft-links a { color: var(--sh-text); }
footer.ft .ft-links a:hover { color: var(--sh-accent-text); }
footer.ft .ft-copy { color: var(--sh-muted); }
footer.ft .ft-social { background: var(--sh-chip); color: var(--sh-text); }
footer.ft .ft-social:hover { background: var(--sh-accent); color: #fff; }
footer.ft .ft-social--wa:hover { background: #25d366; }
footer.ft .ft-pay-icon { color: var(--sh-muted); }
footer.ft .ft-paymob-logo { filter: grayscale(1); opacity: .7; }
[data-theme='dark'] footer.ft .ft-paymob-logo { filter: brightness(0) invert(1); }

/* ==========================================================================
   PAGE LOADER (partials/_pre_loader.html) — overrides the old ring loader
   ========================================================================== */
#preloader.pl {
    background: var(--sh-bg);
    flex-direction: column;
}
.pl-box { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; padding: 1rem; }
.pl .pl-logo { height: 64px; max-width: min(260px, 70vw); animation: pl-breathe 1.8s ease-in-out infinite; }
.pl-bar {
    position: relative;
    width: 180px;
    height: 4px;
    border-radius: 999px;
    background: var(--sh-chip);
    overflow: hidden;
}
.pl-bar span {
    position: absolute;
    inset-block: 0;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--sh-accent), #ff8c42);
    animation: pl-slide 1.1s cubic-bezier(.4, 0, .2, 1) infinite;
}
.pl-tag { margin: 0; color: var(--sh-muted); font-family: 'Cairo', sans-serif; font-size: .8rem; font-weight: 600; text-align: center; }
@keyframes pl-slide {
    0%   { inset-inline-start: -40%; }
    100% { inset-inline-start: 100%; }
}
@keyframes pl-breathe {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .85; transform: scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
    .pl .pl-logo, .pl-bar span { animation: none; }
    .pl-bar span { inset-inline-start: 0; width: 100%; }
}

/* ==========================================================================
   MOBILE: no sideways panning
   `overflow-x: hidden` on <body> alone doesn't stop Android Chrome from
   widening the viewport to reach off-screen fixed elements (the closed
   drawer below), which shifts the whole page sideways. `clip` on both html
   and body stops it without turning <body> into a scroll container (that
   would break sticky elements and window scroll listeners).
   ========================================================================== */
@supports (overflow: clip) {
    html,
    body { overflow-x: clip !important; }
}

/* Closed off-canvas drawer: take it out of rendering entirely (hidden after
   the slide-out transition finishes, visible immediately when opening). */
.mobile-nav {
    visibility: hidden;
    transition: transform .4s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .4s !important;
}
.mobile-nav.active {
    visibility: visible;
    transition: transform .4s cubic-bezier(.4, 0, .2, 1), visibility 0s linear 0s !important;
}
