/* === HEADER === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.header.header-has-border {
  border-bottom: 1px solid #1d2025;
}

.header-inner {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
  gap: 24px;
}

@media (max-width: 950px) {
  .header-inner {
    padding-left: 8px;
    padding-right: 8px;
    gap: 8px;
    max-width: 100vw;
  }
}

@media (max-width: 600px) {
  .header-inner {
    padding-left: 4px;
    padding-right: 4px;
  }
}

.header-search-col {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  width: 44px;
}

.header-logo {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  height: 100%;
  z-index: 2;
}

.header-menu {
  display: flex;
  gap: 24px;
  align-items: center;
  height: 100%;
  justify-content: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

/* --- Кнопки и иконки --- */
.header-search-icon {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0;
  cursor: pointer;
  width: 32px;
  height: 32px;
  color: #fff;
  font-size: 24px;
  background: none;
  border: none;
  outline: none;
  transition: color 0.2s, opacity 0.2s;
  position: relative;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

.header-search-icon.visible {
  opacity: 1;
  pointer-events: auto;
}

.header-btn {
  grid-column: 2;
  background: var(--color-secondary);
  color: var(--color-text);
  position: relative;
  overflow: hidden;
  z-index: 1;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  height: 35px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  border: none;
}

.header-btn>span,
.header-btn>svg,
.header-btn>strong,
.header-btn>b {
  position: relative;
  z-index: 1;
}

.header-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  border-radius: 6px;
  transition: opacity 0.2s;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.header-btn:hover::before {
  opacity: 0;
}

/* --- Меню --- */
.header-menu {
  display: flex;
  gap: 24px;
  align-items: center;
  height: 100%;
  justify-content: center;
}

.header-menu-item {
  color: var(--color-text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.header-menu-item:hover {
  color: inherit;
  background: none;
  text-decoration: none;
}

/* === МОБИЛЬНЫЙ ХЕДЕР: АНИМАЦИЯ И СТИЛИ === */
@media (max-width: 950px) {
  #mobile-header .header-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    height: 100%;
    position: relative;
  }

  #mobile-search-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  #mobile-header .sandvich-menu {
    width: 38px;
    height: 38px;
    background: #000;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    transition: background 0.2s;
    z-index: 2;
    cursor: pointer;
  }

  #mobile-header .sandvich-menu svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  #mobile-header .sandvich-menu rect {
    fill: #fff;
  }
}


@media (max-width: 950px) {
  .header-inner {
    padding-left: 8px;
    padding-right: 8px;
    gap: 8px;
  }

  .header-logo {
    font-size: 18px;
  }

  .header-menu {
    gap: 8px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-app-btn {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 32px !important;
    display: flex;
    align-items: center;
    box-sizing: border-box;
  }
}

@media (min-width: 950px) {
  #mobile-header {
    display: none !important;
  }

  #main-header {
    display: block !important;
  }
}

@media (max-width: 950px) {
  #mobile-header {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--color-secondary);
    z-index: 2000;
  }

  #main-header {
    display: none !important;
  }

  #mobile-search-btn.shift-to-burger {
    margin-left: 0;
    margin-right: 0;
    transition: margin 0.3s cubic-bezier(.4, 0, .2, 1);
  }

  #mobile-search-btn.shift-left {
    margin-left: 0;
    margin-right: 0px;
    transition: margin 0.3s cubic-bezier(.4, 0, .2, 1);
    width: 120px;
  }

  #mobile-header .header-search-icon {
    opacity: 0;
    pointer-events: none;
    margin-left: 0;
    margin-right: 0;
    transition: opacity 0.3s, margin 0.3s, width 0.3s, min-width 0.3s;
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
  }

  #mobile-header .header-search-icon.visible {
    opacity: 1;
    pointer-events: auto;
    width: 38px;
    min-width: 38px;
    margin-right: 0;
    transition: opacity 0.3s, margin 0.3s, width 0.3s, min-width 0.3s;
  }
}

/* === МОБИЛЬНОЕ OFFCANVAS-МЕНЮ === */
.mobile-offcanvas-menu {
  position: fixed;
  top: 70px;
  /* высота хедера */
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100vh - 70px);
  width: 100vw;
  background: #000;
  z-index: 3000;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.4, 0, .2, 1), opacity 0.4s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
  display: block;
}

.mobile-offcanvas-menu.active {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  z-index: 10;
}

.mobile-menu-content {
  height: 100%;
  overflow-y: auto;
  padding: 0 12px 16px 12px;
  /* отступы слева, справа и снизу */
  display: flex;
  flex-direction: column;
}

.mobile-menu-section {
  margin-bottom: 24px;
}

.mobile-menu-section-title {
  color: #fff;
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 12px;
}

.mobile-menu-categories-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding: 0 0 0 0;
  /* убираем внутренние отступы, чтобы не дублировались */
}

