/* ============================================================
   Shop Engine — Основные стили
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --accent: #f59e0b;
  --surface: #f9fafb;
  --card-radius: 14px;
  --transition: .2s ease;
}

/* ── Базовое ─────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--surface);
  color: #1f2937;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { text-decoration: none; }

/* ── Навбар ──────────────────────────────────────────────── */
.navbar.bg-primary { background: var(--primary) !important; }

.search-form {
  width: 100%;
  max-width: 440px;
  position: relative;
}

.search-form .form-control {
  border-radius: 8px 0 0 8px;
  border: none;
  font-size: .9rem;
}

.search-form .btn-light {
  border-radius: 0 8px 8px 0;
  border: none;
}

.cart-badge {
  font-size: .65rem;
  padding: 3px 6px;
  position: absolute;
  top: 2px;
  right: -4px;
}

/* Карточка для кабинетов пользователя */
.admin-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
}

/* Поиск товара (склад / списания) */
.product-picker {
  position: relative;
}
.product-picker-dropdown {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.product-picker-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 0;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}
.product-picker-item:last-child { border-bottom: 0; }
.product-picker-item:hover,
.product-picker-item:focus {
  background: #eff6ff;
  outline: none;
}
.product-picker.is-selected .product-picker-input {
  border-color: #86efac;
  background: #f0fdf4;
}
.product-picker.needs-variant .product-picker-input {
  border-color: #93c5fd;
  background: #eff6ff;
}
.pp-var-badge {
  font-size: 0.65rem !important;
  font-weight: 600;
}
.product-picker-variants {
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.product-picker-variants.is-invalid-wrap {
  border-color: #f87171;
  background: #fef2f2;
}
.pp-variant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.pp-variant-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}
.pp-variant-count {
  font-size: 0.7rem;
}
.pp-variant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.pp-variant-chip {
  min-width: 2.5rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.pp-variant-chip:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}
.pp-variant-chip.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.user-nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Поиск — выпадающий список ───────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 42px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  z-index: 9998;
  max-height: 360px;
  overflow-y: auto;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #1f2937;
  transition: background var(--transition);
}

.search-item:last-child { border-bottom: none; }

