/**
 * Phase 6 — Glassmorphic sticky header + telecom topbar.
 */

/* Top urgent notice bar */
.ar-topbar {
  position: relative;
  z-index: 110;
  background: linear-gradient(90deg, #5C123B 0%, #A12273 42%, #C44A95 100%);
  color: #faf9fc;
  font-size: 0.8125rem;
  overflow: hidden;
}

.ar-topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.08) 45%, transparent 70%);
  background-size: 220% 100%;
  animation: ar-topbar-sheen 7s linear infinite;
  pointer-events: none;
}

.ar-topbar__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 2.25rem;
  padding-block: 0.4rem;
}

.ar-topbar__text {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  color: rgba(250, 249, 252, 0.92);
  line-height: 1.4;
}

.ar-topbar__text strong {
  color: #e8d48b;
  font-weight: 600;
}

.ar-topbar__phone {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  opacity: 0.92;
}

.ar-topbar__phone:hover {
  color: #e8d48b;
}

.ar-topbar__sep {
  opacity: 0.55;
}

.ar-topbar__pulse {
  display: inline-grid;
  place-items: center;
  color: #e8d48b;
  animation: ar-pulse-signal 1.8s ease-in-out infinite;
}

.ar-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #e8d48b;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.ar-topbar__link:hover,
.ar-topbar__link:focus-visible {
  color: #fff;
}

