/* static/client/style-switch.css — переключатель стиля «О Т Э»
   Закрыт: три буквы в ряд, при наведении раскрываются.
   Открыт: меню выезжает ВВЕРХ над пунктом.
*/

.theme-wrap {
  position: relative;
  margin-bottom: 6px;
}

/* ---------- кнопка О Т Э ---------- */
.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .16s, background .16s, transform .16s;
}
.theme-btn:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

/* три буквы в закрытом виде */
.theme-letters {
  display: flex;
  gap: 5px;
  align-items: center;
}
.theme-letters b {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--ink-mid);
  transition: color .18s, transform .18s;
  line-height: 1;
}
.theme-btn:hover .theme-letters b { color: var(--brand); }

/* каждая буква — под свою тему: О основная, Т тёмная, Э экстра */
.theme-letters b:nth-child(1):hover { transform: translateY(-2px); }
.theme-letters b:nth-child(2):hover { transform: translateY(-2px); }
.theme-letters b:nth-child(3):hover { transform: translateY(-2px); }

/* подпись «Стиль» в обычном развёрнутом состоянии панели — рядом с буквами */
.theme-btn .nav-txt {
  margin-left: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* в свёрнутой панели — только буквы, вертикально */
.omni-cabinet.is-collapsed .theme-btn { flex-direction: column; gap: 3px; padding: 8px 4px; }
.omni-cabinet.is-collapsed .theme-letters { flex-direction: column; gap: 3px; }
.omni-cabinet.is-collapsed .theme-btn .nav-txt { display: none; }

/* ---------- выпадающее меню ВВЕРХ ---------- */
.theme-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);      /* ВВЕРХ от кнопки */
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 7px;
  box-shadow: 0 -8px 34px rgba(0,0,0,.14);
  z-index: 1000;
  animation: themeSlideUp .18s ease;
}
@keyframes themeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* стрелка-указатель снизу меню */
.theme-menu::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -7px;
  width: 12px; height: 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}

/* ---------- пункты меню ---------- */
.theme-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: 11px;
  font-family: inherit;
  font-size: 13.8px;
  color: var(--ink-mid);
  cursor: pointer;
  text-align: left;
  transition: background .14s, color .14s;
}
.theme-opt:hover { background: var(--line-soft); color: var(--ink); }

/* буква темы в меню — крупная плашка */
.theme-letter {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  border-radius: 9px;
  transition: transform .15s;
}
.theme-opt:hover .theme-letter { transform: scale(1.06); }

/* цвет плашки-буквы по теме */
.theme-opt[data-theme-opt="main"] .theme-letter {
  background: #F6F2E9; color: #B4432D; border: 1px solid #E2D9C8;
}
.theme-opt[data-theme-opt="dark"] .theme-letter {
  background: #221C1A; color: #E8B04B; border: 1px solid #3D302C;
}
.theme-opt[data-theme-opt="extra"] .theme-letter {
  background: #FFFCF6; color: #D62828; border: 2px solid #131313;
}

.theme-opt-txt { flex: 1; }
.theme-check { font-weight: 800; font-size: 14px; }

