/* الهيدر — شريط علوي + ناف زجاجي */
#header-placeholder {
  position: sticky;
  top: 0;
  z-index: 900;
}

.q-topbar {
  position: relative;
  height: var(--q-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--q-space-md);
  padding-inline: max(1rem, 4vw);
  font-size: 0.78rem;
  color: var(--q-text-muted);
  background: linear-gradient(180deg, rgba(28, 25, 23, 0.97) 0%, rgba(12, 10, 9, 0.94) 100%);
  border-bottom: 1px solid var(--q-border);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.q-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(244, 63, 94, 0.15) 20%,
    rgba(245, 158, 11, 0.35) 50%,
    rgba(244, 63, 94, 0.15) 80%,
    transparent
  );
  background-size: 220% 100%;
  animation: q-topbar-line 10s linear infinite;
  opacity: 0.85;
  pointer-events: none;
}

@keyframes q-topbar-line {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 220% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .q-topbar::after {
    animation: none;
    background-position: 50% 0;
  }
}

.q-topbar__group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* شريحة موحّدة: سوشيال + هاتف + بريد */
.q-topbar a.q-topbar-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 28px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: #f1f5f9;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  background: linear-gradient(145deg, #7f1d1d 0%, #431407 52%, #1c1917 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 2px 10px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    filter 0.25s ease;
  animation: q-topbar-chip-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.q-topbar__group--social .q-topbar-chip:nth-child(1) {
  animation-delay: 0.06s;
}

.q-topbar__group--social .q-topbar-chip:nth-child(2) {
  animation-delay: 0.12s;
}

.q-topbar__group--contacts .q-topbar-chip:nth-child(1) {
  animation-delay: 0.18s;
}

.q-topbar__group--contacts .q-topbar-chip:nth-child(2) {
  animation-delay: 0.24s;
}

@keyframes q-topbar-chip-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .q-topbar a.q-topbar-chip {
    animation: none;
  }
}

.q-topbar a.q-topbar-chip:hover {
  color: #fff;
  transform: translateY(-2px);
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 28px rgba(67, 20, 7, 0.42),
    0 0 24px rgba(244, 63, 94, 0.08);
  filter: brightness(1.06);
}

.q-topbar a.q-topbar-chip:hover .q-topbar-chip__glyph--fb {
  color: #7ab8ff;
}

.q-topbar a.q-topbar-chip:active {
  transform: translateY(0);
  transition-duration: 0.12s;
}

.q-topbar-chip--icononly {
  padding-inline: 0.55rem;
  min-width: 32px;
}

.q-topbar-chip__glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.q-topbar-chip__glyph svg {
  display: block;
}

.q-topbar-chip__text {
  unicode-bidi: isolate;
  line-height: 1.2;
}