.ar-topbar__link .ar-icon--arrow {
  transform: scaleX(-1);
  transition: transform 0.35s var(--ar-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.ar-topbar__link:hover .ar-icon--arrow {
  transform: scaleX(-1) translateX(-3px);
}

/* Glass header
 * NOTE: backdrop-filter must NOT live on this element — it creates a containing
 * block that traps position:fixed mobile drawer inside the header bar.
 * Frost lives on ::before instead.
 */
.ar-header--glass {
  --ar-header-h: 4.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(161, 34, 115, 0.12);
  background: rgba(245, 243, 248, 0.72);
  transition:
    background 0.35s var(--ar-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow 0.35s var(--ar-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 0.35s var(--ar-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    z-index 0s;
}

.ar-header--glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(245, 243, 248, 0.35);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

/* Scrolled dark-glass look owned by nav-ecosystem.css (Phase 30.2) */

/* Keep bar chrome above frost; drawer uses its own stacking in nav-mobile.css */
.ar-header--glass > .ar-header__inner {
  position: relative;
  z-index: 2;
}

.ar-header--glass .ar-header__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  min-height: var(--ar-header-h);
  padding-block: 0.55rem;
}

.ar-header--glass .ar-brand--logo .custom-logo {
  height: 2.6rem;
  max-width: min(200px, 42vw);
  transition: transform 0.4s var(--ar-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.ar-header--glass .ar-brand:hover .custom-logo {
  transform: scale(1.03);
}

/* Navigation — open glass chips (breathing room + neon hover) */
.ar-header--glass .ar-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.ar-header--glass .ar-nav__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 100%;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.ar-header--glass .ar-nav__list > li {
  position: relative;
  flex: 0 0 auto;
}

.ar-header--glass .ar-nav__list > li > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.55rem 0.9rem;
  color: var(--ar-color-text, #2a0a3d);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(161, 34, 115, 0.1);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 6px 16px rgba(61, 13, 40, 0.05);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  transition:
    color 0.3s var(--ar-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    background 0.3s var(--ar-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 0.3s ease,
    box-shadow 0.35s ease,
    transform 0.3s var(--ar-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.ar-header--glass .ar-nav__list > li > a .ar-nav-ico {
  width: 16px;
  height: 16px;
}

.ar-header--glass .ar-nav__list > li > a::after {
  content: "";
  position: absolute;
  inset-inline: 0.95rem;
  bottom: 0.28rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #A12273, #A12273, #e8d48b);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.35s var(--ar-ease, cubic-bezier(0.22, 1, 0.36, 1));
  pointer-events: none;
}

.ar-header--glass .ar-nav__list > li > a:hover,
.ar-header--glass .ar-nav__list > li > a:focus-visible,
.ar-header--glass .ar-nav__list > .current-menu-item > a,
.ar-header--glass .ar-nav__list > .current-menu-ancestor > a {
  color: #A12273;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(250, 244, 248, 0.92)),
    radial-gradient(circle at 30% 20%, rgba(161, 34, 115, 0.14), transparent 55%);
  border-color: rgba(161, 34, 115, 0.32);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.75) inset,
    0 0 12px rgba(161, 34, 115, 0.18),
    0 8px 18px rgba(61, 13, 40, 0.08);
}

.ar-header--glass .ar-nav__list > li > a:hover::after,
.ar-header--glass .ar-nav__list > li > a:focus-visible::after,
.ar-header--glass .ar-nav__list > .current-menu-item > a::after,
.ar-header--glass .ar-nav__list > .current-menu-ancestor > a::after {
  transform: scaleX(1);
}

/* Looking Glass top-level pill removed in 5.2 — tool lives under خدمات mega. */

/* Desktop flyout — glass panel */
@media (min-width: 992px) {
  .ar-header--glass .ar-nav__list > li.menu-item-has-children > a::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    margin-inline-start: 0.05rem;
    border-inline-end: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.55;
    transition: transform 0.3s ease, opacity 0.3s ease;
    order: 2;
  }

  .ar-header--glass .ar-nav__list > li.menu-item-has-children:hover > a::before,
  .ar-header--glass .ar-nav__list > li.menu-item-has-children:focus-within > a::before,
  .ar-header--glass .ar-nav__list > li.menu-item-has-children.is-open > a::before {
    transform: rotate(225deg) translateY(-1px);
    opacity: 0.9;
  }

  .ar-header--glass .ar-nav__list > li > .sub-menu {
    position: absolute;
    top: 100%;
    inset-inline-end: 0;
    min-width: 13.5rem;
    margin: 0;
    padding: 0.7rem 0.45rem 0.45rem;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(161, 34, 115, 0.14);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.55) inset,
      0 18px 40px rgba(61, 13, 40, 0.14),
      0 0 24px rgba(161, 34, 115, 0.08);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(0.45rem) scale(0.98);
    transform-origin: top center;
    transition:
      opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1) 0.14s,
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1) 0.14s,
      visibility 0s linear 0.42s,
      pointer-events 0s linear 0.26s;
    z-index: 80;
  }

  .ar-header--glass .ar-nav__list > li > .sub-menu::before {
    content: "";
    position: absolute;
    top: -0.85rem;
    inset-inline: 0;
    height: 0.85rem;
  }

  .ar-header--glass .ar-nav__list > li:hover > .sub-menu,
  .ar-header--glass .ar-nav__list > li:focus-within > .sub-menu,
  .ar-header--glass .ar-nav__list > li.is-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
  }

  .ar-header--glass .ar-nav__list > li > .sub-menu a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    color: var(--ar-color-text, #2a0a3d);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
  }

  .ar-header--glass .ar-nav__list > li > .sub-menu a::before {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #A12273, #A12273);
    box-shadow: 0 0 0 3px rgba(161, 34, 115, 0.12);
    flex-shrink: 0;
  }

  .ar-header--glass .ar-nav__list > li > .sub-menu a:hover,
  .ar-header--glass .ar-nav__list > li > .sub-menu a:focus-visible {
    color: #A12273;
    background: rgba(161, 34, 115, 0.08);
    transform: translateX(-2px);
  }

  html[dir="ltr"] .ar-header--glass .ar-nav__list > li > .sub-menu a:hover,
  html[dir="ltr"] .ar-header--glass .ar-nav__list > li > .sub-menu a:focus-visible {
    transform: translateX(2px);
  }
}

/* Actions + CTA */
.ar-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ar-header__cta {
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.28);
}

/* Portal CTA — purple glass base, green neon hover; text forced white (beats a:hover logo pink) */
.ar-btn--portal {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 30px;
  padding: 0.55rem 1.05rem;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff !important;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(161, 34, 115, 0.88), rgba(161, 34, 115, 0.72));
  border: 1px solid rgba(232, 212, 139, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 8px 20px rgba(161, 34, 115, 0.28);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  text-decoration: none !important;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease,
    filter 0.3s ease;
}

.ar-btn--portal__glow {
  position: absolute;
  inset: -40%;
  z-index: 0;
  background:
    radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.22), transparent 42%),
    radial-gradient(circle at 72% 70%, rgba(161, 34, 115, 0.4), transparent 52%);
  opacity: 0.5;
  animation: ar-portal-glow-drift 4.5s ease-in-out infinite;
  pointer-events: none;
}

.ar-btn--portal .ar-icon,
.ar-btn--portal > span:not(.ar-btn--portal__glow) {
  position: relative;
  z-index: 1;
  color: #fff !important;
}

.ar-btn--portal .ar-icon--portal {
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.35));
}

