:root {
  --color-primary: #d35400;
  --color-primary-hover: #b94700;
  --color-accent: #2d5a27;
  --color-bg: #fdfcf8;
  --color-surface: #ffffff;
  --color-text: #2c3e50;
  --color-text-muted: #7f8c8d;
  --color-border: #e6e2da;
  --color-danger: #dc2626;
  --color-success: #2d5a27;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --container-width: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* --- Utilities --- */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1rem; }
.hidden { display: none !important; }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.full-width { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }

/* --- Components: Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.95rem;
}
.btn--primary { background: var(--color-primary); color: white; }
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--outline { background: white; border-color: var(--color-border); color: var(--color-text); }
.btn--outline:hover { background: #f1f5f9; border-color: #cbd5e1; }
.btn--text { background: none; color: var(--color-primary); padding: 0.25rem; }
.btn--text:hover { color: var(--color-primary-hover); text-decoration: underline; }
.btn--sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn--lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.theme-toggle { min-width: 36px; }

.btn-group-vertical { display: flex; flex-direction: column; gap: 0.75rem; }

/* --- Components: Inputs --- */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.1); }

/* --- Alerts --- */
.alert { padding: 0.75rem; border-radius: 8px; font-size: 0.9rem; margin: 1rem 0; }
.alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* --- Header --- */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 2000;
  padding: 1rem 0;
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: relative; }

.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: inherit; }
.logo__badge {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: transparent;
}
.logo__badge-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.logo__text { font-weight: 700; font-size: 1.2rem; }
.mobile-category-host { display: none; }

