/* ════════════════════════════════════════════════════
   NAVBAR + SUBNAV + MEGA MENU — redesign mockup style
   Replaces .navbar* / .category-nav* legacy styles
   ════════════════════════════════════════════════════ */

:root {
    --nav-text: #18181B;
    --nav-text-muted: #71717A;
    --nav-text-faint: #A1A1AA;
    --nav-brand: #4DAAD5;
    --nav-bg-soft: #FAFAFA;
    --nav-border: #E5E7EB;
    --nav-border-soft: #F3F4F6;
    --nav-danger: #EF4444;
    --nav-r-sm: 8px;
    --nav-r-md: 12px;
    --nav-r-pill: 999px;
    --nav-shadow-sm: 0 1px 2px rgba(15,15,16,.04), 0 1px 3px rgba(15,15,16,.06);
    --nav-shadow-lg: 0 16px 48px rgba(15,15,16,.12);
    --nav-ease: cubic-bezier(.2,.7,.2,1);
    --nav-container: 1320px;
    --nav-gutter: 24px;
}

/* sr-only utility */
.nav-wrap .sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* ─── Sticky wrapper ─── */
.nav-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--nav-border-soft);
    transition: box-shadow .25s var(--nav-ease), background .25s var(--nav-ease);
}
.nav-wrap.is-scrolled {
    background: rgba(255,255,255,.98);
    box-shadow: var(--nav-shadow-sm);
}
.nav-wrap .container {
    max-width: var(--nav-container);
    padding-inline: var(--nav-gutter);
    margin-inline: auto;
}

/* ─── Top row: logo + search + lang + icons ─── */
.nav {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 0;
}
.nav__logo { flex-shrink: 0; line-height: 0; }
.nav__logo img { height: 56px; width: auto; display: block; }

/* ─── Search (pill with dark button) ─── */
.search {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 12px;
}
.search__wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    height: 44px;
    background: #fff;
    border: 1.5px solid var(--nav-text);
    border-radius: var(--nav-r-pill);
    overflow: hidden;
    transition: border-color .2s var(--nav-ease), box-shadow .2s var(--nav-ease);
}
.search__wrapper:focus-within {
    border-color: var(--nav-text);
    box-shadow: 0 0 0 3px rgba(15,15,16,.06);
}
.search__input {
    flex: 1;
    min-width: 0;
    padding: 0 22px;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 15px;
    color: var(--nav-text);
    font-family: inherit;
}
.search__hint {
    position: absolute;
    inset-inline-start: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nav-text-faint);
    font-size: 14.5px;
    pointer-events: none;
    transition: opacity .15s var(--nav-ease);
    font-weight: 500;
}
.search__wrapper:focus-within .search__hint,
.search__wrapper:has(input:not(:placeholder-shown)) .search__hint {
    opacity: 0;
}
.search__btn {
    flex-shrink: 0;
    width: 78px;
    background: var(--nav-text);
    color: #fff;
    display: grid;
    place-items: center;
    transition: background .2s var(--nav-ease);
    border-radius: var(--nav-r-pill);
    margin: 3px;
    border: 0;
    cursor: pointer;
    padding: 0;
}
.search__btn:hover { background: #000; }
.search__btn svg { width: 20px; height: 20px; display: block; }

/* ─── Language switcher (pill toggle) ─── */
.lang {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 3px;
    background: var(--nav-bg-soft);
    border: 1.5px solid var(--nav-border);
    border-radius: var(--nav-r-pill);
    gap: 0;
}
.lang__opt {
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nav-text-muted);
    border-radius: var(--nav-r-pill);
    transition: color .15s var(--nav-ease), background .15s var(--nav-ease);
    cursor: pointer;
    border: 0;
    line-height: 1;
    font-family: inherit;
    background: transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lang__opt:hover { color: var(--nav-text); }
.lang__opt--active { background: var(--nav-text); color: #fff; }
.lang__opt--active:hover { color: #fff; }

/* ─── Nav icons ─── */
.nav__icons {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.nav__icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--nav-r-sm);
    display: grid;
    place-items: center;
    color: var(--nav-text);
    transition: background .2s var(--nav-ease), color .2s var(--nav-ease);
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}
.nav__icon-btn:hover {
    background: var(--nav-bg-soft);
    color: var(--nav-brand);
}
.nav__icon-btn svg { width: 22px; height: 22px; display: block; }
.nav__icon-badge {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    background: var(--nav-brand);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #fff;
    line-height: 1;
}
.nav__hamburger { display: none; }

/* ════════════════════════════════════════════════════
   SUB-NAV (categories)
   ════════════════════════════════════════════════════ */
.subnav {
    background: #fff;
    border-bottom: 1px solid var(--nav-border-soft);
    position: relative;
}
.subnav .container {
    max-width: var(--nav-container);
    padding-inline: var(--nav-gutter);
    margin-inline: auto;
}
.subnav__list {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    padding: 6px 0;
    scrollbar-width: none;
    list-style: none;
    margin: 0;
}
.subnav__list::-webkit-scrollbar { display: none; }
.subnav__item {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--nav-text-muted);
    border-radius: var(--nav-r-pill);
    transition: background .2s var(--nav-ease), color .2s var(--nav-ease);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    background: transparent;
    border: 0;
    font-family: inherit;
}
.subnav__item:hover { background: var(--nav-bg-soft); color: var(--nav-text); }
.subnav__item--active,
.subnav__item--active:hover { background: var(--nav-text); color: #fff; }
.subnav__item--featured { color: var(--nav-danger); font-weight: 600; }
.subnav__item--featured::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--nav-danger);
    border-radius: 50%;
    margin-inline-end: 6px;
    animation: subnav-pulse 1.6s infinite;
}
.subnav__item svg.chev {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    transition: transform .2s var(--nav-ease);
}
.subnav__item.has-mega:hover svg.chev { transform: rotate(180deg); }
@keyframes subnav-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .5; transform: scale(1.4); }
}