.ar-icon--portal__ring {
  transform-origin: center;
  animation: ar-portal-ring-pulse 2.4s ease-in-out infinite;
}

.ar-icon--portal__core {
  transform-origin: center;
  animation: ar-portal-core-breathe 2s ease-in-out infinite;
}

.ar-btn--portal:hover,
.ar-btn--portal:focus-visible {
  color: #fff !important;
  transform: translateY(-2px) scale(1.02);
  background:
    linear-gradient(135deg, rgba(16, 120, 72, 0.78), rgba(34, 160, 100, 0.68));
  border-color: rgba(110, 231, 170, 0.75);
  filter: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 0 16px rgba(52, 211, 153, 0.55),
    0 0 32px rgba(16, 185, 129, 0.4),
    0 10px 24px rgba(6, 78, 59, 0.28);
  outline: none;
  text-decoration: none !important;
}

.ar-btn--portal:hover .ar-btn--portal__glow,
.ar-btn--portal:focus-visible .ar-btn--portal__glow {
  opacity: 0.9;
  animation-duration: 2.2s;
  background:
    radial-gradient(circle at 30% 30%, rgba(167, 243, 208, 0.45), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(52, 211, 153, 0.4), transparent 50%);
}

.ar-btn--portal:hover .ar-icon,
.ar-btn--portal:hover > span:not(.ar-btn--portal__glow),
.ar-btn--portal:focus-visible .ar-icon,
.ar-btn--portal:focus-visible > span:not(.ar-btn--portal__glow) {
  color: #fff !important;
}

.ar-btn--portal:hover .ar-icon--portal,
.ar-btn--portal:focus-visible .ar-icon--portal {
  animation: ar-portal-icon-lift 0.55s ease;
  filter: drop-shadow(0 0 10px rgba(167, 243, 208, 0.9));
}

.ar-header__portal {
  display: inline-flex;
}

