/* ─── Сброс и база ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary: #1e3a5f;
  --color-primary-light: #4a6fa5;
  --color-primary-dark: #0f1f33;
  --color-accent: #e85d26;
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-border: #e2e5ea;
  --color-success: #16a34a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.15);
  --radius: 10px;
  --radius-sm: 6px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ─── Верхняя полоса контактов ────────────────────────────────── */
.topbar {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.85);
  font-size: 13px;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
}

.topbar__phone {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.topbar__phone:hover { text-decoration: underline; }

.topbar__avito {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: rgba(255,255,255,.85);
  transition: color .2s;
}

.topbar__avito:hover { color: #fff; }

.topbar__avito svg { color: #00aaff; }

/* ─── Авито модалка ──────────────────────────────────────────── */
.avito-modal { max-width: 380px; }

.avito-modal__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.avito-qr {
  width: 260px;
  height: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.avito-link {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
  text-align: center;
}

.avito-link:hover { text-decoration: underline; }

/* ─── Шапка ──────────────────────────────────────────────────── */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 767px) {
  .topbar__inner { font-size: 12px; height: 32px; }
  .topbar__phone { font-size: 12px; }
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-primary);
  flex-shrink: 0;
}

.logo__img {
  height: 50px;
  width: auto;
}

.logo__titles {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo__text {
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 1px;
  font-family: 'Georgia', 'Times New Roman', serif;
}

.logo__sub {
  font-size: 13px;
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--color-text);
  text-align: center;
}

.search-bar {
  flex: 1;
  display: flex;
  min-width: 200px;
}

.search-toggle {
  display: none !important;
}

@media (max-width: 767px) {
  .search-toggle { display: flex !important; }
}

@media (max-width: 767px) {
  .search-bar { display: none; }
}

.search-wrapper {
  position: relative;
  flex: 1;
  display: flex;
}

.search-wrapper input {
  width: 100%;
}

.search-suggest {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}
.search-suggest.open { display: block; }

.search-suggest__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}
.search-suggest__item:last-child { border-bottom: none; }
.search-suggest__item:hover { background: var(--color-bg); }

.search-suggest__name { font-weight: 500; }
.search-suggest__catalog { font-size: 12px; color: var(--color-text-muted); margin-left: 4px; }
.search-suggest__price { font-size: 13px; font-weight: 600; color: var(--color-primary); white-space: nowrap; }

.search-bar input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

.search-bar input:focus {
  border-color: var(--color-accent);
}

.search-bar button {
  padding: 10px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s;
}

.search-bar button:hover { background: var(--color-primary-dark); }

/* ─── Единый стиль кнопок-иконок хедера ───────────────────────── */
.header-icon-btn {
  position: relative;
  background: none;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-primary);
  transition: all .2s;
  flex-shrink: 0;
  text-decoration: none;
  padding: 0;
}
.header-icon-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }

