/* ═══════════════════════════════════════
   header.css — Улучшенная шапка Picturium
   Burger · Drawer · CTA · Scroll-тень
   ========================================== */

/* ── Scroll shadow ──────────────────────── */
.header {
  transition:
    box-shadow 0.35s var(--ease),
    border-bottom-color 0.35s var(--ease);
}

/* ── Переливающийся логотип ─────────────── */
.header__logo-text {
  background: linear-gradient(
    90deg,
    #c44536,
    #e67e22,
    #d4a574,
    #e74c3c,
    #c44536
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logo-shimmer 6s ease-in-out infinite;
}

@keyframes logo-shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Тёмная тема — чуть ярче, чтобы читалось */
html[data-theme="dark"] .header__logo-text {
  background: linear-gradient(
    90deg,
    #e07060,
    #f0943a,
    #e6b880,
    #f06050,
    #e07060
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logo-shimmer 6s ease-in-out infinite;
}

.header.is-scrolled {
  box-shadow:
    0 1px 8px rgba(44, 37, 32, 0.06),
    0 4px 24px rgba(44, 37, 32, 0.04);
  border-bottom-color: transparent;
}

html[data-theme="dark"] .header.is-scrolled {
  box-shadow:
    0 1px 8px rgba(0, 0, 0, 0.2),
    0 4px 24px rgba(0, 0, 0, 0.15);
  border-bottom-color: transparent;
}

/* ── CTA кнопка (десктоп) ───────────────── */
.header__cta {
  display: none; /* скрыта на мобильных */
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #c44536, #e67e22, #e74c3c);
  background-size: 150% 100%;
  background-position: 0% 50%;
  padding: 7px 16px 7px 12px;
  border-radius: 100px;
  transition: all 0.35s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(196, 69, 54, 0.2);
}

.header__cta:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196, 69, 54, 0.35);
}

.header__cta:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(196, 69, 54, 0.2);
}

.header__cta-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Тёмная тема — градиент тот же, тень ярче */
html[data-theme="dark"] .header__cta {
  box-shadow: 0 2px 10px rgba(196, 69, 54, 0.3);
}
html[data-theme="dark"] .header__cta:hover {
  box-shadow: 0 4px 20px rgba(196, 69, 54, 0.45);
}

/* ── Бургер-кнопка ──────────────────────── */
.header__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s var(--ease);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.header__burger:hover {
  background: var(--bg-subtle);
}

html[data-theme="dark"] .header__burger:hover {
  background: #3a3330;
}

.header__burger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition:
    transform 0.3s var(--ease),
    opacity 0.3s var(--ease),
    background 0.2s;
}

html[data-theme="dark"] .header__burger-line {
  background: #a89b8e;
}

/* Бургер → крестик */
.header__burger.is-active .header__burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header__burger.is-active .header__burger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.header__burger.is-active .header__burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Drawer (мобильное меню) ────────────── */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  /* Поверх всего, но ниже хедера z-index:100 */
}

.drawer.is-open {
  pointer-events: auto;
}

/* Затемнение фона */
.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 37, 32, 0.4);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.drawer.is-open .drawer__backdrop {
  opacity: 1;
}

html[data-theme="dark"] .drawer__backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* Панель */
.drawer__panel {
  position: absolute;
  top: var(--header-h);
  right: 0;
  width: min(320px, 85vw);
  bottom: 0;
  background: var(--bg);
  box-shadow: -8px 0 32px rgba(44, 37, 32, 0.1);
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer.is-open .drawer__panel {
  transform: translateX(0);
}

html[data-theme="dark"] .drawer__panel {
  background: #1a1716;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
}

/* Навигация в drawer */
.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer__link {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 14px 16px;
  border-radius: var(--radius);
  transition: all 0.2s var(--ease);
}

.drawer__link:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.drawer__link.is-active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

html[data-theme="dark"] .drawer__link {
  color: #a89b8e;
}
html[data-theme="dark"] .drawer__link:hover {
  background: #3a3330;
  color: #f5f1ed;
}
html[data-theme="dark"] .drawer__link.is-active {
  color: #c44536;
  background: rgba(196, 69, 54, 0.12);
}

.drawer__link-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.6;
}

.drawer__link.is-active .drawer__link-icon {
  opacity: 1;
}

/* Разделитель */
.drawer__divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

html[data-theme="dark"] .drawer__divider {
  background: rgba(58, 51, 48, 0.5);
}

/* CTA в drawer */
.drawer__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #c44536, #e67e22, #e74c3c);
  background-size: 150% 100%;
  background-position: 0% 50%;
  padding: 14px 20px;
  border-radius: var(--radius);
  transition: all 0.35s var(--ease);
  box-shadow: 0 2px 10px rgba(196, 69, 54, 0.2);
}

.drawer__cta:hover {
  background-position: 100% 50%;
  box-shadow: 0 4px 16px rgba(196, 69, 54, 0.35);
}

.drawer__cta:active {
  transform: scale(0.98);
}

.drawer__cta-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

html[data-theme="dark"] .drawer__cta {
  box-shadow: 0 2px 12px rgba(196, 69, 54, 0.3);
}
html[data-theme="dark"] .drawer__cta:hover {
  box-shadow: 0 4px 20px rgba(196, 69, 54, 0.45);
}

/* Подпись внизу drawer */
.drawer__footnote {
  margin-top: auto;
  padding-top: 24px;
  font-size: 0.78rem;
  color: var(--text-4);
  text-align: center;
}

/* ── Блокировка скролла body ────────────── */
body.drawer-open {
  overflow: hidden;
}

/* ── Десктоп (≥768px) ──────────────────── */
@media (min-width: 768px) {
  .header__cta--desktop {
    display: flex;
  }

  .header__burger {
    display: none;
  }

  .drawer {
    display: none;
  }
}

/* ── Мобильный (< 768px) ──────────────── */
@media (max-width: 767px) {
  .header__nav--desktop {
    display: none;
  }
}
