/* Fallbery — светлый дизайн, WebApp */
:root {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-top: var(--safe-top);
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 100vw;
}

/* Хедер + категории — фиксированы вверху экрана */
.sticky-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 101;
  flex-shrink: 0;
  background: var(--bg-card);
}

/* Резерв места под фиксированный хедер (высота подставляется из JS) */
.header-spacer {
  flex-shrink: 0;
}

.header {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
}

.header-inner {
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  max-width: 60%;
}

.logo svg {
  display: block;
  height: 26px;
  width: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.icon-btn:hover {
  color: var(--accent);
  background: rgba(37, 99, 235, .08);
}

.cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden { display: none !important; }
.cart-count.hidden {
  display: none;
}

.social-links {
  display: flex;
  gap: 4px;
}

/* Категории — внутри липкого блока; скрываются на странице товара/статьи */
.brands-wrap {
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.brands-wrap.hidden {
  display: none !important;
}

.brands-wrap::-webkit-scrollbar {
  display: none;
}

.brands-scroll {
  display: flex;
  gap: 6px;
  padding: 10px 0;
  min-width: min-content;
}

.brand-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}

.brand-tab:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.brand-tab.active {
  color: var(--accent);
  background: rgba(37, 99, 235, .1);
  border-color: var(--accent);
}

/* Main */
.main {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(24px + var(--safe-bottom));
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.view.hidden {
  display: none !important;
}

.container-narrow {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 12px;
}

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

/* Каталог по секциям (KEWS, HENGJIAN, STN, SHOT) */
.catalog-scroll {
  padding-bottom: 24px;
}

.catalog-section {
  margin-bottom: 8px;
}

.catalog-section-title {
  margin: 0;
  padding: 12px 14px 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
}

.catalog-section .product-list {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Компактный список: 1 товар в строку */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 100%;
  margin: 0;
}

.product-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  transition: background .15s;
  min-height: 72px;
}

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

.product-row:active {
  background: var(--bg);
}

.product-row-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-row-thumb .placeholder-img {
  width: 100%;
  height: 100%;
  font-size: 0.65rem;
  color: var(--text-muted);
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.product-row-content {
  flex: 1;
  min-width: 0;
}

.product-row-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-row-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.product-row-price {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.product-row-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
}

/* Карточка товара (страница товара) */
.product-detail {
  margin-bottom: 24px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  width: 100%;
  min-width: 0;
}

.product-card-image-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card-image-wrap .placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.product-card-body {
  padding: 14px 16px;
}

.product-card-brand {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.product-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.3;
}

.product-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.product-params {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.product-param {
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-param span:first-child {
  color: var(--text);
  font-weight: 500;
  min-width: 0;
}

.product-param span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-detail-articles {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.block-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.articles-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-block-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}

.article-block-item:active {
  background: var(--bg);
}

.article-block-item img,
.article-block-item .placeholder-img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.article-block-item .placeholder-img {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.article-block-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

.article-detail {
  margin-bottom: 24px;
}

.article-detail-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.3;
}

.article-detail-body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

.article-detail-body p {
  margin: 0 0 0.85em;
}

.article-detail-body p:last-child {
  margin-bottom: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background .2s, opacity .2s;
}

.btn:active {
  opacity: 0.9;
}

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

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

.btn-block {
  width: 100%;
}

.btn-order {
  width: 100%;
  background: var(--accent);
  color: #fff;
}

.btn-order:hover {
  background: var(--accent-hover);
}

.product-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.product-card-reviews-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
  display: inline-block;
}

.product-card-reviews-link:hover {
  text-decoration: underline;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}

.modal.is-open {
  pointer-events: auto;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  cursor: pointer;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s ease;
  overflow: hidden;
}

.modal.is-open .modal-panel {
  transform: translateY(0);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

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

.modal-body {
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.reviews-product-name {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.reviews-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.reviews-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.reviews-list li:last-of-type {
  border-bottom: none;
}

.review-author {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.review-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.review-text {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.review-form .field {
  margin-bottom: 12px;
}

.review-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.review-form input,
.review-form textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
}

.review-form textarea {
  resize: vertical;
  min-height: 80px;
}

.review-form .btn {
  margin-top: 8px;
}

.cart-items {
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cart-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.modal-panel-cart .btn {
  margin-top: 0;
}

.reviews-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* Рейтинг звёздами */
.stars {
  display: inline-flex;
  gap: 2px;
  font-size: 1rem;
}

.star {
  color: var(--border);
}

.star.filled {
  color: #f59e0b;
}

.product-row-rating {
  margin: 2px 0 4px;
}

.product-row-rating .stars {
  font-size: 0.85rem;
}

.product-detail-rating {
  margin-bottom: 6px;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.review-item-stars .stars {
  font-size: 0.9rem;
}

/* Выбор оценки в форме отзыва (общие) */
.stars-input {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.star-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--border);
  font-size: 1.4rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}

.star-btn:hover,
.star-btn.active {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, .08);
}

/* Звёзды на странице отзывов — ровная сетка */
.reviews-stars-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: nowrap;
}
.reviews-star-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--border);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.reviews-star-btn:hover,
.reviews-star-btn.active {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, .1);
}

/* Страница отзывов */
.reviews-page {
  padding-bottom: 32px;
}

.reviews-page-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
}

.reviews-page-intro {
  margin: 0 0 24px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.reviews-page-telegram-hint {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--accent);
}
.reviews-page-telegram-hint.hidden {
  display: none;
}
.reviews-page-no-telegram {
  margin: 0 0 20px;
  padding: 16px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.reviews-page-no-telegram.hidden {
  display: none;
}
.reviews-page-form.hidden {
  display: none;
}

.reviews-page-form {
  margin-bottom: 32px;
  padding: 0;
  border: none;
}

/* Карточка формы отзыва */
.reviews-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.reviews-page-form .reviews-form-field {
  margin-bottom: 20px;
}
.reviews-page-form .reviews-form-field:last-of-type {
  margin-bottom: 0;
}

.reviews-form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.reviews-form-textarea {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 120px;
  max-width: 100%;
}
.reviews-form-textarea::placeholder {
  color: var(--text-muted);
}

.reviews-form-file {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  accent-color: var(--accent);
  cursor: pointer;
}

.reviews-form-submit {
  width: 100%;
  margin-top: 20px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
}

.reviews-form-message {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.reviews-form-message.error {
  background: #fef2f2;
  color: #b91c1c;
}
.reviews-form-message.success {
  background: #f0fdf4;
  color: #166534;
}
.reviews-form-message.hidden {
  display: none;
}

.reviews-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-feed-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

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

.review-feed-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-feed-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-feed-avatar-initial {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.review-feed-body {
  flex: 1;
  min-width: 0;
}

.review-feed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.review-feed-name {
  font-weight: 600;
  color: var(--text);
}

.review-feed-stars .stars {
  font-size: 0.9rem;
}

.review-feed-date {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.review-feed-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.review-feed-image {
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 280px;
}
.review-feed-image img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}

.reviews-feed-more {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* Страница Партнёрам */
.partners-title {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 700;
}

.partners-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

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

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

/* Карусель изображений товара */
.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg);
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,.85);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(.95);
}

.carousel-btn-prev { left: 10px; }
.carousel-btn-next { right: 10px; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border: none;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  transition: background .2s, transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.carousel-dot:hover {
  background: rgba(255,255,255,.8);
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.25);
}

.carousel-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,.85);
  border-radius: 20px;
  z-index: 2;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* Бейдж наличия */
.stock-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 4px;
}

.product-stock-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
}

.stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: stockPulse 2s ease-in-out infinite;
}

