/* ============================================
   Homepage Redesign: Navigation Visibility Override
   Date: 2026-04-20 (Updated: 17:33 UTC)
   Purpose: Horizontal navigation bar with dropdown menus (like skcn.kz)
   Approach: CSS override (non-destructive, safe)
   ============================================ */

/* Desktop only: min-width 992px */
@media (min-width: 992px) {

  /* === STEP 1: Make menu-inner visible, static, and COMPACT === */
  .menu-inner {
    position: static !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    background: #1a1a1a;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: none !important;
    padding: 0 !important;
  }

  /* === STEP 2: Hide burger button on desktop === */
  .header .burger {
    display: none !important;
  }

  /* === Ensure header elements remain visible === */
  .header .logo,
  .header .search,
  .header-social,
  .header .phone,
  .header .version,
  .header .languages {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .header .logo img {
    display: inline-block !important;
    visibility: visible !important;
  }

  /* === STEP 3: Hide overlay on desktop === */
  .overlay {
    display: none !important;
  }

  /* === STEP 4: Hide close button on desktop === */
  .menu-inner .close {
    display: none !important;
  }

  /* === STEP 5: Horizontal navigation bar layout === */
  .menu-inner__row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    flex-wrap: nowrap;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
    height: 50px;
    border: none !important;
  }

  /* === STEP 6: Column as dropdown anchor === */
  .menu-inner__column {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    display: flex;
    align-items: center;
    border: none !important;
    height: auto !important;
  }

  /* === FIX: Remove separator lines (borders and pseudo-elements) === */
  .menu-inner__column::before,
  .menu-inner__column::after,
  .menu-inner__name::before,
  .menu-inner__name::after {
    display: none !important;
    content: none !important;
  }

  /* === STEP 7: Section name as main menu item === */
  .menu-inner__name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 15px 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    border: none !important;
  }

  .menu-inner__name:hover {
    background-color: #2a2a2a;
    color: #e23c3c;
  }

  /* === STEP 8: Dropdown list - HIDDEN by default === */
  .menu-inner__list {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1a1a1a;
    padding: 15px;
    min-width: 220px;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    list-style: none;
    margin: 0;
    border-top: 2px solid #e23c3c;
  }

  /* === STEP 9: Show dropdown on hover === */
  .menu-inner__column:hover .menu-inner__list {
    display: block !important;
  }

  /* === STEP 10: Dropdown list items === */
  .menu-inner__list__item {
    margin: 0;
    padding: 0;
  }

  .menu-inner__list__link {
    display: block;
    font-size: 13px;
    color: #cccccc;
    text-decoration: none;
    padding: 8px 12px;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 3px;
  }

  .menu-inner__list__link:hover {
    background-color: #2a2a2a;
    color: #ffffff;
  }

  /* === STEP 11: Hide duplicate search form in menu-inner on desktop === */
  .menu-inner .search {
    display: none !important;
  }

  /* === STEP 12: Adjust header spacing === */
  .header.header--drop {
    margin-bottom: 0;
  }

  /* Ensure menu-inner appears directly below header */
  .header.header--drop + .menu-inner {
    margin-top: 0;
  }

  /* === STEP 13: Container padding adjustment === */
  .menu-inner .container {
    padding: 0;
  }

}

/* ============================================
   Mobile: Keep existing burger menu behavior
   (No changes needed, original JS will work)
   ============================================ */

/* ============================================
   Phase 2: Модальное окно Общественная приёмная
   Date: 2026-04-20 18:04 UTC
   ============================================ */

/* === Вертикальная кнопка Общественная приёмная === */
.cb-sticky-btn--reception {
  background: #28a745 !important;
  color: #ffffff !important;
  border: none;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.cb-sticky-btn--reception:hover {
  background: #218838 !important;
}

/* === Модальное окно === */
.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-modal.active {
  display: block;
  opacity: 1;
}

.custom-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

.custom-modal__content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 2;
}

.custom-modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
  width: 32px;
  height: 32px;
}

.custom-modal__close:hover {
  color: #333;
}

.custom-modal .top-form {
  background: transparent;
  padding: 0;
  border: none;
}