.q-topbar-chip__text--mail {
  max-width: min(42vw, 220px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .q-topbar {
    height: auto;
    min-height: var(--q-topbar-h);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.55rem;
    padding-block: 0.55rem 0.62rem;
    padding-inline: max(0.7rem, env(safe-area-inset-left, 0px))
      max(0.7rem, env(safe-area-inset-right, 0px));
    font-size: 0.8rem;
    background:
      radial-gradient(120% 140% at 50% -20%, rgba(244, 63, 94, 0.12), transparent 55%),
      linear-gradient(180deg, rgba(22, 19, 18, 0.98) 0%, rgba(12, 10, 9, 0.96) 100%);
    border-bottom-color: rgba(244, 63, 94, 0.22);
  }

  .q-topbar__group {
    flex-wrap: nowrap;
    gap: 0.45rem;
  }

  /* صف علوي: أيقونات السوشيال داخل «رصيف» زجاجي */
  .q-topbar__group--social {
    order: -1;
    align-self: center;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 6px 20px rgba(0, 0, 0, 0.35);
  }

  .q-topbar__group--social .q-topbar-chip {
    min-height: 36px;
    min-width: 38px;
    padding-inline: 0.48rem;
  }

  /* صف الاتصال: عمودان بعرض كامل — لمس أوضح وقراءة أفضل */
  .q-topbar__group--contacts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.5rem;
    width: 100%;
  }

  .q-topbar__group--contacts .q-topbar-chip {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.4rem 0.55rem;
    border-radius: 14px;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 4px 16px rgba(0, 0, 0, 0.32);
  }

  .q-topbar__group--contacts .q-topbar-chip--phone,
  .q-topbar__group--contacts .q-topbar-chip--mail {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    letter-spacing: 0.01em;
    min-height: 2.35rem;
    padding-block: 0.32rem;
  }

  /* بريد في سطر واحد مثل الهاتف: أيقونة + نص مع قص خفيف إن لزم */
  .q-topbar-chip__text--mail {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    text-align: start;
    line-height: 1.2;
    font-size: clamp(0.62rem, 2.6vw, 0.72rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .q-topbar__group--contacts .q-topbar-chip__glyph--mail {
    margin: 0;
    flex-shrink: 0;
  }
}

@media (max-width: 380px) {
  .q-topbar__group--contacts .q-topbar-chip {
    min-height: 2.25rem;
    padding-inline: 0.38rem;
    font-size: 0.66rem;
  }

  .q-topbar-chip__text--mail {
    font-size: clamp(0.56rem, 2.4vw, 0.68rem);
  }
}

/* أيقونات — حركات خفيفة واحترافية */
.q-topbar-chip__glyph--yt {
  animation: q-tb-icon-breathe 3.2s ease-in-out infinite;
}

.q-topbar-chip__glyph--fb {
  color: #1877f2;
  animation: q-tb-icon-breathe 3.2s ease-in-out infinite 0.4s;
}

.q-topbar-chip__glyph--fb svg {
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 1px 4px rgba(24, 119, 242, 0.45));
}

.q-topbar__group--social a:hover .q-topbar-chip__glyph--fb svg {
  filter:
    drop-shadow(0 2px 8px rgba(24, 119, 242, 0.55)),
    drop-shadow(0 0 12px rgba(24, 119, 242, 0.25));
}

.q-topbar-chip__glyph--phone {
  transform-origin: 30% 70%;
  animation: q-tb-phone-tilt 2.6s ease-in-out infinite;
}

.q-topbar-chip__glyph--mail {
  animation: q-tb-mail-float 2.9s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .q-topbar-chip__glyph--yt,
  .q-topbar-chip__glyph--fb,
  .q-topbar-chip__glyph--phone,
  .q-topbar-chip__glyph--mail {
    animation: none;
  }
}

.q-topbar a.q-topbar-chip:hover .q-topbar-chip__glyph--yt,
.q-topbar a.q-topbar-chip:hover .q-topbar-chip__glyph--fb {
  animation: q-tb-icon-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.q-topbar a.q-topbar-chip:hover .q-topbar-chip__glyph--phone {
  animation: q-tb-phone-tilt 0.45s ease-in-out infinite;
}

.q-topbar a.q-topbar-chip:hover .q-topbar-chip__glyph--mail {
  animation: q-tb-mail-float 0.5s ease-in-out infinite;
}

@keyframes q-tb-icon-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes q-tb-icon-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes q-tb-phone-tilt {
  0%,
  100% {
    transform: rotate(0deg);
  }
  20% {
    transform: rotate(-10deg);
  }
  40% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(-6deg);
  }
  80% {
    transform: rotate(6deg);
  }
}

@keyframes q-tb-mail-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.q-header-main {
  --q-header-surface: rgba(12, 10, 9, 0.78);
  height: var(--q-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--q-space-lg);
  padding-inline: max(1rem, 4vw);
  background: var(--q-header-surface);
  border-bottom: 1px solid var(--q-border);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.q-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.q-logo__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  height: calc(var(--q-header-h) - 12px);
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.q-logo img {
  height: 100%;
  width: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 0;
}

.q-logo__text {
  font-family: var(--q-font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.1;
}

.q-logo__text small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--q-text-muted);
  letter-spacing: 0.02em;
}

.q-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.q-nav a {
  color: var(--q-text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  transition:
    background var(--q-dur-fast),
    color var(--q-dur-fast),
    box-shadow var(--q-dur-fast);
}

.q-nav a:hover {
  background: rgba(244, 63, 94, 0.1);
  color: var(--q-cyan);
}

.q-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--q-font-display);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    transform var(--q-dur-fast) var(--q-ease-spring),
    box-shadow var(--q-dur-fast),
    background var(--q-dur-fast),
    border-color var(--q-dur-fast);
}

