/* =============================================================================
   E-COMMERCE SHOP - OZON-LIKE STYLES
   Production-ready, mobile-first, 320px–1920px
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (VARIABLES)
   ----------------------------------------------------------------------------- */
:root {
  --primary: #005BFF;
  --primary-hover: #0050E0;
  --primary-light: rgba(0, 91, 255, 0.1);
  --accent: #FF5722;
  --accent-hover: #E64A19;
  --bg: #F5F5F5;
  --bg-secondary: #FAFAFA;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #E0E0E0;
  --border-light: #EEEEEE;
  --success: #4CAF50;
  --success-bg: rgba(76, 175, 80, 0.1);
  --danger: #F44336;
  --danger-bg: rgba(244, 67, 54, 0.1);
  --warning: #FF9800;
  --warning-bg: rgba(255, 152, 0, 0.1);
  --info: #2196F3;
  --info-bg: rgba(33, 150, 243, 0.1);
  --group-chip: #5B9A6E;
  --group-chip-hover: #477A56;
  --group-chip-light: rgba(165, 214, 167, 0.45);
  --group-chip-active-bg: rgba(129, 199, 149, 0.55);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --transition: 0.2s ease;
  
  --font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --container-max: 1280px;
  --header-height: 56px;
  /* Иконки шапки (корзина, меню, моб. чипы) — эталон высоты лого на узком экране */
  --header-control-height: 40px;
  /* Десктоп: как пилюли .header__nav-link; мобильный — как --header-control-height */
  --header-logo-height: calc(var(--header-height) - 18px);
  --header-logo-width: calc(var(--header-logo-height) * 68 / 38);
}

@media (max-width: 768px) {
  :root {
    --header-logo-height: var(--header-control-height);
    --header-logo-width: min(120px, 38vw);
  }
}

@media (max-width: 360px) {
  :root {
    --header-control-height: 36px;
  }
}

/* Предзаказ: блок «В корзине» на карточках и в модалке */
.cart-qty-row.cart-qty-row--preorder {
  background: #FF9800 !important;
}

.logo-dark { display: none !important; }

[data-theme="dark"] {
  color-scheme: dark;
  --primary: #4D9AFF;
  --primary-hover: #6BABFF;
  --primary-light: rgba(77, 154, 255, 0.2);
  --accent: #FF7043;
  --accent-hover: #FF8A65;
  --bg: #121212;
  --bg-secondary: #1E1E1E;
  --card: #252525;
  --text: #F5F5F5;
  --text-secondary: #B0B0B0;
  --text-muted: #808080;
  --border: #404040;
  --border-light: #333333;
  --group-chip: #8FD3A3;
  --group-chip-hover: #A8E6BC;
  --group-chip-light: rgba(143, 211, 163, 0.22);
  --group-chip-active-bg: rgba(129, 199, 149, 0.32);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Push UI (профиль / админка): цвет статуса из JS — классы, чтобы тёмная тема могла переопределить */
.push-status-msg--success {
  color: #198754;
}

.push-status-msg--error {
  color: #c62828;
}

.push-status-msg--muted {
  color: #666;
}

[data-theme="dark"] .push-status-msg--success {
  color: #81c784 !important;
}

[data-theme="dark"] .push-status-msg--error {
  color: #ef9a9a !important;
}

[data-theme="dark"] .push-status-msg--muted {
  color: var(--text-secondary) !important;
}

/* Тёмная тема: общие детали UI (без отдельного HTTP; модули theme-dark/*.css — только зоны страниц) */
[data-theme="dark"] ::selection {
  background: rgba(77, 154, 255, 0.35);
  color: inherit;
}

[data-theme="dark"] :focus-visible:not(.header__search-expand-input):not(.header__search-expand-close):not(.header__search-expand-trigger):not(.header__search-clear) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[data-theme="dark"] body {
  -webkit-tap-highlight-color: rgba(77, 154, 255, 0.2);
}

[data-theme="dark"] * {
  scrollbar-color: var(--border) var(--bg-secondary);
}
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }
/* Шапка: оба img в layout, переключение через opacity (site-chrome.css) */
.header__logo-mark .logo-light,
.header__logo-mark .logo-dark,
[data-theme="dark"] .header__logo-mark .logo-light,
[data-theme="dark"] .header__logo-mark .logo-dark {
  display: block !important;
}
/* Подложка под фото товара: витрина (.product-card) и модалка — белая в светлой теме; в тёмной — тёмное «поле» под превью */
.product-card__image-wrap,
.pd-gallery { background: #fff !important; }
[data-theme="dark"] .product-card__image-wrap,
[data-theme="dark"] .pd-gallery { background: var(--card, #252525) !important; }
[data-theme="dark"] .product-card {
  border: 1px solid var(--border);
  box-shadow: none;
}
[data-theme="dark"] .product-card__image-wrap {
  border-bottom: 1px solid var(--border);
}

/* -----------------------------------------------------------------------------
   2. RESET + BASE STYLES
   ----------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  min-width: 280px;
  overflow-x: hidden;
  /* Липкий футер: цепочка высоты + фон до низа окна (без «полосы» под футером) */
  height: 100%;
  background: var(--bg);
}
@supports (overflow: clip) {
  html {
    overflow-x: clip;
  }
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
@supports (overflow: clip) {
  body {
    overflow-x: clip;
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* -----------------------------------------------------------------------------
   3. LAYOUT & CONTAINER
   ----------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .container { padding: 0 24px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 32px; }
}

/* Вход / регистрация / восстановление пароля — на мобильном форма уже на 10% */
@media (max-width: 768px) {
  body.page-auth main.container {
    width: 90% !important;
    max-width: 432px !important; /* 480px × 0.9 */
    box-sizing: border-box;
  }
}

/* Регистрация: Email и телефон в одну строку (на мобильном — столбиком) */
body.page-auth .auth-reg-contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  margin-bottom: 16px;
}

body.page-auth .auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
  flex-wrap: wrap;
}

body.page-auth .auth-remember-row__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .88rem;
  margin: 0;
}

body.page-auth .auth-remember-row__forgot {
  font-size: .88rem;
  white-space: nowrap;
}

body.page-auth .auth-reg-contact-row .form-group {
  margin-bottom: 0;
  min-width: 0;
}

@media (max-width: 768px) {
  body.page-auth .auth-reg-contact-row {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }
}

/* Регистрация: подсказки DaData в одной строке адреса */
body.page-auth .auth-reg-addr-suggest-wrap.addr-suggest-wrap {
  position: relative;
}

body.page-auth .auth-reg-addr-suggest-wrap .addr-suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 2px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  font-size: 0.84rem;
}

body.page-auth .auth-reg-addr-suggest-wrap .addr-suggest-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: #222;
  line-height: 1.35;
  box-sizing: border-box;
}

body.page-auth .auth-reg-addr-suggest-wrap .addr-suggest-list button:hover,
body.page-auth .auth-reg-addr-suggest-wrap .addr-suggest-list button:focus {
  background: #f0f7ff;
  outline: none;
}

/* -----------------------------------------------------------------------------
   4. HEADER
   ----------------------------------------------------------------------------- */
.header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  /* 100% вместо 100vw — в WebView (Telegram и др.) 100vw может вызывать горизонтальный скролл */
  max-width: 100%;
  min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  background: var(--card);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  padding: env(safe-area-inset-top, 0) 16px 0;
  overflow: hidden;
  /* contain: layout убран — в WebView Telegram может ломать верстку шапки */
}
/* Три колонки: логотип | меню/моб. иконки | действия — иначе flex + min-width:max-content у действий
   даёт наезжание кнопок на логотип при узком окне */
.header__inner {
  display: grid;
  /* max-content — логотип не отдаёт ширину полоске иконок; иначе на iOS кнопки заезжают под лого */
  grid-template-columns: max-content minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  width: 100%;
  min-width: 0;
  max-width: var(--container-max);
  margin: 0 auto;
  flex: 1 1 auto;
}

/* Настраиваемое меню: десктоп — ссылки в шапке; мобильный — кнопка «бургер» и выпадающая панель */
.header__nav {
  display: none;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.header__nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 0;
  transition: color var(--transition), border-color var(--transition);
}
.header__nav-link:hover {
  color: var(--primary);
  text-decoration: none;
}
.header__nav-dropdown {
  position: relative;
  flex-shrink: 0;
}
.header__nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  font: inherit;
}
.header__nav-dropdown-caret {
  font-size: 0.65rem;
  opacity: 0.75;
}
.header__nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  max-width: min(280px, 80vw);
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #dbeafe;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  z-index: 120;
}
.header__nav-dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header__nav-dropdown-item:hover {
  background: rgba(0, 91, 255, 0.08);
  color: var(--primary);
  text-decoration: none;
}
.header__nav-dropdown-item.is-active {
  background: rgba(0, 91, 255, 0.12);
  color: var(--primary);
  font-weight: 600;
}

[data-theme="dark"] .header__nav-dropdown-panel {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .header__nav-dropdown-item {
  color: var(--text);
}

[data-theme="dark"] .header__nav-dropdown-item:hover {
  background: rgba(77, 154, 255, 0.14);
  color: #7eb8ff;
}

[data-theme="dark"] .header__nav-dropdown-item.is-active {
  background: rgba(77, 154, 255, 0.22);
  color: #7eb8ff;
}

.header__mobmenu-sub {
  padding: 4px 0 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.header__mobmenu-sub-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 14px 4px;
}
.header__mobmenu-link--sub {
  padding-left: 22px;
  font-size: 0.92rem;
}
.header__mobicon--groups-menu {
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
}
.header__mobmenu-panel--catalog .header__mobmenu-nav--nav-overflow,
.header__mobmenu-panel--catalog .header__mobmenu-nav--overflow {
  display: none !important;
}
.header__mobmenu-nav--catalog-only > .header__mobmenu-link {
  display: none !important;
}
.header__mobmenu-nav--catalog-only .header__mobmenu-sub {
  display: block;
  border-bottom: none;
  padding-top: 0;
}
.header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only,
#lk-app .header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only {
  text-align: left;
}
.header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only .header__mobmenu-link,
.header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only .header__mobmenu-link--sub,
#lk-app .header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only .header__mobmenu-link,
#lk-app .header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only .header__mobmenu-link--sub {
  text-align: left;
}
.header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only .header__mobmenu-sub-title,
#lk-app .header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only .header__mobmenu-sub-title {
  padding: 12px 16px 4px;
  text-align: center;
}
.header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only .header__mobmenu-link--sub,
#lk-app .header__mobmenu-panel--catalog .header__mobmenu-nav--catalog-only .header__mobmenu-link--sub {
  padding-left: 16px;
  font-size: 0.95rem;
}
@media (min-width: 768px) {
  .header__nav {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    justify-content: flex-start;
    max-width: 100%;
  }
  .header--desk-nav-overflow .header__nav {
    /* Колонка действий идёт в DOM после nav и при узкой ширине может перекрывать край последней ссылки */
    padding-right: 14px;
    box-sizing: border-box;
  }
  .header__nav-link {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #93c5fd;
    box-sizing: border-box;
  }
  .header__nav-link:hover {
    border-color: #2563eb;
    color: #1d4ed8;
  }
  /* Чуть больше зазор между меню и блоком с бургером, когда бургер показан */
  .header.header--desk-nav-overflow .header__inner {
    column-gap: 20px;
  }
  /* На десктопе панель бургера только если есть «ещё» из текстового меню */
  .header:not(.header--desk-nav-overflow) .header__mobmenu-panel {
    display: none !important;
  }
  .header--desk-nav-overflow #site-menu-classic {
    display: none !important;
  }
}

/* Активная страница в настраиваемом меню шапки */
.header__nav-link.header__nav-link--active,
.header__nav-link[aria-current="page"] {
  color: var(--primary, #005bff);
  font-weight: 600;
}
@media (min-width: 768px) {
  .header__nav-link.header__nav-link--active,
  .header__nav-link[aria-current="page"] {
    border-color: #2563eb;
    background: rgba(0, 91, 255, 0.1);
    color: #1d4ed8;
  }
}
.header__mobicon.header__mobicon--active,
.header__mobicon[aria-current="page"] {
  border-color: #2563eb;
  background: rgba(0, 91, 255, 0.12);
  color: var(--primary, #005bff);
}
.header__mobmenu-link.header__mobmenu-link--active,
.header__mobmenu-link[aria-current="page"] {
  color: var(--primary, #005bff);
  font-weight: 600;
  background: transparent;
}
.header__mobmenu-nav--nav-overflow .header__nav-link.header__nav-link--active,
.header__mobmenu-nav--nav-overflow .header__nav-link[aria-current="page"] {
  color: var(--primary, #005bff);
  background: transparent;
  font-weight: 600;
  border: none;
  box-shadow: none;
}

.header__icon-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.header__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid #93c5fd;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  box-sizing: border-box;
}
.header__menu-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #2563eb;
}
@media (max-width: 767px) {
  .header--has-menu:not(.header--mobicons) .header__menu-btn,
  .header--has-menu.header--mobicons-overflow .header__menu-btn {
    display: flex;
  }
  .header--has-menu.header--mobicons:not(.header--mobicons-overflow) .header__menu-btn {
    display: none !important;
  }
}
@media (min-width: 768px) {
  .header--has-menu.header--desk-nav-overflow .header__menu-btn {
    display: flex;
  }
}

/* Мобильное меню шапки: полоска квадратных кнопок между логотипом и действиями */
.header__mobicons-tray {
  display: none;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  align-items: center;
  /* Лоток растягивается между логотипом и действиями — прижимаем полоску кнопок к корзине/профилю */
  justify-content: flex-end;
}
.header__mobicons-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.header__mobicon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid #93c5fd;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.header__mobicon:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #2563eb;
  text-decoration: none;
}
.header__mobicon i {
  font-size: 1rem;
  line-height: 1;
}
.header__mobicon-abbr {
  display: block;
  max-width: 2.1em;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  text-align: center;
}
.header__mobicon-label {
  display: none;
}
@media (max-width: 767px) {
  .header--mobicons .header__mobicons-tray {
    display: flex;
  }
}
@media (min-width: 768px) {
  .header__mobicons-tray {
    display: none !important;
  }
}
.header__mobmenu-nav--overflow .header__mobicon {
  width: 100%;
  height: auto;
  min-height: 44px;
  border-radius: 0;
  border: none;
  box-shadow: none;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 500;
}
.header__mobmenu-nav--overflow .header__mobicon-slot {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}
.header__mobmenu-nav--overflow .header__mobicon-label {
  display: inline;
  text-align: left;
  white-space: normal;
  line-height: 1.25;
}
.header__mobmenu-nav--overflow .header__mobicon:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}

.header.header--menu-open {
  overflow: visible;
}
/* Выпадающий «Каталог» (группы товаров) позиционируется ниже кнопки — иначе overflow:hidden у .header / .header__nav обрезает панель */
.header.header--nav-dropdown-open {
  overflow: visible;
}
@media (min-width: 768px) {
  .header.header--nav-dropdown-open .header__nav {
    overflow: visible;
  }
}
.header__mobmenu-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 12000;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  -webkit-tap-highlight-color: transparent;
}
.header__mobmenu-panel[hidden] {
  display: none !important;
}
/* [hidden] на <nav> иначе перебивается правилом .header__mobmenu-nav { display: flex } — в панели дублируются overflow и «классические» ссылки */
.header__mobmenu-panel .header__mobmenu-nav[hidden] {
  display: none !important;
}
.header__mobmenu-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 8px 16px 16px;
  max-width: var(--container-max);
  margin: 0 auto;
  gap: 0;
  text-align: center;
}
.header__mobmenu-link {
  display: block;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  text-align: center;
}
.header__mobmenu-link:hover {
  color: var(--primary);
}
/* В панели бургера — без синей системной обводки и синего tap-flash на iOS */
.header__mobmenu-panel .header__mobmenu-link:focus-visible,
.header__mobmenu-panel .header__mobmenu-nav--nav-overflow .header__nav-link:focus-visible,
.header__mobmenu-panel .header__mobmenu-nav--overflow .header__mobicon:focus-visible {
  outline: 2px solid var(--border);
  outline-offset: -2px;
}
/* Пункты .header__nav, перенесённые в бургер на узком десктопе */
.header__mobmenu-nav--nav-overflow .header__nav-link {
  display: block;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  text-align: center;
  border-radius: 0 !important;
  /* Снять «пилюлю» из @media (min-width:768px) .header__nav-link { border: 1px solid #93c5fd } */
  border: none;
  box-shadow: none;
}
.header__mobmenu-nav--nav-overflow .header__nav-link:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}

