/* Hebrew top bar — shared by native, Puck and mirrored pages (markup: src/lib/topbar.ts +
   SiteHeader.tsx). Everything is scoped under .anb-topbar and written with enough specificity
   to beat the mirrors' Elementor kit rules (e.g. `.elementor-kit-5 a:hover`). */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@300;400;700;900&display=swap');

.anb-topbar {
  --tb-navy: #15303e; --tb-cream: #f7f2ee; --tb-terracotta: #b76a50;
  position: sticky; top: 0; z-index: 60;
  background: var(--tb-cream); border-bottom: 2px solid var(--tb-navy);
  font-family: 'Noto Sans Hebrew', 'Heebo', Arial, sans-serif; color: var(--tb-navy);
  direction: rtl; -webkit-font-smoothing: antialiased; margin: 0;
}
.anb-topbar *, .anb-topbar *::before, .anb-topbar *::after { box-sizing: border-box; }
.anb-topbar a { text-decoration: none; }
.anb-topbar a:focus-visible, .anb-topbar label:focus-visible { outline: 2px solid var(--tb-terracotta); outline-offset: 2px; }

.anb-topbar .anb-topbar__inner {
  max-width: 1320px; margin: 0 auto; padding: 18px clamp(20px, 5vw, 72px);
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: nowrap;
}

/* logo: thin ״ד״ר״ above the bold name, short terracotta line under it, aligned right */
.anb-topbar .anb-topbar__logo { display: inline-flex; flex-direction: column; align-items: flex-start; color: var(--tb-navy); white-space: nowrap; flex: none; }
.anb-topbar .anb-topbar__logo-title { font-size: 14px; font-weight: 300; line-height: 1.1; }
.anb-topbar .anb-topbar__logo-name { font-size: 24px; font-weight: 900; line-height: 1.05; }
.anb-topbar .anb-topbar__logo-line { width: 34%; height: 3px; border-radius: 2px; background: var(--tb-terracotta); margin-top: 6px; }

/* nav */
.anb-topbar .anb-topbar__nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); flex-wrap: nowrap; justify-content: flex-end; margin-inline-start: auto; }
.anb-topbar .anb-topbar__link {
  display: flex; flex-direction: column; gap: 4px; white-space: nowrap;
  font-size: 17px; font-weight: 400; line-height: 1.5; color: var(--tb-navy);
}
.anb-topbar .anb-topbar__link::after { content: ""; height: 3px; border-radius: 2px; background: var(--tb-terracotta); opacity: 0; transition: opacity .3s; }
.anb-topbar .anb-topbar__link:hover, .anb-topbar .anb-topbar__link:focus { color: var(--tb-navy); }
.anb-topbar .anb-topbar__link:hover::after, .anb-topbar .anb-topbar__link[aria-current="page"]::after { opacity: 1; }
.anb-topbar .anb-topbar__link--flagship { font-weight: 700; }

/* יצירת קשר: outline button */
.anb-topbar .anb-topbar__contact {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 24px; white-space: nowrap;
  border: 1.5px solid var(--tb-navy); border-radius: 30px; background: transparent;
  font-size: 17px; font-weight: 700; color: var(--tb-navy); transition: background .3s, color .3s;
}
.anb-topbar .anb-topbar__contact:hover, .anb-topbar .anb-topbar__contact[aria-current="page"] { background: var(--tb-navy); color: var(--tb-cream); }

/* account (+ cart while it has items): outlined circles at the left edge */
.anb-topbar .anb-topbar__actions { display: flex; align-items: center; gap: 10px; flex: none; }
.anb-topbar .anb-topbar__circle {
  position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1.5px solid var(--tb-navy); border-radius: 50%;
  color: var(--tb-navy); background: transparent; transition: background .3s, color .3s, transform .3s;
}
.anb-topbar .anb-topbar__circle:hover { background: var(--tb-navy); color: var(--tb-cream); transform: translateY(-2px); }
.anb-topbar .anb-topbar__circle svg { width: 22px; height: 22px; display: block; }
/* the cart circle appears only once something is in the cart (cart-bridge.js sets data-counter) */
.anb-topbar .anb-topbar__cart:has(.cart-count[data-counter="0"]) { display: none; }
.anb-topbar .anb-topbar__cart .cart-count { top: -4px !important; left: -4px !important; }

/* the account circle is a pill with words beside the icon: 'החשבון שלי' signed out, the first
   name signed in (filled navy then, so a returning customer sees at a glance they're in) */
.anb-topbar .anb-topbar__acct.is-in .anb-topbar__account { background: var(--tb-navy); color: var(--tb-cream); }
.anb-topbar .anb-topbar__account.has-name {
  width: auto; gap: 7px; padding-inline-start: 10px; padding-inline-end: 16px; border-radius: 999px;
}
.anb-topbar .anb-topbar__acct-name {
  max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 15px; font-weight: 500; line-height: 1;
}

