:root {
  --bg: #f6f4f1;
  --panel: #ffffff;
  --ink: #2b2420;
  --muted: #7a7067;
  --border: #e7e0d8;
  --accent: #c96a4b;
  --accent-dark: #a8543a;
  --accent-soft: #f4e3dc;
  --ok: #4c8a5e;
  --ok-soft: #e3f0e6;
  --warn: #c99a2e;
  --warn-soft: #f7edd6;
  --danger: #b8433f;
  --danger-soft: #f6e0df;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: #2b2420;
  color: #eee7df;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* sticky + свой скролл — раньше при невысоком окне ссылка "Выйти" внизу уезжала за
     пределы экрана вместе со всей страницей, приходилось скроллить весь контент. */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.login-card .brand img { width: 40px; height: 40px; }

.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: #d8cfc5;
  text-decoration: none;
  font-size: 14px;
}

.nav-link:hover { background: #3a3129; color: #fff; }
.nav-link.active { background: var(--accent); color: #fff; }

.content {
  flex: 1;
  padding: 28px 36px;
  max-width: 1760px;
}

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.subtitle { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .value { font-size: 26px; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: 13px; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #faf8f5; }

a { color: var(--accent-dark); }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--danger); }
.btn.ok { color: var(--ok); }

/* Анимация "пузырьков" при клике — только сама анимация (заимствована у "Игристой кнопки"
   с msiter.ru, https://codepen.io/nourabusoud/pen/ypZzMM), форма и свечение кнопок не менялись. */
.btn {
  position: relative;
  --bubble-color: var(--accent);
  /* Размер пузырьков в vw (не в %), поэтому форма всегда квадратная (круг), а не растянутая
     под прямоугольную кнопку; растёт вместе с шириной экрана, чтобы не терялся на больших мониторах. */
  --bubble-xs: clamp(4px, 0.5vw, 9px);
  --bubble-sm: clamp(6px, 0.7vw, 12px);
  --bubble-md: clamp(7px, 0.9vw, 15px);
  --bubble-lg: clamp(8px, 1vw, 16px);
}
.btn:before, .btn:after {
  position: absolute;
  content: '';
  display: none;
  width: 140%;
  height: 100%;
  left: -20%;
  z-index: 1000;
  background-repeat: no-repeat;
  pointer-events: none;
}
.btn:before {
  top: -75%;
  background-image:
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, transparent 20%, var(--bubble-color) 20%, transparent 30%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, transparent 10%, var(--bubble-color) 15%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%);
  background-size:
    var(--bubble-xs) var(--bubble-xs), var(--bubble-lg) var(--bubble-lg), var(--bubble-sm) var(--bubble-sm),
    var(--bubble-lg) var(--bubble-lg), var(--bubble-md) var(--bubble-md), var(--bubble-xs) var(--bubble-xs),
    var(--bubble-sm) var(--bubble-sm), var(--bubble-xs) var(--bubble-xs), var(--bubble-md) var(--bubble-md);
}
.btn:after {
  bottom: -75%;
  background-image:
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, transparent 10%, var(--bubble-color) 15%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
    radial-gradient(circle, var(--bubble-color) 20%, transparent 20%);
  background-size:
    var(--bubble-sm) var(--bubble-sm), var(--bubble-lg) var(--bubble-lg), var(--bubble-md) var(--bubble-md),
    var(--bubble-lg) var(--bubble-lg), var(--bubble-sm) var(--bubble-sm), var(--bubble-xs) var(--bubble-xs),
    var(--bubble-lg) var(--bubble-lg);
}
.btn.animate:before { display: block; animation: crmBtnTopBubbles ease-in-out 0.75s forwards; }
.btn.animate:after { display: block; animation: crmBtnBottomBubbles ease-in-out 0.75s forwards; }

@keyframes crmBtnTopBubbles {
  0% { background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%, 40% 90%, 55% 90%, 70% 90%; }
  50% { background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%, 50% 50%, 65% 20%, 90% 30%; }
  100% {
    background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%, 50% 40%, 65% 10%, 90% 20%;
    background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  }
}
@keyframes crmBtnBottomBubbles {
  0% { background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%, 70% -10%, 70% 0%; }
  50% { background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%, 95% 60%, 105% 0%; }
  100% {
    background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%, 95% 70%, 110% 10%;
    background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  }
}

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.NEW { background: var(--warn-soft); color: var(--warn); }
.badge.CONFIRMED, .badge.IN_PRODUCTION, .badge.IN_PROGRESS, .badge.COLLECTED { background: var(--accent-soft); color: var(--accent-dark); }
.badge.READY, .badge.DONE, .badge.RECEIVED { background: var(--ok-soft); color: var(--ok); }
.badge.DELIVERED { background: #e5e5e5; color: #555; }
.badge.CANCELLED { background: var(--danger-soft); color: var(--danger); }
.badge.PENDING { background: #eee; color: #777; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--muted); border: 1px solid var(--border); }
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

form .field { margin-bottom: 14px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], textarea, select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.item-row { display: flex; gap: 10px; align-items: end; margin-bottom: 10px; }
.item-row select, .item-row input { flex: 1; }
.item-row.hidden-row { display: none; }
.hidden-row { display: none; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.success { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

.empty { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.board-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.board-col h2 { display: flex; justify-content: space-between; font-size: 14px; }
.task-card { display: block; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; background: #fdfcfb; text-decoration: none; color: inherit; }
.task-card:hover { border-color: var(--accent); }
.task-card .title { font-weight: 600; margin-bottom: 4px; }
.task-card .meta { color: var(--muted); font-size: 12px; margin-bottom: 8px; }

.low-stock-row { color: var(--danger); font-weight: 600; }

/* Каталог товаров, сгруппированный по категориям (/products, /warehouse/stock) —
   см. ProductController, WarehouseStockController. */
.product-search {
  max-width: 360px;
  margin-bottom: 22px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7067' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
  background-size: 16px;
  padding-left: 36px;
}
.category-section { margin-bottom: 28px; }
.category-section h2 { display: flex; align-items: baseline; gap: 8px; }
.category-count { color: var(--muted); font-size: 13px; font-weight: 400; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.product-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: border-color .15s, box-shadow .15s;
}
.product-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.product-card-archived { opacity: .55; }
.product-card-archived:hover { opacity: 1; }
.product-card-img, .product-card-avatar { width: 100%; aspect-ratio: 1 / 1; display: block; object-fit: cover; }
.product-card-img { background: var(--accent-soft); }
.product-card-avatar {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 34px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card-body { padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
/* Фиксированная высота в 2 строки — иначе карточки с короткими и длинными названиями в одном
   ряду сетки выглядят неровно (цена/остаток съезжают на разную высоту от карточки к карточке). */
.product-card-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-price { color: var(--muted); font-size: 13px; }
.product-card-stock { font-size: 13px; font-weight: 600; }
.product-card-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 14px; }
.product-card-actions form { margin: 0; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; width: 100%; max-width: 340px; }
.login-card .brand { color: var(--ink); font-size: 18px; font-weight: 700; margin-bottom: 22px; justify-content: center; }
.login-card .btn.primary { width: 100%; text-align: center; }

.hero-card { background: var(--accent); color: #fff; border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; }
.hero-card .value { font-size: 30px; font-weight: 700; }
.hero-card .label { opacity: .85; font-size: 13px; margin-top: 4px; }

a.stat-card { display: block; text-decoration: none; transition: border-color .15s; }
a.stat-card:hover { border-color: var(--accent); }

.date-range-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-range-form input[type=date] { width: auto; height: 38px; }
.date-range-form .btn { white-space: nowrap; height: 38px; display: inline-flex; align-items: center; justify-content: center; }

.client-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.client-row { display: flex; align-items: center; gap: 10px; }

.notif-group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 12px 16px; margin-bottom: 10px; }
.notif-group summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; list-style: none; gap: 10px; }
.notif-group summary::-webkit-details-marker { display: none; }
.notif-group summary::before { content: "›"; display: inline-block; margin-right: 8px; transition: transform .15s; }
.notif-group[open] summary::before { transform: rotate(90deg); }
.notif-group .summary-title { font-weight: 600; flex: 1; }
.notif-group .summary-meta { color: var(--muted); font-size: 12px; }
.notif-group .history { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.notif-group .history .item { margin-bottom: 10px; font-size: 13px; }
.notif-group .history .item .msg { color: var(--ink); }
.notif-group .history .item .when { color: var(--muted); font-size: 12px; }

/* Публичная витрина (/shop) — мобильно-первая вёрстка, повторяет UX мобильного приложения
   (см. mobile/lib/screens/order_form_screen.dart, product_quantity_screen.dart). */
.shop-page { min-height: 100vh; max-width: 480px; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; }
.shop-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.shop-topbar .brand { color: var(--ink); margin-bottom: 0; font-size: 16px; }
.shop-topbar .brand img { width: 26px; height: 26px; }
.shop-topbar-right { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

.shop-content { flex: 1; padding: 18px 16px 140px; }
.shop-title { font-size: 22px; font-weight: 700; line-height: 1.25; margin: 6px 0 18px; }

.shop-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  text-decoration: none;
  color: var(--ink);
  width: 100%;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 10px;
}

.shop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 10px;
}
.shop-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  flex-shrink: 0;
}
.shop-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: var(--accent-dark);
}
.shop-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.shop-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.shop-row-name { font-weight: 600; font-size: 15px; }
.shop-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-row-price { color: var(--muted); font-size: 13px; }
.shop-row-remove {
  border: none;
  background: var(--bg);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.shop-row-remove:hover { background: var(--danger-soft); color: var(--danger); }
.shop-row-remove:active { transform: scale(0.9); }

.shop-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  flex-shrink: 0;
  padding: 4px;
}
.shop-stepper button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, transform .1s;
}
.shop-stepper button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.shop-stepper button:active { transform: scale(0.88); }
.shop-stepper .qty { min-width: 32px; text-align: center; font-weight: 700; font-size: 16px; }

/* История заказов клиента (/shop/orders) — карточка на заказ с кнопкой "Повторить заказ". */
.shop-order-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.shop-order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.shop-order-date { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.shop-order-total { font-weight: 700; font-size: 15px; white-space: nowrap; }
.shop-order-items { color: var(--muted); font-size: 13px; line-height: 1.4; margin-bottom: 12px; }

.shop-add-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px;
  border-radius: 30px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  margin: 6px 0 16px;
}

/* fixed, а не sticky — иначе на длинной странице (много карточек/позиций) панель прижата
   к низу ТОЛЬКО когда докрутили страницу до конца, а не постоянно видна поверх контента,
   как положено нижней навигации/кнопке заказа. */
.shop-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}
.shop-bottom-bar .btn {
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
}

.shop-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
}
.shop-list-row:last-child { border-bottom: none; }

/* Экран товара крупным планом (аналог product_quantity_screen.dart) */
.shop-hero { position: relative; }
.shop-hero-img {
  width: 100%;
  height: 42vh;
  min-height: 220px;
  max-height: 340px;
  object-fit: cover;
  border-radius: 0 0 28px 28px;
  background: var(--accent-soft);
  display: block;
}
.shop-hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 700;
  color: var(--accent-dark);
}
.shop-hero-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 18px;
}
.shop-hero-stepper {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 40px;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  padding: 5px;
  display: flex;
  align-items: center;
}
.shop-hero-stepper button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.shop-hero-stepper button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.shop-hero-stepper button:active { transform: scale(0.88); }
.shop-hero-stepper .qty { min-width: 42px; text-align: center; font-weight: 700; font-size: 18px; }