[data-theme="dark"] .header__mobmenu-nav--overflow .header__mobicon-slot {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text-secondary);
}
[data-theme="dark"] .header__mobmenu-nav--overflow .header__mobicon-slot i {
  color: var(--text-secondary);
}
[data-theme="dark"] .header__mobmenu-sub {
  border-bottom-color: var(--border);
}
[data-theme="dark"] .header__mobmenu-sub-title {
  color: var(--text-muted);
}
[data-theme="dark"] .header__mobicon {
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .header__mobicon:hover {
  border-color: var(--primary);
  background: rgba(77, 154, 255, 0.12);
  color: var(--primary);
}

/* Нижняя мобильная панель быстрых ссылок */
.site-mobile-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  justify-content: space-around;
  align-items: stretch;
  gap: 4px;
}
body.site-mobile-bar-on .site-mobile-bar {
  display: flex;
}
.site-mobile-bar__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background var(--transition), color var(--transition);
}
.site-mobile-bar__item i {
  font-size: 1.15rem;
  color: var(--text);
}
.site-mobile-bar__item:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}
.site-mobile-bar__item:hover i {
  color: var(--primary);
}
.site-mobile-bar__label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
}
.site-mobile-bar--icons-only .site-mobile-bar__item {
  padding: 10px 6px;
  font-size: 0;
}
.site-mobile-bar--icons-only .site-mobile-bar__item i {
  font-size: 1.35rem;
}
@media (min-width: 768px) {
  .site-mobile-bar {
    display: none !important;
  }
  body.site-mobile-bar-on {
    padding-bottom: 0 !important;
  }
}
body.site-mobile-bar-on {
  padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}

/* Sticky верхняя панель в админке (общий класс) */
.admin-topbar--sticky {
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.admin-topbar--sticky-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
/* Совпадает с разметкой admin: class="admin-topbar__row" */
.admin-topbar__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Админка: прокрутка только в .admin-main / .am — шапки position:sticky прилипают к верху области */
body .admin-layout,
body .al {
  display: flex;
  align-items: stretch;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}
body .admin-sidebar {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-self: stretch;
}
body .admin-main,
body .am {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px), (max-height: 520px) and (max-width: 960px) {
  body .admin-layout,
  body .al {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body .admin-main,
  body .am {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overscroll-behavior-x: none;
  }
}

@supports not (overflow: clip) {
  @media (max-width: 768px), (max-height: 520px) and (max-width: 960px) {
    body .admin-main,
    body .am {
      overflow-x: hidden;
    }
  }
}
/* Шапка может быть не прямым ребёнком main (напр. notification-service) */
body .admin-main header.admin-topbar,
body .am > header.at,
body .am > .at {
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

@media (max-width: 767px) {
  body.site-mobile-bar-on #floating-cart {
    bottom: calc(80px + 52px + env(safe-area-inset-bottom, 0px));
  }
  body.site-mobile-bar-on #mob-scroll-top {
    bottom: calc(24px + 52px + env(safe-area-inset-bottom, 0px));
  }
  /* Корзина уже в нижней панели — дублирующая плавающая кнопка не нужна */
  body.site-mbar-has-cart #floating-cart {
    display: none !important;
    pointer-events: none;
  }
}

.header__logo {
  grid-column: 1;
  grid-row: 1;
  flex-shrink: 0;
  min-width: min-content;
  position: relative;
  z-index: 2;
  padding-right: 4px;
  margin-right: 2px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  max-width: 240px;
  min-height: var(--header-logo-height);
  contain: layout style paint;
}

.header__logo .logo-light,
.header__logo .logo-dark {
  flex-shrink: 0;
}

.header__logo:hover {
  text-decoration: none;
  color: var(--primary-hover);
}

.header__logo img {
  display: block;
  flex-shrink: 0;
  height: var(--header-logo-height);
  max-height: var(--header-logo-height);
  max-width: var(--header-logo-width);
  width: auto;
  object-fit: contain;
  object-position: left center;
}

.header__logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Коллапсируемый поиск: иконка у корзины, раскрывается влево при клике/фокусе */
.header__search-expand {
  position: relative;
  flex-shrink: 0;
  z-index: 10;
  /* Пока поиск свёрнут — явная ширина под кнопку-триггер, иначе при переполнении строки flex может сжать блок до 0 и обрезать лупу */
  min-width: 40px;
  box-sizing: border-box;
}
.header--search-open .header__search-expand {
  min-width: 0;
}
.header__search-expand-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}
.header__search-expand-inner {
  position: absolute;
  right: 44px; /* слева от кнопки-триггера (40px + 4px gap) */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  width: 0;
  max-width: min(297.6px, calc((100vw - 180px) * 0.93));
  overflow: hidden;
  transition: width .25s ease;
  background: var(--card);
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.header__search-expand.is-open .header__search-expand-inner {
  width: min(297.6px, calc((100vw - 180px) * 0.93));
}
.header__search-expand-input {
  width: 100%;
  min-width: 180px;
  height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  /* iOS Safari: при <16px при фокусе зум страницы, после blur не всегда сбрасывается */
  font-size: 16px;
  outline: none;
}
.header__search-expand-input:focus,
.header__search-expand-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.header__search-expand-inner:focus-within {
  border-color: var(--border);
  outline: none !important;
}
.header__search-clear:focus,
.header__search-clear:focus-visible,
.header__search-expand-close:focus,
.header__search-expand-close:focus-visible,
.header__search-expand-trigger:focus,
.header__search-expand-trigger:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
[data-theme="dark"] .header__search-expand-input:focus,
[data-theme="dark"] .header__search-expand-input:focus-visible,
[data-theme="dark"] .header__search-expand-close:focus,
[data-theme="dark"] .header__search-expand-close:focus-visible,
[data-theme="dark"] .header__search-expand-trigger:focus,
[data-theme="dark"] .header__search-expand-trigger:focus-visible,
[data-theme="dark"] .header__search-clear:focus,
[data-theme="dark"] .header__search-clear:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
[data-theme="dark"] .header__search-expand-inner:focus-within {
  border-color: var(--border) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
  outline: none !important;
}
.header__search-expand-input::placeholder { color: var(--text-muted); }
[data-theme="dark"] .header__search-expand-input,
[data-theme="dark"] .header__search-expand.is-open .header__search-expand-input,
[data-theme="dark"] .header--search-open .header__search-expand-input {
  background: transparent;
  border: none;
  color: var(--text);
}
/* type=search даёт вторую «×» в Safari/Chrome; при text оставляем только нашу кнопку .header__search-clear */
.header__search-expand-input::-webkit-search-decoration,
.header__search-expand-input::-webkit-search-cancel-button,
.header__search-expand-input::-webkit-search-results-button,
.header__search-expand-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.header__search-expand-icon {
  display: none;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.header__search-expand.is-open .header__search-expand-icon { display: block; }
.header__search-expand.is-open .header__search-expand-input { padding-left: 36px; }
.header__search-expand-inner:has(.header__search-clear:not([hidden])) .header__search-expand-input {
  padding-right: 32px;
}
.header__search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.header__search-clear:hover {
  color: var(--text);
  background: var(--primary-light);
}
.header__search-expand.is-open .header__search-clear:not([hidden]) {
  display: flex;
}
.header__search-expand-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.header__search-expand-trigger:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.header__search-expand-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}
@media (max-width: 768px) {
  .header__search-expand.is-open .header__search-expand-close { display: flex; }
}

/* Десктоп: раскрытый поиск на всю ширину между логотипом и корзиной; кнопка-лупа скрыта (left/right выставляет script.js) */
@media (min-width: 769px) {
  .header__inner {
    position: relative;
  }
  .header--search-open .header__search-expand {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    height: 40px;
    min-width: 0;
    box-sizing: border-box;
  }
  .header--search-open .header__search-expand-trigger {
    display: none !important;
  }
  .header--search-open .header__search-expand-form {
    width: 100%;
    height: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
  }
  .header--search-open .header__search-expand-inner {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    transition: none;
  }
  .header--search-open .header__search-expand-input:focus,
  .header--search-open .header__search-expand-input:focus-visible,
  .header--search-open .header__search-clear:focus,
  .header--search-open .header__search-clear:focus-visible {
    outline: none !important;
    box-shadow: none !important;
  }
  .header--search-open .header__search-expand-inner:focus-within {
    border-color: var(--border) !important;
    outline: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
  }
  [data-theme="dark"] .header--search-open .header__search-expand-inner:focus-within {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35) !important;
  }
}

.header__actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  flex-shrink: 0;
  /* Без position:relative — иначе абсолютный блок поиска (desktop) позиционируется от .header__actions,
   * а script.js layoutDesktopSearchExpand() считает left/right от .header__inner → поле «не открывается». */
  position: static;
  min-width: 0;
  max-width: 100%;
}

.header__cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #93c5fd;
  border-radius: var(--radius-md);
  color: var(--text);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  box-sizing: border-box;
}

.header__cart:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
  border-color: #2563eb;
}

.header__cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  background: var(--accent);
  color: white;
  border-radius: 9px;
}

/* Hide badge when cart is empty */
.header__cart-badge[data-cart-badge="0"],
.cart-badge[data-cart-badge="0"] {
  display: none;
}

/* Quantity input styles */
.qty-input {
  width: 50px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.9rem;
  margin: 0 4px;
  /* Hide arrows in all browsers */
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: none;
}

/* Hide arrows in WebKit browsers */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Hide arrows in IE/Edge */
.qty-input::-ms-clear {
  display: none;
}

.qty-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 91, 255, 0.2);
}

.cart-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-qty-ctrl button {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.cart-qty-ctrl button:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Clear cart button */
.clear-cart-btn {
  margin-top: 16px;
  padding: 10px 16px;
  background: #fff;
  color: var(--danger, #ef4444);
  border: 1px solid var(--danger, #ef4444);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.clear-cart-btn:hover {
  background: var(--danger, #ef4444);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.clear-cart-btn:active {
  transform: translateY(0);
}

/* Mobile styles for clear cart button */
@media (max-width: 768px) {
  .clear-cart-btn {
    margin-top: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
  }
  
  .clear-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  }
}

@media (max-width: 400px) {
  .clear-cart-btn {
    margin-top: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    border-radius: 6px;
  }
}

.header__user-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header__user-menu {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(58vw, 480px);
  min-width: 0;
}

@media (min-width: 768px) {
  .header__user-menu { display: flex; }
}

.header__user-menu-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  max-width: min(100%, 280px);
  min-width: 0;
  text-align: left;
  line-height: 1.25;
}

.header__user-menu-ava {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.header__user-menu-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.header__user-menu-name {
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header__user-menu-google {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.header__user-menu-google-ok {
  color: #2e7d32;
  font-weight: 600;
}

.header__user-pw-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff3e0;
  color: #e65100;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.header__user-pw-badge:hover {
  background: #ffe0b2;
  color: #bf360c;
}

.header__logout-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #93c5fd;
  border-radius: var(--radius-md);
  color: var(--text);
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.header__logout-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
  border-color: #2563eb;
}

@media (min-width: 768px) {
  .header__logout-btn { display: inline-flex; }
}

.header__user-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #93c5fd;
  border-radius: var(--radius-md);
  color: var(--text);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  box-sizing: border-box;
  overflow: hidden;
}
.header__user-icon:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
  border-color: #2563eb;
}

.header__user-icon-img {
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.header__logout-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #93c5fd;
  border-radius: var(--radius-md);
  color: var(--text);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  box-sizing: border-box;
}
.header__logout-icon:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
  border-color: #2563eb;
}

@media (max-width: 767px) {
  .header__user-icon { display: flex; }
  .header__logout-icon { display: flex; }
}

@media (min-width: 768px) {
  .header__user-icon { display: none !important; }
  .header__logout-icon { display: none !important; }
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 16px;
  background: var(--card);
  border-top: 1px solid var(--border);
  gap: 8px;
}

.nav-mobile.open {
  display: flex;
}

/* -----------------------------------------------------------------------------
   5. CATEGORY NAVIGATION
   Моб.: одна строка — группы, затем категории. Десктоп: две строки, у каждой свой скролл.
   ----------------------------------------------------------------------------- */
.category-nav {
  --category-nav-gap: 6px;
  padding: 12px 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.category-nav__list {
  display: block;
  padding: 6px 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.category-nav__rows {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--category-nav-gap);
  width: 100%;
  min-width: 0;
}

.category-nav__scroll-btn {
  display: none;
}

.category-nav__row.category-nav__row--mob {
  display: none;
}

.category-nav__row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--category-nav-gap);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.category-nav__row::-webkit-scrollbar {
  display: none;
}

@media (min-width: 641px) {
  .category-nav {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 12px 0;
  }
  .category-nav__list.container {
    flex: 0 1 var(--container-max);
    width: auto;
    max-width: var(--container-max);
    min-width: 0;
    margin: 0;
    padding: 6px 0;
  }
  body.page-index .index-top-sticky .category-nav__list.container {
    padding-left: 0;
    padding-right: 0;
  }
  .category-nav__scroll-slot {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: stretch;
    align-self: stretch;
  }
  .category-nav__scroll-slot--prev {
    padding-right: 4px;
  }
  .category-nav__scroll-slot--next {
    padding-left: 4px;
  }
  .category-nav__scroll-btn {
    flex: 1 1 auto;
    width: 100%;
    align-self: stretch;
    min-height: 44px;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: opacity var(--transition);
    -webkit-tap-highlight-color: transparent;
  }
  .category-nav__scroll-btn--prev {
    justify-content: flex-end;
  }
  .category-nav__scroll-btn--next {
    justify-content: flex-start;
  }
  .category-nav__scroll-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    flex-shrink: 0;
    color: inherit;
    background: transparent;
    transition: color var(--transition), background var(--transition);
    pointer-events: none;
  }
  .category-nav__scroll-btn-icon i {
    font-size: 0.95rem;
    line-height: 1;
    pointer-events: none;
  }
  @media (hover: hover) and (pointer: fine) {
    .category-nav__scroll-btn:not(.category-nav__scroll-btn--inactive):hover .category-nav__scroll-btn-icon {
      color: var(--primary);
      background: rgba(0, 91, 255, 0.06);
    }
  }
  .category-nav__scroll-btn:focus {
    outline: none;
  }
  .category-nav__scroll-btn:focus-visible .category-nav__scroll-btn-icon {
    outline: 2px solid rgba(0, 91, 255, 0.35);
    outline-offset: 1px;
  }
  .category-nav__scroll-btn--inactive,
  .category-nav__scroll-btn--inactive:hover,
  .category-nav__scroll-btn--inactive:focus,
  .category-nav__scroll-btn--inactive:focus-visible {
    opacity: 0.28;
    cursor: default;
    color: var(--text-secondary) !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    transition: opacity var(--transition);
  }
  .category-nav__scroll-btn--inactive .category-nav__scroll-btn-icon,
  .category-nav__scroll-btn--inactive:hover .category-nav__scroll-btn-icon,
  .category-nav__scroll-btn--inactive:focus .category-nav__scroll-btn-icon,
  .category-nav__scroll-btn--inactive:focus-visible .category-nav__scroll-btn-icon {
    color: var(--text-secondary) !important;
    background: transparent !important;
    outline: none !important;
  }
  .category-nav__row.category-nav__row--mob {
    display: none !important;
  }
}

