/**
 * Табы: главная + админка. Нужен --cadet-blue.
 * У .tab-content: flex:1 + min-width:0 — иначе широкая сетка каталога ломает flex-ряд.
 */

.tabs-shell {
  box-sizing: border-box;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Каталог курорта: на всю ширину main-block, как вводный текст выше */
.catalogue-section .tabs-shell {
  max-width: none;
  width: 100%;
}

.catalogue-section .heading-h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

.tabs {
  position: relative;
}
.tabs:before,
.tabs:after {
  content: "";
  display: table;
}
.tabs:after {
  clear: both;
}

.tab-menu {
  position: relative;
}

.tab-link {
  position: relative;
  display: inline-block;
  vertical-align: top;
  text-decoration: none;
  padding: 9px 30px;
  text-align: left;
  cursor: pointer;
  color: #222;
  background-color: #ddd;
}
.tab-link.is-current {
  background-color: #c8c8c8;
}
.tab-link:focus {
  outline: 0;
}

.tab-content {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 1px;
  flex: 1;
  min-width: 0;
}

/* Абсолютное позиционирование — только там, где нужна анимация (не главная) */
.tabs:not(.tabs-home-page) .tab-pane {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin-left: 25px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.tabs:not(.tabs-home-page) .tab-pane.is-current {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.tabs:not(.tabs-home-page) .tab-pane.tab-pane-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.tabs:not(.tabs-home-page) .tab-content .tab-pane {
  display: block !important;
}

/* Главная (каталог): две колонки одной высоты, активная панель в потоке. Не админка (.admin-dashboard-tabs). */
.tabs-home-page:not(.admin-dashboard-tabs) {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: stretch;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tabs-menu {
  flex: 0 0 auto;
  align-self: stretch;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  overflow: visible;
}

@media screen and (min-width: 768px) {
  .tabs-home-page:not(.admin-dashboard-tabs) .tabs-menu {
    position: sticky;
    top: 24px;
    align-self: flex-start;
    margin-bottom: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .tabs-home-page:not(.admin-dashboard-tabs) .tab-content::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(192, 192, 192, 0.6);
    pointer-events: none;
    z-index: 0;
  }

  .tabs-menu .tab-link {
    z-index: 2;
  }

  .tabs-menu::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(192, 192, 192, 0.6);
    pointer-events: none;
    z-index: 0;
  }

  .tabs-home-page:not(.admin-dashboard-tabs) .tabs-menu::before {
    content: none;
    display: none;
  }

  .tabs-menu::after {
    content: "";
    position: absolute;
    right: 0;
    top: var(--tab-indicator-top, 0);
    height: var(--tab-indicator-height, 0);
    width: 3px;
    background: var(--cadet-blue);
    pointer-events: none;
    z-index: 1;
    transition: top 0.35s ease, height 0.35s ease;
  }
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-content.is-tab-animating {
  overflow: hidden;
  transition: height 0.35s ease;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane[hidden] {
  display: none !important;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane:not([hidden]) {
  display: block !important;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 0 0 25px;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* В покое активная панель в потоке — контент не обрезается, высота естественная */
.tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane.is-current:not(.tab-pane-leaving):not(.tab-pane-entering) {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane.is-current {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane.is-current.tab-pane-entering {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane.is-current.tab-pane-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane > :first-child {
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .tabs-home-page:not(.admin-dashboard-tabs) .tab-content.is-tab-animating,
  .tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane,
  .tabs:not(.tabs-home-page) .tab-pane {
    transition: none !important;
  }
}

.tabs-content {
  flex: 1;
  margin-left: -3px;
}

.header-tabs {
  background-color: transparent;
  border-right: 0;
  padding: 0 20px 0 0;
  transition: color 0.35s ease;
}
.header-tabs:hover {
  color: var(--cadet-blue);
}
.header-tabs.is-current {
  color: var(--cadet-blue);
  text-align: left;
  display: flex;
  background-color: transparent;
}

/* Вертикальная линия: на главной — серая по высоте карточек (.tab-content::before); синий сегмент — у меню */
.tabs-menu {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 15px;
  min-width: 250px;
  border-right: 0;
}

.tabs-home-page:not(.admin-dashboard-tabs) .tab-menu .tab-link {
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  appearance: none;
}

.text-tabs-menu {
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media screen and (max-width: 991px) {
  .text-tabs-menu {
    font-size: 14px;
  }
}

@media screen and (max-width: 767px) {
  .tabs-content {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  .header-tabs {
    border-right: 0;
  }
  .tabs-menu::before,
  .tabs-menu::after {
    content: none;
    display: none;
  }
  .tabs-menu:not(.admin-sidebar) {
    flex-direction: row;
    min-width: 0;
    margin-bottom: 25px;
    padding-bottom: 5px;
    overflow: auto;
    border-right: 0;
    align-self: auto;
  }
  .tabs-home-page:not(.admin-dashboard-tabs) {
    display: block;
  }
  .text-tabs-menu {
    white-space: nowrap;
  }
  .tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane,
  .tabs-home-page:not(.admin-dashboard-tabs) .tab-content .tab-pane.is-current {
    margin-left: 0;
  }
  .tabs:not(.tabs-home-page) .tab-pane {
    margin-left: 0;
  }
}

@media screen and (max-width: 479px) {
  .tab-link {
    display: block;
  }
}

.tabs-menu:not(.admin-sidebar)::-webkit-scrollbar {
  width: 8px;
  height: 6px;
}
.tabs-menu:not(.admin-sidebar)::-webkit-scrollbar-track {
  background: linear-gradient(
    0deg,
    rgba(245, 245, 245, 0) 0%,
    rgba(245, 245, 245, 0) 40%,
    #a8a8a8 40%,
    #a8a8a8 60%,
    rgba(245, 245, 245, 0) 60%,
    rgba(245, 245, 245, 0) 100%
  );
}
.tabs-menu:not(.admin-sidebar)::-webkit-scrollbar-thumb {
  background: #a8a8a8;
  border-radius: 0.4px;
  transition: background 0.4s ease;
}