.q-btn--primary {
  background: linear-gradient(135deg, var(--q-cyan) 0%, var(--q-cyan-dim) 100%);
  color: #0c0a09;
  box-shadow: 0 0 28px rgba(244, 63, 94, 0.35);
}

.q-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(244, 63, 94, 0.5);
}

.q-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--q-border-bright);
  color: var(--q-text);
}

.q-btn--ghost:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: var(--q-cyan);
  color: #fff;
}

/* تبديل اللغة بجوار زر طلب العرض */
.q-header-cta-lang {
  display: flex;
  align-items: center;
  gap: clamp(0.55rem, 1.8vw, 1rem);
  flex-shrink: 0;
}

.q-lang-switch__list {
  list-style: none;
  margin: 0;
  padding: 0.18rem;
  display: flex;
  align-items: stretch;
  gap: 0.12rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--q-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.2);
}

.q-lang-switch__list > li {
  margin: 0;
  padding: 0;
}

.q-lang-switch__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 2.75rem;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  font-family: var(--q-font-display), system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--q-text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    color var(--q-dur-fast) var(--q-ease-out),
    background var(--q-dur-fast) var(--q-ease-out),
    border-color var(--q-dur-fast),
    box-shadow var(--q-dur-fast),
    transform var(--q-dur-fast);
}

.q-lang-switch__link:hover {
  color: var(--q-text);
  background: rgba(255, 255, 255, 0.07);
}

.q-lang-switch__link.is-active {
  color: #0c0a09;
  background: linear-gradient(135deg, var(--q-cyan) 0%, var(--q-cyan-dim) 100%);
  box-shadow:
    0 0 22px rgba(244, 63, 94, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.q-lang-switch__link:focus-visible {
  outline: 2px solid var(--q-cyan);
  outline-offset: 2px;
}

.q-burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--q-border);
  border-radius: 12px;
  cursor: pointer;
}

.q-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--q-dur) var(--q-ease-out), opacity var(--q-dur);
}

.q-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.q-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.q-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.q-mobile-panel {
  display: none;
  position: fixed;
  inset: calc(var(--q-topbar-h) + var(--q-header-h)) 0 0 0;
  background: rgba(12, 10, 9, 0.96);
  backdrop-filter: blur(20px);
  padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  flex-direction: column;
  gap: 0.35rem;
  z-index: 899;
  border-top: 1px solid var(--q-border);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.q-mobile-panel.is-open {
  display: flex;
}

.q-mobile-panel a {
  color: #fff;
  font-size: 1.05rem;
  padding: 0.75rem 1rem;
  border-radius: var(--q-radius-sm);
  border: 1px solid transparent;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
}

.q-mobile-panel a:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: var(--q-border-bright);
}

@media (max-width: 980px) {
  .q-nav,
  .q-header-main .q-btn--primary {
    display: none;
  }

  .q-lang-switch__link {
    min-height: 38px;
    min-width: 2.45rem;
    padding: 0.28rem 0.42rem;
    font-size: 0.72rem;
  }

  .q-burger {
    display: flex;
  }

  .q-logo__mark {
    height: calc(var(--q-header-h) - 14px);
  }
}

@media (max-width: 480px) {
  .q-header-main {
    gap: 0.55rem;
    padding-inline: 0.75rem;
    min-width: 0;
  }

  .q-logo {
    gap: 0;
    min-width: 0;
  }

  .q-logo__text {
    display: none;
  }

  .q-logo__mark {
    height: calc(var(--q-header-h) - 18px);
  }

  .q-header-cta-lang {
    gap: 0.35rem;
    min-width: 0;
  }

  .q-lang-switch__list {
    gap: 0.08rem;
    padding: 0.14rem;
  }

  .q-lang-switch__link {
    min-height: 34px;
    min-width: 2.08rem;
    padding: 0.22rem 0.34rem;
    font-size: 0.68rem;
  }

  .q-burger {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 0.45rem;
    gap: 5px;
  }

  .q-burger span {
    width: 20px;
  }
}