.category-nav__pill {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: 20px;
  white-space: nowrap;
  transition: all var(--transition);
}

.category-nav__pill:hover,
.category-nav__pill.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

/* Группы товаров: отдельная палитра (бледно-зелёная), чтобы отличать от категорий */
.category-nav__row--groups .category-nav__pill,
.category-nav__pill--group {
  background: var(--group-chip-light);
  color: var(--group-chip);
}

.category-nav__row--groups .category-nav__pill:hover,
.category-nav__row--groups .category-nav__pill.active,
.category-nav__pill--group:hover,
.category-nav__pill--group.active {
  background: var(--group-chip-active-bg);
  color: var(--group-chip-hover);
  text-decoration: none;
}

@media (max-width: 640px) {
  .category-nav__scroll-slot {
    display: none !important;
  }
  .category-nav__rows--desk {
    display: none !important;
  }
  .category-nav__row.category-nav__row--mob {
    display: flex;
  }
  /* Mobile catalog nav: keep only category chips, hide product-group chips */
  .category-nav__row.category-nav__row--mob .category-nav__pill--group {
    display: none;
  }
}

@media (max-width: 640px) {
  .category-nav__pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  .category-nav__pill.active {
    background: var(--primary, #005BFF) !important;
    color: #fff !important;
    border-color: var(--primary, #005BFF) !important;
  }
  .category-nav__row--groups .category-nav__pill.active,
  .category-nav__pill--group.active {
    background: var(--group-chip, #5B9A6E) !important;
    color: #fff !important;
    border-color: var(--group-chip, #5B9A6E) !important;
  }
}

/* Sidebar for desktop */
.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
    width: 240px;
    flex-shrink: 0;
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + 24px);
  }
  
  .sidebar__nav-item {
    display: block;
    padding: 10px 12px;
    color: var(--text);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: background var(--transition);
  }
  
  .sidebar__nav-item:hover,
  .sidebar__nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
  }
}

/* -----------------------------------------------------------------------------
   6. PRODUCT GRID
   ----------------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 0;
  align-items: stretch;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1280px) {
  .product-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.product-card {
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  /* Сетка: фиксированная зона превью + тело на 1fr — одинаковая высота карточек в ряду */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-content: stretch;
  min-width: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
}

/* Превью: высота только от ширины колонки (padding-bottom), без aspect-ratio — стабильно при resize */
.product-card__image-wrap {
  grid-row: 1;
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 0;
  padding-bottom: 100%;
  overflow: hidden;
  background: #f5f5f5;
  min-width: 0;
  min-height: 0;
}

.product-card__image-wrap > .product-card__image,
.product-card__image {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  display: block;
  z-index: 0;
}

/* Боковые зоны превью (как в модалке): 30% слева/справа — листание; центр — клик по карточке → модалка */
.product-card__img-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
}
.product-card__img-hit--prev {
  left: 0;
}
.product-card__img-hit--next {
  right: 0;
}

/* Индикатор фото (как на маркетплейсах): точки под превью */
.product-card__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  z-index: 4;
  pointer-events: auto;
  flex-wrap: wrap;
  padding: 0 8px;
  box-sizing: border-box;
}
.product-card__dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.product-card__dot.is-active {
  background: var(--primary, #005bff);
  transform: scale(1.2);
}
[data-theme="dark"] .product-card__dot {
  background: rgba(255, 255, 255, 0.35);
}
[data-theme="dark"] .product-card__dot.is-active {
  background: var(--primary, #5b9fff);
}

.product-card__badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--danger);
  color: white;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  vertical-align: baseline;
}

.product-card__body {
  grid-row: 2;
  padding: 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* В ряду сетки карточки одной высоты — кнопка внизу тела карточки */
.product-card__body .cart-btn-wrap {
  margin-top: 6px;
  min-height: 38px;
}

.product-card .cart-add-btn,
.product-card .cart-qty-row {
  min-height: 38px;
  height: 38px;
  box-sizing: border-box;
  width: 100%;
}

.product-card .cart-qty-row {
  padding: 4px 8px;
}

.product-card .cart-qty-ctrl button {
  width: 32px;
  height: 30px;
  font-size: 1.15rem;
}

.product-card .cart-add-btn {
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.2;
}

/* Та же высота, что у btn-primary (у него border 2px; border:none у предзаказа давал просадку) */
.product-card .cart-add-btn.preorder-btn,
.product-card .cart-add-btn.out-of-stock-btn {
  border: 2px solid transparent !important;
}

.product-card__title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__old-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-right: 6px;
}

/* -----------------------------------------------------------------------------
   7. MODIFICATION SELECT (dropdown)
   ----------------------------------------------------------------------------- */
.mod-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  transition: border-color var(--transition);
}

.mod-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* -----------------------------------------------------------------------------
   8. CHECKOUT (шаги оформления — .steps / .st-c в checkout.php)
   ----------------------------------------------------------------------------- */
.checkout-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
}

/* -----------------------------------------------------------------------------
   10. ORDER CONFIRMATION (Receipt)
   ----------------------------------------------------------------------------- */
.order-receipt {
  max-width: 500px;
  margin: 32px auto;
  padding: 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  container-type: inline-size;
  container-name: order-receipt;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .order-receipt {
    width: calc(100% - 24px);
    max-width: none;
    margin-left: 12px;
    margin-right: 12px;
    padding: 16px;
  }
  body.page-order-confirm .co-wrap,
  body.page-order-confirm main {
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
  }
}

.order-receipt__title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  color: var(--success);
}

.order-receipt__row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dotted var(--border);
}

.order-receipt__total {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}

.order-receipt--confirm .order-receipt__header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.order-receipt__date {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.order-receipt__item {
  padding: 12px 0;
  border-bottom: 1px dotted var(--border);
}

.order-receipt__item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.order-receipt__item-name { flex: 1; min-width: 0; }

.order-receipt__item-name-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.order-receipt__item-name-col .order-receipt__item-name {
  flex: 0 1 auto;
}

.order-receipt__item-subscribe {
  width: 100%;
}

.order-receipt__item-sum { font-weight: 600; }

.order-receipt--confirm .order-receipt__item-main--confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto;
  gap: 4px 8px;
  align-items: baseline;
}

.order-receipt--confirm .order-receipt__item-main--confirm .order-receipt__item-name {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.order-receipt--confirm .order-receipt__item-main--confirm .order-receipt__item-qty {
  grid-column: 2;
  grid-row: 1;
  flex-shrink: 0;
  color: var(--text-secondary);
  white-space: nowrap;
}

.order-receipt--confirm .order-receipt__item-main--confirm .order-receipt__item-sum {
  grid-column: 3;
  grid-row: 1;
  white-space: nowrap;
}

.order-receipt--confirm .order-receipt__item-main--confirm .order-receipt__item-mod {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.order-receipt__totals { margin-top: 16px; }
.order-receipt__totals .order-receipt__row { justify-content: flex-end; gap: 16px; }
/* Одна линия перед «ИТОГО» (border-top у total), без пунктира снизу у предыдущей строки */
.order-receipt__totals .order-receipt__row:has(+ .order-receipt__total) {
  border-bottom: none;
}
.order-receipt__totals .order-receipt__row.order-receipt__total {
  border-bottom: none;
}
.order-receipt__delivery {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.order-receipt__delivery p { margin-bottom: 8px; }
.order-receipt__delivery p:last-child { margin-bottom: 0; }

.order-receipt__track-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.order-receipt__track-num {
  font-weight: 600;
}

.order-receipt__track-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  border: none;
  background: none;
  padding: 0;
  box-shadow: none;
}

.order-receipt__track-link:hover {
  text-decoration: underline;
}

.order-receipt__status-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
  margin-bottom: 0 !important;
}

/* Узкая колонка чека: трек и ссылка — столбиком, «Отследить» по центру */
@container order-receipt (max-width: 440px) {
  .order-receipt__track-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .order-receipt__track-meta {
    width: 100%;
  }

  .order-receipt__track-link {
    justify-content: center;
  }
}

/* -----------------------------------------------------------------------------
   11. PROFILE PAGE (ЛК: /profile, /orders, /balance-topup, …)
   ----------------------------------------------------------------------------- */
/* #lk-app только на страницах ЛК — единая ширина обёртки под .container */
#lk-app {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* ЛК: отступы у main (баланс, заказы, профиль и т.д.) */
.profile-lk-main {
  padding: 12px 16px;
  box-sizing: border-box;
}

.profile-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}

@media (max-width: 768px) {
  /* Единый отступ под шапкой: алерты (.alert) до .profile-layout визуально уводим под меню,
     как на /balance-topup (там сразу идёт меню). display:contents — только ≤768px. */
  .profile-lk-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px 10px 5px;
    box-sizing: border-box;
  }

  /* Явно те же отступы для main ЛК при SPA (класс body может отличаться). */
  #lk-app > main.profile-lk-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px 10px 5px;
    box-sizing: border-box;
  }

  .profile-lk-main > .profile-layout {
    display: contents;
  }

  .profile-lk-main .profile-sidebar {
    order: 1;
    width: 100%;
  }

  .profile-lk-main > .alert {
    order: 2;
    margin-top: 0;
    margin-bottom: 0;
  }

  /* ЛК: #lk-app без лишних отступов (внутри #shop-spa-mount и по body). */
  #lk-app {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .profile-lk-main .profile-content {
    order: 3;
    width: 100%;
  }

  .profile-layout {
    gap: 5px;
    padding: 0;
  }

  .profile-sidebar {
    padding: 8px 10px;
  }

  .profile-lk-reg-sheet-banner {
    margin-bottom: 6px;
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  .profile-lk-reg-sheet-banner__icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .profile-content {
    padding: 8px 10px;
  }

  body.page-profile-notifications .profile-notifications-prefs-form {
    text-align: left;
  }

  body.page-profile-notifications .profile-notifications-settings-card {
    padding: 10px 8px;
  }
}

/* /profile-notifications: карточка вокруг блока каналов (без табличных линий) */
body.page-profile-notifications .profile-notifications-settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
}

body.page-profile-notifications .profile-notifications-prefs-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin-left: -2px;
  margin-right: -2px;
  padding-left: 2px;
  padding-right: 2px;
}

body.page-profile-notifications .profile-notifications-prefs-grid {
  display: grid;
  align-items: center;
  column-gap: 10px;
  row-gap: 12px;
  grid-template-columns: minmax(8.5rem, 1.2fr) repeat(var(--prefs-n, 0), minmax(4.35rem, 5.25rem));
}

@media (min-width: 769px) {
  body.page-profile-notifications .profile-notifications-prefs-scroll {
    overflow-x: visible;
  }

  body.page-profile-notifications .profile-notifications-prefs-grid {
    grid-template-columns: 12.5rem repeat(var(--prefs-n, 0), minmax(4.35rem, 5.25rem));
    min-width: 0;
  }
}

body.page-profile-notifications .prefs-g--type {
  position: sticky;
  left: 0;
  z-index: 2;
  padding: 6px 10px 6px 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text);
  /* Как фон карточки настроек (как у ячеек каналов) — без полосы другого оттенка */
  background: var(--card);
}

body.page-profile-notifications .prefs-g--type.prefs-g--head {
  z-index: 3;
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  color: var(--text);
  padding-top: 2px;
  padding-bottom: 4px;
}

body.page-profile-notifications .prefs-g--chan {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 2px 0;
}

body.page-profile-notifications .prefs-g--chan.prefs-g--head {
  align-items: center;
  padding-bottom: 4px;
}

body.page-profile-notifications .prefs-g-chan-stack {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

body.page-profile-notifications .prefs-g-chan-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

body.page-profile-notifications .prefs-g-chan-icon--telegram {
  color: #229ed9;
}

body.page-profile-notifications .prefs-g-dash {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}

body.page-profile-notifications .profile-notifications-push-box {
  background: #f0f4ff;
  border: 1px solid #d0d9f0;
  border-radius: 10px;
  text-align: center;
}

body.page-profile-notifications .profile-notifications-push-box__title {
  font-size: 1rem;
  margin: 0 0 8px;
  text-align: center;
}

body.page-profile-notifications .profile-notifications-push-box__lead {
  font-size: 0.9rem;
  margin: 0 0 12px;
  text-align: center;
}

body.page-profile-notifications .profile-notifications-push-unsupported {
  display: none;
  font-size: 0.85rem;
  color: #666;
  text-align: center;
}

/* /profile-notifications: кнопка «Сохранить» по центру на всех ширинах */
body.page-profile-notifications .profile-notifications-prefs-submit-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  width: 100%;
}

@media (min-width: 768px) {
  .profile-layout {
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
  }
}

.profile-sidebar {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

/* Баннер ЛК: сервисный просмотр администратором (над .profile-layout, на всю ширину main) */
.profile-lk-impersonate-banner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 9px;
  background: linear-gradient(90deg, #fff8e1 0%, #fff3e0 100%);
  border: 1px solid #ffcc80;
  border-left: 5px solid #ef6c00;
  border-radius: var(--radius-md, 12px);
  color: #5d4037;
  font-size: 0.88rem;
  box-shadow: 0 2px 8px rgba(230, 81, 0, 0.08);
}

.profile-lk-impersonate-banner__inner,
.admin-impersonate-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
}

.admin-impersonate-banner__text i {
  margin-right: 6px;
  color: #ef6c00;
}

.admin-impersonate-banner__exit {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #ffb74d;
  border-radius: 6px;
  color: #e65100;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.admin-impersonate-banner__exit:hover {
  background: #fff3e0;
}

/* Баннер ЛК: подписка на конструктор за регистрацию (над меню и контентом, на всю ширину main) */
.profile-lk-reg-sheet-banner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 9px;
  padding: 14px 18px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(0, 91, 255, 0.35);
  background: linear-gradient(100deg, #e8f2ff 0%, #f0faf4 45%, #f5f0ff 100%);
  box-shadow: 0 2px 8px rgba(0, 40, 120, 0.08);
  font-size: 0.95rem;
  line-height: 1.5;
}

.profile-lk-reg-sheet-banner__inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.profile-lk-reg-sheet-banner__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 91, 255, 0.12);
  color: #005bff;
  font-size: 1.15rem;
}

.profile-lk-reg-sheet-banner__body {
  min-width: 0;
  flex: 1;
}

.profile-lk-reg-sheet-banner__title {
  font-weight: 700;
  font-size: 1.02rem;
  color: #003d99;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.profile-lk-reg-sheet-banner__text {
  margin: 0;
  color: #1a2744;
}

.profile-lk-reg-sheet-banner__text a {
  color: #005bff;
  font-weight: 600;
  text-decoration: none;
}

.profile-lk-reg-sheet-banner__text a:hover {
  text-decoration: underline;
}

.profile-lk-sheet-unlimited-banner--staff {
  border-color: rgba(46, 125, 50, 0.4);
  background: linear-gradient(100deg, #e8f5e9 0%, #f1f8e9 50%, #e8f2ff 100%);
}

.profile-lk-sheet-unlimited-banner--staff .profile-lk-reg-sheet-banner__icon {
  background: rgba(46, 125, 50, 0.14);
  color: #2e7d32;
}

.profile-lk-sheet-unlimited-banner--staff .profile-lk-reg-sheet-banner__title {
  color: #1b5e20;
}

/* ЛК: статус клиента, скидка, цены на печать (над .profile-layout, одна строка) */
.profile-lk-main > .profile-lk-service-block {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 0 5px;
  padding: 6px 14px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.95rem;
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
}

.profile-lk-service-block__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 16px;
  text-align: center;
}