.search-bar { flex: 1; max-width: 400px; position: relative; }
.input--search { padding-right: 2.5rem; }
.search-clear {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.25rem;
  cursor: pointer;
}
.search-clear:hover { color: var(--color-text); }
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.25rem 0;
  max-height: 320px;
  overflow-y: auto;
  z-index: 2000;
}
.search-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.search-dropdown__item:last-child { border-bottom: none; }
.search-dropdown__item:hover,
.search-dropdown__item:focus { background: #f8fafc; outline: none; }
.search-dropdown__name { font-size: 0.95rem; font-weight: 600; }
.search-dropdown__meta { font-size: 0.85rem; color: var(--color-text-muted); white-space: nowrap; }
.search-dropdown__empty { padding: 0.75rem 0.9rem; color: var(--color-text-muted); }
.search-bar--modal { max-width: 100%; }
.search-bar--modal .search-dropdown {
  position: static;
  margin-top: 0.5rem;
}
.modal-content--search { padding: 1rem 1.25rem; }

.nav { display: flex; gap: 0.25rem; }
.nav__link {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  transition: 0.2s;
}
.nav__link:hover { background: #f1f5f9; }
.nav__link.active { background: var(--color-text); color: white; }

.header__controls { display: flex; align-items: center; gap: 0.75rem; padding-right: 3rem; }
.user-controls { display: flex; gap: 0.5rem; }

.theme-toggle {
  position: absolute;
  top: 0.3rem;
  right: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* --- Layout: Main --- */
.section { display: none; padding: 2rem 0; animation: fade-in 0.3s ease-out; }
.section.active { display: block; }
.card { background: white; padding: 2rem; border-radius: var(--radius); border: 1px solid var(--color-border); }

@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- Info & Contact Sections --- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.info-box { background: #f8fafc; padding: 1.5rem; border-radius: 12px; border: 1px solid var(--color-border); }
.info-box--accent { background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 60%); border-color: #bbf7d0; }
.info-box h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.info-box p { margin: 0; color: var(--color-text-muted); }
.contact-layout { display: flex; flex-direction: column; gap: 1rem; }
.contact-item { font-size: 1rem; }
.contact-socials { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.social-badge { display: inline-block; padding: 0.5rem 1rem; background: #f1f5f9; border-radius: 8px; text-decoration: none; color: var(--color-text); font-weight: 500; transition: 0.2s; }
.social-badge:hover { background: var(--color-primary); color: white; }
.social-badge--wa { background: #dcfce7; color: #166534; }
.social-badge--tg { background: #dbeafe; color: #1e40af; }
.social-badge--vk { background: #e0e7ff; color: #4338ca; }
.legal-info { margin-top: 1rem; color: var(--color-text-muted); }
.link { color: var(--color-primary); text-decoration: none; }
.link:hover { text-decoration: underline; }
.footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 2rem 0; text-align: center; color: var(--color-text-muted); }
.footer .theme-toggle {
  position: static;
  margin-top: 0.75rem;
}
.success-icon { width: 60px; height: 60px; background: #dcfce7; color: #166534; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 1rem auto; }
.payment-options { margin-top: 1.5rem; }

/* --- Promo Section (Hero) --- */
.promo {
  background: linear-gradient(135deg, #fff 0%, #f1f5f9 100%);
  padding: 80px 0;
  margin-bottom: 40px;
  overflow: hidden;
}
.promo__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.promo__title {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 800;
}
.promo__title span { color: var(--color-primary); }
.promo__subtitle {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  max-width: 500px;
  margin-bottom: 2.5rem;
}
.promo__image { position: relative; min-height: 240px; flex: 0 0 360px; }
.promo__circle {
  position: absolute;
  inset: -30px auto auto -30px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #d35400 0%, rgba(211, 84, 0, 0.15) 55%, transparent 60%);
  filter: blur(0.2px);
}

/* --- Home Blocks --- */
.home-blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1rem 0 2.5rem;
}
.home-blocks-toggle { margin-bottom: 0.75rem; }
.home-blocks:not(.is-open) .home-block {
  padding: 0.75rem 1rem;
}
.home-blocks:not(.is-open) .home-block__link,
.home-blocks:not(.is-open) .home-block__chips,
.home-blocks:not(.is-open) .home-list {
  display: none;
}
.home-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.home-block--sale {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 60%);
  border-color: #fed7aa;
}
.home-block--new {
  background: linear-gradient(135deg, #ecfeff 0%, #ffffff 60%);
  border-color: #a5f3fc;
}
.home-block--repeat {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 60%);
  border-color: #bbf7d0;
}
.home-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.home-block__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.home-block__link {
  font-size: 0.85rem;
  color: var(--color-primary);
  text-decoration: none;
}
.home-block__link:hover { text-decoration: underline; }
.home-block__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.home-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #fff7ed;
  color: #c2410c;
}
.home-block--new .home-chip {
  background: #ecfeff;
  color: #0e7490;
}
.home-block--repeat .home-chip {
  background: #f0fdf4;
  color: #166534;
}
.home-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.home-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.home-list__item strong {
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.85rem;
}

@media (max-width: 1024px) {
  .home-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Catalog --- */
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; }
.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 1;
  transform: translateY(0);
  transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
  will-change: max-height, opacity, transform;
}

@media (min-width: 769px) {
  .sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
    max-height: calc(100vh - 120px);
  }

  .category-list {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding-right: 4px;
  }
}
.category-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left; padding: 0.75rem; background: none; border: none;
  border-radius: 8px; cursor: pointer; color: var(--color-text);
  transition: 0.2s; font-size: 0.95rem; font-weight: 500;
}
.category-btn:hover { background: #f1f5f9; }
.category-btn.active { background: white; font-weight: 700; color: var(--color-primary); box-shadow: var(--shadow); }
.category-btn.all-products {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background: rgba(211, 84, 0, 0.08);
  font-weight: 700;
}
.category-btn.all-products.active {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow);
}
.category-btn.active-parent:not(.active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(211, 84, 0, 0.08);
  font-weight: 600;
}
.category-item { margin-bottom: 0; }
.category-btn.has-children::after {
  content: '>';
  transition: transform 0.3s;
  font-size: 1.2rem;
  margin-left: 0.5rem;
}
.category-item.open > .category-btn.has-children::after {
  transform: rotate(90deg);
}
.sub-category-list {
  padding-left: 15px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid var(--color-border);
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
}
.category-item.open > .sub-category-list {
  max-height: 400px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.category-btn--sub {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  color: var(--color-text-muted);
}
.category-btn--all { display: none; }
.sidebar.collapsed .category-list {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  overflow: hidden;
}

.sidebar__brand {
  display: none;
  align-items: center;
  gap: 0.5rem;
}
.sidebar__brand-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}
.sidebar__brand-text {
  font-weight: 700;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.grid.grid--switching {
  opacity: 0;
  transform: translateY(8px);
}

.catalog-pager { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin: 1.5rem 0 0; }
.catalog-loader,
.catalog-end { color: var(--color-text-muted); font-size: 0.95rem; }
.catalog-sentinel { height: 1px; }

/* --- Product Card --- */
.product-card {
  background: white;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--color-primary); }
.product-card--highlight { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(211, 84, 0, 0.18), var(--shadow); }

.product-card__img {
    position: relative;
    height: 160px; background: #f1f5f9; border-radius: 8px; margin-bottom: 1rem;
    background-size: contain; background-position: center; background-repeat: no-repeat;
    display: flex; align-items: center; justify-content: center; color: var(--color-text-muted);
    overflow: hidden;
  }
.product-card__cart-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 2;
}
.qty-control--overlay {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.2rem 0.35rem;
  gap: 0.25rem;
  box-shadow: var(--shadow);
  z-index: 2;
}
.qty-control--overlay .btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
}
.qty-control--overlay .qty-control__val {
  width: auto;
  min-width: 18px;
  font-size: 0.8rem;
}
.product-card__price { font-weight: 800; font-size: 1.25rem; margin-bottom: 0.25rem; }
.product-card__price--overlay {
  position: absolute;
  right: 8px;
  bottom: 44px;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.1;
  box-shadow: var(--shadow);
}
.product-card__name {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
  line-height: 1.2;
  min-height: calc(1.2em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card__stock {
  background: #fef9c3; color: #854d0e; font-size: 0.75rem;
  padding: 2px 6px; border-radius: 4px; display: inline-block; margin-bottom: 0.5rem;
}

.qty-control { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.qty-control__val { font-weight: 700; width: 30px; text-align: center; }

/* =========================================
   === MODALS (UPDATED) ===
   ========================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  opacity: 0;
  animation: fadeInOverlay 0.3s forwards;
}

/* Специфичность для перекрытия flex */
.modal-overlay.hidden {
  display: none !important;
  animation: none;
}

.modal {
  background: var(--color-surface);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  animation: slideInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
  overflow: hidden;
}

.modal h3 {
  margin: 0;
  padding: 1.5rem 1.5rem 1rem;
  font-size: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.modal-content, .auth-step { padding: 1.5rem; overflow-y: auto; }

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.modal__close:hover { background: #e2e8f0; color: var(--color-danger); transform: rotate(90deg); }

@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInModal { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* --- Modal: Product Detail --- */
.modal--product { max-width: 550px; }

.product-detail { display: flex; flex-direction: column; }

.product-detail__image {
  background: #f8fafc; width: 100%; height: 280px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-detail__image img { width: 100%; height: 100%; object-fit: contain; }
.product-detail__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-weight: 600;
}
.pd-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem 0;
  overflow-x: auto;
}
.pd-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  flex: 0 0 auto;
}
.pd-thumb.active {
  border-color: var(--color-primary);
}

.product-detail__info { padding: 1.5rem; }

.pd-price { font-size: 1.75rem; font-weight: 800; color: var(--color-primary); margin: 0.5rem 0 1rem; }

.pd-meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.pd-meta-item {
  background: #f1f5f9; padding: 0.75rem; border-radius: 8px;
  font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.pd-meta-item span { color: var(--color-text-muted); font-size: 0.75rem; text-transform: uppercase; }
.pd-meta-item strong { color: var(--color-text); font-weight: 600; }

.pd-description {
  color: var(--color-text-muted); line-height: 1.6; font-size: 0.95rem;
  border-top: 1px dashed var(--color-border); padding-top: 1rem;
}

/* --- Modal: Cart --- */
.modal--cart .modal-content { padding: 0; }

.cart-list {
  padding: 1.5rem; max-height: 50vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1rem;
}

.cart-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem; border: 1px solid var(--color-border); border-radius: 12px;
  background: #fff; transition: border-color 0.2s;
}
.cart-item:hover { border-color: var(--color-primary); }

.cart-item__info h4 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 600; }
.cart-item__price { font-size: 0.85rem; color: var(--color-text-muted); }

.cart-footer {
  padding: 1.5rem; background: #f8fafc; border-top: 1px solid var(--color-border);
  margin-top: auto;
}
.cart-total {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1.25rem; margin-bottom: 1rem;
}

/* --- Modal: Auth --- */
.tg-verify-block {
  margin-top: 1.5rem; background: #f0f9ff;
  border: 1px dashed #0ea5e9; border-radius: 12px; padding: 1rem; text-align: center;
}

.spinner-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 2rem; background: #f8fafc; border-radius: 12px; text-align: center;
}
.spinner {
  width: 40px; height: 40px; border: 4px solid #e2e8f0;
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-stack { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; overflow-y: auto; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
#modal-auth .auth-step {
  padding: 2.5rem;
}
#modal-auth h3 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
  border: none;
  padding: 0;
}
#modal-auth .text-muted {
  text-align: center;
  margin-bottom: 2rem;
  display: block;
}
#modal-auth .form-group {
  margin-bottom: 1.5rem;
}
#modal-auth .btn {
  height: 52px;
  margin-top: 0.5rem;
}

/* --- Profile --- */
.address-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.address-row { display: flex; gap: 0.5rem; }

/* --- Mobile --- */
@media (max-width: 768px) {
  .container { padding: 0 0.5rem; }
  .header { z-index: 2000; }
  .header__inner { flex-wrap: wrap; }
  .header .logo { display: none; }
  .header .search-bar { display: none; }
  .search-bar { order: 3; max-width: 100%; width: 100%; margin-top: 0.5rem; }
  
  .nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: white; padding: 1rem; box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    justify-content: space-around; z-index: 40;
  }
  .nav__link { display: flex; flex-direction: column; align-items: center; font-size: 0.8rem; }
  .header__controls { padding-right: 2.5rem; }
  .header__controls #authBtn,
  .header__controls #userControls,
  .header__controls [data-action="cart:toggle"] {
    display: none;
  }
  .theme-toggle { top: 0.2rem; }
  .promo { display: none; }
  .promo__circle { width: 220px; height: 220px; inset: -10px auto auto -10px; }
  .home-blocks,
  .home-blocks-toggle { display: none; }
  
  .catalog-layout { grid-template-columns: 1fr; }
  .mobile-category-host { display: block; margin-top: 0.5rem; }
  .category-slot { display: none; }
  .sidebar { 
    position: relative;
    top: auto;
    z-index: auto;
    margin-bottom: 0; 
    background: var(--color-surface); 
    border: 2px solid var(--color-border); 
    border-radius: 16px; 
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
  }
  .sidebar.collapsed {
    box-shadow: none;
  }
  .sidebar__title { 
    margin: 0; 
    padding: 1rem 1.25rem; 
    cursor: pointer; 
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 14px;
    min-height: 56px;
    position: static;
    top: auto;
    z-index: auto;
  }
  .sidebar__title {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
  }
  .sidebar__brand { display: inline-flex; flex-shrink: 0; }
  .sidebar__title-text {
    display: block;
    font-size: 0.95rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
  }
  .sidebar__title::after {
    content: '>';
    transition: transform 0.3s;
    font-size: 1rem;
    opacity: 0.9;
  }
  .sidebar.collapsed .sidebar__title::after {
    transform: rotate(-90deg);
  }
  .sidebar.collapsed .category-list {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    overflow: hidden;
  }
  .category-list { 
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    bottom: auto;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; 
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 2001;
  }
  .category-btn { 
    white-space: normal; 
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 48px;
  }
  .category-btn.all-products {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    font-weight: 700;
    font-size: 0.95rem;
  }
  .category-item {
    display: block;
  }
  .category-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  }
  .category-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.4);
  }
  .category-btn.has-children::after {
    content: '>';
    font-size: 0.9rem;
    opacity: 0.7;
  }
  .category-item.open > .sub-category-list {
    max-height: 400px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .sub-category-list {
    padding-left: 15px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 2px solid var(--color-border);
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
  }
  .category-btn--sub {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
  }
  .category-btn--all {
    display: flex;
  }

  /* Mobile Modals (Centered) */
  .modal {
    max-width: 92vw;
    max-height: 85vh;
    margin: 0;
    border-radius: 16px;
    transform: translateY(20px) scale(0.95);
    animation: slideInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
  }
  
  #modal-auth .modal {
    max-height: 92vh;
  }
  #modal-auth .modal__close {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
  }
  #modal-auth .auth-step {
    padding: 1.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  }
  #modal-auth h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }
  #modal-auth .text-muted {
    margin-bottom: 1.25rem;
  }
  #modal-auth .btn {
    height: 48px;
  }
  #modal-auth .btn-group-vertical {
    gap: 0.5rem;
  }
  #modal-auth .tg-verify-block {
    margin-top: 1rem;
    padding: 0.75rem;
  }
  #modal-auth .spinner-box {
    padding: 1.5rem;
  }

  .product-detail__image { height: 200px; }
  
  .cart-item { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .cart-item .qty-control {
    width: 100%; justify-content: space-between;
    margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--color-border);
  }
}
/* --- Mobile App Interface --- */

