:root {
  --yellow-primary: #FFD700;
  --yellow-secondary: #FFC107;
  --yellow-light: #FFF176;
  --yellow-dark: #F57C00;
  --yellow-gradient: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
  --yellow-shadow: rgba(255, 193, 7, 0.3);
  --text: #333;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f8f9fa;
  --sidebar-w: 60px;
  --sidebar-open: 260px;
  --radius: 5px;
  --container: 1400px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Как на tehno-comp.ru: Arial глобально (без ::before/::after — иначе ломаются иконки FA) */
* {
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a, a:hover, a:focus, a:visited { color: inherit; text-decoration: none !important; }
b, strong, .font-weight-bold {
  font-weight: bold;
  font-family: Arial, sans-serif;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
.container { width: min(100% - 32px, var(--container)); margin: 0 auto; }

/* Left sidebar */
.categories-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  box-shadow: 2px 0 10px rgba(0,0,0,.08);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: width .25s ease;
  padding: 16px 0;
}
.categories-sidebar.open { width: var(--sidebar-open); }
.sidebar-menu-icon {
  width: 44px; height: 44px;
  margin: 0 auto 20px;
  border: none;
  border-radius: 50%;
  background: var(--yellow-gradient);
  color: #222;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--yellow-shadow);
  position: relative;
  flex-shrink: 0;
}
.categories-sidebar.open .sidebar-menu-icon {
  width: calc(100% - 30px);
  border-radius: 5px;
  justify-content: flex-start;
  padding-left: 14px;
}
.sidebar-menu-text {
  display: none;
  margin-left: 12px;
  font-weight: 600;
  font-size: 15px;
}
.categories-sidebar.open .sidebar-menu-text { display: inline; }
.categories-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  flex: 1;
  min-height: 0;
  overflow-x: visible;
  overflow-y: auto;
}
.categories-sidebar.open .categories-list { align-items: stretch; padding: 0 12px; }
.cat-item {
  position: relative;
  width: 100%;
}
.category-mini-icon {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow-secondary);
  border-radius: 5px;
  transition: background .2s;
  text-decoration: none;
}
.categories-sidebar.open .category-mini-icon {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  height: 42px;
}
.category-mini-icon:hover,
.cat-item.is-open > .category-mini-icon {
  background: rgba(255,193,7,.12);
}
.category-name {
  display: none;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.categories-sidebar.open .category-name { display: block; }
.cat-chevron {
  display: none;
  margin-left: auto;
  font-size: 10px;
  color: #9ca3af;
  flex-shrink: 0;
}
.categories-sidebar.open .cat-item.has-children > .cat-link .cat-chevron {
  display: inline-block;
}

/* Nested flyout panels — высота как у левого сайдбара */
.cat-flyout {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 1100;
  width: 280px;
  height: 100vh;
  max-height: none;
  overflow-x: visible;
  overflow-y: auto;
  padding: 16px 8px;
  background: #fff;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}
.cat-item.is-open > .cat-flyout {
  display: block;
}
.cat-flyout .cat-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 5px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  line-height: 1.3;
}
.cat-flyout .category-name {
  display: block;
  white-space: normal;
}
.cat-flyout .cat-chevron {
  display: inline-block;
  margin-left: auto;
}
.cat-flyout .cat-link:hover,
.cat-flyout .cat-item.is-open > .cat-link {
  background: rgba(255, 193, 7, 0.12);
  color: var(--text);
}

.main-content-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
}

/* Header */
.header {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  padding: 14px 0;
  position: relative;
  z-index: 20;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo { flex-shrink: 0; }
.logo a { display: flex; align-items: center; }
.logo-image { height: 48px; width: auto; }
.search-bar {
  flex: 1;
  min-width: 0;
  max-width: none;
}
.search-bar form { position: relative; display: flex; }
.search-bar input {
  width: 100%;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 5px;
  padding: 0 18px 0 44px;
  font-size: 15px;
  background: #fff;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--yellow-secondary);
  box-shadow: 0 0 0 3px rgba(255,193,7,.15);
}
.search-bar button {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  border: none; background: none;
  color: var(--yellow-secondary);
  cursor: pointer;
  font-size: 16px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  margin-left: auto;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  position: relative;
  padding: 0;
}
.action-btn i { font-size: 20px; }
.action-btn:hover { color: var(--yellow-dark); }
.cart-count {
  position: absolute;
  top: -6px; right: -8px;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.mobile-menu-toggle, .mobile-header-actions { display: none; }

/* Nav */
.nav-container {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 15;
}
.nav-content {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
  flex-wrap: wrap;
}
.nav-categories-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 5px;
  background: var(--yellow-gradient);
  color: #222;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--yellow-shadow);
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--yellow-dark); }
.nav-links a i { color: var(--yellow-secondary); }