.profile-lk-service-block__segment {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35em 0.5em;
  white-space: nowrap;
}

.profile-lk-service-block__segment--prices {
  white-space: normal;
}

.profile-lk-service-block__label {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.profile-lk-service-block__val {
  font-weight: 600;
  font-size: 1rem;
}

.profile-lk-service-block__val--status {
  color: #005bff;
}

.profile-lk-service-block__val--discount {
  color: #2e7d32;
}

.profile-lk-service-block__chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
}

.profile-lk-service-block__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 3px 8px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-secondary);
  font-size: 0.92rem;
  line-height: 1.3;
  white-space: nowrap;
}

.profile-lk-service-block__chip-name {
  font-weight: 600;
  color: #1a2744;
}

.profile-lk-service-block__chip-sep {
  color: #888;
}

.profile-lk-service-block__chip-price {
  font-weight: 700;
  color: #005bff;
}

@media (min-width: 769px) {
  .profile-lk-service-block__row {
    flex-wrap: nowrap;
  }

  .profile-lk-service-block__segment--prices {
    flex: 0 1 auto;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .profile-lk-main > .profile-lk-service-block {
    margin-bottom: 4px;
    padding: 5px 10px;
    font-size: 0.9rem;
  }

  .profile-lk-service-block__label {
    font-size: 0.88rem;
  }

  .profile-lk-service-block__val {
    font-size: 0.95rem;
  }

  .profile-lk-service-block__row {
    gap: 4px 12px;
  }

  .profile-lk-service-block__chip {
    font-size: 0.88rem;
    padding: 3px 7px;
  }
}

/* Плашка «заполните профиль» в ЛК */
.profile-gate-alert {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.profile-gate-alert__text {
  margin: 0;
}

.profile-gate-alert__actions {
  display: flex;
  justify-content: center;
  width: 100%;
}

.profile-gate-fill-btn {
  width: 100%;
  max-width: 100%;
  text-align: center;
}

#profile-gate-banner {
  border-left: 4px solid #ff9800;
}

.profile-gate-alert__text + .profile-gate-password-banner__title {
  margin-top: 8px;
}

.profile-gate-password-banner__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-gate-password-banner__title .fa-key {
  color: #ff9800;
}

.profile-gate-password-banner__text {
  margin-top: 6px;
}

.profile-password--highlight {
  outline: 2px solid #ff9800;
  outline-offset: 4px;
  border-radius: 8px;
  transition: outline-color 0.4s ease;
}

@media (min-width: 768px) {
  .profile-sidebar {
    width: 190px;
    flex-shrink: 0;
  }
}

.profile-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-sidebar__link {
  display: block;
  padding: 12px 16px;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.profile-sidebar__link:hover,
.profile-sidebar__link.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

button.profile-sidebar__link {
  width: 100%;
  text-align: left;
  color: inherit;
}

.profile-sidebar__link--balance {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.profile-sidebar__link-label {
  display: inline;
  min-width: 0;
}

.profile-sidebar__balance-badge {
  position: static;
  transform: none;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  line-height: 1.3;
  max-width: 100%;
  flex-basis: 100%;
  flex-shrink: 0;
  min-width: 0;
  box-sizing: border-box;
  pointer-events: none;
  text-align: center;
}

.balance-breakdown {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.35;
}

.balance-breakdown__total {
  font-size: 1em;
  font-weight: 600;
}

.balance-breakdown__total strong {
  font-weight: 600;
}

.balance-breakdown__line {
  font-size: 0.88em;
  font-weight: 400;
  color: var(--text-secondary);
}

.balance-breakdown__line strong {
  font-weight: 600;
  color: var(--text);
}

.balance-breakdown--checkout .balance-breakdown__total {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.balance-breakdown--checkout .balance-breakdown__total strong {
  font-weight: 700;
  color: var(--text);
}

.balance-breakdown--checkout .balance-breakdown__line {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.balance-breakdown--checkout .balance-breakdown__line strong {
  color: var(--text);
}

.balance-breakdown--checkout .balance-bonus-expiry-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 400;
}

.balance-breakdown--page {
  margin: 0 0 14px;
  font-size: 1rem;
  gap: 4px;
}

.balance-breakdown--page .balance-breakdown__total {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.balance-breakdown--page .balance-breakdown__total strong {
  font-weight: 700;
  color: var(--text);
}

.balance-breakdown--page .balance-breakdown__line {
  font-size: 1rem;
  color: var(--text-secondary);
}

.balance-breakdown--page .balance-breakdown__line strong {
  color: var(--text);
}

.balance-bonus-expiry-hint {
  color: #b45309;
  font-weight: 400;
}

.balance-breakdown--inline.balance-breakdown--page {
  display: block;
  margin: 0 0 18px;
}

.balance-breakdown--inline .balance-breakdown__headline {
  display: block;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
}

.balance-breakdown--inline .balance-breakdown__sep {
  color: #888;
  opacity: 0.75;
  font-weight: 400;
}

.balance-breakdown--inline .balance-breakdown__line {
  font-size: 1.05rem;
  font-weight: 400;
  color: #666;
}

.balance-breakdown--inline .balance-breakdown__line strong {
  font-weight: 600;
  color: #222;
}

[data-theme="dark"] body.page-balance .balance-breakdown--inline .balance-breakdown__headline,
[data-theme="dark"] body.page-balance .balance-breakdown--inline .balance-breakdown__headline strong,
[data-theme="dark"] body.page-balance .balance-breakdown--inline .balance-breakdown__line strong {
  color: var(--text) !important;
}

[data-theme="dark"] body.page-balance .balance-breakdown--inline .balance-breakdown__line,
[data-theme="dark"] body.page-balance .balance-breakdown--inline .balance-breakdown__sep {
  color: var(--text-secondary) !important;
}

.profile-sidebar__link--balance.active .profile-sidebar__balance-badge {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--border);
}

.profile-content {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* ЛК мобильное меню: после базовых .profile-sidebar__link (display:block), иначе каскад перебивает inline-flex */
@media (max-width: 768px) {
  .profile-sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    align-items: center;
    gap: 8px 10px;
    width: 100%;
  }

  .profile-sidebar__link {
    display: inline-flex;
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    text-align: center;
    gap: 4px 6px;
    padding: 8px 12px;
    font-size: 0.82rem;
    box-sizing: border-box;
    white-space: normal;
    line-height: 1.25;
  }

  /* flex:1 на балансе растягивал чип на всю строку → «разъезд» пунктов по краям при justify-content:center */
  .profile-sidebar__link--balance {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .profile-sidebar button.profile-sidebar__link {
    width: auto;
  }
}

/* Профиль: индекс + адрес в одну строку. В style.css (а не только инлайн в profile.php),
   чтобы при тихой навигации lk-nav.js между /orders и /profile сетка не пропадала — <head> не подменяется. */
.profile-default-address-block {
  overflow: visible;
  position: relative;
  z-index: 3;
}

.page-profile .profile-default-address-block h3 .req {
  color: #e53935;
}

.page-profile .checkout-addr-grid {
  --co-addr-control-min-h: 42px;
  display: grid;
  grid-template-columns: minmax(96px, 0.95fr) minmax(0, 2.05fr);
  gap: 8px 10px;
  align-items: end;
  margin-top: 0;
}

.page-profile .checkout-addr-grid.profile-addr-first {
  grid-template-columns: minmax(0, 2.05fr) minmax(96px, 0.95fr);
}

.page-profile .checkout-addr-grid.profile-addr-first .addr-suggest-wrap {
  order: 1;
}

.page-profile .checkout-addr-grid.profile-addr-first #profile-checkout-loc-col {
  order: 2;
}

/* Доп. адреса: название | адрес | индекс в одну строку (пропорции адрес/индекс как в .checkout-addr-grid) */
.page-profile .profile-extra-addr-line1 {
  --co-addr-control-min-h: 42px;
  display: grid;
  grid-template-columns: minmax(100px, 0.78fr) minmax(0, 2.05fr) minmax(72px, 0.68fr);
  gap: 8px 10px;
  align-items: end;
  margin-bottom: 10px;
}

.page-profile .profile-extra-addr-line1 .fg {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  min-width: 0;
}

.page-profile .profile-extra-addr-postal-col input {
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}

.page-profile .profile-extra-label-hint {
  font-weight: 400;
  color: #999;
}

@media (max-width: 640px) {
  .page-profile .profile-extra-addr-line1 {
    grid-template-columns: 1fr;
  }

  .page-profile .profile-extra-addr-postal-col input {
    text-align: left;
  }
}

@media (max-width: 360px) {
  .page-profile .checkout-addr-grid {
    grid-template-columns: 1fr;
  }
}

.page-profile .checkout-addr-grid .fg {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.page-profile .checkout-addr-grid .fg[style*="margin-bottom:0"] {
  margin-bottom: 0 !important;
}

.page-profile .profile-postal-label-short {
  display: none;
}

@media (max-width: 768px) {
  .page-profile .profile-postal-label-long {
    display: none;
  }

  .page-profile .profile-postal-label-short {
    display: inline;
  }
}

.page-profile .checkout-addr-grid .fg label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
}

.page-profile .checkout-addr-grid .req {
  color: #e53935;
}

.page-profile .checkout-addr-grid .fg input {
  width: 100%;
  min-height: var(--co-addr-control-min-h, 42px);
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.25;
  font-family: inherit;
  box-sizing: border-box;
  background: var(--card, #fff);
  color: var(--text, #111);
}

.page-profile .checkout-addr-grid .fg input:focus {
  outline: none;
  border-color: #005bff;
  box-shadow: 0 0 0 3px rgba(0, 91, 255, 0.1);
}

.page-profile .checkout-addr-grid .fg input[readonly] {
  background: #f5f5f5;
  color: #555;
}

.page-profile #profile-extra-addr-form .fg label:not(.profile-same-as-primary-check),
.page-profile .profile-extra-addr-edit-form .fg label:not(.profile-same-as-primary-check) {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
}

.page-profile #profile-extra-addr-form .fg input:not([type="checkbox"]),
.page-profile .profile-extra-addr-edit-form .fg input:not([type="checkbox"]) {
  width: 100%;
  min-height: var(--co-addr-control-min-h, 42px);
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.25;
  font-family: inherit;
  box-sizing: border-box;
  background: var(--card, #fff);
  color: var(--text, #111);
}

.page-profile #profile-extra-addr-form .fg input:not([type="checkbox"]):focus,
.page-profile .profile-extra-addr-edit-form .fg input:not([type="checkbox"]):focus {
  outline: none;
  border-color: #005bff;
  box-shadow: 0 0 0 3px rgba(0, 91, 255, 0.1);
}

.page-profile #profile-extra-addr-form .profile-extra-addr-actions .btn,
.page-profile .profile-extra-addr-edit-form .profile-extra-addr-actions .btn {
  min-height: var(--co-addr-control-min-h, 42px);
  white-space: nowrap;
  box-sizing: border-box;
}

.page-profile .profile-extra-addr-line2 {
  --co-addr-control-min-h: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: end;
}

.page-profile .profile-extra-addr-line2 .fg {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  min-width: 0;
}

.page-profile .profile-extra-addr-line2 .profile-extra-addr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  align-self: end;
}

.page-profile .profile-extra-recipient-label-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.page-profile .profile-extra-recipient-label-row > label:first-child {
  display: inline;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: #555;
}

.page-profile .profile-same-as-primary-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: .76rem;
  font-weight: 400;
  color: #666;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.2;
}

.page-profile .profile-same-as-primary-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 2px;
  flex-shrink: 0;
  accent-color: var(--primary, #005bff);
}

.page-profile .profile-extra-addresses-block,
#lk-app .profile-extra-addresses-block {
  margin-bottom: 20px;
}

.page-profile .profile-extra-addr-empty {
  color: #999;
  font-size: .84rem;
  margin: 0;
}

.page-profile .profile-extra-addr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-profile .profile-extra-addr-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
  font-size: .88rem;
  line-height: 1.35;
}

.page-profile .profile-extra-addr-row__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 200px;
  min-width: 0;
}

.page-profile .profile-extra-addr-row__text {
  flex: 1 1 auto;
  min-width: 0;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-profile .profile-extra-addr-row__recipient {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: .8rem;
  color: #666;
}

.page-profile .profile-extra-addr-row__recipient-phone {
  color: #555;
}

.page-profile .profile-extra-addr-edit-form {
  flex: 1 1 100%;
  border-top: 1px solid #eee;
  padding-top: 10px;
  margin-top: 2px;
  overflow: visible;
}

.page-profile .profile-extra-addr-row:has(.profile-extra-addr-edit-form:not([hidden])) {
  overflow: visible;
  z-index: 2;
}

.page-profile .profile-extra-addr-row__edit {
  font-size: .78rem;
  padding: 4px 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.page-profile .profile-extra-addr-row__label {
  font-weight: 600;
  color: #005bff;
}

.page-profile .profile-extra-addr-row__sep {
  color: #888;
}

.page-profile .profile-extra-addr-row__actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.page-profile .profile-extra-addr-row__form {
  display: inline-flex;
  margin: 0;
}

.page-profile .profile-extra-addr-row__set-default {
  font-size: .78rem;
  padding: 4px 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.page-profile .profile-extra-addr-row__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: #e53935;
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
}

.page-profile .profile-extra-addr-row__delete:hover {
  background: #fee;
  color: #c62828;
}

@media (max-width: 720px) {
  .page-profile .profile-extra-addr-line2 {
    grid-template-columns: 1fr;
  }

  .page-profile .profile-extra-addr-line2 .profile-extra-addr-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .page-profile .profile-extra-addr-row__main {
    flex-direction: column;
    align-items: stretch;
  }

  .page-profile .profile-extra-addr-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .page-profile .profile-extra-addr-row__text {
    flex: 1 1 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .page-profile .profile-extra-addr-row__actions {
    margin-left: auto;
  }
}

.page-profile .profile-form-actions,
#lk-app .profile-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
  box-sizing: border-box;
}

/* Только «Редактировать»: на всю ширину блока формы */
.page-profile .profile-form[data-edit-mode="false"] .profile-form-actions,
#lk-app .profile-form[data-edit-mode="false"] .profile-form-actions {
  justify-content: center;
}

.page-profile .profile-form[data-edit-mode="false"] .profile-form-actions .btn-edit-toggle,
#lk-app .profile-form[data-edit-mode="false"] .profile-form-actions .btn-edit-toggle {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  justify-content: center;
}

/* «Сохранить» + «Отмена»: поровну на всю ширину */
.page-profile .profile-form[data-edit-mode="true"] .profile-form-actions,
#lk-app .profile-form[data-edit-mode="true"] .profile-form-actions {
  justify-content: stretch;
}

.page-profile .profile-form[data-edit-mode="true"] .profile-form-actions #btn-profile-save,
.page-profile .profile-form[data-edit-mode="true"] .profile-form-actions #btn-profile-cancel,
#lk-app .profile-form[data-edit-mode="true"] .profile-form-actions #btn-profile-save,
#lk-app .profile-form[data-edit-mode="true"] .profile-form-actions #btn-profile-cancel {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
}

/* ФИО / Email / Телефон — в глобальном CSS; селектор #lk-app — чтобы сетка работала при SPA (класс body обновляется, но не полагаемся только на него). */
.page-profile .profile-row-2col,
#lk-app .profile-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.page-profile .profile-contact-row,
#lk-app .profile-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 0 16px;
  align-items: start;
}

.page-profile .profile-contact-row > .form-group,
#lk-app .profile-contact-row > .form-group {
  min-width: 0;
}

/* Мессенджеры: на десктопе Telegram + WhatsApp + VK в одну строку (#lk-app — SPA) */
.page-profile .profile-messengers-grid,
#lk-app .profile-messengers-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-profile #messengers-section > .form-label.profile-messengers-heading,
#lk-app #messengers-section > .form-label.profile-messengers-heading {
  color: var(--text-secondary, #555);
}