/* signed-in account menu (לחשבון שלי / התנתקות) — .is-in set by SiteHeader / cart-bridge.js.
   Opens on click (.is-open), and on hover where there is a mouse. padding-top bridges the gap. */
.anb-topbar .anb-topbar__acct { position: relative; flex: none; }
.anb-topbar .anb-topbar__menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 5; padding-top: 10px; min-width: 180px;
}
.anb-topbar .anb-topbar__acct.is-in.is-open .anb-topbar__menu { display: block; }
@media (hover: hover) {
  .anb-topbar .anb-topbar__acct.is-in:hover .anb-topbar__menu,
  .anb-topbar .anb-topbar__acct.is-in:focus-within .anb-topbar__menu { display: block; }
}
.anb-topbar .anb-topbar__panel {
  overflow: hidden; padding: 6px 0;
  background: #fff; border: 1.5px solid var(--tb-navy); border-radius: 16px; box-shadow: 0 14px 34px rgba(21, 48, 62, .14);
}
.anb-topbar .anb-topbar__panel form { margin: 0; border-top: 1px solid rgba(21, 48, 62, .12); }
.anb-topbar .anb-topbar__menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 18px; margin: 0; border: 0; background: none; border-radius: 0;
  font: inherit; font-size: 16px; font-weight: 400; line-height: 1.3; text-align: right; color: var(--tb-navy); cursor: pointer;
  transition: background .2s, color .2s;
}
.anb-topbar .anb-topbar__menu-item svg { width: 19px; height: 19px; flex: none; color: var(--tb-terracotta); }
.anb-topbar .anb-topbar__menu-item:hover, .anb-topbar .anb-topbar__menu-item:focus-visible { background: var(--tb-cream); color: var(--tb-terracotta); }
.anb-topbar .anb-topbar__menu-item:focus-visible { outline: 2px solid var(--tb-terracotta); outline-offset: -2px; }

/* mobile menu (CSS-only checkbox toggle) */
.anb-topbar .anb-topbar__toggle { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.anb-topbar .anb-topbar__burger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 44px; height: 44px; cursor: pointer; margin: 0; }
.anb-topbar .anb-topbar__burger span[aria-hidden] { display: block; width: 24px; height: 2px; border-radius: 2px; background: var(--tb-navy); }
.anb-topbar .anb-topbar__toggle:focus-visible ~ .anb-topbar__inner .anb-topbar__burger { outline: 2px solid var(--tb-terracotta); outline-offset: 2px; }
.anb-topbar .anb-topbar__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1100px) {
  .anb-topbar .anb-topbar__inner { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .anb-topbar .anb-topbar__actions { margin-inline-start: auto; order: 2; }
  .anb-topbar .anb-topbar__burger { display: flex; order: 3; }
  .anb-topbar .anb-topbar__nav {
    order: 4; flex-basis: 100%; display: none; flex-direction: column; align-items: stretch;
    gap: 0; margin: 0; padding: 4px 0 8px;
  }
  .anb-topbar .anb-topbar__toggle:checked ~ .anb-topbar__inner .anb-topbar__nav { display: flex; }
  .anb-topbar .anb-topbar__link { flex-direction: row; padding: 12px 4px; border-bottom: 1px solid rgba(21, 48, 62, .12); }
  .anb-topbar .anb-topbar__link::after { display: none; }
  .anb-topbar .anb-topbar__link[aria-current="page"] { color: var(--tb-terracotta); }
  .anb-topbar .anb-topbar__contact { justify-content: center; margin-top: 14px; }
}
/* narrow phones: logo + pill + burger (+ cart) must share ~330px */
@media (max-width: 420px) {
  .anb-topbar .anb-topbar__inner { gap: 8px; }
  .anb-topbar .anb-topbar__actions { gap: 6px; }
  .anb-topbar .anb-topbar__circle { width: 40px; height: 40px; }
  .anb-topbar .anb-topbar__circle svg { width: 20px; height: 20px; }
  .anb-topbar .anb-topbar__account.has-name { gap: 4px; padding-inline-start: 8px; padding-inline-end: 10px; }
  .anb-topbar .anb-topbar__acct-name { font-size: 14px; max-width: 6em; }
  .anb-topbar .anb-topbar__burger { width: 34px; }
  .anb-topbar .anb-topbar__logo-name { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) { .anb-topbar * { transition: none !important; } }

/* Mirrors: Elementor sets overflow-x:hidden on BOTH html and body, which turns body into its own
   scroll container and silently disables position:sticky. `clip` clips the same way without
   creating a scroll container. Landing pages that only gained the bar (no header of their own)
   keep their sticky section nav instead, so the bar scrolls away there. */
html:has(.anb-topbar--mirror), html:has(.anb-topbar--mirror) > body { overflow-x: clip !important; overflow-y: visible !important; }
.anb-topbar.anb-topbar--landing { position: relative; }
