/* ==========================================================================
   Site header: logo, primary navigation, language switcher, phone button
   ========================================================================== */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(14, 15, 17, .96), rgba(14, 15, 17, .82));
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 20px;
}

.site-header__logo img { width: 128px; height: auto; }

/* ----- mobile toggle ----- */
.nav-toggle {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 6px;
}
.nav-toggle .icon { grid-area: 1 / 1; font-size: 24px; }
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded='true'] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded='true'] .nav-toggle__close { display: block; }

/* ----- mobile panel ----- */
.site-header__panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: 8px 20px 24px;
  background: rgba(14, 15, 17, .98);
  border-top: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 18px 30px rgba(0, 0, 0, .45);
}
.site-header__panel.is-open { display: block; }

.primary-nav__list { display: block; }
.primary-nav__item {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.primary-nav__link {
  flex: 1 1 auto;
  display: block;
  padding: 14px 0;
  min-height: 48px;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}
.primary-nav__link.is-active { color: var(--c-orange-2); }
.primary-nav__sub-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
}
.primary-nav__sub-toggle .icon { font-size: 20px; transition: transform .2s; }
.primary-nav__sub-toggle[aria-expanded='true'] .icon { transform: rotate(180deg); }
.primary-nav__sub { display: none; flex: 0 0 100%; padding: 0 0 10px 14px; }
.primary-nav__sub.is-open { display: block; }
.primary-nav__sub a { display: block; padding: 10px 0; font-size: 15px; color: #d6d6d8; }
.primary-nav__sub a:hover { color: var(--c-orange-2); }

.lang-switcher { margin-top: 16px; }
.lang-switcher__list { display: flex; gap: 8px; }
.lang-switcher__link {
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #cfcfd2;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 6px;
}
.lang-switcher__link.is-current { color: #1a1206; background: var(--c-orange-2); border-color: var(--c-orange-2); }

.site-header__phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  min-height: 46px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  border: 1px solid var(--c-orange-deep);
  border-radius: 6px;
}
.site-header__phone .icon { color: var(--c-orange-2); font-size: 18px; }

/* ==========================================================================
   Desktop (reference layout)
   ========================================================================== */
@media (min-width: 992px) {
  .site-header { background: linear-gradient(180deg, rgba(14, 15, 17, .93), rgba(14, 15, 17, .8)); }

  .site-header__inner {
    justify-content: flex-start;
    height: 5rem;
    padding: 0 5.8rem 0 5.4rem;
  }
  .site-header__logo img { width: 14rem; }

  .nav-toggle { display: none; }

  .site-header__panel {
    position: static;
    display: flex;
    flex: 1;
    align-items: center;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .primary-nav { margin-left: 9.9rem; }
  .primary-nav__list { display: flex; align-items: center; gap: 2.2rem; }
  .primary-nav__item { display: block; border: 0; }
  .primary-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 0;
    height: 4.8rem;
    padding: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
  }
  .primary-nav__link.is-active { color: #fff; }
  .primary-nav__link.is-active::after,
  .primary-nav__link:hover::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1rem;
    height: .2rem;
    background: var(--c-orange);
  }
  .primary-nav__link:hover { color: #fff; }

  /* "Hizmetlerimiz" chevron: the toggle button sits right after the link text */
  .has-sub { display: flex; align-items: center; }
  .has-sub .primary-nav__link { padding-right: .2rem; }
  .primary-nav__sub-toggle { width: 1.2rem; height: 4.8rem; margin-left: .1rem; color: #fff; }
  .primary-nav__sub-toggle .icon { font-size: 1rem; }

  .primary-nav__sub {
    display: none;
    position: absolute;
    top: 4.6rem;
    left: -1.4rem;
    z-index: 5;
    min-width: 19rem;
    padding: .8rem 0;
    background: rgba(16, 17, 19, .98);
    border-top: .2rem solid var(--c-orange);
    box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, .5);
  }
  .has-sub:hover .primary-nav__sub,
  .has-sub:focus-within .primary-nav__sub,
  .primary-nav__sub.is-open { display: block; }
  .primary-nav__sub a { padding: .8rem 1.6rem; font-size: 1rem; }

  .lang-switcher { margin: 0 0 0 auto; }
  .lang-switcher__list { gap: 0; }
  .lang-switcher__list li + li { position: relative; }
  .lang-switcher__list li + li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    height: 1rem;
    border-left: 1px solid rgba(255, 255, 255, .35);
    transform: translateY(-50%);
  }
  .lang-switcher__link {
    min-width: 0;
    min-height: 0;
    padding: .4rem .8rem;
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .7);
    border: 0;
    border-radius: 0;
    background: none;
  }
  .lang-switcher__link:hover { color: #fff; }
  .lang-switcher__link.is-current { color: #fff; font-weight: 700; background: none; }

  .site-header__phone {
    gap: .7rem;
    margin: -.2rem 0 0 1.4rem;
    min-height: 2.7rem;
    padding: 0 1.3rem;
    font-size: .95rem;
    border-width: 1px;
    border-radius: .4rem;
    background: rgba(8, 8, 9, .45);
    white-space: nowrap;
  }
  .site-header__phone .icon { font-size: 1.2rem; }
}