/* Page */
.page-main { flex: 1; padding: 28px 0 48px; }
.section { margin-bottom: 40px; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}
.section-header h2 {
  margin: 0;
  font-size: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-header h2 i { color: var(--yellow-secondary); }
.view-all { color: var(--yellow-secondary); font-weight: 600; }
.view-all:hover { color: var(--yellow-dark); }

/* Categories carousel */
.categories-carousel-wrap { position: relative; }
.categories-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 4px 16px;
  scrollbar-width: none;
}
.categories-carousel::-webkit-scrollbar { display: none; }
.category-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  padding: 16px 12px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,.1);
}
.category-card .cat-icon,
.category-card .category-image {
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
  border-radius: 5px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.category-card .cat-icon {
  background: linear-gradient(145deg, #fff8e1, #fff);
  border: 1px solid #f3e5ab;
  color: var(--yellow-dark);
  font-size: 28px;
}
.category-card .category-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .3s ease;
}
.category-card:hover .category-image img {
  transform: scale(1.06);
}
.category-card span { font-size: 13px; font-weight: 600; line-height: 1.3; }
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  cursor: pointer;
  z-index: 2;
  color: var(--text);
}
.carousel-btn.prev { left: -8px; }
.carousel-btn.next { right: -8px; }
.carousel-btn:disabled { opacity: .35; cursor: default; }

/* Product grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.product-card, .assembly-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.product-card:hover, .assembly-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}
.product-image, .assembly-image {
  position: relative;
  height: 160px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.product-image img, .assembly-image img {
  max-height: 100%;
  object-fit: contain;
  background: #ffffff;
}
.badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--yellow-secondary);
  color: #222;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  z-index: 1;
}
.badge.in-stock { background: #22c55e; color: #fff; }
.badge.out { background: #ef4444; color: #fff; }
.badge.delivery { background: #3b82f6; color: #fff; }
.badge.badge-stock {
  top: 10px;
  left: 10px;
  right: auto;
  max-width: calc(100% - 56px);
  white-space: normal;
  line-height: 1.2;
  font-size: 11px;
}
.badge.badge-hit {
  top: 10px;
  right: 10px;
}
.product-info, .assembly-info {
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.product-cat {
  font-size: 12px;
  color: var(--muted);
}
.product-info h3, .assembly-info h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px 14px;
  margin-top: auto;
}
.product-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none !important;
}
.assembly-comps {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  max-height: 54px;
  overflow: hidden;
  line-height: 1.35;
}
.assembly-comps--full {
  max-height: none;
  overflow: visible;
  flex: 1;
}
.assembly-card--tall .assembly-info {
  flex: 1;
}
.assembly-card--tall .assembly-info h3 {
  -webkit-line-clamp: 3;
  min-height: 0;
  margin-bottom: 4px;
}
.home-assemblies {
  align-items: stretch;
}
.home-assemblies .assembly-card--tall {
  height: 100%;
}
.home-assemblies .assembly-card--tall .product-image,
.home-assemblies .assembly-card--tall .assembly-image {
  height: 180px;
  flex-shrink: 0;
}
.btn-cart-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.product-price, .assembly-price {
  color: var(--yellow-dark);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}
.btn-cart-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 5px;
  background: var(--yellow-gradient);
  color: #222;
  box-shadow: 0 2px 8px var(--yellow-shadow);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn-cart-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--yellow-shadow);
}
.btn-cart-icon i {
  font-size: 13px;
  line-height: 1;
}
.btn-cart-icon.is-added {
  background: #22c55e;
  color: #fff;
  box-shadow: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--yellow-gradient);
  color: #222;
  box-shadow: 0 4px 12px var(--yellow-shadow);
}
.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-block { width: 100%; }
.btn-sm { height: 34px; font-size: 13px; }

.assemblies-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

/* Right drawers */
.right-sidebar {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 0;
  background: #fff;
  box-shadow: -2px 0 16px rgba(0,0,0,.12);
  z-index: 1100;
  overflow: hidden;
  transition: width .25s ease;
}
.right-sidebar.open { width: min(360px, 100vw); }
.right-sidebar-header {
  padding: 18px 20px;
  background: var(--yellow-gradient);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.right-sidebar-header h3 { margin: 0; font-size: 18px; }
.close-sidebar {
  border: none; background: none;
  font-size: 26px; cursor: pointer; line-height: 1;
}
.right-sidebar-content {
  padding: 20px;
  height: calc(100vh - 64px);
  overflow: auto;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 14px;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--yellow-secondary);
  box-shadow: 0 0 0 3px rgba(255,193,7,.15);
}
.auth-links { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13px; }
.auth-links a { color: var(--yellow-dark); }