/* Compact soft call chip — green hover */
.ar-header__call {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(161, 34, 115, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: #A12273;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(28, 21, 40, 0.06);
  transition:
    color 0.28s ease,
    background 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.ar-header__call-ico {
  width: 15px;
  height: 15px;
  display: block;
}

.ar-header__call:hover,
.ar-header__call:focus-visible {
  color: #fff;
  background: linear-gradient(145deg, #22c55e, #15803d);
  border-color: rgba(22, 163, 74, 0.45);
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    0 0 0 3px rgba(22, 163, 74, 0.12),
    0 8px 16px rgba(22, 163, 74, 0.28);
  outline: none;
}

.ar-header__cta .ar-icon--headset {
  animation: ar-icon-float 2.4s ease-in-out infinite;
}

.ar-header__agents .ar-icon--nodes {
  animation: ar-icon-spin-soft 6s linear infinite;
}

.ar-header__agents {
  display: none;
}

@media (max-width: 991px) {
  .ar-header--glass .ar-header__inner {
    position: relative;
    flex-wrap: nowrap;
  }

  .ar-header__cta {
    display: none;
  }

  .ar-header__actions {
    gap: 0.35rem;
  }

  /* Portal stays beside hamburger on mobile */
  .ar-header__portal {
    display: inline-flex;
    order: 2;
    padding: 0.42rem 0.7rem;
    font-size: 0.74rem;
    gap: 0.3rem;
    min-height: 2.4rem;
  }

  .ar-header__call {
    order: 1;
    width: 2.25rem;
    height: 2.25rem;
  }

  .ar-nav-toggle {
    order: 3;
  }

  .ar-search-trigger {
    order: 0;
  }

  .ar-topbar__text {
    font-size: 0.75rem;
  }
}

@media (max-width: 420px) {
  .ar-header__portal {
    padding: 0.42rem 0.55rem;
    font-size: 0.7rem;
  }

  .ar-header__portal .ar-header__portal-label {
    max-width: 5.6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (min-width: 992px) {
  .ar-header__agents {
    display: inline-flex;
  }

  .ar-header--glass .ar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
  }

  .ar-header--glass .ar-header__inner {
    gap: 0.65rem 1rem;
  }

  .ar-header--glass .ar-brand--logo .custom-logo {
    height: 2.5rem;
    max-width: min(180px, 20vw);
  }

  /* Home stays icon-chip only — clearer & saves a long label */
  .ar-header--glass .ar-nav__list > li > a .ar-nav-ico--home + .ar-nav__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .ar-header--glass .ar-nav__list > li > a:has(.ar-nav-ico--home) {
    padding-inline: 0.72rem;
  }
}

@media (min-width: 992px) and (max-width: 1180px) {
  .ar-header--glass .ar-nav__list {
    gap: 0.22rem;
  }

  .ar-header--glass .ar-nav__list > li > a {
    padding: 0.48rem 0.7rem;
    font-size: 0.82rem;
    gap: 0.35rem;
  }

  .ar-header--glass .ar-nav__list > li > a .ar-nav-ico {
    width: 15px;
    height: 15px;
  }

  .ar-header--glass .ar-header__portal .ar-header__portal-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .ar-header--glass .ar-header__portal {
    width: 2.65rem;
    height: 2.65rem;
    min-height: 2.65rem;
    padding: 0;
    border-radius: 50%;
  }
}

/* Shop CTA — separated from chips, neon hover */
.ar-header--glass .ar-nav__list > .ar-nav-shop-pill > a {
  border-radius: 30px;
  padding: 0.55rem 1.05rem;
  margin-inline-start: 0.35rem;
  font-size: 0.875rem;
  font-weight: 750;
  background: linear-gradient(135deg, #A12273, #A12273);
  color: #faf9fc !important;
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 8px 20px rgba(161, 34, 115, 0.28);
  white-space: nowrap;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.ar-header--glass .ar-nav__list > .ar-nav-shop-pill > a::after,
.ar-header--glass .ar-nav__list > .ar-nav-shop-pill > a::before {
  display: none !important;
}

.ar-header--glass .ar-nav__list > .ar-nav-shop-pill > a:hover,
.ar-header--glass .ar-nav__list > .ar-nav-shop-pill > a:focus-visible {
  color: #fff !important;
  filter: none;
  transform: translateY(-2px);
  background: linear-gradient(135deg, #8B1C62, #A12273);
  border-color: rgba(232, 212, 139, 0.65);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.28) inset,
    0 0 16px rgba(161, 34, 115, 0.45),
    0 12px 26px rgba(61, 13, 40, 0.28);
}

/* Icon motion */
@keyframes ar-pulse-signal {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes ar-topbar-sheen {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes ar-icon-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes ar-icon-spin-soft {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes ar-portal-glow-drift {
  0%,
  100% {
    transform: translate(-6%, -4%) rotate(0deg) scale(1);
  }
  50% {
    transform: translate(8%, 6%) rotate(12deg) scale(1.08);
  }
}

@keyframes ar-portal-ring-pulse {
  0%,
  100% {
    opacity: 0.75;
    stroke-width: 1.75;
  }
  50% {
    opacity: 1;
    stroke-width: 2.15;
  }
}

@keyframes ar-portal-core-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

@keyframes ar-portal-icon-lift {
  0% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-2px) scale(1.12);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ar-topbar::before,
  .ar-topbar__pulse,
  .ar-header__cta .ar-icon--headset,
  .ar-header__agents .ar-icon--nodes,
  .ar-btn--portal__glow,
  .ar-icon--portal__ring,
  .ar-icon--portal__core,
  .ar-btn--portal:hover .ar-icon--portal {
    animation: none !important;
  }

  .ar-btn--portal:hover,
  .ar-btn--portal:focus-visible {
    transform: none;
  }
}