/* ---------- активный пункт — в цветах темы ---------- */
.omni-cabinet[data-theme="main"] .theme-opt.active {
  background: #F8E7DF !important; color: #8E2F1E !important; font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(180,67,45,.22);
}
.omni-cabinet[data-theme="main"] .theme-check { color: #B4432D; }

.omni-cabinet[data-theme="dark"] .theme-opt.active {
  background: linear-gradient(100deg, rgba(122,42,46,.55) 0%, rgba(232,176,75,.14) 100%) !important;
  color: #FFE9BE !important; font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(232,176,75,.32);
}
.omni-cabinet[data-theme="dark"] .theme-check { color: #E8B04B; }
.omni-cabinet[data-theme="dark"] .theme-menu {
  background: #221C1A; border-color: #3D302C;
  box-shadow: 0 -10px 40px rgba(0,0,0,.6);
}
.omni-cabinet[data-theme="dark"] .theme-menu::after {
  background: #221C1A; border-color: #3D302C;
}
.omni-cabinet[data-theme="dark"] .theme-btn { border-color: #3D302C; }
.omni-cabinet[data-theme="dark"] .theme-btn:hover {
  background: rgba(232,176,75,.10); border-color: var(--gold);
}
.omni-cabinet[data-theme="dark"] .theme-letters b { color: #D9C9B6; }
.omni-cabinet[data-theme="dark"] .theme-btn:hover .theme-letters b { color: #E8B04B; }

.omni-cabinet[data-theme="extra"] .theme-opt.active {
  background: #131313 !important; color: #FFFCF6 !important; font-weight: 700;
  box-shadow: 3px 3px 0 #D62828;
}
.omni-cabinet[data-theme="extra"] .theme-check { color: #F2B705; }
.omni-cabinet[data-theme="extra"] .theme-menu {
  background: #FFFCF6; border: 2.5px solid #131313;
  border-radius: 30px 8px 30px 8px;
  box-shadow: 7px 7px 0 #131313;
  padding: 9px;
}
.omni-cabinet[data-theme="extra"] .theme-menu::after {
  background: #FFFCF6; border-color: #131313; border-width: 2.5px;
}
.omni-cabinet[data-theme="extra"] .theme-btn {
  border: 2px solid #131313; border-radius: 999px;
}
.omni-cabinet[data-theme="extra"] .theme-btn:hover { background: #FDF3DC; }
.omni-cabinet[data-theme="extra"] .theme-letters b { color: #131313; }
.omni-cabinet[data-theme="extra"] .theme-btn:hover .theme-letters b { color: #D62828; }

/* ===== КОГДА МЕНЮ ОТКРЫТО — НА КНОПКЕ ТОЛЬКО «Стиль» ===== */
.theme-wrap.is-open .theme-letters { display: none; }
.theme-wrap.is-open .theme-btn .nav-txt {
  display: inline;
  margin-left: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.omni-cabinet.is-collapsed .theme-wrap.is-open .theme-btn .nav-txt {
  display: inline;
  font-size: 12px;
}
.omni-cabinet.is-collapsed .theme-wrap.is-open .theme-btn { flex-direction: column; }


/* ===== ЗАКРЫТОЕ СОСТОЯНИЕ — ТОЛЬКО БУКВЫ «О Т Э» ===== */
.theme-wrap:not(.is-open) .theme-btn .nav-txt { display: none !important; }

/* ===== ФИНАЛЬНОЕ ПРАВИЛО =====
   ШИРОКАЯ панель  -> на кнопке слово «Стиль»
   УЗКАЯ  панель   -> на кнопке только «С»
   Состояние меню (открыто/закрыто) на текст кнопки НЕ влияет. */

/* широкая: буква скрыта, слово видно — всегда */
.omni-cabinet:not(.is-collapsed) .theme-btn .theme-letters { display: none !important; }
.omni-cabinet:not(.is-collapsed) .theme-btn .nav-txt {
  display: inline !important;
  margin-left: 0;
  font-size: 13.8px;
  font-weight: 600;
  color: var(--ink);
}

/* узкая: только буква «С» */
.omni-cabinet.is-collapsed .theme-btn .nav-txt { display: none !important; }
.omni-cabinet.is-collapsed .theme-btn .theme-letters {
  display: flex !important;
  flex-direction: row;
  justify-content: center;
}
.omni-cabinet.is-collapsed .theme-btn .theme-letters b { font-size: 16px; }

/* снимаем прежние правила «на кнопке только Стиль при открытом меню» */
.theme-wrap.is-open .theme-letters { display: revert; }
.omni-cabinet:not(.is-collapsed) .theme-wrap.is-open .theme-letters { display: none !important; }
.omni-cabinet.is-collapsed .theme-wrap.is-open .theme-letters { display: flex !important; }

/* ======================= ОМНИ - МАРКЕТ ======================= */
.market-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mf-btn {
  padding: 8px 16px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-mid);
  cursor: pointer;
  transition: all .15s;
}
.mf-btn:hover { border-color: var(--brand); color: var(--brand); }
.mf-btn.active {
  background: var(--ink);
  color: #FFFCF6;
  border-color: var(--ink);
}
.omni-cabinet[data-theme="dark"] .mf-btn.active { background: var(--gold); color: #1A1312; border-color: var(--gold); }
.omni-cabinet[data-theme="extra"] .mf-btn { border: 2px solid var(--ink); }
.omni-cabinet[data-theme="extra"] .mf-btn.active { background: var(--ink); color: #FFFCF6; box-shadow: 3px 3px 0 var(--brand); }

.market-section {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 34px 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.market-section::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.omni-cabinet[data-theme="extra"] .market-section {
  font-size: 19px;
}
.omni-cabinet[data-theme="extra"] .market-section::after {
  height: 2.5px;
  background: var(--ink);
}

/* скрытая карточка при фильтрации */
.svc-card.is-hidden { display: none; }