.page-profile .profile-messenger-cell .form-label,
#lk-app .profile-messenger-cell .form-label {
  font-size: 0.85rem;
  color: var(--text-secondary, #555);
  margin-bottom: 4px;
}

.page-profile .profile-messenger-cell--telegram .profile-telegram-label,
#lk-app .profile-messenger-cell--telegram .profile-telegram-label,
.page-profile .profile-messenger-cell--max .profile-max-label,
#lk-app .profile-messenger-cell--max .profile-max-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em;
}

.page-profile .profile-messenger-cell--telegram .profile-telegram-label,
#lk-app .profile-messenger-cell--telegram .profile-telegram-label {
  white-space: nowrap;
}

.page-profile .profile-messenger-status,
#lk-app .profile-messenger-status {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  font-weight: 400;
}

.page-profile .profile-messenger-google-label,
#lk-app .profile-messenger-google-label {
  font-size: 0.85rem;
  color: var(--text-secondary, #555);
  display: block;
  margin-bottom: 4px;
}

.page-profile .profile-messenger-google-ok,
#lk-app .profile-messenger-google-ok {
  font-size: 0.88rem;
  color: var(--success, #2e7d32);
  font-weight: 600;
}

.page-profile .profile-messenger-cell--telegram .profile-messenger-tg-widget-row,
#lk-app .profile-messenger-cell--telegram .profile-messenger-tg-widget-row {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.page-profile .profile-link-telegram-btn,
#lk-app .profile-link-telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #0088cc;
  color: #fff !important;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.page-profile .profile-max-input-wrap,
#lk-app .profile-max-input-wrap {
  position: relative;
  width: 100%;
}

.page-profile .profile-max-input-wrap .profile-max-input,
#lk-app .profile-max-input-wrap .profile-max-input {
  padding-right: 2.25rem;
}

.page-profile .profile-max-clear,
#lk-app .profile-max-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #888;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.page-profile .profile-max-clear:hover,
#lk-app .profile-max-clear:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #c62828;
}

.page-profile .profile-max-clear[hidden],
#lk-app .profile-max-clear[hidden] {
  display: none !important;
}

.page-profile .profile-max-actions,
#lk-app .profile-max-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.page-profile .profile-link-max-btn,
#lk-app .profile-link-max-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.page-profile .profile-max-save-hint,
#lk-app .profile-max-save-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.page-profile .profile-telegram-bot-banner,
#lk-app .profile-telegram-bot-banner {
  margin-bottom: 16px;
}

.page-profile .profile-telegram-bot-banner__inner,
#lk-app .profile-telegram-bot-banner__inner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #b8e4f7;
  background: linear-gradient(135deg, #f0f9ff 0%, #e8f4fc 100%);
}

.page-profile .profile-telegram-bot-banner--highlight .profile-telegram-bot-banner__inner,
#lk-app .profile-telegram-bot-banner--highlight .profile-telegram-bot-banner__inner {
  border-color: #0088cc;
  box-shadow: 0 0 0 2px rgba(0, 136, 204, 0.15);
}

.page-profile .profile-telegram-bot-banner__icon,
#lk-app .profile-telegram-bot-banner__icon {
  flex-shrink: 0;
  font-size: 1.5rem;
  color: #0088cc;
  line-height: 1;
}

.page-profile .profile-telegram-bot-banner__title,
#lk-app .profile-telegram-bot-banner__title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.page-profile .profile-telegram-bot-banner__text,
#lk-app .profile-telegram-bot-banner__text {
  font-size: 0.88rem;
  color: #444;
  margin: 0 0 12px;
  line-height: 1.45;
}

.page-profile .profile-telegram-bot-banner__text code,
#lk-app .profile-telegram-bot-banner__text code {
  font-size: 0.85em;
  background: rgba(0, 136, 204, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
}

.page-profile .profile-telegram-bot-banner__btn,
#lk-app .profile-telegram-bot-banner__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: #0088cc;
  color: #fff !important;
  border-radius: 8px;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

.page-profile .profile-telegram-bot-banner__btn:hover,
#lk-app .profile-telegram-bot-banner__btn:hover {
  background: #0077b3;
  color: #fff !important;
}

@media (min-width: 768px) {
  .page-profile .profile-messengers-grid,
  #lk-app .profile-messengers-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 20px;
    align-items: start;
  }
}

.page-profile .profile-row-3col,
#lk-app .profile-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 16px;
}

.page-profile .pw-password-layout,
#lk-app .pw-password-layout {
  display: grid;
  column-gap: 16px;
  row-gap: 6px;
  align-items: start;
}

.page-profile .pw-password-layout.pw-has-current,
#lk-app .pw-password-layout.pw-has-current {
  grid-template-columns: 1fr 1fr 1fr auto;
}

.page-profile .pw-password-layout.pw-no-current,
#lk-app .pw-password-layout.pw-no-current {
  grid-template-columns: 1fr 1fr auto;
}

.page-profile .pw-password-layout .pw-fg-cur,
.page-profile .pw-password-layout .pw-fg-new,
.page-profile .pw-password-layout .pw-fg-rep,
.page-profile .pw-password-layout .pw-fg-btn,
#lk-app .pw-password-layout .pw-fg-cur,
#lk-app .pw-password-layout .pw-fg-new,
#lk-app .pw-password-layout .pw-fg-rep,
#lk-app .pw-password-layout .pw-fg-btn {
  display: contents;
}

.page-profile .pw-password-layout.pw-has-current .pw-fg-cur > .form-label,
#lk-app .pw-password-layout.pw-has-current .pw-fg-cur > .form-label {
  grid-column: 1;
  grid-row: 1;
}

.page-profile .pw-password-layout.pw-has-current .pw-fg-cur > .pw-input-wrap,
#lk-app .pw-password-layout.pw-has-current .pw-fg-cur > .pw-input-wrap {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
}

.page-profile .pw-password-layout.pw-has-current .pw-fg-new > .form-label,
#lk-app .pw-password-layout.pw-has-current .pw-fg-new > .form-label {
  grid-column: 2;
  grid-row: 1;
}

.page-profile .pw-password-layout.pw-has-current .pw-fg-new > .pw-input-wrap,
#lk-app .pw-password-layout.pw-has-current .pw-fg-new > .pw-input-wrap {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
}

.page-profile .pw-password-layout.pw-has-current .pw-fg-rep > .form-label,
#lk-app .pw-password-layout.pw-has-current .pw-fg-rep > .form-label {
  grid-column: 3;
  grid-row: 1;
}

.page-profile .pw-password-layout.pw-has-current .pw-fg-rep > .pw-input-wrap,
#lk-app .pw-password-layout.pw-has-current .pw-fg-rep > .pw-input-wrap {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
}

.page-profile .pw-password-layout.pw-has-current .pw-fg-btn > .form-label,
#lk-app .pw-password-layout.pw-has-current .pw-fg-btn > .form-label {
  grid-column: 4;
  grid-row: 1;
}

.page-profile .pw-password-layout.pw-has-current .pw-fg-btn > .btn,
#lk-app .pw-password-layout.pw-has-current .pw-fg-btn > .btn {
  grid-column: 4;
  grid-row: 2;
  align-self: center;
  width: 100%;
}

.page-profile .pw-password-layout.pw-has-current #pw-reqs,
#lk-app .pw-password-layout.pw-has-current #pw-reqs {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 8px 0 0;
}

.page-profile .pw-password-layout.pw-no-current .pw-fg-new > .form-label,
#lk-app .pw-password-layout.pw-no-current .pw-fg-new > .form-label {
  grid-column: 1;
  grid-row: 1;
}

.page-profile .pw-password-layout.pw-no-current .pw-fg-new > .pw-input-wrap,
#lk-app .pw-password-layout.pw-no-current .pw-fg-new > .pw-input-wrap {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
}

.page-profile .pw-password-layout.pw-no-current .pw-fg-rep > .form-label,
#lk-app .pw-password-layout.pw-no-current .pw-fg-rep > .form-label {
  grid-column: 2;
  grid-row: 1;
}

.page-profile .pw-password-layout.pw-no-current .pw-fg-rep > .pw-input-wrap,
#lk-app .pw-password-layout.pw-no-current .pw-fg-rep > .pw-input-wrap {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
}

.page-profile .pw-password-layout.pw-no-current .pw-fg-btn > .form-label,
#lk-app .pw-password-layout.pw-no-current .pw-fg-btn > .form-label {
  grid-column: 3;
  grid-row: 1;
}

.page-profile .pw-password-layout.pw-no-current .pw-fg-btn > .btn,
#lk-app .pw-password-layout.pw-no-current .pw-fg-btn > .btn {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  width: 100%;
}

.page-profile .pw-password-layout.pw-no-current #pw-reqs,
#lk-app .pw-password-layout.pw-no-current #pw-reqs {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 8px 0 0;
}

@media (max-width: 600px) {
  .page-profile .profile-row-2col,
  .page-profile .profile-row-3col,
  .page-profile .profile-contact-row,
  #lk-app .profile-row-2col,
  #lk-app .profile-row-3col,
  #lk-app .profile-contact-row {
    grid-template-columns: 1fr;
  }

  .page-profile #password #password-form,
  #lk-app #password #password-form {
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
    width: calc(100% + 48px);
    box-sizing: border-box;
  }

  .page-profile .pw-password-layout,
  #lk-app .pw-password-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-profile .pw-password-layout .pw-fg-cur,
  .page-profile .pw-password-layout .pw-fg-new,
  .page-profile .pw-password-layout .pw-fg-rep,
  .page-profile .pw-password-layout .pw-fg-btn,
  #lk-app .pw-password-layout .pw-fg-cur,
  #lk-app .pw-password-layout .pw-fg-new,
  #lk-app .pw-password-layout .pw-fg-rep,
  #lk-app .pw-password-layout .pw-fg-btn {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .page-profile .pw-password-layout .pw-fg-btn,
  #lk-app .pw-password-layout .pw-fg-btn {
    margin-bottom: 0;
  }

  .page-profile .pw-password-layout .pw-fg-btn > .form-label.pw-label-btn,
  #lk-app .pw-password-layout .pw-fg-btn > .form-label.pw-label-btn {
    display: none !important;
  }

  .page-profile .pw-password-layout .pw-input-wrap,
  .page-profile .pw-password-layout .form-control,
  #lk-app .pw-password-layout .pw-input-wrap,
  #lk-app .pw-password-layout .form-control {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-profile .pw-password-layout #pw-reqs,
  #lk-app .pw-password-layout #pw-reqs {
    margin: 4px 0 12px !important;
    font-size: 0.7rem !important;
    padding: 8px 10px !important;
    column-gap: 6px !important;
  }

  .page-profile .pw-password-layout .pw-fg-btn > .btn,
  #lk-app .pw-password-layout .pw-fg-btn > .btn {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Шапка профиля и аватар (+ поверх круга) — в глобальном CSS: при lk-nav без этих правил «+» уезжает под круг. */
.page-profile .profile-header--bar,
#lk-app .profile-header--bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 1.5rem;
  min-width: 0;
}

.page-profile .profile-header__left,
#lk-app .profile-header__left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.page-profile .profile-header__identity,
#lk-app .profile-header__identity {
  min-width: 0;
}

.page-profile .profile-header__title-row,
#lk-app .profile-header__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.page-profile .profile-header__title-row h1,
#lk-app .profile-header__title-row h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

.page-profile .profile-header__theme,
#lk-app .profile-header__theme {
  margin-top: 6px;
  display: flex;
  align-items: center;
}

.page-profile .profile-header__theme-label,
#lk-app .profile-header__theme-label {
  display: inline;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary, #555);
  user-select: none;
  line-height: 1.35;
}
.page-profile .profile-header__theme-label input[data-theme-toggle],
#lk-app .profile-header__theme-label input[data-theme-toggle] {
  margin: 0 6px 0 0;
  vertical-align: middle;
}

.page-profile .profile-header__identity .text-muted,
#lk-app .profile-header__identity .text-muted {
  margin: 0;
  font-size: 0.9rem;
  word-break: break-word;
}

.page-profile .profile-header__photo-hint,
#lk-app .profile-header__photo-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(320px, 100%);
}

.page-profile .profile-header__photo-hint .fa-arrow-left,
#lk-app .profile-header__photo-hint .fa-arrow-left {
  flex-shrink: 0;
  opacity: 0.9;
}

.page-profile .profile-header__pw-badge,
#lk-app .profile-header__pw-badge {
  background: #fff3e0;
  color: #e65100;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  align-self: center;
}

.page-profile .profile-header__pw-badge:hover,
#lk-app .profile-header__pw-badge:hover {
  background: #ffe0b2;
  color: #bf360c;
}

.page-profile .profile-avatar-wrap,
#lk-app .profile-avatar-wrap {
  width: 64px;
  min-height: 64px;
  flex-shrink: 0;
  position: relative;
}

.page-profile .profile-avatar-wrap--letter .profile-avatar-slot,
#lk-app .profile-avatar-wrap--letter .profile-avatar-slot {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
}

.page-profile .profile-avatar-wrap--letter .profile-avatar__letter,
#lk-app .profile-avatar-wrap--letter .profile-avatar__letter {
  width: 64px;
  height: 64px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.page-profile .profile-avatar-letter-hit,
#lk-app .profile-avatar-letter-hit {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s;
  z-index: 2;
  box-sizing: border-box;
}

.page-profile .profile-avatar-wrap--letter:hover .profile-avatar-letter-hit,
.page-profile .profile-avatar-wrap--letter:focus-within .profile-avatar-letter-hit,
#lk-app .profile-avatar-wrap--letter:hover .profile-avatar-letter-hit,
#lk-app .profile-avatar-wrap--letter:focus-within .profile-avatar-letter-hit {
  background: rgba(0, 0, 0, 0.45);
}

.page-profile .profile-avatar-letter-hit__icon,
#lk-app .profile-avatar-letter-hit__icon {
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
}

.page-profile .profile-avatar-wrap--letter:hover .profile-avatar-letter-hit__icon,
.page-profile .profile-avatar-wrap--letter:focus-within .profile-avatar-letter-hit__icon,
#lk-app .profile-avatar-wrap--letter:hover .profile-avatar-letter-hit__icon,
#lk-app .profile-avatar-wrap--letter:focus-within .profile-avatar-letter-hit__icon {
  opacity: 1;
}

.page-profile .profile-avatar-wrap--photo .profile-avatar-slot-img,
#lk-app .profile-avatar-wrap--photo .profile-avatar-slot-img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border, #e5e7eb);
  box-sizing: border-box;
}

.page-profile .profile-avatar-wrap--photo .profile-avatar-remove,
#lk-app .profile-avatar-wrap--photo .profile-avatar-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  margin: 0;
  z-index: 3;
  opacity: 0.14;
  transition: opacity 0.2s ease;
}

.page-profile .profile-avatar-wrap--photo:hover .profile-avatar-remove,
.page-profile .profile-avatar-wrap--photo:focus-within .profile-avatar-remove,
#lk-app .profile-avatar-wrap--photo:hover .profile-avatar-remove,
#lk-app .profile-avatar-wrap--photo:focus-within .profile-avatar-remove {
  opacity: 1;
}

.page-profile .profile-avatar-remove__btn,
#lk-app .profile-avatar-remove__btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.page-profile .profile-avatar-remove__btn:hover,
#lk-app .profile-avatar-remove__btn:hover {
  background: #c62828;
}

.page-profile .profile-avatar-remove__btn i,
#lk-app .profile-avatar-remove__btn i {
  font-size: 11px;
}

.page-profile .avatar-crop-modal,
#lk-app .avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.page-profile .avatar-crop-modal[hidden],
#lk-app .avatar-crop-modal[hidden] {
  display: none !important;
}

.page-profile .avatar-crop-modal__backdrop,
#lk-app .avatar-crop-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
}