.mobile-menu-category {
  padding: 12px 0;
  font-size: 18px;
  background: none;
  border: none;
  box-shadow: none;
  color: #fff;
  transition: opacity 0.3s, max-height 0.3s, margin 0.3s;
  opacity: 1;
  max-height: 100px;
  margin: 0;
}

.mobile-menu-category.anim-hide {
  opacity: 0;
  max-height: 0;
  margin: 0;
  pointer-events: none;
}

.mobile-menu-category.hidden {
  display: none;
}

.mobile-menu-show-more-row,
.mobile-menu-category .mobile-menu-show-more {
  padding: 0;
  grid-column: span 2;
  justify-self: start;
  text-align: left;
}

.mobile-menu-show-more {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  width: auto;
  text-align: left;
  padding: 0;
  margin: 0;
  display: inline-block;
}

.mobile-menu-bottom {
  margin-top: 24px;
  color: #fff;
  display: block;
  padding-bottom: 8px;
  /* небольшой отступ снизу */
}

.mobile-menu-app-text,
.mobile-menu-app-btn {
  margin-bottom: 10px;
  color: var(--color-text) !important;
}

@media (max-width: 600px) {
  .mobile-menu-content {
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: 8px;
  }

  .mobile-menu-categories-list {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* --- hover цвет для svg иконки поиска в хедере --- */
.header-search-icon:hover svg {
  color: var(--color-secondary);
  stroke: var(--color-secondary);
}

.header-search-icon:hover svg * {
  stroke: var(--color-secondary);
}

/* === APP HEADER BUTTON === */
.header-app-btn,
.mobile-menu-app-btn {
  background: #2a211a;
  color: #ff881a;
  border-radius: 8px;
  /* уменьшен горизонтальный отступ */
  font-size: 13px!important;
  /* чуть меньше для баланса */
  font-weight: 600;
  font-family: 'Poppins', Arial, sans-serif;
  cursor: pointer;
  height: 32px;
  /* как у input в search-block */
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: none;
  outline: none;
  margin-left: 0;
  width: 100px;
  transition: background 0.18s, color 0.18s;
}

.header-app-btn:hover {
  background: #3a2d22;
  color: #ff881a;
}

.header-app-btn:active {
  background: #1a140e;
}

.header-app-btn>* {
  display: inline;
}

@media (max-width: 950px) {
  .header-app-btn {
    height: 32px;
    font-size: 15px;
    margin-left: 12px;
  }
}

/* Исключение для .main-slider-bg */
.main-slider-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
  padding-left: 0 !important;
  padding-right: 0 !important;
  /* background-color не задаём здесь, он задаётся инлайном в PHP */
}
.main-slider-bg.active {
  display: block;
}



/* --- Шрифт --- */
.header,
.header-inner,
.header-menu,
.header-app-btn {
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 16px;
}

/* App Modal Styles */
.app-modal {
  position: fixed;
  z-index: 3001;
  inset: 0;
  display: block;
  min-height: 100vh;
}

.app-modal[style*="display: block"] .app-modal-content {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.25s cubic-bezier(.4,0,.2,1), transform 0.25s cubic-bezier(.4,0,.2,1);
  transform: translate(-50%, -50%) scale(1);
}

.app-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  background: #1d2025;
  color: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 48px 40px 36px 40px;
  min-width: 0;
  width: 560px;
  max-width: 96vw;
  text-align: center;
  z-index: 3002;
  animation: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(.4,0,.2,1), transform 0.25s cubic-bezier(.4,0,.2,1);
}

.app-modal.hide .app-modal-content {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
}

.app-modal-subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  opacity: 0.85;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.app-modal-title {
  font-size: 2.1rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: #fff;
  letter-spacing: -0.5px;
}

.app-modal-qr {
  margin: 0 auto 28px auto;
  width: 210px;
  height: 210px;
  background: #fff;
  border-radius: 18px;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

.app-modal-qr svg {
  width: 210px;
  height: 210px;
  display: block;
}

.app-modal-desc {
  color: #bfc6d1;
  font-size: 1.13rem;
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.app-modal-close {
  position: absolute;
  top: 22px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  z-index: 3;
  transition: color 0.15s;
}

.app-modal-close:hover {
  color: #4b90e0;
}

.app-modal-overlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 3000;
  width: 100vw;
  height: 100vh;
  box-shadow: none;
  transition: opacity 0.25s cubic-bezier(.4,0,.2,1);
  opacity: 1;
}

@media (max-width: 700px) {
  .app-modal-content {
    width: 98vw;
    max-width: 98vw;
    padding: 24px 2vw 20px 2vw;
    border-radius: 0;
    min-height: unset;
    justify-content: center;
  }

  .app-modal-qr {
    width: 140px;
    height: 140px;
    border-radius: 12px;
  }

  .app-modal-qr svg {
    width: 140px;
    height: 140px;
  }

  .app-modal-close {
    top: 12px;
    right: 12px;
  }
}