.cart-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-line img { width: 56px; height: 56px; object-fit: contain; background: #f9fafb; border-radius: 5px; }
.cart-line h4 { margin: 0 0 4px; font-size: 13px; }
.cart-line .price { color: var(--yellow-dark); font-weight: 700; font-size: 13px; }
.cart-empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.cart-total {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
}

/* Footer */
.site-footer {
  background: #1f2937;
  color: #e5e7eb;
  padding: 48px 0 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr;
  gap: 32px;
  margin-bottom: 28px;
}
.site-footer h3 { color: #fff; margin: 0 0 14px; }
.site-footer p, .site-footer li { font-size: 14px; line-height: 1.6; color: #cbd5e1; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a:hover { color: var(--yellow-secondary); }
.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 18px;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
}

/* Contact FAB (как на tehno-comp.ru) */
.contact-fab-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.contact-fab-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  pointer-events: none;
}
.contact-fab-wrap.contact-fab-open .contact-fab-actions {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
@keyframes contact-fab-pulse {
  0%, 100% {
    box-shadow: 0 4px 14px var(--yellow-shadow);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 4px 24px var(--yellow-shadow), 0 0 0 8px rgba(255, 193, 7, 0.25);
    transform: scale(1.03);
  }
}
.contact-fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--yellow-gradient);
  color: #333;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--yellow-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: contact-fab-pulse 2s ease-in-out infinite;
}
.contact-fab-main:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.45);
  animation: none;
}
.contact-fab-main:active {
  transform: scale(0.98);
  animation: none;
}
.contact-fab-wrap.contact-fab-open .contact-fab-main {
  animation: none;
}
.contact-fab-item {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #333;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
  padding: 0;
  font: inherit;
}
.contact-fab-item:hover {
  transform: scale(1.1);
  color: #1a1a1a;
  background: #f8f8f8;
}
.contact-fab-item.contact-fab-whatsapp:hover {
  background: #25D366;
  color: #fff;
}
.contact-fab-item.contact-fab-avito:hover {
  background: #00aaff;
  color: #fff;
}
.contact-fab-item.contact-fab-instagram:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
}
.contact-fab-modal-dialog {
  width: min(440px, 100%);
}
.contact-fab-form .form-group {
  margin-bottom: 14px;
}
.contact-fab-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
}
.contact-fab-form input[type="text"],
.contact-fab-form input[type="email"],
.contact-fab-form input[type="tel"],
.contact-fab-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  box-sizing: border-box;
}
.contact-fab-form textarea {
  resize: vertical;
  min-height: 90px;
}
.contact-fab-agree {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  margin-bottom: 16px;
  cursor: pointer;
}
.contact-fab-agree input {
  margin-top: 2px;
}
.contact-fab-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
@media (max-width: 480px) {
  .contact-fab-wrap {
    bottom: 16px;
    right: 16px;
  }
  .contact-fab-main {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }
  .contact-fab-item {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.45);
  overscroll-behavior: none;
}
.modal.open { display: flex; }
.modal-dialog {
  background: #fff;
  border-radius: 5px;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  position: relative;
  overscroll-behavior: contain;
}
body.modal-open {
  overflow: hidden;
}
.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  border: none; background: none;
  font-size: 24px; cursor: pointer;
}

/* Catalog layout */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.catalog-filters-sidebar {
  background: #fff;
  border-radius: 5px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  align-self: start;
  position: sticky;
  top: 70px;
  overflow: visible;
}