.custom-modal .top-form__header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-modal .top-form__name {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.custom-modal .top-form__right img {
  width: 40px;
  height: 40px;
}

.custom-modal .top-form__link {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.custom-modal .top-form__item {
  display: block;
  padding: 12px 15px;
  margin-bottom: 10px;
  background: #f5f5f5;
  border-radius: 5px;
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease;
  position: relative;
}

.custom-modal .top-form__item:hover {
  background: #e23c3c;
  color: #ffffff;
}

.custom-modal .top-form__tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #333;
  color: #fff;
  padding: 10px;
  border-radius: 5px;
  font-size: 12px;
  margin-top: 5px;
  z-index: 10;
  min-width: 200px;
}

.custom-modal .top-form__item:hover .top-form__tooltip {
  display: block;
}

.custom-modal .top-form__list {
  display: flex;
  gap: 15px;
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.custom-modal .top-form__list li {
  margin: 0;
}

.custom-modal .top-form__list img {
  width: 32px;
  height: 32px;
  transition: opacity 0.2s ease;
}

.custom-modal .top-form__list img:hover {
  opacity: 0.7;
}

@media (max-width: 768px) {
  .custom-modal__content {
    width: 95%;
    padding: 20px;
    max-height: 90vh;
  }

  .custom-modal .top-form__name {
    font-size: 16px;
  }

  .custom-modal .top-form__item {
    font-size: 14px;
    padding: 10px;
  }
}

/* ============================================
   Phase 2: Hero Banner Height Fix
   Date: 2026-04-20 18:10 UTC
   ============================================ */

section.top {
  min-height: 550px !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0 !important;
}

.hero-tagline {
  text-align: center !important;
  max-width: 800px;
  margin: 0 auto !important;
  padding: 20px !important;
  font-size: 24px !important;
  line-height: 1.5 !important;
}

.top-row.top-row--main {
  display: none !important;
}

@media (max-width: 768px) {
  section.top {
    min-height: 400px !important;
    padding: 40px 0 !important;
  }

  .hero-tagline {
    font-size: 18px !important;
    padding: 15px !important;
  }
}

/* ============================================
   HOTFIX: Header layout fix
   Date: 2026-04-20 18:42 UTC
   ============================================ */

@media (min-width: 992px) {
  /* Fix header row layout */
  .header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 15px 0 !important;
  }

  /* Ensure logo is visible and has proper size */
  .header .logo {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
  }

  .header .logo img {
    max-height: 50px !important;
    width: auto !important;
  }

  /* Fix search and other elements */
  .header .search {
    flex: 0 1 auto !important;
    max-width: 300px !important;
  }

  .header-social {
    display: flex !important;
    gap: 10px !important;
  }

  .header .phone {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
  }
}

/* ============================================
   HOTFIX 2: Header overflow fix
   Date: 2026-04-20 18:43 UTC
   ============================================ */

@media (min-width: 992px) {
  /* Fix header container */
  .header {
    overflow: visible !important;
    position: relative !important;
  }

  .header .container {
    overflow: visible !important;
  }

  /* Ensure header-row doesn't push content up */
  .header-row {
    position: relative !important;
    overflow: visible !important;
    min-height: 80px !important;
  }
}

/* ============================================
   HOTFIX 3: Cancel header transform
   Date: 2026-04-20 18:43 UTC
   ============================================ */

@media (min-width: 992px) {
  /* Cancel JavaScript transform on header */
  .header {
    transform: none !important;
  }
}

/* Уменьшаем высоту навигационного меню */
.menu-inner__row {
  height: 45px !important;
}

.menu-inner__name {
  padding: 12px 18px !important;
  font-size: 13px !important;
}

/* ============================================
   Final optimization: Compact header + visible menu items
   Date: 2026-04-20 18:50 UTC
   ============================================ */

@media (min-width: 992px) {
  /* Уменьшаем высоту header */
  .header {
    padding: 10px 0 !important;
  }


/* ============================================
   CORRECT FIX: Compact header banner only
   Date: 2026-04-20 18:54 UTC
   ============================================ */

@media (min-width: 992px) {
  /* Уменьшаем высоту header banner (верхняя полоса) */
  .header {
    padding: 8px 0 !important;
  }

  .header-row {
    min-height: 50px !important;
    padding: 5px 0 !important;
  }

  /* Компактный логотип */
  .header .logo img {
    max-height: 35px !important;
  }

  .header .logo span {
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  /* Компактные элементы header */
  .header .phone {
    font-size: 13px !important;
  }

  .header-social img {
    width: 20px !important;
    height: 20px !important;
  }
}

/* ============================================
   FIX: Eye icon + Language switcher alignment
   Date: 2026-04-20 18:57 UTC
   ============================================ */

@media (min-width: 992px) {
  /* Контейнер для глаза и языков в одну линию */
  .header-row > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px !important;
  }

  /* Значок глаза */
  .header .version {
    display: flex !important;
    align-items: center !important;
  }

  /* Языки: показать все 3 кнопки сразу */
  .header .languages {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
  }

  /* Скрыть текущий язык (RU) */
  .header .languages__item {
    display: none !important;
  }

  /* Показать все языки в одну линию */
  .header .languages__sub {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  .header .languages__sub__item {
    margin: 0 !important;
  }

  .header .languages__sub .lang {
    display: block !important;
    padding: 5px 10px !important;
    background: #2a2a2a !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    transition: background-color 0.2s ease !important;
  }

  .header .languages__sub .lang:hover {
    background: #e23c3c !important;
  }
}

/* ============================================
   FIX 2: Force header-row children visibility
   Date: 2026-04-20 18:58 UTC
   ============================================ */

@media (min-width: 992px) {
  /* Исправляем позиционирование всех детей header-row */
  .header-row > * {
    position: relative !important;
    z-index: 10 !important;
  }

  /* Правый блок (глаз + языки) */
  .header-row > div:last-child {
    position: relative !important;
    top: auto !important;
    transform: none !important;
  }
}

/* ============================================
   CRITICAL FIX: Force header position
   Date: 2026-04-20 18:59 UTC
   ============================================ */

@media (min-width: 992px) {
  /* Жёстко фиксируем header на месте */
  .header,
  .header.header--drop {
    transform: translateY(0) !important;
    top: 0 !important;
  }
}
