/* ArbiSEO Smart Header v1.2 — clean RTL-first header, no external assets */
.arb-smart-header {
  --arb-header-primary: var(--arb-primary, #3B3FE4);
  --arb-header-text: #1d1d2f;
  --arb-header-bg: #ffffff;
  --arb-header-border: rgba(32, 31, 68, .08);
  --arb-header-width: 1180px;
  --arb-header-height: 78px;
  --arb-logo-width: 142px;
  --arb-menu-gap: 6px;
  --arb-cta-bg: var(--arb-header-primary);
  --arb-cta-hover-bg: #2F33C8;
  --arb-cta-color: #fff;
  --arb-cta-radius: 8px;
  --arb-cta-height: 46px;
  --arb-cta-padding-x: 18px;
  width: 100%;
  direction: rtl;
  position: relative;
  z-index: 1000;
  isolation: isolate;
  background: var(--arb-header-bg);
  background: color-mix(in srgb, var(--arb-header-bg) 96%, transparent);
  border-bottom: 1px solid var(--arb-header-border);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  transition: box-shadow .24s ease, background-color .24s ease;
}

.arb-smart-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--arb-primary-rgb,59,63,228),.2), transparent);
  opacity: .55;
}

.arb-smart-header.is-sticky { position: sticky; top: 0; }
.admin-bar .arb-smart-header.is-sticky { top: 32px; }
.arb-smart-header.is-transparent { background: color-mix(in srgb, var(--arb-header-bg) 84%, transparent); }
.arb-smart-header.is-scrolled {
  background: color-mix(in srgb, var(--arb-header-bg) 98%, transparent);
  box-shadow: 0 12px 36px rgba(33, 29, 80, .09);
}

.arb-smart-header__inner {
  width: min(var(--arb-header-width), calc(100% - 36px));
  min-height: var(--arb-header-height);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) minmax(170px, auto);
  align-items: center;
  gap: clamp(18px, 2.2vw, 34px);
}

.arb-smart-header__brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  max-width: 210px;
  text-decoration: none !important;
}
.arb-smart-header__logo {
  width: var(--arb-logo-width);
  max-width: 100%;
  max-height: 54px;
  height: auto;
  object-fit: contain;
  display: block;
}
.arb-smart-header__textlogo { font-size: 24px; line-height: 1.2; font-weight: 900; color: var(--arb-header-text); }

.arb-smart-header__nav { min-width: 0; }
.arb-smart-menu,
.arb-smart-menu ul { list-style: none; margin: 0; padding: 0; }
.arb-smart-menu { display: flex; align-items: center; justify-content: center; gap: var(--arb-menu-gap); }
.arb-smart-menu > li { position: relative; }
.arb-smart-menu > li > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  color: var(--arb-header-text);
  font-size: 14.5px;
  line-height: 1.35;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color .18s ease;
}
.arb-smart-menu > li > a::after {
  content: "";
  position: absolute;
  inset-inline: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--arb-header-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease;
}
.arb-smart-menu > li > a:hover,
.arb-smart-menu > li.current-menu-item > a,
.arb-smart-menu > li.current-menu-ancestor > a { color: var(--arb-header-primary); }
.arb-smart-menu > li > a:hover::after,
.arb-smart-menu > li.current-menu-item > a::after,
.arb-smart-menu > li.current-menu-ancestor > a::after { transform: scaleX(1); }

.arb-smart-menu .menu-item-has-children > a { padding-inline-end: 23px; }
.arb-smart-menu .menu-item-has-children > a::before {
  content: "";
  position: absolute;
  inset-inline-end: 9px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-inline-end: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-68%) rotate(45deg);
  opacity: .62;
}