.catalog-filters-title {
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog-filter-section {
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f5f5f5;
}

.catalog-filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.catalog-filter-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
}

.catalog-all-categories-link {
  margin-bottom: 12px;
  display: block;
}

.catalog-all-categories-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  min-height: 48px;
  box-sizing: border-box;
  background: #f9f9f9;
  color: #666;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid #eee;
  transition: background .2s, color .2s, border-color .2s;
}

.catalog-all-categories-btn:hover {
  background: #FFF9E6;
  color: #333;
  border-color: #FFE082;
}

.catalog-all-categories-link.is-active .catalog-all-categories-btn {
  background: #FFC107;
  color: #333;
  font-weight: 600;
  border-color: #FFC107;
}

.catalog-filter-category-tabs {
  display: flex;
  flex-direction: column;
}

.catalog-filter-category-tab {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 5px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow .3s ease, margin .3s ease;
}

.catalog-filter-category-tab.expanded {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 12px;
  overflow: visible;
}

.catalog-filter-category-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px;
  min-height: 54px;
  cursor: pointer;
  transition: background .2s;
  font-weight: 500;
  font-size: 15px;
  color: #555;
  user-select: none;
  gap: 10px;
}

.catalog-filter-category-tab-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.catalog-filter-category-tab-label span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-filter-category-tab-header:hover {
  background: #f0f0f0;
}

.catalog-filter-category-tab-header.active {
  background: #FFC107;
  color: #333;
  font-weight: 600;
}

.catalog-filter-category-tab-header > .fa-chevron-down {
  transition: transform .3s ease;
  font-size: 14px;
  flex-shrink: 0;
}

.catalog-filter-category-tab.expanded .catalog-filter-category-tab-header > .fa-chevron-down,
.catalog-filter-category-tab-header.active > .fa-chevron-down {
  transform: rotate(180deg);
}

.catalog-filter-tab-arrow {
  font-size: 11px;
  color: #888;
  flex-shrink: 0;
}

.catalog-filter-subcategories-list {
  display: none;
  background: #fff;
  border-top: 1px solid #eee;
}

.catalog-filter-subcategories-list.active {
  display: block;
}

.catalog-filter-subcategory-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px 12px 28px;
  min-height: 44px;
  box-sizing: border-box;
  color: #666;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
  transition: background .2s, color .2s, padding-left .2s;
}

.catalog-filter-subcategory-item:hover {
  background: #FFF9E6;
  color: #333;
  padding-left: 32px;
}

.catalog-filter-subcategory-item.active {
  background: #FFE082;
  color: #333;
  font-weight: 500;
  border-left: 3px solid #FFC107;
}

.catalog-filter-item-icon {
  font-size: 10px;
  color: #999;
  flex-shrink: 0;
}

.catalog-filter-item-label {
  flex: 1;
  min-width: 0;
}
.catalog-filter-item-count {
  color: #9ca3af;
  font-style: normal;
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}
.catalog-all-categories-btn .catalog-filter-item-count,
.catalog-filter-category-tab-label .catalog-filter-item-count {
  margin-left: 2px;
}

.catalog-filter-subcategory-level1-wrapper {
  border-bottom: 1px solid #f5f5f5;
}

.catalog-filter-subcategory-level1-wrapper:last-child {
  border-bottom: none;
}

.catalog-filter-subcategories-level2 {
  display: none;
  margin: 0;
  padding: 4px 0 4px 12px;
  border-left: 2px solid #FFE082;
  background: #fafafa;
}

.catalog-filter-subcategory-level1-wrapper.open .catalog-filter-subcategories-level2 {
  display: block;
}

.catalog-filter-level1-toggle {
  margin-left: auto;
  color: #999;
  font-size: 14px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .2s ease;
}

.catalog-filter-subcategory-level1-wrapper.open .catalog-filter-level1-toggle {
  transform: rotate(180deg);
}

.catalog-filter-subcategories-level2 .catalog-filter-level2-item {
  padding: 14px 16px 14px 26px;
  min-height: 48px;
  font-size: 14px;
  border-bottom: none;
}