@keyframes stockPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Старая цена (зачёркнута) */
.product-card-old-price {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: 4px;
}

.product-row-old-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Загрузка Ozon */
.ozon-loading {
  padding: 24px 16px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ozon-loading::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* Футер */
.footer {
  margin-top: auto;
  padding: 32px 16px 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  background: var(--text);
  color: rgba(255, 255, 255, .9);
}

.footer-inner {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}

.footer-tagline {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, .75);
}

.footer-contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-title {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, .6);
}

.footer-phone {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.footer-phone:hover {
  text-decoration: underline;
  color: #fff;
}

.footer-note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, .6);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.footer-link {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, .9);
  text-decoration: none;
}

.footer-link:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-legal {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, .5);
}

/* Tire filters */
.tire-filters {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tire-filters::-webkit-scrollbar { display: none; }

.tire-filter-select {
  flex-shrink: 0;
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 0;
}
.tire-filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.tire-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.tire-type-badge.tire-type-шина {
  background: #dbeafe; color: #1e40af;
}
.tire-type-badge.tire-type-камера {
  background: #d1fae5; color: #065f46;
}
.tire-type-badge.tire-type-мусс {
  background: #fef3c7; color: #92400e;
}

.tire-size {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  vertical-align: middle;
}

/* Catalog section titles */
.catalog-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 18px 16px 4px;
  margin: 0;
  color: var(--text);
}

/* Product description toggle */
.product-description-wrap {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.product-description-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 0;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.product-description-toggle:hover { color: var(--accent); }
.toggle-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s;
}
.product-description-body {
  padding: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
}
.product-description-body p { margin: 0; }

/* Catalog articles section */
.catalog-articles {
  padding: 24px 16px 32px;
}
.catalog-articles .block-title {
  margin-bottom: 16px;
}
.catalog-articles .articles-block {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.catalog-articles .article-block-item {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, transform 0.15s;
}
.catalog-articles .article-block-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.catalog-articles .article-block-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.catalog-articles .article-block-item-title {
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}
.articles-more-wrap {
  text-align: center;
  margin-top: 18px;
}
.btn-outline {
  display: inline-block;
  padding: 10px 28px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}
