/**
 * Header — шапка (референс: docs/design/screenshots/Компоненты/Header, naming.png)
 * Варианты (пропсы): --warning, --close, --order, --menu, --empty, --back, --header, --texts, --accordion, --timer, --geo-tooltip
 * 4. Menu — header--menu
 * 11. Geo + Tooltip — header--geo-tooltip
 * Слоты: header__left, header__center, header__right
 * Кнопки: IconButton (icon-button--40, icon-button--56)
 * Timer использует компонент Timer
 * Только токены из tokens.css
 */

@import 'icon-button.css';
@import 'timer.css';

.header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--Text-Styles-Value-font-family-master), sans-serif;
}

.header__left,
.header__center,
.header__right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header__left { flex-shrink: 0; }
.header__center { flex: 1; justify-content: center; text-align: center; }
.header__right { flex-shrink: 0; justify-content: flex-end; }

/* Tooltip в header — отступ от кнопки (Geo + Tooltip) */
.header__right .tooltip {
  margin-right: var(--Spacing-Value-spacing-4, 4px);
}

/* Заголовок */
.header__title {
  color: var(--Product-Theme-Light-text-basic-primary);
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
}

/* === Warning === */
/* Высота для отступов контента (отступ под баннер = высота header--warning) */
:root {
  --header-warning-height: 28px;
}
.header--warning {
  width: 100%;
  min-height: auto;
  padding: 2px 16px 2px 16px;
  background: var(--Product-Theme-Light-vector-color-critical-hover, #DE3531);
  border-radius: 0;
  border: none;
  cursor: pointer;
  text-align: left;
}

.header--warning .header__center {
  flex: 1;
  color: var(--Product-Theme-Light-text-basic-primary-on-color, white);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  text-align: center;
}

.header--warning .header__icon {
  color: var(--Product-Theme-Light-vector-basic-white-fixed, #ffffff);
}

.header__icon--caret-right {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: block;
  background-color: currentColor;
  mask: url('/masterclick/assets/icons/regular/caret-right.svg') no-repeat center / contain;
  -webkit-mask: url('/masterclick/assets/icons/regular/caret-right.svg') no-repeat center / contain;
}

/* === Empty === */
.header--empty {
  min-height: 32px;
  padding: 16px;
}

/* === Texts (центрированный блок) === */
.header--texts {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.header--texts .header__center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.header__text-title {
  color: var(--Product-Theme-Light-text-basic-primary);
  font-size: 24px;
  font-weight: 700;
  line-height: 28px;
  margin-bottom: 0;
}

.header__text-body {
  color: var(--Product-Theme-Light-text-basic-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  margin-top: 0;
}

.header__text-secondary {
  color: var(--Product-Theme-Light-text-basic-secondary);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  margin-top: 0;
}

/* === Accordion (время + label + caret) === */
.header--accordion {
  align-items: flex-start;
}

.header--accordion .header__left {
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
}

.header__accordion-time {
  color: var(--Product-Theme-Light-text-basic-primary);
  font-size: 24px;
  font-weight: 700;
  line-height: 28px;
}

.header__accordion-label {
  color: var(--Product-Theme-Light-text-basic-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
}

.header--accordion .header__left:focus-within .header__accordion-label {
  color: var(--Product-Theme-Light-text-basic-secondary);
}

/* === Timer (заголовок + прогресс + текст) === */
.header--timer {
  flex-direction: column;
  align-items: stretch;
  gap: var(--Spacing-Value-spacing-6);
}

.header--timer .header__center {
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

.header__timer-title {
  color: var(--Product-Theme-Light-text-basic-primary);
  font-size: 24px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}

.header__timer-body {
  color: var(--Product-Theme-Light-text-basic-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
}

.header__timer-note {
  color: var(--Product-Theme-Light-text-basic-secondary);
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  margin-top: var(--Spacing-Value-spacing-8);
}

.header__timer-note--primary {
  color: var(--Product-Theme-Light-text-basic-primary);
}

/* === 4. Menu === */
.header--menu {
  /* Вариант: меню слева, center и right пустые */
}

/* === 11. Geo + Tooltip === */
.header--geo-tooltip {
  /* Вариант: tooltip + geo справа, left — back или placeholder */
}

/* Кнопка «N заказ» в header--geo-tooltip (активные заказы) — светлый чип, число и слово в две строки */
.header-orders-btn[hidden] {
  display: none !important;
}
.header-orders-btn {
  box-sizing: border-box;
  height: var(--Components-Value-button-xxl-height);
  padding-left: var(--Components-Value-button-xxl-padding-width);
  padding-right: var(--Components-Value-button-xxl-padding-width);
  border-radius: var(--Radius-Value-buttons-and-controls);
  background: var(--Product-Theme-Light-bg-basic);
  color: var(--Product-Theme-Light-text-basic-primary);
  font-family: var(--Text-Styles-Value-font-family-master), sans-serif;
  border: none;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.header-orders-btn__line1 {
  font-size: var(--Text-Styles-Value-font-size-18);
  font-weight: 700;
  line-height: 18px;
}
.header-orders-btn__line2 {
  font-size: var(--Text-Styles-Value-font-size-14);
  font-weight: 500;
  line-height: 14px;
}
.header-orders-btn:focus-visible {
  outline: 4px solid var(--Product-Theme-Light-border-basic-focus);
  outline-offset: -4px;
}

.header--geo-tooltip .header__left .icon-button--back {
  display: none;
}
.header--geo-tooltip .icon-button--secondary-selected {
  background: var(--Product-Theme-Light-controls-secondary-selected-fixed, #ffffff);
  opacity: 1;
}