.catalog-filter-depth-3.catalog-filter-level2-item { padding-left: 34px; }
.catalog-filter-depth-4.catalog-filter-level2-item { padding-left: 42px; }
.catalog-filter-depth-5.catalog-filter-level2-item { padding-left: 50px; }
.catalog-filter-depth-6.catalog-filter-level2-item { padding-left: 58px; }
.catalog-filter-depth-7.catalog-filter-level2-item { padding-left: 66px; }
.catalog-filter-depth-8.catalog-filter-level2-item { padding-left: 74px; }

/* Product filters (3logic-like) */
.catalog-product-filters {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}
.catalog-product-filters__head h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cpf-section {
  margin-bottom: 10px;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 8px;
}
.cpf-section__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-align: left;
}
.cpf-section__toggle i {
  font-size: 11px;
  color: #999;
  transition: transform .2s ease;
}
.cpf-section.is-open .cpf-section__toggle i {
  transform: rotate(180deg);
  color: var(--yellow-dark);
}
.cpf-section__body {
  display: none;
  padding: 0 0 8px;
}
.cpf-section.is-open .cpf-section__body {
  display: block;
}
.cpf-radio,
.cpf-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  line-height: 1.35;
}
.cpf-radio input,
.cpf-check input {
  margin-top: 2px;
  accent-color: #FFC107;
  flex-shrink: 0;
}
.cpf-check em,
.cpf-radio em {
  color: #9ca3af;
  font-style: normal;
  font-size: 12px;
}
.cpf-check.is-hidden,
.cpf-link.is-hidden {
  display: none !important;
}
.cpf-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cpf-price-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid #eee;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 13px;
  background: #f9f9f9;
}
.cpf-price-row input:focus {
  outline: none;
  border-color: #FFC107;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}
.cpf-price-hint {
  margin-top: 8px;
  font-size: 11px;
  color: #888;
}
.cpf-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.cpf-link {
  border: none;
  background: none;
  padding: 0;
  color: #c79100;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.cpf-link:hover {
  color: var(--yellow-dark);
  text-decoration: underline;
}
.cpf-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  min-width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 14px;
}
.pagination a:hover, .pagination .current {
  background: var(--yellow-gradient);
  border-color: transparent;
  font-weight: 700;
}

/* Info pages */
.info-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  padding: 28px;
}
.info-card h1 { margin-top: 0; }
.alert {
  padding: 12px 14px;
  border-radius: 5px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-error { background: #fef2f2; color: #991b1b; }

/* Content pages: delivery / contacts */
.content-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.content-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.04);
  position: relative;
  overflow: hidden;
}
.content-hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--yellow-gradient);
}
.content-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--yellow-gradient);
  color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--yellow-shadow);
}
.content-hero-text h1 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}
.content-hero-text p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  max-width: 52ch;
}
.content-block .section-header {
  margin-bottom: 16px;
}
.content-block .section-header h2 {
  font-size: 1.25rem;
}

.info-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.info-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.info-tile:hover {
  border-color: rgba(255, 193, 7, .55);
  box-shadow: 0 8px 22px rgba(255, 193, 7, .12);
  transform: translateY(-2px);
}
.info-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff8e1;
  color: var(--yellow-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.info-tile h3 {
  margin: 0;
  font-size: 17px;
  color: #111827;
}
.info-tile > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  flex: 1;
}
.info-tile-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.info-tile-list li {
  position: relative;
  padding-left: 14px;
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
}
.info-tile-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow-secondary);
}
.info-tile-link {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--yellow-dark) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.info-tile-link:hover { color: #e65100 !important; }

.pay-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pay-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
.pay-tile > i:first-child {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--yellow-gradient);
  color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.pay-tile strong {
  display: block;
  font-size: 15px;
  color: #111827;
  margin-bottom: 2px;
}
.pay-tile span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}
.pay-tile--link {
  text-decoration: none !important;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
  cursor: pointer;
}
.pay-tile--link:hover {
  border-color: rgba(255, 193, 7, .6);
  box-shadow: 0 6px 18px rgba(255, 193, 7, .14);
}
.pay-tile-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.content-cta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.content-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: #fffbeb;
  border: 1px solid rgba(255, 193, 7, .35);
  border-radius: 10px;
}
.content-cta-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  color: var(--yellow-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--yellow-shadow);
}
.content-cta h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #111827;
}
.content-cta p {
  margin: 0;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.4;
}
.content-cta a {
  color: var(--yellow-dark) !important;
  font-weight: 600;
}