.page-profile .avatar-crop-modal__dialog,
#lk-app .avatar-crop-modal__dialog {
  position: relative;
  z-index: 1;
  background: var(--card, #fff);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  max-width: min(420px, 100%);
  padding: 20px 20px 16px;
}

.page-profile .avatar-crop-modal__dialog h3,
#lk-app .avatar-crop-modal__dialog h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.page-profile .avatar-crop-modal__hint,
#lk-app .avatar-crop-modal__hint {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

.page-profile .avatar-crop-stage,
#lk-app .avatar-crop-stage {
  margin: 0 auto 12px;
  display: flex;
  justify-content: center;
}

.page-profile .avatar-crop-viewport,
#lk-app .avatar-crop-viewport {
  width: min(300px, 85vw);
  height: min(300px, 85vw);
  max-width: 300px;
  max-height: 300px;
  overflow: hidden;
  border-radius: 50%;
  border: 3px solid #005bff;
  box-shadow: 0 4px 20px rgba(0, 91, 255, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
  touch-action: none;
  cursor: grab;
  background: #fff;
}

.page-profile .avatar-crop-viewport[data-avatar-bg="black"],
#lk-app .avatar-crop-viewport[data-avatar-bg="black"] {
  background: #000;
}

.page-profile .avatar-crop-viewport[data-avatar-bg="white"],
#lk-app .avatar-crop-viewport[data-avatar-bg="white"] {
  background: #fff;
}

.page-profile .avatar-crop-viewport[data-avatar-bg="transparent"],
#lk-app .avatar-crop-viewport[data-avatar-bg="transparent"] {
  background-color: #e8e8e8;
  background-image:
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}

.page-profile .avatar-crop-bg,
#lk-app .avatar-crop-bg {
  margin-bottom: 12px;
  font-size: 0.88rem;
}

.page-profile .avatar-crop-bg__label,
#lk-app .avatar-crop-bg__label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #334155;
}

.page-profile .avatar-crop-bg__opts,
#lk-app .avatar-crop-bg__opts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.page-profile .avatar-crop-bg__opts label,
#lk-app .avatar-crop-bg__opts label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}

.page-profile .avatar-crop-viewport:active,
#lk-app .avatar-crop-viewport:active {
  cursor: grabbing;
}

.page-profile .avatar-crop-viewport img,
#lk-app .avatar-crop-viewport img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  max-height: none;
  user-select: none;
  -webkit-user-drag: none;
}

.page-profile .avatar-crop-zoom,
#lk-app .avatar-crop-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.page-profile .avatar-crop-zoom input[type="range"],
#lk-app .avatar-crop-zoom input[type="range"] {
  flex: 1;
  min-width: 0;
}

.page-profile .avatar-crop-modal__actions,
#lk-app .avatar-crop-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .page-profile .profile-header--bar,
  #lk-app .profile-header--bar {
    flex-wrap: wrap;
  }
}

body.page-profile .co-card__btn,
#lk-app .co-card__btn {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.25;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

body.page-profile .co-card__btn--download,
#lk-app .co-card__btn--download {
  background: #f0f4ff;
  color: #005bff;
  border: 1px solid #005bff;
}

body.page-profile .co-card__btn--download:hover,
#lk-app .co-card__btn--download:hover {
  background: #e3ebff;
  border-color: #0046cc;
  color: #0046cc;
}

body.page-profile .co-card__btn--download:focus-visible,
#lk-app .co-card__btn--download:focus-visible {
  outline: 2px solid rgba(0, 91, 255, 0.35);
  outline-offset: 2px;
}

body.page-profile .co-card__btn--download:active,
#lk-app .co-card__btn--download:active {
  background: #d6e4ff;
}

.page-profile .addr-suggest-wrap,
#lk-app .addr-suggest-wrap {
  position: relative;
  z-index: 4;
}

.page-profile #profile-address-suggest.addr-suggest-list,
.page-profile .addr-suggest-list,
#lk-app .addr-suggest-list {
  position: absolute !important;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 10050;
  background: var(--card, #fff);
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 2px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  font-size: 0.84rem;
}

.page-profile .addr-suggest-list button,
#lk-app .addr-suggest-list button {
  display: block !important;
  width: 100% !important;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--text, #222);
  line-height: 1.35;
  box-sizing: border-box;
}

.page-profile .addr-suggest-list button:hover,
.page-profile .addr-suggest-list button:focus,
#lk-app .addr-suggest-list button:hover,
#lk-app .addr-suggest-list button:focus {
  background: #f0f7ff;
  outline: none;
}

.profile-avatar__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}

/* -----------------------------------------------------------------------------
   12. ADMIN PANEL
   ----------------------------------------------------------------------------- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Админка: единственный крупный блок в body — растягиваем на высоту окна при flex-колонке body */
body > .admin-layout {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.admin-layout,
.al {
  --admin-sidebar-width: 240px;
}

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 8px 0;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 210;
  height: 100vh;
  overflow-y: auto;
  overflow-anchor: none;
  scroll-behavior: auto;
}

@media (min-width: 1280px) {
  .admin-layout,
  .al {
    --admin-sidebar-width: 256px;
  }

  .admin-sidebar {
    width: 256px;
  }
}

.admin-sidebar__user {
  margin: 8px 10px 0;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.admin-sidebar__user-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 2px;
}

.admin-sidebar__user-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  word-break: break-word;
}

.admin-sidebar__user--mob {
  margin: 0 0 10px;
}

/* Мобильная панель всегда тёмная (#1a1a2e) — бейдж как в десктоп-сайдбаре, не светлая карточка */
.admin-mobmenu-panel .admin-sidebar__user--mob {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  text-align: center;
}

.admin-mobmenu-panel .admin-sidebar__user--mob .admin-sidebar__user-label {
  color: rgba(255, 255, 255, 0.55);
  display: inline;
  margin-bottom: 0;
}

.admin-mobmenu-panel .admin-sidebar__user--mob .admin-sidebar__user-label::after {
  content: ' — ';
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.admin-mobmenu-panel .admin-sidebar__user--mob .admin-sidebar__user-name {
  color: #fff;
  display: inline;
}

.admin-sidebar__logo {
  padding: 10px 12px 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar__logo a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-layout .admin-main,
.al .am {
  margin-left: var(--admin-sidebar-width);
}

@media (max-width: 768px), (max-height: 520px) and (max-width: 960px) {
  .admin-layout .admin-main,
  .al .am {
    margin-left: 0;
  }
}

/* Мобильное меню админки: гамбургер + выпадающий список (как header__mobmenu на сайте) */
.admin-mobmenu-bar {
  display: none;
}

@media (max-width: 768px), (max-height: 520px) and (max-width: 960px) {
  .admin-mobmenu-bar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 12000;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding-top: env(safe-area-inset-top, 0px);
  }

  .admin-mobmenu-bar__row {
    --admin-mobmenu-toggle-size: 40px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 12px;
    box-sizing: border-box;
  }

  .admin-mobmenu-bar .header__menu-btn.admin-mobmenu-bar__toggle {
    display: flex;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    z-index: 1;
  }

  .admin-mobmenu-bar__title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 2 * (12px + var(--admin-mobmenu-toggle-size)));
    width: max-content;
    box-sizing: border-box;
    padding: 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    min-width: 0;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }

  .admin-mobmenu-bar__title-icon {
    flex-shrink: 0;
    font-size: 0.95rem;
    line-height: 1;
    color: #5c6bc0;
  }

  .admin-mobmenu-bar__title-icon[hidden] {
    display: none !important;
  }

  .admin-mobmenu-bar__title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  /* Заголовок раздела — в мобильной шапке, дубль в topbar скрываем */
  body.admin-panel-page .admin-main > header.admin-topbar > h1,
  body.admin-panel-page .admin-main header.admin-topbar .admin-topbar__title,
  body.admin-panel-page .admin-main header.admin-topbar .admin-topbar__left > h1,
  body.admin-panel-page .admin-page-warehouse .wh-topbar-head__main {
    display: none !important;
  }

  body.admin-panel-page .admin-topbar__row > .admin-topbar__left:has(> h1) {
    display: none !important;
  }

  .admin-mobmenu-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1;
    background: #1a1a2e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-height: min(70vh, calc(100dvh - 52px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-mobmenu-panel[hidden]:not(.is-open) {
    display: none !important;
  }

  .admin-mobmenu-panel.is-open {
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-mobmenu-panel {
    padding: 10px 12px 0;
  }

  .admin-mobmenu-panel__nav {
    padding: 8px 0 12px;
  }

  /* Высота моб. шапки: safe-area + строка 48px */
  .admin-layout,
  .al {
    --admin-mobbar-stack: calc(48px + env(safe-area-inset-top, 0px));
  }

  /* Один отступ под фикс. шапку — padding на layout; контент/topbar без доп. зазоров */
  body.admin-panel-page .admin-layout,
  body.admin-panel-page .al {
    padding-top: var(--admin-mobbar-stack);
    height: calc(100dvh - var(--admin-mobbar-stack));
    max-height: calc(100dvh - var(--admin-mobbar-stack));
    box-sizing: border-box;
  }

  .admin-layout .admin-main,
  .al .am {
    padding-top: 0;
  }

  /* Topbar только с h1 (дубль в моб. шапке) — убираем полностью */
  body.admin-panel-page .admin-main > header.admin-topbar:first-child:has(> h1:only-child),
  body.admin-panel-page .admin-main > header.admin-topbar:first-child:has(> .admin-topbar__title:only-child) {
    display: none !important;
  }

  body.admin-panel-page .admin-main > header.admin-topbar:first-child {
    margin-top: 0 !important;
    box-sizing: border-box;
  }

  body.admin-panel-page .admin-main > header.admin-topbar:first-child + .admin-content {
    margin-top: 0 !important;
  }

  body:not(.admin-panel-page) .admin-main > header:first-child,
  body:not(.admin-panel-page) .am > header:first-child,
  body.admin-panel-page .admin-main > header:first-child:not(.admin-topbar),
  body.admin-panel-page .am > header:first-child:not(.at) {
    margin-top: var(--admin-mobbar-stack);
  }

  body:not(.admin-panel-page) .admin-main > *:first-child:not(header) {
    margin-top: var(--admin-mobbar-stack);
  }

  body.admin-panel-page .admin-main header.admin-topbar,
  body.admin-panel-page .am > header.at,
  body.admin-panel-page .am > .at,
  body.admin-panel-page .admin-main .admin-topbar--sticky,
  body.admin-panel-page .am .admin-topbar--sticky {
    top: 0;
  }

  body:not(.admin-panel-page) .admin-main header.admin-topbar,
  body:not(.admin-panel-page) .am > header.at,
  body:not(.admin-panel-page) .am > .at,
  body:not(.admin-panel-page) .admin-main .admin-topbar--sticky,
  body:not(.admin-panel-page) .am .admin-topbar--sticky {
    top: var(--admin-mobbar-stack);
  }

  .admin-sidebar {
    display: none !important;
  }

  /* Мобильное меню: тёмный фон до низа экрана (без белой полосы под пунктами) */
  .admin-mobmenu-panel:not([hidden]) {
    max-height: none;
    height: calc(100dvh - var(--admin-mobbar-stack));
    min-height: calc(100dvh - var(--admin-mobbar-stack));
  }

  /* Модалки поверх мобильной шапки (z-index выше admin-mobmenu-bar: 12000) */
  .modal-bg,
  .modal-bg.on,
  .u-modal-overlay,
  .u-modal-overlay.open,
  #adminCoModalOverlay,
  #createUserOverlay,
  #createAdminOverlay,
  #adminModalOverlay,
  .ozon-modal-overlay,
  .ozon-modal-overlay.open,
  #ozon-ship-overlay,
  #ozon-ship-overlay.open,
  #ozon-print-job-detail-overlay,
  #ozon-print-job-detail-overlay.open,
  #ozon-match-report-overlay,
  #ozon-stock-file-picker-overlay,
  #ozon-picker-overlay {
    z-index: 13050 !important;
    padding: 1vh 1vw;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
  }

  #ozon-toast-host {
    z-index: 13200 !important;
    top: calc(var(--admin-mobbar-stack, 48px) + 8px);
  }

  /* Юр. лицо поверх модалок пользователя/создания пользователя */
  .company-form-modal-overlay,
  .company-form-modal-overlay.open {
    z-index: 13150 !important;
    padding: 1vh 1vw;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
  }

  .modal-bg .modal-box,
  .modal-bg.on .modal-box,
  .u-modal-overlay .u-modal,
  .u-modal-overlay.open .u-modal,
  #adminCoModalOverlay > div,
  #createUserOverlay > div,
  #createAdminOverlay > .u-modal,
  #adminModalOverlay > .u-modal,
  .company-form-modal-overlay > .company-form-modal {
    width: 98vw !important;
    max-width: 98vw !important;
    height: 98dvh !important;
    max-height: 98dvh !important;
    margin: 0 !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
  }

  #receipt-detail-modal .modal-box.wh-modal-tall,
  #receipt-modal .modal-box.wh-modal-tall,
  #expense-modal .modal-box.wh-modal-tall,
  #expense-detail-modal .modal-box.wh-modal-tall,
  #adjustment-modal .modal-box,
  #package-modal .modal-box,
  #pkg-modal .modal-box {
    width: 98vw !important;
    max-width: 98vw !important;
    height: 98dvh !important;
    max-height: 98dvh !important;
  }

  #stock-modal .modal-box,
  #repair-sale-result-modal .modal-box {
    width: min(96vw, 400px) !important;
    max-width: 96vw !important;
    height: auto !important;
    max-height: min(88dvh, 560px) !important;
  }

  .warehouse-modals-root #picker-modal {
    z-index: 13100 !important;
  }

  .warehouse-modals-root #picker-modal .modal-box {
    width: 98vw !important;
    max-width: 98vw !important;
    max-height: 90dvh !important;
  }

  body.page-admin-create-order #picker-modal {
    z-index: 13100 !important;
  }

  .warehouse-modals-root .wh-modal-body,
  .modal-box:not(.wh-modal-tall) {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
  }

  /* Склад / пользователи / админы: шапка и вкладки */
  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-topbar__row {
    width: 100%;
  }

  .admin-topbar__tools {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .admin-topbar__tools form {
    flex: 1 1 auto;
    min-width: 0 !important;
    max-width: none !important;
    width: 100%;
  }

  .admin-topbar__tools .btn {
    width: 100%;
    justify-content: center;
  }

  /* Склад / вкладки разделов: css/admin-sections.css */

  /* Формы в модалках пользователей / админов */
  .u-modal .fg.admin-login-role-row:not(.admin-user-meta-row),
  .u-modal .admin-login-role-row:not(.admin-login-role-row--pair):not(.admin-user-meta-row) {
    flex-direction: column;
    align-items: stretch;
  }

  .u-modal .fg.admin-login-role-row:not(.admin-user-meta-row) .admin-lr-col,
  .u-modal .admin-login-role-row:not(.admin-login-role-row--pair):not(.admin-user-meta-row) .admin-lr-col {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    box-sizing: border-box;
  }

  .u-modal .fg.admin-login-role-row:not(.admin-login-role-row--pair):not(.admin-user-meta-row) .admin-lr-col input,
  .u-modal .fg.admin-login-role-row:not(.admin-login-role-row--pair):not(.admin-user-meta-row) .admin-lr-col select,
  .u-modal .admin-login-role-row:not(.admin-login-role-row--pair):not(.admin-user-meta-row) .admin-lr-col input,
  .u-modal .admin-login-role-row:not(.admin-login-role-row--pair):not(.admin-user-meta-row) .admin-lr-col select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .u-modal .fg.admin-login-role-row.admin-login-role-row--pair,
  .u-modal .admin-login-role-row.admin-login-role-row--pair {
    flex-direction: row;
    align-items: flex-end;
  }

  .u-modal .fg.admin-login-role-row.admin-login-role-row--pair .admin-lr-col,
  .u-modal .admin-login-role-row.admin-login-role-row--pair .admin-lr-col {
    flex: 1;
    min-width: 0;
    width: auto;
    max-width: none;
  }

  #createUserOverlay .cu-contacts-row {
    flex-direction: column;
    align-items: stretch;
  }

  #createUserOverlay .cu-contacts-row .admin-lr-col {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
  }

  @media (max-width: 520px) {
    .u-modal .admin-user-meta-row,
    .u-modal .admin-user-meta-row.admin-user-meta-row--custom {
      grid-template-columns: 1fr;
    }
  }

  .u-modal .perm-grid {
    grid-template-columns: 1fr;
  }

  .u-modal > #userModalContent,
  .u-modal > #adminModalContent,
  .u-modal > form,
  #adminCoModalOverlay form,
  #createUserOverlay form,
  #createAdminOverlay form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