.header-icon-btn__badge {
  position: absolute;
  top: -8px;
  right: -8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.orders-btn__count { background: var(--color-primary); }
.orders-btn__count:empty { display: none; }

.fav-btn__count { background: #e55; }
.fav-btn__count:empty { display: none; }

.cart-btn__count { background: var(--color-accent); }
.cart-btn__count:empty { display: none; }

.header__auth-btn {
  height: 46px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  font-size: 14px;
}

/* ─── Основной контент ───────────────────────────────────────── */
.main {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 48px;
  flex: 1;
}

/* ─── Сайдбар ─────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.sidebar h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.sidebar__profile {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

@media (max-width: 767px) {
  .sidebar__profile--visible { display: flex !important; }
}

.sidebar__profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 14px;
}
.sidebar__profile-link:hover { color: var(--color-accent); }
.sidebar__profile-icon { font-size: 18px; }

.sidebar__auth { display: none; margin-bottom: 12px; }
.sidebar__auth--hidden { display: none !important; }

.sidebar__nav { display: none; margin-bottom: 12px; }
.sidebar__nav-link {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.sidebar__nav-link:hover { background: var(--color-border); }
.sidebar__nav-link span { font-size: 12px; color: var(--color-text-muted); }

@media (max-width: 767px) {
  .sidebar__nav { display: block; }
}
.sidebar__contacts { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.sidebar__phone { display: block; font-size: 15px; font-weight: 600; color: var(--color-primary); text-decoration: none; margin-bottom: 8px; }
.sidebar__messengers { display: flex; gap: 12px; font-size: 13px; }
.sidebar__messengers a { color: var(--color-accent); text-decoration: none; }
.sidebar__messengers a:hover { text-decoration: underline; }

@media (max-width: 767px) {
  .sidebar__contacts { display: block; }
  .sidebar__auth { display: block; }
  .sidebar__auth--hidden { display: none !important; }
}

.category-list {
  list-style: none;
}

.category-list a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: all .15s;
}

.category-list a:hover { background: var(--color-border); }

.cat-item__row {
  display: flex;
  align-items: center;
}
.cat-item__row a { flex: 1; }

.cat-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text-muted);
  font-size: 12px;
  transition: transform .2s;
}
.cat-item--open > .cat-item__row > .cat-toggle { transform: rotate(90deg); }

.cat-children {
  display: none;
  list-style: none;
  padding-left: 16px;
}
.cat-item--open > .cat-children { display: block; }
.cat-children a { font-size: 13px; padding: 6px 14px; }
.cat-children .cat-children { padding-left: 12px; }
.cat-children .cat-children a { font-size: 12px; padding: 5px 14px; }

.category-list a.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
}

.replication-status {
  margin-top: 32px;
  padding: 14px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-muted);
}

.replication-status .sync-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  margin-right: 6px;
  vertical-align: middle;
}

/* ─── Каталог ─────────────────────────────────────────────────── */
.catalog { min-width: 0; width: 100%; }

/* ─── Фильтры каталога ────────────────────────────────────────── */
.catalog-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.filter-checkbox input { cursor: pointer; }

.filter-sort {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--color-surface);
  cursor: pointer;
  outline: none;
}

.catalog__header {
  display: none;
}

.catalog__header h2 {
  font-size: 22px;
  font-weight: 600;
}

.catalog__count {
  color: var(--color-text-muted);
  font-size: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* ─── Карточка товара ─────────────────────────────────────────── */
.product-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card__image {
  width: 100%;
  height: 170px;
  background: linear-gradient(135deg, #e8ecf1 0%, #d1d8e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-light);
  font-size: 42px;
  position: relative;
}

.product-card__image--photo { background: var(--color-bg); }

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.product-card__catalog-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.product-card__alt-num {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.product-card__stock {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}

.product-card__stock--ok {
  background: rgba(74, 140, 92, .15);
  color: var(--color-success);
}

.product-card__stock--low {
  background: rgba(200, 100, 50, .15);
  color: #c86432;
}

.product-card__fav {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255,255,255,.9);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.product-card__fav:hover { transform: scale(1.15); }
.product-card__fav:hover svg { stroke: #e55; }
.product-card__fav--active svg { fill: #e55; stroke: #e55; }

.product-card__stock--out {
  background: rgba(100, 100, 100, .15);
  color: #888;
}

.product-card__body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__category {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.product-card__name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-card__desc {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  cursor: pointer;
}
.product-card__desc--open {
  -webkit-line-clamp: unset;
  display: block;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notify-btn--active {
  color: var(--color-success) !important;
  border-color: var(--color-success) !important;
  cursor: default;
}

/* ─── Контрол количества ─────────────────────────────────────── */
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-control__btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.qty-control__btn:hover:not(:disabled) { background: var(--color-border); }
.qty-control__btn:disabled { opacity: .4; cursor: default; }

.qty-control__input {
  width: 36px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  -moz-appearance: textfield;
  color: var(--color-text);
}
.qty-control__input::-webkit-inner-spin-button,
.qty-control__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-control__input:focus { outline: none; }


.product-card__price {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-primary);
}

.product-card__price span {
  font-size: 12px;
  font-weight: 400;
}

.btn {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
}

.btn--primary:hover { background: #d04d1a; }

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

.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--lg { padding: 12px 28px; font-size: 16px; }
.btn--full { width: 100%; }

.btn--outline {
  background: none;
  border: 2px solid var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover { border-color: var(--color-accent); color: var(--color-accent); }

.btn--danger {
  background: none;
  color: #c44;
}

.btn--danger:hover { background: rgba(200,60,60,.08); }

/* ─── Модальные окна ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal-overlay.open { display: flex; }
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: 0;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

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

.modal__header h2 { font-size: 20px; }

.modal__close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
}

.modal__body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Корзина ─────────────────────────────────────────────────── */
.cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
}

.cart-empty__icon { font-size: 48px; margin-bottom: 12px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-item:last-child { border-bottom: none; }

.cart-item__thumb {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #e8ecf1, #d1d8e0);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--color-primary-light);
  flex-shrink: 0;
}

.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-weight: 600; font-size: 14px; }
.cart-item__catalog { font-size: 12px; color: var(--color-text-muted); }

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item__qty button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item__qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.cart-item__price {
  font-weight: 600;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.cart-item__remove { margin-left: 4px; }

.cart-total { font-size: 18px; }
.cart-total strong { font-size: 22px; color: var(--color-primary); }

/* ─── Форма оформления ────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}

.form-group input:focus { border-color: var(--color-accent); }

.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-group select:focus { border-color: var(--color-accent); }

.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  resize: vertical;
  transition: border-color .2s;
}
.form-group textarea:focus { border-color: var(--color-accent); }

/* Product form (admin) */
.pf__section {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.pf__section:last-of-type { border-bottom: none; margin-bottom: 8px; }

.pf__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pf__col--full { grid-column: 1 / -1; }

.pf__input-suffix {
  position: relative;
}
.pf__input-suffix input {
  padding-right: 40px;
}
.pf__input-suffix span {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 14px;
  pointer-events: none;
}

.pf__photo-preview {
  margin-bottom: 8px;
}
.pf__photo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-border);
}

.pf__file-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.pf__file-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
.pf__file-name {
  font-size: 13px;
  color: #999;
}

@media (max-width: 500px) {
  .pf__row { grid-template-columns: 1fr; }
}

.radio-group { display: flex; flex-wrap: wrap; gap: 12px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}
.radio-option input { cursor: pointer; }

.checkout-error {
  color: #c44;
  font-size: 14px;
  min-height: 0;
  margin-bottom: 8px;
}
.checkout-error:empty { display: none; }

.delivery-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.delivery-toggle__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  transition: all .2s;
}
.delivery-toggle__btn:hover { border-color: var(--color-primary-light); }
.delivery-toggle__btn--active {
  border-color: var(--color-accent);
  background: rgba(232, 93, 38, .05);
}
.delivery-toggle__icon { font-size: 24px; }
.delivery-toggle__label { font-size: 14px; font-weight: 600; }

.delivery-info {
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 10px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}
.delivery-info a { color: var(--color-accent); }
.delivery-info input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  background: var(--color-surface);
}
.delivery-info input:focus { border-color: var(--color-accent); }

.payment-block {
  margin: 16px 0;
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.payment-block__content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.payment-qr {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.payment-block__info { font-size: 14px; }

.cart-footer__actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.pickup-address {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

.checkout-summary {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 14px;
}

.checkout-summary__row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.checkout-summary__total {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 8px;
}

/* ─── Уведомление ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--color-success);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  font-weight: 500;
  transform: translateY(120%);
  opacity: 0;
  transition: all .3s ease;
  z-index: 300;
}

.floating-wa {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  z-index: 100;
  transition: transform .2s;
}
.floating-wa:hover { transform: scale(1.1); }

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ─── Cookie-баннер ──────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.4;
}
.cookie-banner p { margin: 0; }
.cookie-banner a { color: var(--color-accent); }
.cookie-banner .btn { flex-shrink: 0; }

@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 12px 16px;
  }
}

/* ─── Подвал ──────────────────────────────────────────────────── */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.7);
  font-size: 13px;
  padding-top: 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-bottom: 0;
}

.footer__col h4 {
  color: #fff;
  font-size: 14px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer__col ul { list-style: none; }
.footer__col li { padding: 3px 0; }
.footer__col a { color: rgba(255,255,255,.7); text-decoration: none; }
.footer__col a:hover { color: #fff; text-decoration: underline; }
.footer__about { line-height: 1.5; }

.footer__decor {
  display: flex;
  justify-content: center;
  padding: 4px 0;
  margin-top: -10px;
}
.footer__decor img {
  width: 100%;
  height: 60px;
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding: 16px 24px;
  text-align: center;
}

@media (max-width: 767px) {
  .footer__grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (max-width: 480px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ─── Breadcrumbs ────────────────────────────────────────────── */
.breadcrumbs {
  font-size: 13px;
  margin-bottom: 16px;
  min-height: 20px;
  color: var(--color-text-muted);
}

.breadcrumbs a {
  color: var(--color-primary-light);
  text-decoration: none;
}

.breadcrumbs a:hover { text-decoration: underline; }

.breadcrumbs__sep {
  margin: 0 6px;
  color: var(--color-border);
}

.breadcrumbs__current {
  color: var(--color-text);
  font-weight: 500;
}

/* ─── Подкатегории ───────────────────────────────────────────── */
.subcategories {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 4px;
  min-height: 44px;
}

.subcategories::-webkit-scrollbar { display: none; }
.subcategories { scrollbar-width: none; }
.subcategories:empty { margin-bottom: 0; min-height: 0; display: none; }

.subcategory-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  transition: all .2s;
}

.subcategory-card:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.subcategory-card__arrow {
  color: var(--color-text-muted);
  transition: transform .2s;
}

.subcategory-card:hover .subcategory-card__arrow {
  transform: translateX(3px);
  color: var(--color-accent);
}

.load-more-btn {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px 0;
}

/* ─── Пустая сетка ───────────────────────────────────────────── */
.product-grid__empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

/* ─── Цена со скидкой ────────────────────────────────────────── */
.product-card__price-old {
  text-decoration: line-through;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 400;
  display: block;
}

.product-card__price-new {
  color: var(--color-accent);
  font-size: 20px;
  font-weight: 700;
}

/* ─── Кнопка авторизации ─────────────────────────────────────── */
.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ─── Бургер-меню ────────────────────────────────────────────── */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: relative;
}

.burger-btn span:not(.burger-btn__dot) {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: all .3s;
}

.burger-btn__dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #e55;
  border-radius: 50%;
  display: none;
}

.burger-btn--active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger-btn--active span:nth-child(2) { opacity: 0; }
.burger-btn--active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Адаптивность ────────────────────────────────────────────── */

/* Десктоп: карточки вертикальные (картинка сверху, описание снизу) — по умолчанию */

/* Планшет: 2 колонки */
@media (max-width: 1100px) {
  .main { grid-template-columns: 200px minmax(0, 1fr); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Мобильная: карточки горизонтальные (картинка слева, описание справа) */
@media (max-width: 767px) {
  .burger-btn { display: flex; }

  .header__inner { gap: 8px; }
  .logo__text { font-size: 18px; }
  .logo__sub { font-size: 10px; }
  .logo__img { height: 40px; }
  .header__actions { gap: 8px; }
  .header__auth-btn { display: none; }
  .fav-btn { display: none !important; }
  .orders-btn { display: none !important; }
  .burger-btn { order: 99; }

  /* Компактный каталог на мобильном */
  .topbar { display: none; }
  .breadcrumbs { margin-bottom: 4px; font-size: 12px; min-height: 0; }
  .catalog__header { display: none; }
  .subcategories {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 4px;
  }
  .subcategory-card { padding: 6px 12px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  .catalog-filters { margin-bottom: 10px; gap: 10px; }
  .filter-checkbox { font-size: 13px; }
  .filter-sort { font-size: 12px; }

  .main { grid-template-columns: 1fr; gap: 16px; }

  .sidebar {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: none;
    background: var(--color-surface);
    z-index: 150;
    padding: 24px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }

  .sidebar--open { display: block; }

  .category-list { display: flex; flex-direction: column; gap: 2px; }
  .category-list a { padding: 12px 16px; font-size: 15px; }

  /* Горизонтальные карточки товаров */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-card {
    display: flex;
    flex-direction: row;
  }

  .product-card__image {
    width: 120px;
    min-width: 120px;
    height: auto;
    min-height: 120px;
    font-size: 32px;
    border-radius: var(--radius) 0 0 var(--radius);
  }

  .product-card__catalog-num {
    font-size: 10px;
  }

  .product-card__alt-num {
    font-size: 10px;
  }

  .product-card__stock {
    top: auto;
    bottom: 6px;
    right: auto;
    left: 6px;
    font-size: 9px;
    padding: 2px 6px;
  }

  .product-card__body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
  }

  .product-card__name { font-size: 14px; }
  .product-card__desc { font-size: 12px; margin-bottom: 8px; }
  .product-card__price { font-size: 16px; }
  .product-card__price span { font-size: 12px; }

  .product-card__footer { flex-wrap: wrap; gap: 8px; }

  /* Подкатегории */
  .subcategories { gap: 8px; }
  .subcategory-card { padding: 8px 14px; font-size: 13px; }

  /* ─── Модальные окна (мобильная) ─────────────────────────────── */
  .modal-overlay { padding: 0; align-items: stretch; }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .modal__body { flex: 1; overflow-y: auto; }

  .modal__header { padding: 16px; }
  .modal__header h2 { font-size: 18px; }
  .modal__body { padding: 16px; }
  .modal__footer { padding: 12px 16px; flex-direction: column; gap: 10px; }
  .modal__footer .cart-total { width: 100%; text-align: center; }
  .modal__footer .btn { width: 100%; }

  /* ─── Корзина (мобильная) ────────────────────────────────────── */
  .cart-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 10px;
    padding: 12px 0;
  }

  .cart-item__thumb {
    width: 44px;
    height: 44px;
    font-size: 18px;
    grid-row: 1 / 3;
  }

  .cart-item__info {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .cart-item__name { font-size: 13px; }

  .cart-item__remove {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
    padding: 4px 8px;
    font-size: 16px;
    align-self: start;
  }

  .cart-item__qty {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .cart-item__qty button {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .cart-item__price {
    grid-column: 3;
    grid-row: 2;
    min-width: auto;
    font-size: 15px;
    align-self: center;
    text-align: right;
  }

  /* ─── Оформление заказа (мобильная) ─────────────────────────── */
  .checkout-summary { font-size: 13px; padding: 12px; }
  .checkout-summary__total { font-size: 16px; }
}

@media (max-width: 480px) {
  .header-icon-btn { width: 40px; height: 40px; }
  .header-icon-btn svg { width: 18px; height: 18px; }
  .cart-item__info { min-width: 0; }
}

/* Мобильный поиск — выезжающая строка под хедером */
.mobile-search {
  display: none;
  padding: 10px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.mobile-search.open { display: flex; }
.mobile-search input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 15px;
  outline: none;
}
.mobile-search input:focus { border-color: var(--color-accent); }
.mobile-search button {
  padding: 10px 16px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════
   Страницы авторизации
   ═══════════════════════════════════════════════════════════════════ */

.auth-page {
  display: flex;
  justify-content: center;
  padding: 60px 24px;
  flex: 1;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  font-size: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.auth-error {
  color: #c44;
  font-size: 14px;
  margin-bottom: 12px;
  min-height: 20px;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.auth-link a {
  color: var(--color-accent);
  text-decoration: none;
}

.auth-link a:hover { text-decoration: underline; }

/* ─── Профиль ────────────────────────────────────────────────── */
.profile-page {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 48px;
  flex: 1;
  align-items: start;
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-card, .orders-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px;
}

.profile-card h2, .orders-card h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

.profile-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
}

.profile-row:last-child { border-bottom: none; }

.profile-discount { color: var(--color-accent); }

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}
.profile-actions .btn {
  text-align: center;
  justify-content: center;
}

.profile-logout {
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.profile-logout:hover { color: #c44; border-color: #c44; }

.discount-badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
}

/* ─── Заказы ─────────────────────────────────────────────────── */
.orders-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--color-text-muted);
}

.order-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.order-block:last-child { margin-bottom: 0; }

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.order-header__left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-header__id {
  font-weight: 700;
  font-size: 15px;
}

.order-header__date {
  font-size: 13px;
  color: var(--color-text-muted);
}

.order-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.order-items {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}

.order-block { cursor: pointer; transition: box-shadow .2s; }
.order-block:hover { box-shadow: var(--shadow-sm); }

.order-compact {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-compact__photos {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.order-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--color-bg);
}
.order-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.order-thumb--more {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
}

.order-compact__info { flex: 1; min-width: 0; }
.order-compact__top { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.order-compact__bottom { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }

.order-compact__arrow {
  color: var(--color-text-muted);
  font-size: 14px;
  transition: transform .2s;
  flex-shrink: 0;
}
.order-block--open .order-compact__arrow { transform: rotate(90deg); }

.order-details {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.order-block--open .order-details { display: block; }

.order-detail-row {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
}

.order-item__thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  font-size: 16px;
}
.order-item__thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }

.order-item__info { flex: 1; min-width: 0; }
.order-item__name { display: block; font-weight: 500; }
.order-item__catalog { font-size: 12px; color: var(--color-text-muted); }
.order-item__qty { color: var(--color-text-muted); white-space: nowrap; }
.order-item__price { font-weight: 600; white-space: nowrap; }

.order-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 10px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-footer__actions { display: flex; gap: 8px; }

.order-total {
  font-size: 15px;
}

@media (max-width: 767px) {
  .profile-page { grid-template-columns: 1fr; gap: 16px; padding-top: 20px; }
  .profile-sidebar { gap: 16px; }
  .profile-card, .orders-card { padding: 20px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Админ-панель
   ═══════════════════════════════════════════════════════════════════ */

.admin-page {
  padding: 32px 24px 60px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
}

.admin-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}

.admin-tab:hover { color: var(--color-text); }

.admin-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.admin-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.admin-hint {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.admin-hint code {
  background: var(--color-bg);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
}

#importForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#importForm .btn { align-self: flex-start; }

.import-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-field label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
}

.import-field .admin-hint {
  margin-top: 4px;
  margin-bottom: 0;
}

.import-result {
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
}

/* ─── Фото товаров (админка) ──────────────────────────────────── */
.products-photo-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-photo-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.product-photo-item__preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-photo-item__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-photo-item__placeholder {
  font-size: 28px;
  opacity: .4;
}

.product-photo-item__info {
  flex: 1;
  min-width: 0;
}

.product-photo-item__name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-photo-item__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.settings-result { margin-bottom: 12px; font-size: 14px; min-height: 20px; }
.text-success { color: var(--color-success); }
.text-error { color: #c44; }
.text-muted { color: var(--color-text-muted); }

/* ─── Таблица ────────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--color-bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}

.admin-table select, .admin-table input[type="number"] {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* ─── Заказы (админка) ────────────────────────────────────────── */
.orders-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.admin-order {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}
.admin-order:last-child { margin-bottom: 0; }

.admin-order__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-order-status {
  padding: 4px 10px;
  border: 2px solid;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.admin-order__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}
.admin-order__contacts a { color: var(--color-primary-light); text-decoration: none; }
.admin-order__contacts a:hover { text-decoration: underline; }

.admin-order__items {
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
}

.admin-order-item {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}
.admin-order-item__name { flex: 1; }

.admin-order__total {
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 8px;
  text-align: right;
  font-size: 15px;
}

/* ─── Статистика ─────────────────────────────────────────────── */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  text-align: center;
}

.stat-card__value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-card__label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.stats-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.stats-filter .btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.chart-container {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.stats-block {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.stats-block h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

/* ─── Дерево категорий (админка) ─────────────────────────────── */
.cat-tree-item { margin-bottom: 4px; }
.cat-tree-item--l1 { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 8px; background: #fff; }
.cat-tree-item--l2 { padding: 8px 12px; margin-left: 24px; border-left: 2px solid var(--border); }
.cat-tree-item--l3 { padding: 6px 12px; margin-left: 48px; border-left: 2px solid #e0e0e0; }
.cat-tree-row { display: flex; align-items: center; gap: 12px; }
.cat-tree-row strong { font-size: 15px; }
.cat-tree-row span:not(.cat-tree-slug) { font-size: 14px; }
.cat-tree-slug { color: var(--text-light); font-size: 12px; font-family: monospace; }
.cat-tree-actions { margin-left: auto; display: flex; gap: 6px; }
.cat-tree-img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.btn--xs { padding: 4px 10px; font-size: 12px; min-width: unset; }

/* ─── Адаптив админки ────────────────────────────────────────── */
@media (max-width: 767px) {
  .admin-page { padding: 16px 12px 40px; }
  .admin-tabs { overflow-x: auto; }
  .admin-tab { padding: 10px 16px; font-size: 13px; white-space: nowrap; }
  .admin-card { padding: 16px; }
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
  .stat-card__value { font-size: 24px; }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 8px 6px; }
}