/* Contacts */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 20px;
  align-items: start;
}
.contact-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  color: inherit;
}
a.contact-card:hover {
  border-color: rgba(255, 193, 7, .55);
  box-shadow: 0 8px 20px rgba(255, 193, 7, .12);
  transform: translateY(-2px);
}
.contact-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff8e1;
  color: var(--yellow-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-card-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 600;
}
.contact-card-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
  word-break: break-word;
}
.contact-map {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.contact-map-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.contact-map-head h2 {
  margin: 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
}
.contact-map-head h2 i { color: var(--yellow-secondary); }
.contact-map-frame {
  position: relative;
  height: 280px;
  background: #f3f4f6;
}
.contact-map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.contact-form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.contact-form-head {
  margin-bottom: 18px;
}
.contact-form-head h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: #111827;
}
.contact-form-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.contact-submit {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
}

@media (max-width: 980px) {
  .info-tiles {
    grid-template-columns: 1fr;
  }
  .pay-tiles,
  .content-cta-row,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .content-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }
  .contact-cards,
  .contact-form .form-row {
    grid-template-columns: 1fr;
  }
  .contact-map-frame { height: 220px; }
}

/* Constructor — единая сетка: слева мелкие слоты, справа крупный корпус */
.constructor-page {
  padding-bottom: 8px;
}
.constructor-lead {
  color: #6b7280;
  margin: -8px 0 22px;
  line-height: 1.45;
}
.constructor-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 0.85fr)) minmax(300px, 1.6fr);
  grid-template-rows: repeat(4, 86px);
  gap: 10px;
  align-items: stretch;
}
.slot-card {
  background: #fff;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  width: 100%;
  height: 100%;
  min-height: 0;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
  overflow: hidden;
}
.slot-card:hover,
.slot-card.filled {
  border-style: solid;
  border-color: var(--yellow-secondary);
  background: #fffbeb;
}
.slot-card--compact {
  padding: 8px 10px;
}
.slot-card-thumb {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--border);
}
.slot-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.slot-card-body {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.slot-card h4 {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.slot-card h4 i { color: var(--yellow-secondary); font-size: 13px; }
.slot-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slot-card--case {
  grid-column: 3;
  grid-row: 1 / span 4;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 193, 7, 0.1), transparent 38%),
    #fff;
}
.slot-card-case-head {
  flex: 0 0 auto;
}
.slot-card-case-head h4 {
  margin: 0;
  font-size: 16px;
}
.slot-card-case-head h4 i {
  font-size: 16px;
}
.slot-card-case-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  overflow: hidden;
}
.slot-card-case-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
  padding: 20px;
  pointer-events: none;
}
.slot-card-case-placeholder i {
  font-size: 40px;
  color: #d1d5db;
}
.slot-card-case-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  display: block;
  box-sizing: border-box;
}
.slot-card--case.filled .slot-card-case-media {
  background: #fff;
  border-color: rgba(255, 193, 7, 0.45);
}
.slot-card--case .slot-meta {
  flex: 0 0 auto;
  min-height: 2.6em;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  -webkit-line-clamp: 2;
}