/* ════════════════════════════════════════════════════
   MEGA MENU
   ════════════════════════════════════════════════════ */
.mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--nav-border-soft);
    box-shadow: var(--nav-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .22s var(--nav-ease), transform .22s var(--nav-ease), visibility .22s;
    z-index: 99;
}
.mega.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mega__inner {
    max-width: var(--nav-container);
    margin: 0 auto;
    padding: 32px var(--nav-gutter);
    display: grid;
    grid-template-columns: repeat(3, 1fr) 1.4fr;
    gap: 36px;
}
/* Stickers mega has 4 categorized columns + no feature card → 4 equal tracks. */
#m-stickers .mega__inner {
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

/* Slightly tighter row spacing in the new mega menu — keeps each column ≤ 3
   visual rows tall on desktop so the mega never feels like a wall of text. */
.mega__list { gap: 8px; }
.mega__list a { line-height: 1.4; }

/* The "הדפסות ומיוחדים" (m-prints) mega was removed 2026-07 — those categories
   earned ₪0 over 180 days and now live under עסקים / עיצוב אישי. Its rules are
   deleted rather than left as dead weight in every page's CSS. */
.mega__col--muted h4 {
    color: #99948a;
    font-size: 12px;
}
.mega__col--muted .mega__list a { color: #6a6a6f; font-size: 13.5px; }
.mega__list--small a { font-size: 12.5px; opacity: .8; }
.mega__list--small a:hover { opacity: 1; }
.mega__col h4 {
    font-size: 13px;
    font-weight: 800;
    color: var(--nav-text);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--nav-border-soft);
    margin-top: 0;
}
.mega__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mega__list a {
    font-size: 14px;
    color: var(--nav-text-muted);
    transition: color .15s var(--nav-ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.mega__list a:hover { color: var(--nav-brand); }
.mega__list a .count {
    font-size: 12px;
    color: var(--nav-text-faint);
}
.mega__feature {
    position: relative;
    border-radius: var(--nav-r-md);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: #ddd;
    display: block;
    text-decoration: none;
}
.mega__feature img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--nav-ease);
    display: block;
}
.mega__feature:hover img { transform: scale(1.05); }
.mega__feature::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,15,16,.7), transparent 55%);
}
.mega__feature-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: #fff;
    z-index: 1;
}
.mega__feature-tag {
    display: inline-block;
    background: var(--nav-brand);
    padding: 3px 10px;
    border-radius: var(--nav-r-pill);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 8px;
    color: #fff;
}
.mega__feature-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}
.mega__feature-sub {
    font-size: 12.5px;
    color: rgba(255,255,255,.85);
}

/* ────── Hide legacy site-header chrome that conflicts ────── */
.site-header > #masthead { /* no-op marker */ }
.site-header .navbar,
.site-header .category-nav {
    /* Old wrappers from previous version — content replaced; reset spacing */
    padding: 0;
    background: transparent;
}