#adminCoModalOverlay,
#createUserOverlay,
#createAdminOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

#adminCoModalOverlay.open,
#createUserOverlay.open,
#createAdminOverlay.open {
  display: flex;
}

/* Таблицы админки (.dt): без горизонтальной прокрутки, перенос в ячейках */
.admin-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: visible;
}

.admin-table-scroll > table.dt {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.admin-table-scroll > table.dt th,
.admin-table-scroll > table.dt td {
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  vertical-align: top;
}

.admin-content .card--table {
  overflow: visible;
}


.admin-sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

/* Единый вид пунктов меню админки */
.admin-sidebar__link {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  transition: background 0.2s, color 0.2s;
}

.admin-sidebar__link i {
  width: 20px;
  margin-right: 8px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.925rem;
}

.admin-sidebar__group {
  margin: 6px 10px 8px;
  padding: 6px 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.admin-sidebar__group-title {
  display: block;
  margin: 0 0 2px;
  padding: 4px 12px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
  text-decoration: none;
}

a.admin-sidebar__group-title:hover,
a.admin-sidebar__group-title.is-active {
  color: rgba(255, 255, 255, 0.92);
}

.admin-sidebar__group .admin-sidebar__link {
  margin: 0 4px;
  border-radius: 8px;
}

.admin-mobmenu-panel .admin-sidebar__group {
  margin-left: 0;
  margin-right: 0;
}

.admin-sidebar__link[class*='admin-sidebar__link--'] {
  margin: 2px 6px 5px;
  padding: 7px 10px;
  box-sizing: border-box;
}

.admin-sidebar__link:hover:not(.admin-sidebar__link--create-order):not(.admin-sidebar__link--create-shipment):not(.admin-sidebar__link--orders):not(.admin-sidebar__link--warehouse):not(.admin-sidebar__link--products):not(.admin-sidebar__link--promos):not(.admin-sidebar__link--settings),
.admin-sidebar__link.active:not(.admin-sidebar__link--create-order):not(.admin-sidebar__link--create-shipment):not(.admin-sidebar__link--orders):not(.admin-sidebar__link--warehouse):not(.admin-sidebar__link--products):not(.admin-sidebar__link--promos):not(.admin-sidebar__link--settings) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.admin-sidebar__link.admin-sidebar__link--create-order,
.admin-sidebar__link.admin-sidebar__link--create-shipment {
  border: 2px solid #005bff;
  border-radius: 8px;
  color: #e3f2fd;
  box-sizing: border-box;
}

.admin-sidebar__link.admin-sidebar__link--create-order:hover:not(.active),
.admin-sidebar__link.admin-sidebar__link--create-shipment:hover:not(.active) {
  background: rgba(0, 91, 255, 0.15);
  color: #fff;
  border-color: #448aff;
}

.admin-sidebar__link.admin-sidebar__link--create-order.active,
.admin-sidebar__link.admin-sidebar__link--create-shipment.active {
  background: rgba(0, 91, 255, 0.38);
  color: #fff;
  border-color: #82b1ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(130, 177, 255, 0.45);
  font-weight: 600;
}

.admin-sidebar__link.admin-sidebar__link--orders {
  border: 2px solid #1b5e20;
  border-radius: 8px;
  color: #c8e6c9;
  box-sizing: border-box;
}

.admin-sidebar__link.admin-sidebar__link--orders:hover:not(.active) {
  background: rgba(27, 94, 32, 0.22);
  color: #fff;
  border-color: #2e7d32;
}

.admin-sidebar__link.admin-sidebar__link--orders.active {
  background: rgba(27, 94, 32, 0.5);
  color: #fff;
  border-color: #66bb6a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), 0 0 0 1px rgba(102, 187, 106, 0.4);
  font-weight: 600;
}

.admin-sidebar__link.admin-sidebar__link--warehouse {
  border-radius: 8px;
  background: rgba(117, 117, 117, 0.45);
  color: #eceff1;
  box-sizing: border-box;
}

.admin-sidebar__link.admin-sidebar__link--warehouse:hover:not(.active) {
  background: rgba(158, 158, 158, 0.4);
  color: #fff;
}

.admin-sidebar__link.admin-sidebar__link--warehouse.active {
  background: rgba(189, 189, 189, 0.62);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

.admin-sidebar__link.admin-sidebar__link--products {
  border-radius: 8px;
  background: rgba(27, 94, 32, 0.58);
  color: #c8e6c9;
  box-sizing: border-box;
}

.admin-sidebar__link.admin-sidebar__link--products:hover:not(.active) {
  background: rgba(46, 125, 50, 0.72);
  color: #fff;
}

.admin-sidebar__link.admin-sidebar__link--products.active {
  background: rgba(56, 142, 60, 0.88);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(129, 199, 132, 0.45);
  font-weight: 600;
}

.admin-sidebar__link.admin-sidebar__link--promos {
  border-radius: 8px;
  background: rgba(255, 152, 0, 0.3);
  color: #ffe0b2;
  box-sizing: border-box;
}

.admin-sidebar__link.admin-sidebar__link--promos:hover:not(.active) {
  background: rgba(255, 152, 0, 0.46);
  color: #fff;
}

.admin-sidebar__link.admin-sidebar__link--promos.active {
  background: rgba(255, 152, 0, 0.62);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(255, 183, 77, 0.5);
  font-weight: 600;
}

.admin-sidebar__link.admin-sidebar__link--settings {
  border-radius: 8px;
  background: rgba(239, 83, 80, 0.28);
  color: #ffcdd2;
  box-sizing: border-box;
}

.admin-sidebar__link.admin-sidebar__link--settings:hover:not(.active) {
  background: rgba(239, 83, 80, 0.44);
  color: #fff;
}

.admin-sidebar__link.admin-sidebar__link--settings.active {
  background: rgba(229, 57, 53, 0.62);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(239, 154, 154, 0.45);
  font-weight: 600;
}

.admin-content {
  flex: 1;
  padding: var(--admin-content-pad-y, 12px) var(--admin-content-pad-x, 14px);
  background: var(--bg);
  overflow-x: auto;
  min-width: 0;
  font-size: var(--admin-font-base, 0.875rem);
  line-height: var(--admin-line, 1.45);
}

/* Контент разделов с широкими таблицами (в т.ч. .ac на странице товаров) */
body .am > .ac {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.admin-table th,
.admin-table td {
  padding: var(--admin-table-cell-y, 8px) var(--admin-table-cell-x, 10px);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--admin-font-base, 0.875rem);
}

.admin-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: var(--admin-font-sm, 0.8125rem);
  color: var(--text);
}

.admin-table tbody tr:nth-child(even) {
  background: var(--bg-secondary);
}

.admin-table tbody tr:hover {
  background: var(--primary-light);
}

/* -----------------------------------------------------------------------------
   13. MODALS
   ----------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition);
}

.modal__close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal__close:focus,
.modal__close:focus-visible,
.u-modal-close:focus,
.u-modal-close:focus-visible,
.bal-modal__close:focus,
.bal-modal__close:focus-visible,
.pwa-close:focus,
.pwa-close:focus-visible,
.co-modal__close:focus,
.co-modal__close:focus-visible,
#file-preview-close-btn:focus,
#file-preview-close-btn:focus-visible,
[data-modal-close]:focus,
[data-modal-close]:focus-visible {
  outline: none;
  box-shadow: none;
}

.modal__body {
  padding: 24px;
}

.shop-rental-modal.modal-overlay {
  z-index: 10000;
  transition: none;
}

.shop-rental-modal .modal {
  max-width: 760px;
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: none;
}

.shop-rental-modal.modal-overlay.active .modal {
  transform: none;
}

.shop-rental-modal__form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.shop-rental-modal .modal__body {
  overflow: auto;
  min-height: 0;
}

.shop-rental-modal__actions {
  flex-shrink: 0;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.shop-rental-modal__captcha {
  width: 100%;
  height: 118px;
  min-height: 118px;
  margin-bottom: 12px;
}

.shop-rental-modal__error {
  margin-bottom: 12px;
}

.shop-rental-modal__autofill-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shop-rental-modal__form {
  position: relative;
}

.shop-rental-modal__form .form-group {
  margin-bottom: 16px;
}

.shop-rental-modal__row {
  display: grid;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.shop-rental-modal__row .form-group {
  margin-bottom: 0;
  min-width: 0;
}

.shop-rental-modal__row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shop-rental-modal .password-field__wrap .form-control {
  min-height: 42px;
  height: 42px;
  padding-top: 0;
  padding-bottom: 0;
}

.shop-rental-modal__mods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

.shop-rental-modal__mods label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  cursor: pointer;
}

.shop-rental-modal__mods label input {
  flex-shrink: 0;
  margin-top: 3px;
}

.shop-rental-modal__submit {
  width: 100%;
  margin-top: 4px;
}

.shop-rental-manage-card {
  background: var(--card, #fff);
  border: 1px solid var(--border, #eee);
  border-radius: 12px;
  padding: 20px 22px;
  margin-top: 16px;
}

.shop-rental-manage-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 18px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text, #222);
}

.shop-rental-manage-summary__label {
  color: var(--text-secondary, #777);
  font-weight: 500;
}

.shop-rental-manage-summary__part strong {
  font-weight: 600;
}

.shop-rental-manage-summary__sep {
  color: var(--text-secondary, #bbb);
  user-select: none;
}

.shop-rental-secret-wrap {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
}

.shop-rental-copy-toast {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  background: #22c55e;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.shop-rental-copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.shop-rental-secret {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  letter-spacing: 0.12em;
}

.shop-rental-secret.is-shown {
  letter-spacing: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.shop-rental-manage-card__hint--footer {
  margin: 14px 0 0;
}

.shop-rental-manage-card__status {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.shop-rental-manage-card__spinner {
  flex-shrink: 0;
  padding: 4px 0;
}

.shop-rental-manage-card__spinner .spinner {
  width: 36px;
  height: 36px;
}

.shop-rental-manage-card__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.shop-rental-manage-card__icon--success { color: #2e7d32; }
.shop-rental-manage-card__icon--error { color: #c62828; }
.shop-rental-manage-card__icon--wait { color: #f57c00; }

.shop-rental-manage-card__title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 600;
}

.shop-rental-manage-card__hint {
  margin: 0;
  color: var(--text-secondary, #666);
  line-height: 1.5;
  font-size: 0.9375rem;
}

.shop-rental-manage-meta {
  display: grid;
  gap: 10px 20px;
  margin: 0 0 18px;
}

.shop-rental-manage-meta div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: baseline;
}

.shop-rental-manage-meta dt {
  margin: 0;
  color: var(--text-secondary, #777);
  font-size: 0.875rem;
}

.shop-rental-manage-meta dd {
  margin: 0;
  font-weight: 500;
  word-break: break-word;
}

.shop-rental-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.shop-rental-manage-delete-open {
  margin-left: auto;
}

.shop-rental-delete-modal .modal__header {
  position: relative;
  justify-content: center;
}

.shop-rental-delete-modal .modal__title {
  flex: 1;
  text-align: center;
  padding: 0 44px;
}

.shop-rental-delete-modal .modal__close {
  position: absolute;
  right: 16px;
  top: 50%;
  margin: 0;
  transform: translateY(-50%);
}

.shop-rental-delete-modal__lead {
  margin: 0 0 16px;
  line-height: 1.5;
  color: var(--text-secondary, #555);
}

.shop-rental-delete-modal__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.shop-rental-delete-modal__password {
  flex: 1 1 160px;
  min-width: 0;
  margin: 0;
}

.shop-rental-delete-modal__password .password-field__wrap .form-control {
  min-height: 40px;
}

.shop-rental-delete-modal__toolbar .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.shop-rental-delete-modal #shop-rental-delete-error {
  width: 100%;
  margin-bottom: 10px;
}

.shop-rental-delete-modal__confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
}

.shop-rental-delete-modal__confirm input {
  margin-top: 3px;
  flex-shrink: 0;
}

.shop-rental-steps-wrap {
  margin-bottom: 18px;
}

.shop-rental-steps-toolbar {
  margin-bottom: 12px;
}

.shop-rental-steps-toolbar .btn i {
  margin-right: 6px;
}

.shop-rental-steps__refresh {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  padding: 0;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  background: var(--card, #fff);
  color: var(--primary, #005bff);
  cursor: pointer;
}

.shop-rental-steps__refresh:hover {
  background: var(--bg, #f5f5f5);
}

.shop-rental-steps__refresh.is-spinning i,
.shop-rental-steps-toolbar .btn.is-spinning i {
  animation: shop-rental-refresh-spin 0.75s linear infinite;
}

@keyframes shop-rental-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.shop-rental-manage-card .shop-rental-steps {
  margin-top: 0;
  margin-bottom: 0;
}

.shop-rental-steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.shop-rental-steps__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.shop-rental-steps__mark {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--border, #ccc);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--text-secondary, #888);
  background: transparent;
}

.shop-rental-steps__item.is-done .shop-rental-steps__mark {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

.shop-rental-steps__item.is-failed .shop-rental-steps__mark {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}

.shop-rental-steps__item.is-current .shop-rental-steps__mark {
  border-color: var(--primary, #005bff);
  color: var(--primary, #005bff);
}

.shop-rental-steps__title {
  font-weight: 600;
  line-height: 1.35;
}

.shop-rental-steps__item.is-wait .shop-rental-steps__title {
  color: var(--text-secondary, #777);
  font-weight: 500;
}

.shop-rental-steps__text {
  margin: 4px 0 0;
  color: var(--text-secondary, #555);
  line-height: 1.5;
  font-size: 0.9375rem;
}

.shop-rental-steps__item.is-failed .shop-rental-steps__text {
  color: inherit;
}

.shop-rental-manage-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.shop-rental-manage-switch__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border, #ddd);
  text-decoration: none;
  color: inherit;
  font-size: 0.875rem;
}

.shop-rental-manage-switch__link.is-active {
  border-color: var(--primary, #005bff);
  color: var(--primary, #005bff);
  background: rgba(0, 91, 255, 0.06);
}

.shop-rental-manage-card--progress {
  border-color: rgba(0, 91, 255, 0.25);
}

.shop-rental-manage-card--success {
  border-color: rgba(46, 125, 50, 0.35);
}

.shop-rental-manage-card--error {
  border-color: rgba(198, 40, 40, 0.35);
}

@media (max-width: 560px) {
  .shop-rental-manage-meta div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (max-width: 720px) {
  .shop-rental-modal__row--2 {
    grid-template-columns: 1fr;
  }

  .shop-rental-modal__mods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .shop-rental-modal__mods {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------------------------
   14. BUTTONS
   ----------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border: 2px solid transparent;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-light);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #d32f2f;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.1rem;
}

/* -----------------------------------------------------------------------------
   15. FORMS (Additional)
   ----------------------------------------------------------------------------- */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* -----------------------------------------------------------------------------
   16. ALERTS
   ----------------------------------------------------------------------------- */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.alert-success {
  background: var(--success-bg);
  color: #2e7d32;
}

[data-theme="dark"] .alert-success {
  color: #81c784;
}

.alert-danger {
  background: var(--danger-bg);
  color: #c62828;
}

[data-theme="dark"] .alert-danger {
  color: #e57373;
}

.alert-warning {
  background: var(--warning-bg);
  color: #e65100;
}

.alert-info {
  background: var(--info-bg);
  color: #1565c0;
}

[data-theme="dark"] .alert-info {
  color: #64b5f6;
}

/* -----------------------------------------------------------------------------
   17. BADGES
   ----------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
}

.badge-success {
  background: var(--success);
  color: white;
}

.badge-danger {
  background: var(--danger);
  color: white;
}

.badge-warning {
  background: var(--warning);
  color: white;
}

/* «Отправлен» — фиолетовый, отдельно от оранжевого «Предзаказ» */
.badge-shipped {
  background: #9c27b0;
  color: #fff;
  border: 1px solid rgba(74, 20, 140, 0.12);
}

.badge-delivered {
  background: #00897b;
  color: #fff;
}

.badge-info {
  background: var(--info);
  color: white;
}

.badge-secondary {
  background: var(--text-muted);
  color: white;
}

/* -----------------------------------------------------------------------------
   18. LOADING & SKELETON
   ----------------------------------------------------------------------------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 1em;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-image {
  aspect-ratio: 1 / 1;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -----------------------------------------------------------------------------
   19. PAGINATION
   ----------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.pagination__btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  transition: all var(--transition);
}

.pagination__btn:hover:not(:disabled) {
  background: var(--primary-light);
  color: var(--primary);
}

.pagination__btn.active {
  background: var(--primary);
  color: white;
}

.pagination__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
  box-sizing: border-box;
}

.pagination-toolbar__loadmore {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.pagination-toolbar__row {
  display: flex;
  justify-content: stretch;
  width: 100%;
}

/* Десктоп: номера по центру строки, «На странице» справа (сетка 1fr auto 1fr) */
.pagination-toolbar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px 16px;
  width: 100%;
  max-width: 100%;
}

.pagination-toolbar__inner .pagination {
  grid-column: 2;
  justify-self: center;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pagination-toolbar__inner .pagination-per-page {
  grid-column: 3;
  justify-self: end;
}

/* Одна страница — только блок «На странице» */
.pagination-toolbar__inner > .pagination-per-page:only-child {
  grid-column: 3;
  justify-self: end;
}

.pagination-per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .pagination-toolbar__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
  }
  .pagination-toolbar__inner .pagination {
    grid-column: auto;
    order: 1;
    justify-content: center;
    width: 100%;
  }
  .pagination-toolbar__inner .pagination-per-page {
    grid-column: auto;
    order: 2;
    justify-content: center;
    width: 100%;
    justify-self: stretch;
  }
  .pagination-toolbar__inner > .pagination-per-page:only-child {
    grid-column: auto;
    order: 1;
  }
}