/* Скрываем нижний таб-бар на десктопе */
.mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Фиксируем хедер и убираем лишнее */
    .header__inner {
        padding: 10px 0;
    }
    .nav, .header__search {
        display: none !important; /* Прячем старую навигацию */
    }
    
    .header__brand-text {
        font-size: 1rem;
    }

    /* Главный экран: сетка товаров 2 в ряд как в маркетплейсах */
    #productGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 0;
    }
    #productGrid .product-card {
        min-width: 0;
    }

    .product-card {
        padding: 6px;
        border-radius: 16px;
    }

    .product-card__img {
        height: 110px;
        border-radius: 12px;
    }

    .product-card__price {
        font-size: 1rem;
    }
    .product-card__price--overlay {
        bottom: 40px;
        font-size: 0.95rem;
    }

    /* Нижняя панель навигации */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: rgba(255, 255, 255, 0.78);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--color-border);
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom); /* Поддержка iPhone с челкой */
    }

    .mobile-nav__item {
        background: none;
        border: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--color-text-muted);
        cursor: pointer;
        flex: 1;
    }

    .mobile-nav__item.active {
        color: var(--color-primary);
    }

    .mobile-nav__icon {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
    }

    .mobile-nav__badge {
        position: absolute;
        top: -6px;
        right: -10px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--color-danger);
        color: #ffffff;
        font-size: 0.6rem;
        line-height: 16px;
        font-weight: 700;
        text-align: center;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

    .mobile-nav__label {
        font-size: 0.7rem;
        font-weight: 500;
    }

    /* Добавляем отступ снизу для контента, чтобы его не закрывал таб-бар */
    body {
        padding-bottom: 80px;
    }

    /* Сайдбар категорий превращаем в горизонтальный скролл */
    .catalog-layout {
        display: block;
    }

    .category-list { 
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        right: 0;
        bottom: auto;
        margin-top: 0;
        display: flex;
        flex-direction: column;
        gap: 0.5rem; 
        padding: 1rem;
        max-height: 70vh;
        overflow-y: auto;
        background: var(--color-surface);
        border: 2px solid var(--color-border);
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15);
        z-index: 2001;
    }

    .category-item {
        display: block;
    }

    .category-btn {
        white-space: normal;
        width: 100%;
        background: var(--color-surface);
        border: 2px solid var(--color-border);
        padding: 0.6rem 0.75rem;
        border-radius: 12px;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        font-size: 0.85rem;
        font-weight: 600;
        min-height: 48px;
    }

    .category-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .category-btn.active {
        background: var(--color-primary);
        color: white;
    }

    .modal {
        max-width: 92vw;
        max-height: 85vh;
        margin: 0;
        border-radius: 16px;
        transform: translateY(20px) scale(0.95);
        animation: slideInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    }
}