/* Количество вводится тапом напрямую (см. shop/product.html, shop/catalog.html) — иначе для
   оптовых заказов (сотни/тысячи штук) пришлось бы жать +/- сотни раз. Оба .qty-input и в
   степпере товара, и в степпере строки корзины должны выглядеть как обычный текст, а не как
   инпут (сброс общих правил `input[type=text]` выше по файлу — здесь выше специфичность).
   ВАЖНО: ширина задаётся фиксированным px, а не `auto`/`%` — `<input>` не "сжимается" по
   контенту как span, внутри flex-контейнера без явной ширины auto резолвится в дефолтные
   ~20 символов браузера, из-за чего степпер разъезжался за край экрана. */
input.qty-input {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  color: inherit;
  text-align: center;
}
.shop-stepper input.qty-input { width: 56px; }
.shop-hero-stepper input.qty-input { width: 70px; }

.shop-detail-body { padding: 48px 20px 100px; }
.shop-detail-name { font-size: 22px; font-weight: 700; }
.shop-detail-price { color: var(--muted); font-size: 14px; margin-top: 6px; }
.shop-detail-desc { color: #6b5e52; line-height: 1.5; margin-top: 14px; font-size: 14px; }
.shop-category-badge { background: var(--warn-soft); color: var(--warn); padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }

@media (min-width: 481px) {
  .shop-page { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

/* Нижняя таб-панель витрины (Главная/Корзина/Мои заказы) — ВСЕГДА видна поверх контента,
   независимо от прокрутки (fixed, а не sticky — sticky держит панель у низа, только пока
   не докрутили страницу до конца, а на длинном списке товаров это может быть далеко).
   Контент страницы получает нижний отступ (.shop-content padding), чтобы карточки не
   прятались под панелью. */
.shop-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.shop-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
}
.shop-tabbar a.active { color: var(--accent-dark); font-weight: 600; }
.shop-tab-icon { position: relative; display: inline-block; font-size: 20px; line-height: 1; }
.shop-content-with-tabbar { padding-bottom: 12px; }
.shop-tab-badge {
  position: absolute;
  top: -6px;
  right: -11px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* Каталог витрины (/shop/products) — всегда ровно 2 карточки в ряд. */
.shop-page .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shop-page .product-card-img,
.shop-page .product-card-avatar { aspect-ratio: auto; height: 140px; font-size: 28px; }
.shop-page .product-card-body { padding: 8px 10px 6px; gap: 3px; }
.shop-page .product-card-name { font-size: 12.5px; min-height: 2.1em; }
.shop-page .product-card-price { font-size: 12px; }
.shop-page .category-section { margin-bottom: 14px; }
.shop-page .category-section h2 { font-size: 15px; margin-bottom: 6px; }
.shop-page .product-search { margin-bottom: 14px; }

/* Фото товара на карточке + плавающая кнопка быстрого добавления в его углу (см.
   crmAddIngredientRow-подобный приём — только для корзины). Кнопка привязана к углу ВСЕЙ
   карточки (а не только фото) — .shop-product-card становится точкой отсчёта позиции. */
.shop-product-media { position: relative; }
.shop-page .shop-product-card { position: relative; }
.shop-page .product-card-body { padding-right: 40px; }
.shop-quick-add {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
  transition: transform .12s, background .15s;
}
.shop-quick-add:active { transform: scale(0.85); }
.shop-quick-add.added { animation: shopQuickAddPulse .45s ease; }
@keyframes shopQuickAddPulse {
  0% { transform: scale(1); background: var(--accent); }
  45% { transform: scale(1.4); background: var(--ok); }
  100% { transform: scale(1); background: var(--accent); }
}
.shop-tab-badge.bump { animation: shopBadgeBump .35s ease; }
@keyframes shopBadgeBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* На экране корзины над таб-панелью ещё есть кнопка "Оформить заказ" — обе вместе должны
   быть закреплены у низа экрана как единый блок (у двух независимо "fixed" соседей с
   bottom:0 второй перекрыл бы первый). */
.shop-bottom-area { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; width: 100%; }
.shop-bottom-area .shop-bottom-bar,
.shop-bottom-area .shop-tabbar { position: static; }

/* Карточки товаров на главной витрины (/shop/products) — переиспользуют .product-card из
   админки, но обёрнуты в <a>, т.к. вся карточка кликабельна (переход на товар крупным планом). */
.shop-product-card { text-decoration: none; color: inherit; }