.arb-smart-menu .sub-menu {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 9px);
  width: 250px;
  padding: 10px;
  border: 1px solid rgba(32,31,68,.09);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 52px rgba(34,31,85,.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(7px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.arb-smart-menu .sub-menu::before {
  content: "";
  position: absolute;
  top: -5px;
  inset-inline-start: 24px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-inline-start: 1px solid rgba(32,31,68,.08);
  border-top: 1px solid rgba(32,31,68,.08);
  transform: rotate(45deg);
}
.arb-smart-menu li:hover > .sub-menu,
.arb-smart-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.arb-smart-menu .sub-menu li { position: relative; }
.arb-smart-menu .sub-menu a {
  display: flex;
  align-items: center;
  min-height: 43px;
  padding: 8px 11px;
  color: #303047;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.55;
  text-decoration: none !important;
  border-radius: 9px;
  transition: background-color .18s ease, color .18s ease, padding .18s ease;
}
.arb-smart-menu .sub-menu a:hover {
  color: var(--arb-header-primary);
  background: rgba(var(--arb-primary-rgb,59,63,228), .065);
  padding-inline-start: 15px;
}
.arb-smart-menu .sub-menu .sub-menu { top: -10px; inset-inline-start: calc(100% + 8px); }

.arb-smart-header__actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.arb-smart-header__cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--arb-cta-height);
  padding: 0 var(--arb-cta-padding-x);
  border: 1px solid rgba(32,31,68,.10);
  border: 1px solid color-mix(in srgb, var(--arb-cta-bg) 82%, #000 18%);
  border-radius: var(--arb-cta-radius);
  background: var(--arb-cta-bg);
  color: var(--arb-cta-color) !important;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(var(--arb-primary-rgb,59,63,228), .18);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.arb-smart-header__cta::before {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  inset-inline-start: -54px;
  top: -56px;
  border-radius: 50%;
  background: rgba(255,255,255,.17);
  transition: transform .28s ease;
}
.arb-smart-header__cta span,
.arb-smart-header__cta svg { position: relative; z-index: 1; }
.arb-smart-header__cta svg {
  width: 27px;
  height: 27px;
  padding: 6px;
  border-radius: 6px;
  background: rgba(255,255,255,.13);
  transform: scaleX(-1);
  transition: transform .18s ease, background-color .18s ease;
}
.arb-smart-header__cta:hover {
  transform: translateY(-1px);
  background: var(--arb-cta-hover-bg);
  box-shadow: 0 11px 24px rgba(var(--arb-primary-rgb,59,63,228), .24);
}
.arb-smart-header__cta:hover::before { transform: translate(22px, 22px) scale(1.35); }
.arb-smart-header__cta:hover svg { transform: scaleX(-1) translateX(2px); background: rgba(255,255,255,.19); }
.arb-smart-header__cta:focus-visible,
.arb-header-toggle:focus-visible,
.arb-smart-menu a:focus-visible { outline: 3px solid rgba(var(--arb-primary-rgb,59,63,228), .22); outline-offset: 3px; }

.arb-header-toggle {
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(32,31,68,.10);
  border-radius: 9px;
  background: #fff;
  color: var(--arb-header-text);
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(34,31,85,.06);
}
.arb-header-toggle span { width: 19px; height: 2px; border-radius: 4px; background: currentColor; transition: .2s ease; }
.arb-smart-header.is-menu-open .arb-header-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.arb-smart-header.is-menu-open .arb-header-toggle span:nth-child(2) { opacity: 0; }
.arb-smart-header.is-menu-open .arb-header-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.arb-menu-empty { display:block; text-align:center; font-size:14px; color:var(--arb-header-primary); }
.arb-submenu-toggle { display:none; }

@media (max-width: 1080px) {
  .arb-smart-header__inner { grid-template-columns: 1fr auto; min-height: 72px; gap: 12px; }
  .arb-smart-header__brand { justify-self: start; }
  .arb-smart-header__actions { grid-column: 2; }
  .arb-header-toggle { display: flex; }
  .arb-smart-header__nav {
    position: absolute;
    inset-inline: max(12px, calc((100% - min(var(--arb-header-width), calc(100% - 36px))) / 2));
    top: calc(100% + 9px);
    max-height: calc(100vh - 112px);
    overflow: auto;
    padding: 12px;
    border: 1px solid rgba(32,31,68,.09);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 62px rgba(34,31,85,.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-7px) scale(.99);
    transform-origin: top center;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }
  .arb-smart-header.is-menu-open .arb-smart-header__nav { opacity:1; visibility:visible; transform:none; }
  .arb-smart-menu { display: block; }
  .arb-smart-menu > li { border-bottom: 1px solid #f0f0f6; }
  .arb-smart-menu > li:last-child { border-bottom: 0; }
  .arb-smart-menu > li > a {
    width: calc(100% - 44px);
    min-height: 52px;
    padding-inline: 10px;
    font-size: 14.5px;
  }
  .arb-smart-menu > li > a::after,
  .arb-smart-menu .menu-item-has-children > a::before { display:none; }
  .arb-smart-menu .sub-menu,
  .arb-smart-menu .sub-menu .sub-menu {
    position: static;
    width: auto;
    padding: 0 10px 10px;
    border: 0;
    box-shadow: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  .arb-smart-menu .sub-menu::before { display:none; }
  .arb-smart-menu li.is-submenu-open > .sub-menu { display: block; }
  .arb-smart-menu .sub-menu a { min-height: 44px; background: #f8f8fc; margin-top: 5px; }
  .arb-submenu-toggle {
    display: inline-flex;
    position: absolute;
    top: 7px;
    inset-inline-end: 0;
    width: 40px;
    height: 40px;
    align-items:center;
    justify-content:center;
    border:0;
    border-radius:8px;
    background:rgba(var(--arb-primary-rgb,59,63,228),.055);
    color:var(--arb-header-primary);
    font-size:20px;
    cursor:pointer;
  }
}

@media (max-width: 640px) {
  .arb-smart-header { --arb-header-height: 68px; }
  .arb-smart-header__inner { width: min(100% - 20px, var(--arb-header-width)); gap: 9px; }
  .arb-smart-header__brand { max-width: 112px; }
  .arb-smart-header__logo { width: min(var(--arb-logo-width), 112px); max-height: 44px; }
  .arb-smart-header__actions { gap: 7px; }
  .arb-smart-header__cta {
    min-height: 40px;
    padding-inline: 11px;
    gap: 6px;
    border-radius: 7px;
    font-size: 12px;
  }
  .arb-smart-header__cta svg { width: 23px; height:23px; padding:5px; border-radius:5px; }
  .arb-header-toggle { width: 40px; height:40px; border-radius:8px; }
  .arb-smart-header__nav { inset-inline: 10px; border-radius:12px; }
}

@media (max-width: 390px) {
  .arb-smart-header__brand { max-width: 98px; }
  .arb-smart-header__logo { width: min(var(--arb-logo-width), 98px); }
  .arb-smart-header__cta { padding-inline: 9px; font-size: 12px; }
  .arb-smart-header__cta svg { display:none; }
}

@media (max-width: 782px) { .admin-bar .arb-smart-header.is-sticky { top: 46px; } }
@media (prefers-reduced-motion: reduce) {
  .arb-smart-header, .arb-smart-header *, .arb-smart-header *::before, .arb-smart-header *::after { transition: none !important; }
}