.constructor-summary {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  margin-top: 20px;
}
.constructor-compat {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.constructor-compat--ok {
  border-color: #86efac;
  background: #f0fdf4;
}
.constructor-compat--warning {
  border-color: #fcd34d;
  background: #fffbeb;
}
.constructor-compat--error {
  border-color: #fca5a5;
  background: #fef2f2;
}
.constructor-compat-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #111827;
}
.constructor-compat--ok .constructor-compat-title { color: #166534; }
.constructor-compat--warning .constructor-compat-title { color: #92400e; }
.constructor-compat--error .constructor-compat-title { color: #991b1b; }
.constructor-compat-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.constructor-compat-item {
  font-size: 13px;
  line-height: 1.4;
  color: #374151;
}
.constructor-compat-item--error { color: #991b1b; }
.constructor-compat-item--warning { color: #92400e; }
.slot-card--conflict {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, .25);
}
.slot-card--warning {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .2);
}
.constructor-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.constructor-summary-label {
  color: #6b7280;
  font-size: 13px;
}
.constructor-summary-total {
  font-size: 28px;
  font-weight: 700;
  color: var(--yellow-dark);
}
.constructor-summary-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-dialog--constructor {
  width: min(640px, calc(100vw - 32px));
}
.constructor-search {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-sizing: border-box;
}
.constructor-results {
  max-height: min(480px, 60vh);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.constructor-empty {
  color: #6b7280;
  margin: 0;
  padding: 8px 0;
}
.constructor-pick {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color .15s, background .15s;
}
.constructor-pick:hover {
  border-color: var(--yellow-secondary);
  background: #fffbeb;
}
.constructor-pick--incompatible {
  border-color: #fecaca;
  background: #fff7f7;
  opacity: .92;
}
.constructor-pick--incompatible:hover {
  border-color: #f87171;
  background: #fef2f2;
}
.constructor-pick img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
  background: #f3f4f6;
}
.constructor-pick-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.constructor-pick-name {
  font-size: 14px;
  line-height: 1.35;
}
.constructor-pick-reason {
  font-size: 12px;
  color: #b91c1c;
  line-height: 1.3;
}
.constructor-pick-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.constructor-pick-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.constructor-pick-badge--error {
  background: #fee2e2;
  color: #991b1b;
}
.constructor-pick-badge--warning {
  background: #fef3c7;
  color: #92400e;
}
.constructor-pick-price {
  font-size: 14px;
  white-space: nowrap;
  color: #111827;
}

/* Product modal + variants */
.modal-dialog--product {
  width: min(920px, calc(100vw - 40px));
  height: min(620px, calc(100vh - 40px));
  max-width: 920px;
  max-height: min(620px, calc(100vh - 40px));
  padding: 20px 22px 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Assembly modal: fixed viewport height so cart CTA stays bottom-right */
.modal-dialog--product.modal-dialog--assembly {
  height: min(90vh, calc(100vh - 24px));
  max-height: min(90vh, calc(100vh - 24px));
  overflow: hidden;
}
.modal-dialog--assembly .product-modal-body {
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.modal-dialog--assembly .assembly-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.modal-dialog--assembly .product-modal-layout {
  height: auto;
  min-height: 0;
  align-items: start;
}
.modal-dialog--assembly .product-modal-left,
.modal-dialog--assembly .product-modal-right {
  overflow: visible;
}
.modal-dialog--assembly .product-modal-gallery-wrap {
  flex: none;
  min-height: 280px;
  height: 320px;
}
.modal-dialog--assembly .product-modal-description-text {
  max-height: none;
  min-height: 0;
  overflow: visible;
}
.modal-dialog--assembly .assembly-modal-comps-list {
  max-height: none;
  overflow: visible;
}
.modal-dialog--assembly .product-modal-left {
  gap: 14px;
}
.modal-dialog--assembly .assembly-modal-comps {
  margin-top: 0;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 5px;
}
.assembly-modal-actions {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  background: #fff;
}
.assembly-modal-actions .btn {
  width: auto;
  min-width: 200px;
  margin-left: auto;
  padding-left: 22px;
  padding-right: 22px;
}
.product-modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-modal-loading {
  padding: 48px 20px;
  text-align: center;
  color: #6b7280;
  margin: auto;
}
.product-modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.product-modal-left,
.product-modal-right {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.product-modal-right {
  overflow: hidden;
  padding-right: 4px;
}
.product-modal-gallery-wrap {
  background: #ffffff;
  border-radius: 5px;
  padding: 12px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  border: 1px solid var(--border);
}
.product-modal-gallery {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.product-modal-image-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}
.product-modal-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #ffffff;
}
.product-modal-gallery-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 220px;
  background: #ffffff;
  border-radius: 5px;
}
.product-modal-gallery-prev,
.product-modal-gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 193, 7, 0.9);
  color: #111;
  cursor: pointer;
  z-index: 2;
}
.product-modal-gallery-prev { left: 4px; }
.product-modal-gallery-next { right: 4px; }
.product-modal-gallery-prev:disabled,
.product-modal-gallery-next:disabled {
  opacity: 0.35;
  cursor: default;
}
.product-modal-gallery-thumbnails {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  justify-content: center;
}
.product-modal-gallery-thumb {
  width: 52px;
  height: 52px;
  border-radius: 5px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  background: #ffffff;
}
.product-modal-gallery-thumb.active {
  border-color: #FFD700;
}
.product-modal-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-modal-gallery-counter {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
}
.product-modal-category {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}
.product-modal-name {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
}
.product-modal-price {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin-bottom: 10px;
}
.product-modal-price--unavailable {
  color: #b91c1c;
  font-size: 18px;
}
.product-modal-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  background: #ecfdf5;
  color: #047857;
  margin-bottom: 12px;
}
.product-modal-badge--out {
  background: #fef2f2;
  color: #b91c1c;
}
.product-modal-badge--delivery {
  background: #dbeafe;
  color: #1d4ed8;
}
.product-modal-variants {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 16px;
}
.product-modal-variant-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-modal-variant-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.product-modal-variant-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.product-modal-swatch {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  flex: 0 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0.12);
  cursor: pointer;
  padding: 0;
  outline: none;
  box-sizing: border-box;
  appearance: none;
  background-clip: padding-box;
}
.product-modal-swatch.is-active {
  border-color: #FFD700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.18);
}
.product-modal-variant-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.product-modal-pill {
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  white-space: nowrap;
  min-height: 34px;
  appearance: none;
}
.product-modal-pill.is-active {
  border-color: #FFD700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.18);
}
.product-modal-description-block {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}
.product-modal-description-title {
  margin: 0 0 8px;
  font-size: 15px;
  flex-shrink: 0;
}
.product-modal-description-text {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: none;
  overflow: auto;
  white-space: pre-wrap;
  padding-right: 4px;
}
.product-modal-actions {
  margin-top: auto;
  padding-top: 16px;
  flex-shrink: 0;
}
.assembly-modal-comps {
  margin-top: 8px;
}
.assembly-modal-comps-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.assembly-modal-comps-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.35;
  color: #374151;
}
.assembly-modal-comps-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: #16a34a;
  font-weight: 700;
  font-size: 12px;
}
.product-modal-error {
  color: #b91c1c;
  padding: 24px;
  text-align: center;
  margin: auto;
}

