/* Header & navigation UX */

:root {
  --header-h: 68px;
  --header-h-scrolled: 60px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 251, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.header.is-scrolled {
  background: rgba(255, 255, 255, 0.97);
  border-color: var(--color-border);
  box-shadow: 0 6px 24px rgba(6, 21, 28, 0.07);
}

.header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
  transition: min-height 0.2s;
}

.header.is-scrolled .header__inner {
  min-height: var(--header-h-scrolled);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-primary);
  font-family: var(--font-display, "Unbounded", Manrope, sans-serif);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.logo__mark {
  width: 40px;
  height: 40px;
  display: block;
  flex-shrink: 0;
  overflow: visible;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.logo__text {
  display: none;
}

@media (min-width: 380px) {
  .logo__text {
    display: inline;
  }
}

/* Desktop nav */
.nav {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.nav a {
  position: relative;
  padding: 0.45rem 0.7rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--color-primary);
  background: rgba(11, 36, 48, 0.04);
}

.nav a.is-active {
  color: var(--color-primary);
  background: rgba(196, 146, 58, 0.12);
}

.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 2px;
  background: var(--color-accent);
}

/* Actions cluster */
.header__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-self: end;
}

.header__phone-wrap {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  text-decoration: none;
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.header__phone-wrap:hover {
  background: rgba(196, 146, 58, 0.1);
}

.header__phone-wrap .header__phone {
  display: inline;
  position: relative;
  padding-left: 0;
  color: var(--color-primary);
  font-family: var(--font-display, "Unbounded", Manrope, sans-serif);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.header__phone-wrap .header__phone::before {
  display: none;
}

.header__phone-meta {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-primary);
  text-decoration: none;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.header__icon-btn:hover {
  border-color: var(--color-accent);
  background: rgba(196, 146, 58, 0.08);
}

.header__icon-btn--call {
  color: #0b2430;
  background: linear-gradient(135deg, #fff, #f8f3e8);
  border-color: rgba(196, 146, 58, 0.45);
  box-shadow: 0 2px 10px rgba(196, 146, 58, 0.15);
}

.header__cta {
  display: none;
  min-height: 44px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.header__cta-short {
  display: none;
}

.burger {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.burger:hover {
  border-color: var(--color-accent);
}

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 21, 28, 0.52);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s, visibility 0.22s;
}

.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(360px, 92vw);
  height: 100%;
  background: #fff;
  padding: 1rem 1.15rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -16px 0 48px rgba(6, 21, 28, 0.18);
  overflow-y: auto;
}

.mobile-nav.is-open .mobile-nav__panel {
  transform: translateX(0);
}

.mobile-nav__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display, "Unbounded", Manrope, sans-serif);
  font-weight: 600;
  color: var(--color-primary);
  font-size: 1.05rem;
  text-decoration: none;
}

.mobile-nav__brand .logo__mark {
  width: 28px;
  height: 28px;
}

.mobile-nav__close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav__quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.mobile-nav__quick .btn {
  width: 100%;
  min-height: 48px;
  font-size: 0.92rem;
}

.mobile-nav__quick .btn--outline {
  background: #fff;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
  box-shadow: none;
}

.mobile-nav__quick .btn--outline:hover {
  border-color: var(--color-accent);
  background: rgba(196, 146, 58, 0.06);
}

.mobile-nav__label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
}

.mobile-nav__links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.25rem;
}

.mobile-nav__links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.65rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.02rem;
  border-radius: 10px;
  border-bottom: none;
}

.mobile-nav__links a:hover,
.mobile-nav__links a.is-active {
  background: rgba(196, 146, 58, 0.1);
  color: var(--color-primary);
}

.mobile-nav__messengers {
  display: grid;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.mobile-nav__messengers a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 600;
  background: #f8fafb;
}

.mobile-nav__hours {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  text-align: center;
}

body.nav-open {
  overflow: hidden;
}

/* Breakpoints */
@media (min-width: 640px) {
  .header__cta {
    display: inline-flex;
  }

  .header__cta-full {
    display: none;
  }

  .header__cta-short {
    display: inline;
  }
}

@media (min-width: 768px) {
  .header__icon-btn--call {
    display: none;
  }

  .header__phone-wrap {
    display: flex;
  }

  .burger {
    display: none;
  }

  .nav {
    display: flex;
  }

  .header__cta-full {
    display: inline;
  }

  .header__cta-short {
    display: none;
  }
}

@media (min-width: 1024px) {
  .header__inner {
    gap: 1.25rem;
  }

  .nav {
    gap: 0.2rem;
  }

  .nav a {
    font-size: 0.92rem;
    padding: 0.5rem 0.8rem;
  }

  .header__phone-wrap .header__phone {
    font-size: 0.95rem;
  }

  .header__actions {
    gap: 0.75rem;
  }
}

@media (max-width: 639px) {
  .header__cta {
    display: none;
  }
}

/* Callbar polish */
.callbar {
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
}

.callbar.is-visible {
  display: grid;
  grid-template-columns: auto 1fr 1.15fr;
  gap: 0.45rem;
  align-items: center;
}

.callbar__tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #2aabee;
  color: #fff;
  text-decoration: none;
}

.callbar .btn {
  min-height: 46px;
  font-size: 0.88rem;
  padding: 0.5rem 0.65rem;
}

@media (max-width: 767px) {
  body.has-callbar {
    padding-bottom: 76px;
  }
}