/* --- Dark Theme --- */
body.theme-dark {
    --color-primary: #e67e22;
    --color-primary-hover: #cf6f1e;
    --color-accent: #4f7942;
    --color-bg: #121212;
    --color-surface: #1e1e1e;
    --color-text: #f5f5f5;
    --color-text-muted: #a0a0a0;
    --color-border: #2a2a2a;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
body.theme-light {
    --color-primary: #d35400;
    --color-primary-hover: #b94700;
    --color-accent: #2d5a27;
    --color-bg: #fdfcf8;
    --color-surface: #ffffff;
    --color-text: #2c3e50;
    --color-text-muted: #7f8c8d;
    --color-border: #e6e2da;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
body.theme-dark .promo { background: linear-gradient(135deg, #121212 0%, #1e1e1e 100%); }
body.theme-dark .home-block,
body.theme-dark .product-card,
body.theme-dark .card,
body.theme-dark .modal,
body.theme-dark .cart-item { background: var(--color-surface); }
body.theme-dark .home-block--sale {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.3) 0%, #1e1e1e 60%);
    border-color: #e67e22;
}
body.theme-dark .home-block--new {
    background: linear-gradient(135deg, rgba(79, 121, 66, 0.28) 0%, #1e1e1e 60%);
    border-color: #4f7942;
}
body.theme-dark .home-block--repeat {
    background: linear-gradient(135deg, rgba(79, 121, 66, 0.22) 0%, #1e1e1e 60%);
    border-color: #3f6b36;
}
body.theme-dark .home-chip {
    background: rgba(230, 126, 34, 0.3);
    color: #f5f5f5;
}
body.theme-dark .home-block--new .home-chip {
    background: rgba(79, 121, 66, 0.3);
    color: #d7ead2;
}
body.theme-dark .home-block--repeat .home-chip {
    background: rgba(79, 121, 66, 0.24);
    color: #c7dfc0;
}
body.theme-dark .sidebar {
    background: #1e1e1e;
    border-color: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
body.theme-dark .sidebar.collapsed {
    box-shadow: none;
}
body.theme-dark .sidebar__title {
    background: linear-gradient(135deg, #e67e22 0%, #cf6f1e 100%);
    color: #121212;
}
body.theme-dark .category-list {
    background: #1e1e1e;
    border-color: #2a2a2a;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}
body.theme-dark .category-btn {
    background: #1e1e1e;
    border-color: #2a2a2a;
    color: #f5f5f5;
}
body.theme-dark .category-btn:hover {
    background: #e67e22;
    color: #ffffff;
    border-color: #e67e22;
}
body.theme-dark .category-btn.active {
    background: #e67e22;
    color: #ffffff;
    border-color: #e67e22;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.5);
}
body.theme-dark .category-btn.all-products {
    background: rgba(230, 126, 34, 0.2);
    border-color: #e67e22;
    color: #f5f5f5;
}
body.theme-dark .category-btn.active-parent:not(.active) {
    background: rgba(230, 126, 34, 0.18);
    border-color: #e67e22;
    color: #e67e22;
}
body.theme-dark .btn--outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #3a3a3a;
}
body.theme-dark .nav__link:hover { background: rgba(255, 255, 255, 0.08); }
body.theme-dark .nav__link.active { background: #f5f5f5; color: #121212; }
body.theme-dark .home-block__link:hover { color: #e67e22; }
body.theme-dark .product-card:hover { border-color: #e67e22; }
body.theme-dark .cart-item:hover { border-color: #e67e22; }
body.theme-dark .modal__close:hover { background: #1f2937; color: #f87171; }
body.theme-dark .product-card__price--overlay {
    background: rgba(30, 30, 30, 0.9);
    color: var(--color-text);
    border: 1px solid #2a2a2a;
}
body.theme-dark .btn--primary {
    background: #e67e22;
    color: #121212;
}
body.theme-dark .btn--primary:hover { background: #cf6f1e; }
body.theme-dark .btn--outline {
    background: #1e1e1e;
    border-color: #2a2a2a;
    color: #f5f5f5;
}
body.theme-dark .btn--text {
    color: #e67e22;
}
body.theme-dark .btn--text:hover { color: #cf6f1e; }
@media (prefers-color-scheme: dark) {
    body:not(.theme-light):not(.theme-dark) {
        --color-primary: #e67e22;
        --color-primary-hover: #cf6f1e;
        --color-accent: #4f7942;
        --color-bg: #121212;
        --color-surface: #1e1e1e;
        --color-text: #f5f5f5;
        --color-text-muted: #a0a0a0;
        --color-border: #2a2a2a;
        --shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    }
    body:not(.theme-light):not(.theme-dark) .promo { background: linear-gradient(135deg, #121212 0%, #1e1e1e 100%); }
    body:not(.theme-light):not(.theme-dark) .home-block,
    body:not(.theme-light):not(.theme-dark) .product-card,
    body:not(.theme-light):not(.theme-dark) .card,
    body:not(.theme-light):not(.theme-dark) .modal,
    body:not(.theme-light):not(.theme-dark) .cart-item { background: var(--color-surface); }
    body:not(.theme-light):not(.theme-dark) .home-block--sale {
        background: linear-gradient(135deg, rgba(230, 126, 34, 0.3) 0%, #1e1e1e 60%);
        border-color: #e67e22;
    }
    body:not(.theme-light):not(.theme-dark) .home-block--new {
        background: linear-gradient(135deg, rgba(79, 121, 66, 0.28) 0%, #1e1e1e 60%);
        border-color: #4f7942;
    }
    body:not(.theme-light):not(.theme-dark) .home-block--repeat {
        background: linear-gradient(135deg, rgba(79, 121, 66, 0.22) 0%, #1e1e1e 60%);
        border-color: #3f6b36;
    }
    body:not(.theme-light):not(.theme-dark) .home-chip {
        background: rgba(230, 126, 34, 0.3);
        color: #f5f5f5;
    }
    body:not(.theme-light):not(.theme-dark) .home-block--new .home-chip {
        background: rgba(79, 121, 66, 0.3);
        color: #d7ead2;
    }
    body:not(.theme-light):not(.theme-dark) .home-block--repeat .home-chip {
        background: rgba(79, 121, 66, 0.24);
        color: #c7dfc0;
    }
    body:not(.theme-light):not(.theme-dark) .category-btn:hover,
    body:not(.theme-light):not(.theme-dark) .btn--outline:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: #3a3a3a;
    }
    body:not(.theme-light):not(.theme-dark) .category-btn.active {
        background: #e67e22;
        color: #ffffff;
        border-color: #e67e22;
        box-shadow: 0 4px 12px rgba(230, 126, 34, 0.5);
    }
    body:not(.theme-light):not(.theme-dark) .category-btn.all-products {
        background: rgba(230, 126, 34, 0.2);
        border-color: #e67e22;
        color: #f5f5f5;
    }
    body:not(.theme-light):not(.theme-dark) .category-btn.active-parent:not(.active) {
        background: rgba(230, 126, 34, 0.18);
        border-color: #e67e22;
        color: #e67e22;
    }
    body:not(.theme-light):not(.theme-dark) .nav__link:hover { background: rgba(255, 255, 255, 0.08); }
    body:not(.theme-light):not(.theme-dark) .nav__link.active { background: #f5f5f5; color: #121212; }
    body:not(.theme-light):not(.theme-dark) .home-block__link:hover { color: #e67e22; }
    body:not(.theme-light):not(.theme-dark) .product-card:hover { border-color: #e67e22; }
    body:not(.theme-light):not(.theme-dark) .cart-item:hover { border-color: #e67e22; }
    body:not(.theme-light):not(.theme-dark) .modal__close:hover { background: #1f2937; color: #f87171; }
    body:not(.theme-light):not(.theme-dark) .btn--primary {
        background: #e67e22;
        color: #121212;
    }
    body:not(.theme-light):not(.theme-dark) .btn--primary:hover { background: #cf6f1e; }
    body:not(.theme-light):not(.theme-dark) .btn--outline {
        background: #1e1e1e;
        border-color: #2a2a2a;
        color: #f5f5f5;
    }
    body:not(.theme-light):not(.theme-dark) .btn--text {
        color: #e67e22;
    }
    body:not(.theme-light):not(.theme-dark) .btn--text:hover { color: #cf6f1e; }
}
/* --- Admin Panel Modern Style --- */
.admin-page {
    --color-bg: #f5f6fb;
    --color-surface: #ffffff;
    --color-text: #101828;
    --color-text-muted: #667085;
    --color-border: #e4e7ec;
    --color-primary: #f05a22;
    --color-primary-hover: #d94e1b;
    --color-accent: #0ea5e9;
    --shadow: 0 12px 24px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.06);
    --admin-surface-2: #f1f5f9;
    --admin-table-row: #f8fafc;
    --admin-table-row-hover: #eef2ff;
    background-color: var(--color-bg);
    color: var(--color-text);
}

.admin-page.theme-dark {
    --color-bg: #0b111a;
    --color-surface: #0f172a;
    --color-text: #e5e7eb;
    --color-text-muted: #9ca3af;
    --color-border: #1f2937;
    --color-primary: #fb923c;
    --color-primary-hover: #f97316;
    --color-accent: #38bdf8;
    --shadow: 0 16px 30px rgba(0, 0, 0, 0.35), 0 6px 14px rgba(0, 0, 0, 0.25);
    --admin-surface-2: #111827;
    --admin-table-row: #0f172a;
    --admin-table-row-hover: #1f2937;
}

.admin-container {
    padding-top: 2rem;
    padding-bottom: 5rem;
}

.admin-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.admin-page .btn--outline {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.admin-page .btn--outline:hover {
    background: var(--admin-surface-2);
}

.admin-status {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    background: var(--admin-surface-2);
    border: 1px solid var(--color-border);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
}

.admin-theme-toggle {
    min-width: 76px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-header__controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-section__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-section__actions .input {
    max-width: 240px;
}

.input--sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.admin-tab-btn.active {
    background: var(--color-text);
    color: #fff;
}

.admin-note {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.admin-item-list {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.admin-auth {
    margin-bottom: 2rem;
}

.admin-auth__card {
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.admin-auth__message {
    font-size: 0.9rem;
    min-height: 1.25rem;
}

.admin-auth__message[data-status="error"] {
    color: var(--color-danger);
}

.admin-auth__message[data-status="success"] {
    color: var(--color-success);
}

.admin-auth__message[data-status="info"] {
    color: var(--color-text-muted);
}

.admin-auth__alt {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Статистика в шапке админки */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
}

.stat-card__label {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-top: 0.5rem;
}

/* Таблицы в стиле Modern */
.admin-table-container {
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    overflow: hidden; /* Для скругления углов таблицы */
    box-shadow: var(--shadow);
    margin-top: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: var(--admin-surface-2);
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

.admin-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover {
    background-color: var(--admin-table-row-hover);
}

/* Статусы заказов */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status--new { background: #dcfce7; color: #166534; }
.status--pending { background: #fef9c3; color: #854d0e; }

.admin-page.theme-dark .status--new {
    background: rgba(22, 163, 74, 0.2);
    color: #86efac;
}

.admin-page.theme-dark .status--pending {
    background: rgba(234, 179, 8, 0.18);
    color: #fde047;
}

/* Формы управления категориями */
.admin-card {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    height: 100%;
}

.scanner-reader {
  width: 100%;
  max-width: 420px;
  min-height: 260px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--admin-surface-2);
  position: relative;
}

.admin-category-forms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .admin-category-forms {
        grid-template-columns: 1fr;
    }
    .admin-header .header__inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-page .header__brand {
        width: 100%;
    }
    .admin-header__controls {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .admin-header__controls .btn,
    .admin-header__controls .admin-status {
        flex: 1 1 calc(50% - 0.5rem);
    }
    .admin-theme-toggle {
        min-width: 0;
    }
    .admin-page .header__brand-subtitle {
        display: none;
    }
    .admin-tabs {
        background: var(--color-bg);
        padding: 0.5rem 0 0.75rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    .admin-tabs::-webkit-scrollbar {
        display: none;
    }
    .admin-tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .admin-section__head {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-section__actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .admin-section__actions .input {
        max-width: none;
        flex: 1 1 100%;
    }
    .admin-section__actions .btn {
        width: 100%;
    }
    .admin-table-container {
        overflow-x: auto;
    }
    .admin-table {
        display: table;
        min-width: 640px;
    }
    .admin-table th,
    .admin-table td {
        padding: 0.75rem 1rem;
    }
    .admin-auth__card,
    .admin-card {
        padding: 1.25rem;
    }
}


/* В конец styles.css */
.admin-table tbody tr:nth-child(odd) { background-color: var(--admin-table-row); }
.admin-table tbody tr:hover { background-color: var(--admin-table-row-hover); }
.admin-tabs { gap: 0.75rem; display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--color-border); padding-bottom: 1rem; }
.admin-hidden-before-auth { display: none; } /* Управляется через JS */