.pagination-per-page__select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.875rem;
  max-width: 100%;
}

.btn-load-more {
  padding: 8px 16px;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-load-more:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-toolbar--mobile {
  margin-top: 16px;
  padding: 0 4px;
}

/* -----------------------------------------------------------------------------
   20. TOAST NOTIFICATIONS
   ----------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100002;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}

/* Не трогать #toast конструктора листов — у него свои позиция/transform в layout-tool.css */
.toast:not(#toast) {
  padding: 16px 20px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* -----------------------------------------------------------------------------
   21. ANIMATIONS
   ----------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* -----------------------------------------------------------------------------
   22. UTILITY CLASSES
   ----------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

.ms-1 { margin-inline-start: 4px; }
.ms-2 { margin-inline-start: 8px; }
.ms-3 { margin-inline-start: 16px; }

.me-1 { margin-inline-end: 4px; }
.me-2 { margin-inline-end: 8px; }
.me-3 { margin-inline-end: 16px; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.pt-4 { padding-top: 24px; }

.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-grid { display: grid; }
.d-none { display: none; }

.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.hidden { visibility: hidden; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.font-weight-normal { font-weight: 400; }
.font-weight-medium { font-weight: 500; }
.font-weight-bold { font-weight: 700; }

.rounded { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -----------------------------------------------------------------------------
   ADDITIONAL: PAGE LAYOUT (index product cards — .product-card__price / .price-current)
   ----------------------------------------------------------------------------- */

.product-card__price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  margin-top: auto;
  flex-wrap: wrap;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.price-current {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

/* Cart empty (cart modal / script.js) */
.cart-empty {
  text-align: center;
  padding: 60px 20px;
}

/* Admin stats grid */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--admin-content-gap, 12px);
  margin-bottom: var(--admin-content-gap, 12px);
}

.admin-stat-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: var(--admin-card-pad, 12px);
  box-shadow: var(--shadow-sm);
}

.admin-stat-card__value {
  font-size: var(--admin-font-lg, 1.125rem);
  font-weight: 700;
  color: var(--primary);
}

.admin-stat-card__label {
  font-size: var(--admin-font-sm, 0.8125rem);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Checkout form styling extras */
.checkout-form .form-group {
  margin-bottom: 16px;
}

/* Tab pane */
.tab-pane {
  animation: fadeIn 0.2s ease;
}

/* Order table for user history */
.orders-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.orders-table th,
.orders-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.orders-table__sum-value-wrap {
  display: inline;
}

.orders-table__sum-note {
  font-size: 0.82em;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.orders-table th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .orders-table th:first-child,
  .orders-table td:first-child {
    text-align: center;
  }
}

.orders-table tbody tr:hover {
  background: var(--bg-secondary);
}

@media (max-width: 767px) {
  .orders-table thead { display: none; }
  .orders-table tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  .orders-table td {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border: none;
  }
  .orders-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-right: 8px;
  }
  /* «Срок хранения» — только для заказов с раскладкой (бейдж); иначе строку не показываем */
  .orders-table td.orders-table__retention-col--empty {
    display: none !important;
  }
  .orders-table td.orders-table__retention-col:not(.orders-table__retention-col--empty) {
    width: 100%;
    text-align: inherit;
  }
  .orders-table td.orders-table__retention-col:not(.orders-table__retention-col--empty) .order-sheet-retention-badge {
    margin-left: auto;
    flex-shrink: 0;
  }
  .orders-table td[data-label='Сумма'] .orders-table__sum-value-wrap {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25em;
    justify-content: flex-end;
    margin-left: auto;
    text-align: right;
  }
  .orders-table .order-review-cell--na {
    display: none !important;
  }
  .orders-table td.order-review-cell {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    align-items: center;
  }
  .orders-table td.order-review-cell .orders-table__cell-value {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
}

/* Print styles for PDF */
@media print {
  .header, .footer, .no-print, .admin-sidebar, .site-mobile-bar {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }
  .admin-content {
    margin: 0;
    padding: 0;
  }
}

/* ===== Mobile Responsiveness ===== */
@media(max-width:768px){
    /* Поля ≥16px — iOS Safari не приближает при фокусе (витрина и админка) */
    body {
        touch-action: manipulation;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    body input:not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="image"]),
    body select,
    body textarea {
        font-size: max(16px, 1em);
    }
    .header{padding:env(safe-area-inset-top, 0) 16px 0}
    /* Якорь — вся строка шапки */
    .header__inner{position:relative;padding:8px 4px;column-gap:10px;row-gap:0;min-width:0}
    .header.header--search-open{overflow:visible;z-index:1105}
    /* Свернуто: лупа в панели действий; развернуто: строка поиска без лупы справа, только поле + X */
    .header__search-expand-inner{display:none}
    .header__search-expand.is-open{
      position:absolute;
      left:0;
      right:0;
      top:0;
      bottom:0;
      z-index:1020;
      display:flex;
      align-items:center;
      padding:0 4px;
      box-sizing:border-box;
      /* Фон на всю шапку: перекрывает логотип и кнопку меню бургер, чипы ниже — не затрагиваются */
      background:var(--card);
    }
    .header__search-expand.is-open .header__search-expand-form{
      display:flex;
      width:100%;
      align-items:center;
      justify-content:center;
      gap:0;
      position:relative;
      z-index:1;
    }
    .header__search-expand.is-open .header__search-expand-inner{
      display:flex !important;
      position:relative;
      flex:0 1 93%;
      min-width:0;
      width:93%;
      max-width:93%;
      height:40px;
      left:auto;
      right:auto;
      top:auto;
      transform:none;
      transition:none;
      margin:0;
      padding:0 8px 0 10px;
      align-items:center;
      box-sizing:border-box;
      overflow:hidden;
      border-radius:var(--radius-md);
      box-shadow:0 4px 20px rgba(0,0,0,.12);
      border:1px solid var(--border);
      background:var(--card);
    }
    .header__search-expand.is-open .header__search-expand-icon{display:none !important}
    .header__search-expand.is-open .header__search-expand-input{
      min-width:0;
      flex:1;
      width:100%;
      height:100%;
      padding:0 6px 0 0;
      font-size:16px;
    }
    .header__search-expand.is-open .header__search-clear{display:none !important}
    .header__search-expand.is-open .header__search-expand-trigger{display:none !important}
    .header__search-expand-trigger{
      background:#fff;
      position:relative;
      z-index:2;
      box-shadow:0 0 0 1px rgba(0,0,0,.06);
    }
    .header__search-expand-trigger:hover{background:#f5f5f5;color:var(--text)}
    [data-theme="dark"] .header__search-expand-trigger{
      background:var(--card);
      box-shadow:0 0 0 1px var(--border);
    }
    [data-theme="dark"] .header__search-expand-trigger:hover{background:var(--primary-light)}
    .header__search-expand.is-open .header__search-expand-close{
      display:flex !important;
      flex-shrink:0;
      margin-left:4px;
    }
    /* Не сжимать лого до нуля — иначе полоска .header__mobicons заезжает под картинку */
    .header__logo{font-size:1rem;flex-shrink:0;min-width:min-content;overflow:hidden;max-width:var(--header-logo-width)}
    .header__logo-text{display:none !important}
    .header__logo--no-img .header__logo-text{display:block;line-height:1.2;max-width:min(200px,55vw)}
    .nav-mobile{display:none !important}
    .product-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:12px !important}
    .product-card__title{font-size:.78rem !important;-webkit-line-clamp:2}
    .product-card__price{font-size:.82rem !important}
    .container{padding-left:8px !important;padding-right:8px !important}
    .category-nav{--category-nav-gap:4px}
    .category-nav__list{padding-left:8px!important;padding-right:8px!important}
    .category-nav__pill{font-size:.78rem;padding:6px 12px}
    .orders-table-wrapper{overflow-x:auto;-webkit-overflow-scrolling:touch}
    .orders-table{font-size:.82rem;min-width:auto}
    .orders-table thead{display:none}
    .orders-table tbody tr{display:block;padding:12px 0;border-bottom:1px solid var(--border)}
    .orders-table td{display:flex;justify-content:space-between;padding:4px 0;border:none}
    .orders-table td::before{content:attr(data-label);font-weight:600;font-size:.85rem;color:var(--text-secondary);flex-shrink:0;margin-right:8px}
    .orders-table td.orders-table__retention-col--empty{display:none!important}
    .orders-table td.orders-table__retention-col:not(.orders-table__retention-col--empty){width:100%;text-align:inherit}
    .orders-table td.orders-table__retention-col:not(.orders-table__retention-col--empty) .order-sheet-retention-badge{margin-left:auto;flex-shrink:0}
    .orders-table td[data-label='Сумма'] .orders-table__sum-value-wrap{display:inline-flex;align-items:baseline;flex-wrap:wrap;gap:.25em;justify-content:flex-end;margin-left:auto;text-align:right}
    .orders-table .order-review-cell--na{display:none!important}
    .orders-table td.order-review-cell{width:100%!important;max-width:none!important;box-sizing:border-box;align-items:center}
    .orders-table td.order-review-cell .orders-table__cell-value{flex:1 1 auto;min-width:0;display:flex;justify-content:flex-end;align-items:center}
    .orders-table th,.orders-table td{padding:6px 8px}
    .site-footer{padding:24px 0 16px}
    .footer-grid{grid-template-columns:1fr 1fr;gap:16px}
    .co-wrap{padding:12px 8px}
    .steps{gap:0}
    .st-line{width:24px}
    .fr{grid-template-columns:1fr}
    .card{padding:14px}
}
@media(max-width:400px){
    .product-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:12px !important}
    .product-card{border-radius:8px}
    .footer-grid{grid-template-columns:1fr}
}
/* Telegram WebView и очень узкие экраны */
@media(max-width:360px){
    .header{padding:env(safe-area-inset-top, 0) 12px 0}
    .header__inner{padding:6px 2px;column-gap:8px;row-gap:0}
    .header__actions{gap:6px}
    .header__search-expand-trigger,.header__cart,.header__user-icon{width:36px;height:36px;min-width:36px;flex-shrink:0}
}

/* Dark theme: text and background fixes for all pages */
[data-theme="dark"] .card,
[data-theme="dark"] .checkout-form,
[data-theme="dark"] .order-receipt,
[data-theme="dark"] .ci,
[data-theme="dark"] .sb,
[data-theme="dark"] .empty,
[data-theme="dark"] .qty {
    background: var(--card);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .ci-name,
[data-theme="dark"] .ci-total,
[data-theme="dark"] .sb h3,
[data-theme="dark"] .sb-row.tot {
    color: var(--text);
}
[data-theme="dark"] .ci-img,
[data-theme="dark"] .oi-img,
[data-theme="dark"] .pickup-addr {
    background: var(--bg-secondary);
    border-color: var(--border);
}
[data-theme="dark"] .qty span {
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .qty button {
    color: var(--text-secondary);
}
[data-theme="dark"] .st-c {
    background: var(--card);
    border-color: var(--border);
    color: var(--text-secondary);
}
[data-theme="dark"] .del-o {
    background: var(--card);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .del-o:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-secondary);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .modal-overlay > div,
[data-theme="dark"] .u-modal {
    background: var(--card);
    color: var(--text);
}
[data-theme="dark"] label {
    color: var(--text-secondary);
}
[data-theme="dark"] .form-label {
    color: var(--text-secondary);
}
[data-theme="dark"] .form-control {
    background: var(--bg-secondary);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .btn-outline {
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .hint {
    color: var(--text-muted);
}
[data-theme="dark"] .co-wrap {
    color: var(--text);
}
[data-theme="dark"] .co-wrap h2 {
    color: var(--text);
}
[data-theme="dark"] .panel {
    color: var(--text);
}

/* =============================================================================
   FLOATING BUTTONS
   ============================================================================= */

/* Scroll to top button */
#mob-scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px; /* Default: right for desktop */
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 91, 255, 0.3);
}

/* Mobile: scroll to top button on left */
@media (max-width: 768px) {
  #mob-scroll-top {
    right: auto;
    left: 24px;
  }
}

#mob-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#mob-scroll-top:hover {
  background: #0050dd;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 91, 255, 0.4);
}

#mob-scroll-top:active {
  transform: translateY(0);
}

/* Floating cart button */
#floating-cart {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--success, #22c55e);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
  text-decoration: none;
}

#floating-cart.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#floating-cart:hover {
  background: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

#floating-cart:active {
  transform: translateY(0);
}

#floating-cart .cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: var(--danger, #ef4444);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #mob-scroll-top {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    bottom: 20px;
    left: 20px;
    right: auto;
  }
  
  #floating-cart {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    bottom: 72px;
    right: 20px;
  }
}

@media (max-width: 400px) {
  #mob-scroll-top {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    bottom: 16px;
    left: 16px;
    right: auto;
  }
  
  #floating-cart {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    bottom: 64px;
    right: 16px;
  }
}