@media (max-width: 1100px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .assemblies-grid { grid-template-columns: repeat(3, 1fr); }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-filters-sidebar { position: static; }
}
@media (max-width: 768px) {
  .categories-sidebar { display: none; }
  .main-content-wrapper { margin-left: 0; }
  .mobile-menu-toggle, .mobile-header-actions { display: flex; }
  .header-actions, .search-bar { display: none; }
  .logo-image { height: 40px; }
  .nav-links { display: none; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .assemblies-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .constructor-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: minmax(78px, auto);
  }
  .slot-card--case {
    grid-column: 1 / -1;
    grid-row: auto;
    height: 320px;
    order: -1;
  }
  .slot-card-case-media {
    min-height: 0;
  }
  .mobile-header-search-wrap {
    display: block;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 15px;
  }
  .page-main .container > div[style*="grid-template-columns:1.2fr"],
  .page-main .container > div[style*="grid-template-columns:1fr 1fr"] {
    display: block !important;
  }
  .product-modal-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .modal-dialog--product {
    height: min(90vh, calc(100vh - 24px));
    max-height: min(90vh, calc(100vh - 24px));
    width: min(920px, calc(100vw - 24px));
  }
  .modal-dialog--product.modal-dialog--assembly {
    height: min(90vh, calc(100vh - 16px));
    max-height: min(90vh, calc(100vh - 16px));
    overflow: hidden;
  }
  .assembly-modal-actions .btn {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }
  .modal-dialog--assembly .product-modal-gallery-wrap {
    height: 240px;
    min-height: 220px;
  }
  .product-modal-gallery-wrap {
    min-height: 220px;
    flex: none;
    height: 240px;
  }
  .product-modal-gallery-main {
    min-height: 180px;
  }
  .product-modal-image {
    max-height: 200px;
  }
  .product-modal-right {
    overflow: visible;
    min-height: 0;
  }
  .product-modal-description-block {
    flex: 1 1 auto;
    min-height: 160px;
  }
  .product-modal-description-text {
    max-height: none;
    min-height: 140px;
  }
  .modal-dialog--assembly .product-modal-description-text,
  .modal-dialog--assembly .assembly-modal-comps-list {
    max-height: none;
  }
}
@media (min-width: 769px) {
  .mobile-header-search-wrap { display: none; }
}