/* ════════════════════════════════════════════════════
   SEARCH DROPDOWN — styled to match new design
   ════════════════════════════════════════════════════ */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--nav-border-soft);
    border-radius: var(--nav-r-md);
    box-shadow: var(--nav-shadow-lg);
    max-height: 540px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s var(--nav-ease), transform .2s var(--nav-ease), visibility .2s;
    z-index: 200;
}
.search:focus-within .search-dropdown,
.search-dropdown.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.search-dropdown__container {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    max-height: 540px;
}
.search-dropdown__column {
    padding: 18px 20px;
    overflow-y: auto;
}
.search-dropdown__column--suggestions {
    border-inline-end: 1px solid var(--nav-border-soft);
    background: var(--nav-bg-soft);
    max-height: 540px;
}
.search-dropdown__column--products {
    max-height: 540px;
}
.search-dropdown__heading {
    font-size: 11px;
    font-weight: 800;
    color: var(--nav-text-faint);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 12px;
}
.search-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.search-dropdown__item { margin: 0; }
.search-dropdown__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--nav-r-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--nav-text-muted);
    text-decoration: none;
    transition: background .15s var(--nav-ease), color .15s var(--nav-ease);
}
.search-dropdown__link:hover,
.search-dropdown__link.is-active {
    background: #fff;
    color: var(--nav-text);
    box-shadow: 0 1px 2px rgba(15,15,16,.04);
}
.search-dropdown__link .text-muted,
.search-dropdown__link .fs-7 {
    font-size: 11.5px;
    color: var(--nav-text-faint);
    font-weight: 400;
}

.search-dropdown__grid-wrapper { position: relative; }
.search-dropdown__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.search-result-card {
    display: block;
    border-radius: var(--nav-r-sm);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--nav-border-soft);
    text-decoration: none;
    transition: border-color .15s var(--nav-ease), transform .15s var(--nav-ease), box-shadow .15s var(--nav-ease);
}
.search-result-card:hover {
    border-color: var(--nav-border);
    box-shadow: var(--nav-shadow-sm);
    transform: translateY(-1px);
}
.search-result-card__image {
    aspect-ratio: 1 / 1;
    background: var(--nav-bg-soft);
    overflow: hidden;
}
.search-result-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.search-result-card__content {
    padding: 8px 10px 10px;
}
.search-result-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    color: var(--nav-text);
    line-height: 1.3;
    margin-bottom: 4px;
}
.search-result-card__type {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--nav-brand);
    font-variant-numeric: tabular-nums;
}
.search-result-card__type del {
    color: var(--nav-text-faint);
    font-weight: 400;
    margin-inline-end: 4px;
}

.search-dropdown__empty,
.search-dropdown__loading {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--nav-text-muted);
}
.search-dropdown__empty.d-none,
.search-dropdown__loading.d-none,
.search-dropdown__grid.d-none,
.search-dropdown__list.d-none { display: none !important; }

@media (max-width: 768px) {
    /* The dropdown previously inherited .search's narrow flex width (the
       form sits between logo + icons in a constrained flex row), so
       width:100% meant ~150px on a phone — the cards collapsed to tall
       vertical strips. Escape the .search container with position:fixed
       so the dropdown spans the full viewport width on mobile. */
    .search-dropdown {
        position: fixed !important;
        top: 64px !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-height: 75vh !important;
        overflow-y: auto !important;
        border-radius: 14px !important;
    }
    .search-dropdown__container {
        grid-template-columns: 1fr !important;
        max-height: none !important;
    }
    .search-dropdown__column { padding: 12px 14px !important; max-height: none !important; }
    .search-dropdown__column--suggestions {
        border-inline-end: 0;
        border-bottom: 1px solid var(--nav-border-soft);
        max-height: 160px !important;
    }
    .search-dropdown__heading { font-size: 11px; margin-bottom: 8px; }
    .search-dropdown__grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
    .search-result-card__title { font-size: 12px; -webkit-line-clamp: 2; }
    .search-result-card__content { padding: 6px 8px 8px; }
    .search-result-card__type { font-size: 11px; }
}

/* ────── Responsive: tablets ────── */
@media (max-width: 1199.98px) {
    .mega__inner {
        grid-template-columns: repeat(3, 1fr) 1.2fr;
        gap: 28px;
        padding: 24px var(--nav-gutter);
    }
    .mega__col:nth-child(4) { display: none; }
}