.search-item:hover { background: #f3f4f6; color: var(--primary); }

.search-item img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.search-item-info { flex: 1; min-width: 0; }
.search-item-name { font-size: .875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-price { font-size: .8rem; color: var(--primary); font-weight: 600; }
.search-no-results { padding: 14px; text-align: center; color: #9ca3af; font-size: .875rem; }

/* ── Лэйаут каталога (сайдбар + контент) ─────────────────── */
.catalog-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

.catalog-sidebar {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.catalog-sidebar::-webkit-scrollbar { width: 4px; }
.catalog-sidebar::-webkit-scrollbar-track { background: transparent; }
.catalog-sidebar::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Виджет сайдбара ────────────────────────────────────── */
.sidebar-widget {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.sidebar-widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
}

.sidebar-widget-title i {
  font-size: 1rem;
  color: var(--primary);
}

/* ── Навигация по категориям ────────────────────────────── */
.cat-nav {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #374151;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

.cat-nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.cat-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.cat-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.cat-nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.cat-nav-item:hover .cat-nav-icon {
  transform: scale(1.1);
}

.cat-nav-label {
  flex: 1;
  font-size: .875rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-nav-count {
  font-size: .72rem;
  font-weight: 600;
  color: #9ca3af;
  background: #f3f4f6;
  border-radius: 20px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.cat-nav-item.active .cat-nav-count {
  background: var(--primary-border);
  color: var(--primary-dark);
}

.cat-nav-icon-theme {
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Социальные сети (сайдбар) ──────────────────────────── */
.social-links {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.social-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.social-link-item:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  opacity: .93;
  color: #fff;
}

.social-link-item:active {
  transform: scale(.97);
}

.social-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.social-vk      { background: linear-gradient(135deg, #2787f5, #1a6ed6); }
.social-ig      { background: linear-gradient(135deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888); }
.social-tg      { background: linear-gradient(135deg, #2aabee, #229ed9); }
.social-max     { background: linear-gradient(135deg, #7c3aed, #a855f7, #6366f1); }
.social-tiktok  { background: #010101; }
.social-youtube { background: #ff0000; }
.social-facebook{ background: #1877f2; }
.social-ok      { background: #ff7700; }

/* ── Мобильный сайдбар ──────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

@media (max-width: 991px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    max-height: 100vh;
    z-index: 200;
    padding: 16px;
    background: #f9fafb;
    transform: translateX(-110%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    box-shadow: 4px 0 30px rgba(0,0,0,.15);
  }

  .catalog-sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* ── Карточки товаров ────────────────────────────────────── */
.product-card {
  border: 1px solid #e5e7eb;
  border-radius: var(--card-radius);
  background: #fff;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(79,70,229,.15);
}

.product-card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f9fafb;
  cursor: pointer;
}

.product-card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.product-card:hover .product-card-img-wrap img {
  transform: scale(1.06);
}

.product-card-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-size: .7rem;
  padding: 3px 8px;
  border-radius: 20px;
}

.product-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-category {
  font-size: .72rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}

.product-card-name {
  font-size: .95rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  margin-top: auto;
}

.btn-buy {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  padding: 8px 14px;
  transition: background var(--transition);
  width: 100%;
}

.btn-buy:hover { background: var(--primary-dark); color: #fff; }
.btn-buy:active { transform: scale(.97); }
.btn-buy.added { background: #059669; }

/* ── Страница товара: галерея ─────────────────────────────── */
.pgallery {
  position: sticky;
  top: 1rem;
}
.pgallery-stage {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 55%);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.pgallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: transform .25s ease;
  padding: 1rem;
  background: transparent;
}
.pgallery-stage:hover .pgallery-main-img {
  transform: scale(1.02);
}
.pgallery-adult {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #fff;
  border-radius: 16px;
}
.pgallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease, background .2s ease;
}
.pgallery-stage:hover .pgallery-nav,
.pgallery-nav:focus {
  opacity: 1;
}
.pgallery-prev { left: 10px; }
.pgallery-next { right: 10px; }
.pgallery-nav:hover { background: #fff; color: var(--primary); }
.pgallery-zoom-hint {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pgallery-zoom-hint:hover { background: var(--primary); }
.pgallery-counter {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  font-size: .75rem;
  font-weight: 600;
  color: #0f172a;
  background: rgba(255,255,255,.9);
  border-radius: 999px;
  padding: .2rem .55rem;
  border: 1px solid #e5e7eb;
}
.pgallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.pgallery-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 2px solid transparent;
  padding: 0;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pgallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pgallery-thumb.is-active,
.pgallery-thumb:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}

body.pgallery-lock { overflow: hidden; }
.pgallery-lightbox[hidden] { display: none !important; }
.pgallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pgallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(4px);
}
.pgallery-lightbox-inner {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1100px);
  max-height: 92vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pgallery-lightbox-inner img {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  background: #0b1220;
}
.pgallery-lightbox-close,
.pgallery-lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.pgallery-lightbox-close { top: 8px; right: 8px; }
.pgallery-lightbox-nav.prev { left: 8px; top: 50%; transform: translateY(-50%); }
.pgallery-lightbox-nav.next { right: 8px; top: 50%; transform: translateY(-50%); }
.pgallery-lightbox-close:hover,
.pgallery-lightbox-nav:hover { background: var(--primary); }
.pgallery-lightbox-meta {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: .85rem;
  background: rgba(0,0,0,.35);
  padding: .25rem .7rem;
  border-radius: 999px;
}
@media (max-width: 991.98px) {
  .pgallery { position: static; }
  .pgallery-nav { opacity: 1; }
}

.product-gallery-main {
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: var(--card-radius);
  background: #fff;
  border: 1px solid #e5e7eb;
}

.product-gallery-main img {
  width: 100%; height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

.product-thumb-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.product-thumb {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition);
}

.product-thumb.active,
.product-thumb:hover { border-color: var(--primary); }

.product-variants .variant-btn {
  padding: 6px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.product-variants .variant-btn:hover,
.product-variants .variant-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* Описание товара — полноценный блок под карточкой */
.product-description {
  margin: 2rem 0 2.5rem;
}
.product-description-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .9rem;
}
.product-description-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .4rem .8rem .4rem .65rem;
  border-radius: 999px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
}
.product-description-label i { font-size: .85rem; opacity: .9; }
.product-description-panel {
  background: #fff;
  border: 1px solid #e8eaef;
  border-radius: 16px;
  padding: 1.35rem 1.35rem 1.5rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
@media (min-width: 768px) {
  .product-description-panel { padding: 1.75rem 2rem 2rem; }
}
.product-description-body {
  font-size: .95rem;
  line-height: 1.7;
  color: #4b5563;
  max-width: none;
}
.product-short-desc {
  margin: -.25rem 0 1.25rem;
  padding: .85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e8eaef;
  border-radius: 12px;
  color: #374151;
  font-size: .9rem;
  line-height: 1.55;
}
.product-description-body > *:first-child { margin-top: 0; }
.product-description-body > *:last-child { margin-bottom: 0; }
.product-description-body h1,
.product-description-body h2 {
  color: #111827;
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -.02em;
  margin: 0 0 .85rem;
}
.product-description-body h3,
.product-description-body h4 {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #111827;
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 1.6rem 0 .85rem;
}
.product-description-body h3::before,
.product-description-body h4::before {
  content: '';
  width: 3px;
  height: 1.05em;
  border-radius: 3px;
  background: var(--primary);
  flex-shrink: 0;
}
.product-description-body p {
  margin: 0 0 .85rem;
}
.product-description-body p:last-child {
  margin-bottom: 0;
  padding: .95rem 1.05rem;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: 12px;
  color: #1f2937;
}
.product-description-body strong {
  color: #111827;
  font-weight: 700;
}
.product-description-body a { color: var(--primary); }

/* Списки преимуществ */
.product-description-body ul:not(.product-specs):not(.product-features),
.product-description-body ol:not(.product-specs):not(.product-features) {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}
.product-features {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 1.25rem !important;
  display: grid;
  gap: .65rem;
}
@media (min-width: 768px) {
  .product-features { grid-template-columns: 1fr 1fr; }
}
.product-features li {
  position: relative;
  margin: 0 !important;
  padding: .9rem 1rem .9rem 2.65rem;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.55;
  color: #374151;
}
.product-features li::before {
  content: '✓';
  position: absolute;
  left: .85rem;
  top: .95rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.35rem;
  text-align: center;
}

/* Характеристики — две колонки, в ячейке метка слева / значение справа */
.product-specs {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 1.25rem !important;
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  border: 1px solid #e8eaef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
@media (min-width: 768px) {
  .product-specs { grid-template-columns: 1fr 1fr; }
}
.product-specs li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .85rem;
  margin: 0 !important;
  padding: .72rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: .875rem;
  line-height: 1.4;
  color: #1f2937;
  min-width: 0;
}
@media (min-width: 768px) {
  .product-specs li:nth-child(odd) { border-right: 1px solid #f1f5f9; }
  .product-specs li:nth-last-child(-n+2) { border-bottom: none; }
}
.product-specs li:last-child { border-bottom: none; }
.product-specs li:nth-child(odd) { background: #fafbfc; }
.product-specs .spec-label {
  color: #6b7280;
  font-weight: 600;
  font-size: .82rem;
  flex: 0 1 46%;
  min-width: 0;
}
.product-specs .spec-value {
  color: #111827;
  font-weight: 650;
  text-align: right;
  flex: 1 1 50%;
  min-width: 0;
  word-break: break-word;
}
.product-specs strong {
  color: #6b7280 !important;
  font-weight: 600 !important;
  font-size: .82rem;
}

.product-variants .variant-btn.out-of-stock {
  opacity: .45;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Кнопки атрибутов (каскадный выбор) */
.attr-btn {
  padding: 6px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.attr-btn:hover,
.attr-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.wh-selected .stock-wh-placeholder { display: none !important; }

.attr-btn.out-of-stock {
  opacity: .4;
  cursor: not-allowed;
  text-decoration: line-through;
}
.attr-btn:disabled {
  pointer-events: none;
}

/* ── Корзина ─────────────────────────────────────────────── */
.cart-item {
  border: 1px solid #e5e7eb;
  border-radius: var(--card-radius);
  background: #fff;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  transition: box-shadow var(--transition);
}

.cart-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }

.cart-item-img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.cart-item-variant { font-size: .8rem; color: #6b7280; }
.cart-item-price { font-weight: 700; color: var(--primary); font-size: 1rem; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 30px; height: 30px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-value { font-weight: 600; min-width: 24px; text-align: center; }

.cart-summary {
  border: 1px solid #e5e7eb;
  border-radius: var(--card-radius);
  background: #fff;
  padding: 24px;
  position: sticky;
  top: 80px;
}

/* ── Контакты ────────────────────────────────────────────── */
.info-card {
  border: 1px solid #e5e7eb;
  border-radius: var(--card-radius);
  background: #fff;
  padding: 24px;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child { border-bottom: none; }

.info-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.05rem;
}

/* ── Форма ───────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Пагинация ───────────────────────────────────────────── */
.pagination .page-link {
  color: var(--primary);
  border-radius: 8px !important;
  margin: 0 2px;
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer { background: #111827 !important; }

.footer-link {
  color: #9ca3af;
  font-size: .875rem;
  transition: color var(--transition);
  display: block;
  margin-bottom: 6px;
}

.footer-link:hover { color: #fff; }

/* ── Пустые состояния ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.empty-state i { font-size: 4rem; margin-bottom: 16px; display: block; }
.empty-state h4 { color: #6b7280; }

/* ── Юридические страницы ────────────────────────────────── */
.legal-content {
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--card-radius);
  padding: 40px;
  line-height: 1.8;
}

.legal-content h2 { color: var(--primary); margin-bottom: 1.25rem; }
.legal-content h3 { color: #1f2937; margin-top: 1.5rem; }

/* ── Светлая метка ───────────────────────────────────────── */
.badge-out { background: #fee2e2; color: #b91c1c; }
.badge-in  { background: #dcfce7; color: #15803d; }
.badge-pick {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ── Капча ───────────────────────────────────────────────── */
.captcha-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-img {
  display: block;
  width: 180px;
  height: 56px;
  border-radius: 10px;
  border: 2px solid #e0dcff;
  background: #f8f8ff;
  cursor: pointer;
  transition: opacity .25s, border-color .2s;
  user-select: none;
  flex-shrink: 0;
}

.captcha-img:hover {
  border-color: var(--primary);
}

.captcha-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  white-space: nowrap;
}

.captcha-refresh-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.captcha-refresh-btn i {
  font-size: .95rem;
  transition: transform .4s ease;
}

.captcha-refresh-btn.spinning i {
  animation: spin .55s linear infinite;
}

.captcha-input {
  width: 100%;
  letter-spacing: .12em;
  font-weight: 700;
  font-size: 1.05rem;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  text-align: center;
  border-radius: 10px;
  border: 2px solid #e0dcff;
  height: 46px;
  padding: 0 14px;
  color: var(--primary);
  background: #faf9ff;
  transition: border-color .2s, box-shadow .2s;
}

.captcha-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
  background: #fff;
  outline: none;
}

.captcha-input.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220,53,69,.12);
}

.captcha-hint { color: #9ca3af; }

/* ── Карта ───────────────────────────────────────────────── */
.map-wrap {
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.map-wrap iframe { display: block; }

/* ── Адаптивность ────────────────────────────────────────── */
@media (max-width: 575px) {
  .cart-item { flex-wrap: wrap; }
  .cart-item-img { width: 60px; height: 60px; }
  .legal-content { padding: 20px; }
}

/* ── Анимации ────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp .4s ease forwards;
}

/* ── Загрузчик ───────────────────────────────────────────── */
.loading-spinner {
  display: inline-block;
  width: 1.2em; height: 1.2em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   v3 — Акции и скидки
═══════════════════════════════════════════════════════ */

.promo-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  border-radius: 6px;
  padding: 3px 8px;
}

.adult-badge {
  background: #111827;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 7px;
  top: auto;
  bottom: 8px;
}

.price-new {
  color: var(--primary);
  font-weight: 700;
}

.price-old {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: .85em;
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════
   v3 — 18+ blur и age-gate
═══════════════════════════════════════════════════════ */

.adult-blur-img.adult-blur {
  filter: blur(12px);
  transition: filter .3s;
}

.age-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.age-gate-box {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.age-gate-icon {
  font-size: 3rem;
  margin-bottom: .5rem;
}

/* ═══════════════════════════════════════════════════════
   v3 — Отзывы
═══════════════════════════════════════════════════════ */

.review-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
}

.review-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.review-stars i {
  font-size: .9rem;
  color: #f59e0b;
}

.review-stars-display i {
  font-size: 1rem;
  color: #f59e0b;
}

.review-form-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
}

/* Star rating input */
.star-rating-input {
  display: flex;
  gap: 4px;
  cursor: pointer;
  font-size: 1.6rem;
}

.star-input {
  color: #d1d5db;
  transition: color .1s;
  cursor: pointer;
}

.star-input.active,
.star-input.bi-star-fill {
  color: #f59e0b;
}

/* ═══════════════════════════════════════════════════════
   v3 — Вариации
═══════════════════════════════════════════════════════ */

.product-card-price .price-new {
  display: inline;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   v3 — Артикул в карточке
═══════════════════════════════════════════════════════ */

.product-sku {
  font-size: .72rem;
  color: #9ca3af;
  letter-spacing: .03em;
}

/* ═══════════════════════════════════════════════════════
   БЛОГ — карточки, виджеты, статья
═══════════════════════════════════════════════════════ */

/* ── Список статей (одна колонка) ───────────────────── */
.blog-list { display: flex; flex-direction: column; gap: 1.25rem; }

.blog-list-item {
  display: flex;
  gap: 1.25rem;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.blog-list-item:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.09);
  border-color: #d1d5db;
}
.blog-list-img-wrap {
  flex-shrink: 0;
  width: 220px;
  overflow: hidden;
}
.blog-list-img {
  width: 220px;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  display: block;
  transition: transform .35s;
}
.blog-list-item:hover .blog-list-img { transform: scale(1.04); }
.blog-list-img-placeholder {
  flex-shrink: 0;
  width: 220px;
  min-height: 160px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #94a3b8;
}
.blog-list-body {
  flex: 1;
  padding: 1.2rem 1.25rem 1.2rem 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.blog-list-top { margin-bottom: .3rem; }
.blog-list-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: .5rem;
}
.blog-list-title a {
  color: #1a1f36;
  text-decoration: none;
}
.blog-list-title a:hover { color: var(--bs-primary); }
.blog-list-excerpt {
  font-size: .875rem;
  color: #6b7280;
  flex-grow: 1;
  margin-bottom: .85rem;
  line-height: 1.6;
}
.blog-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: auto;
}
.blog-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .85rem;
  font-size: .75rem;
  color: #9ca3af;
}
.blog-list-meta i { font-size: .75rem; }
.blog-list-read-more {
  font-size: .8rem;
  font-weight: 600;
  color: var(--bs-primary);
  text-decoration: none;
  white-space: nowrap;
  transition: gap .15s;
}
.blog-list-read-more:hover { text-decoration: underline; }

@media (max-width: 576px) {
  .blog-list-item { flex-direction: column; }
  .blog-list-img-wrap, .blog-list-img, .blog-list-img-placeholder { width: 100%; min-height: 180px; }
  .blog-list-body { padding: 1rem; }
}

/* ── Совместимость со старыми .blog-card (для виджетов) ── */
.blog-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.blog-card-img-wrap { overflow: hidden; }
.blog-card-img { width: 100%; height: 160px; object-fit: cover; display: block; }
.blog-card-body { padding: .85rem; display: flex; flex-direction: column; flex-grow: 1; }
.blog-card-cat {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--bs-primary);
  text-decoration: none;
  margin-bottom: .3rem;
}
.blog-card-cat:hover { text-decoration: underline; }
.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  font-size: .73rem;
  color: #9ca3af;
  margin-top: auto;
}

/* ── Виджеты сайдбара ───────────────────────────────── */
.blog-widget {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.blog-widget-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--bs-primary);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid #e9ecef;
}
.blog-widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-widget-list li {
  padding: .3rem 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: .875rem;
}
.blog-widget-list li:last-child { border-bottom: none; }
.blog-widget-list a {
  color: inherit;
  text-decoration: none;
}
.blog-widget-list a:hover { color: var(--bs-primary); }

/* ── Облако тегов ───────────────────────────────────── */
.blog-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.blog-tag-cloud-item {
  display: inline-block;
  padding: .2rem .6rem;
  background: #f3f4f6;
  border-radius: 20px;
  color: #374151;
  text-decoration: none;
  font-size: .8rem;
  transition: background .15s, color .15s;
}
.blog-tag-cloud-item:hover {
  background: var(--bs-primary);
  color: #fff;
}

/* ── Теги на статье ──────────────────────────────────── */
.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.blog-tag {
  display: inline-block;
  padding: .2rem .7rem;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 20px;
  font-size: .8rem;
  text-decoration: none;
  transition: background .15s;
}
.blog-tag:hover { background: #c7d2fe; }

/* ── Страница статьи ────────────────────────────────── */
.blog-post-wrap {
  width: 100%;
  max-width: 860px;
}
.blog-post-title {
  font-size: clamp(1.55rem, 2.4vw, 2.05rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: #111827;
  margin-bottom: .6rem;
}
.blog-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  font-size: .85rem;
  color: #6c757d;
  margin-top: .5rem;
}
.blog-post-panel {
  background: #fff;
  border: 1px solid #e8eaef;
  border-radius: 16px;
  padding: 1.35rem 1.35rem 1.5rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
@media (min-width: 768px) {
  .blog-post-panel { padding: 1.75rem 2rem 2rem; }
}
.blog-post-content {
  font-size: .98rem;
  line-height: 1.75;
  color: #4b5563;
  max-width: none;
}
.blog-post-content.product-description-body > p:last-child {
  /* Не превращаем финальный абзац длинной статьи в «плашку CTA» как у товара */
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: inherit;
}
.blog-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 1.2rem auto;
}
.blog-post-content iframe {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 1.2rem auto;
}
.blog-post-content audio {
  width: 100%;
  border-radius: 8px;
  margin: .8rem 0;
}
.blog-post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: .75rem 1.05rem;
  background: var(--primary-light);
  border-radius: 0 12px 12px 0;
  color: #374151;
  margin: 1.2rem 0;
}
.blog-post-content code {
  background: #f3f4f6;
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .9em;
}
.blog-post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

/* ── Таблицы в контенте статьи ───────────────────────── */
.blog-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .95rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #e5e7eb;
}
.blog-post-content table th,
.blog-post-content table td {
  padding: .65rem .9rem;
  border: 1px solid #e5e7eb;
  vertical-align: top;
}
.blog-post-content table th {
  background: #f8fafc;
  font-weight: 700;
  color: #374151;
}
.blog-post-content table tr:hover td { background: #f9fafb; }
.blog-post-content table caption {
  caption-side: bottom;
  font-size: .8rem;
  color: #9ca3af;
  padding: .4rem;
}

/* ── Изображения с подписями (CKEditor) ─────────────── */
.blog-post-content figure { margin: 1.5rem 0; }
.blog-post-content figure img { margin: 0 auto; }
.blog-post-content figcaption {
  font-size: .82rem;
  color: #9ca3af;
  text-align: center;
  margin-top: .4rem;
}
.blog-post-content .image { display: table; max-width: 100%; }
.blog-post-content .image.image_resized { max-width: 100%; }
.blog-post-content .image.image-style-side { float: right; margin-left: 1rem; max-width: 50%; }
.blog-post-content .image.image-style-align-left { float: left; margin-right: 1rem; }
.blog-post-content .image.image-style-align-right { float: right; margin-left: 1rem; }
.blog-post-content .image.image-style-block-align-center { margin: 1rem auto; }
.blog-post-content .image > img { width: 100%; height: auto; }
.blog-post-content .image > figcaption { display: table-caption; caption-side: bottom; }
.blog-post-content::after { content: ''; display: table; clear: both; }

/* ── Горизонтальная линия ───────────────────────────── */
.blog-post-content hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 2rem 0;
}

/* ── Медиа-вставка (видео) ──────────────────────────── */
.blog-post-content .media { position: relative; padding-bottom: 56.25%; height: 0; margin: 1.5rem 0; }
.blog-post-content .media iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  border-radius: 8px;
  margin: 0;
}

/* ── Карточка автора ──────────────────────────────────── */
.blog-author-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
}
.blog-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}