/* ────── Mobile ────── */
@media (max-width: 991.98px) {
    .nav { gap: 10px; padding: 10px 0; }
    .nav__logo img { height: 42px; }
    .search { margin: 0; }
    .search__wrapper { height: 44px; }
    .search__hint { display: none; }
    .search__input { padding: 0 14px; font-size: 14px; }
    .search__btn { width: 50px; }
    .search__btn svg { width: 16px; height: 16px; }
    .lang { display: none; } /* hidden on mobile */
    .nav__icon-btn { width: 38px; height: 38px; }
    .nav__icon-btn svg { width: 20px; height: 20px; }
    .nav__icon-btn[aria-label*="המשאלות"],
    .nav__icon-btn[aria-label*="wishlist"] { display: none; }
    .nav__hamburger { display: grid !important; }

    /* Mega menus disabled on mobile (use mobile drawer instead) */
    .mega { display: none; }
    .subnav__item.has-mega svg.chev { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE OFFCANVAS — fixes for the side menu drawer
   These overrides target the compiled dist `.offcanvas__*` rules
   without needing a rebuild.
   ════════════════════════════════════════════════════════════════ */

/* 1. Wider drawer — was capped at 320px so on a 414px phone there
      was ~94px of empty overlay on the left. Cap at 92vw with no
      pixel max so it hugs closer to the left edge. */
.offcanvas__content {
    width: 92vw !important;
    max-width: 420px !important;
}

/* 2. Force flex on visible panels even if older JS still sets
      `display: block` (the rebuilt bundle now sets `display: flex`,
      but this stays as a belt-and-braces guard against caching). */
.offcanvas__panel[style*="display: block"],
.offcanvas__panel[style*="display:block"] {
    display: flex !important;
    flex-direction: column !important;
}

/* 2b. THE bug fix. Some upstream rule was setting
   `.offcanvas__panel { display: flex }` with enough specificity to
   beat the JS-set inline `display: none`, so every panel was
   visible at once (only the active one was supposed to be) — the
   non-active ones rendered ON TOP of the active panel as a blank
   white box. Force display:none whenever the JS hides a panel. */
.offcanvas__panel[style*="display: none"],
.offcanvas__panel[style*="display:none"] {
    display: none !important;
}

/* 2c. THE actual root cause of the blank category panels.
   `.offcanvas__panels` had picked up `overflow: hidden` from somewhere
   in the cascade (couldn't trace it via grep — likely a normalize or
   a ::before/::after thing), AND the document RTL combined with
   flex-direction:row produced a row layout the JS's translateX(100%)
   couldn't move correctly. Two-line fix:
   - Force `overflow: visible` so child panels aren't clipped by their
     parent's tiny 100%-of-content width.
   - Force `direction: ltr` so the panels lay out LEFT to RIGHT in DOM
     order. The JS's existing `multiplier = isRtl ? 100 : -100` then
     does the right thing because, with the parent forced to LTR, the
     RTL branch never fires for this element. (See offcanvas-menu.ts
     update — the multiplier line is now `-100` unconditionally.) */
.offcanvas__panels {
    overflow: visible !important;
    direction: ltr !important;
}

/* 3. Make sure every link / list item in the drawer is dark text on
      light background. Belt-and-braces against any stray rule from
      WooCommerce / a plugin that puts `color: #fff` on generic `li`
      or `button` and bleeds in. */
.offcanvas .offcanvas__list,
.offcanvas .offcanvas__panel {
    background-color: #ffffff !important;
}
.offcanvas .offcanvas__link,
.offcanvas .offcanvas__list li,
.offcanvas .offcanvas__list button,
.offcanvas .offcanvas__list a,
.offcanvas .offcanvas__title {
    color: #191919 !important;
    background-color: transparent !important;
}
.offcanvas .offcanvas__link {
    display: flex !important;
    width: 100%;
    padding: 14px 18px !important;
    border-block-end: 1px solid #f3f4f6 !important;
    font-size: 15px;
    font-weight: 500;
    text-align: start;
    text-decoration: none;
    align-items: center;
    justify-content: space-between;
}
.offcanvas .offcanvas__link:hover,
.offcanvas .offcanvas__link:focus {
    background-color: #fafafa !important;
}
.offcanvas .offcanvas__chevron::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-top: 2px solid #191919;
    border-inline-start: 2px solid #191919;
    transform: rotate(-45deg);   /* RTL: chevron points to the LEFT */
}
.offcanvas .offcanvas__list {
    overflow-y: auto;
    flex: 1 1 auto;
}
.offcanvas .offcanvas__list li {
    list-style: none;
}

/* 2d. 1.11.2026 — blank sub-panels on the HOME page only ("sometimes it opens, sometimes not").
   mu-plugins/sd-critical-css-inline.php minified this file into the homepage <head> and turned the
   2b selector [style*="display: none"] into [style*="display:none"], which never matches the JS
   inline style "display: none;" — so hidden panels stayed in the flex row and the slide landed on
   an empty one. Match on the word only, which no minifier can change. */
.offcanvas .offcanvas__panel[style*="none"] {
    display: none !important;
}
