:root {
  --primary: rgba(255, 128, 43, 1);
  --primary-dark: #ef6a18;
  --primary-soft: #fff1e8;
  --accent: #2f86eb;
  --accent-dark: #1f6fd0;
  --bg: #f6f6fb;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --text: #1d1d1f;
  --muted: #6d7280;
  --line: #e8e9f2;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 18px 48px rgba(17, 24, 39, 0.12);
  --radius: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --max-width: 1280px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top, #ffffff 0%, var(--bg) 55%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 20px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  font-weight: 700;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 128, 43, 0.28);
}

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

.btn-blue {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(47, 134, 235, 0.24);
}

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

.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.btn-whatsapp img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* WhatsApp popup */
.wa-wrap {
  position: relative;
}

.wa-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.13);
  min-width: 190px;
  z-index: 500;
  overflow: hidden;
}

.wa-popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  text-decoration: none;
  color: #111;
  font-size: .93rem;
  transition: background .15s;
}

.wa-popup-item:hover {
  background: #f5f5f5;
}

.wa-popup-item img {
  flex-shrink: 0;
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-light {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 16px 0;
}

.header-inner,
.main-nav-inner,
.page-wrap,
.content-full,
.footer-inner {
  width: min(100%, var(--max-width));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 16px 20px;
}

.logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-mark {
  font-family: "Stalinist One", cursive;
  font-size: 32px;
  line-height: 22px;
  color: var(--primary);
  letter-spacing: 0;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 560px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 22px;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 46px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 128, 43, 0.65);
  background: #fff;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 128, 43, 0.12);
}

.header-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.header-actions .btn {
  min-width: 130px;
  min-height: 44px;
  border-radius: 12px;
  padding-inline: 18px;
}

.main-nav {
  padding: 8px 16px;
}

.main-nav-inner {
  display: flex;
  gap: 8px;
  padding: 10px 0;
  align-items: center;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}

.main-nav a:hover,
.main-nav a.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow);
}

.page-wrap {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 20px 16px 32px;
  flex: 1;
}

.content-full {
  padding: 20px 16px 40px;
  flex: 1;
}

.sidebar {
  width: 270px;
  flex-shrink: 0;
  position: sticky;
  top: 112px;
}

.sidebar-card,
.detail-card,
.detail-section,
.contact-card,
.contact-map,
.hero-card,
.info-card,
.stat-card,
.value-card,
.footer-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar-card {
  padding: 18px;
  margin-bottom: 14px;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 800;
}

.sidebar-kicker {
  color: var(--primary);
  font-size: 15px;
}

.sort-chip {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 128, 43, 0.6);
  border-radius: 999px;
  padding: 10px 40px 10px 14px;
  color: var(--muted);
  background: #fff;
  appearance: none;
  outline: none;
  cursor: pointer;
  font-weight: 600;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--primary) 50%),
    linear-gradient(135deg, var(--primary) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 1px),
    calc(100% - 12px) calc(50% - 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.sort-chip:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 128, 43, 0.12);
}

.price-label,
.category-head {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.price-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  height: 42px;
  padding: 0 12px;
  outline: none;
  background: #fff;
}

.price-row input:focus {
  border-color: var(--primary);
}

.price-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-apply {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn-reset {
  background: #fff5ef;
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  color: var(--primary-dark);
}

.cat-toggle-btn {
  display: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
}

.cat-toggle-label {
  flex: 1;
  text-align: left;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-list a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.category-list a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.category-list:not(.sidebar-cat-tree) a.active {
  background: var(--primary);
  color: #fff;
}

.cat-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.cat-label {
  flex: 1;
  font-weight: 700;
}

.cat-count {
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f8;
  color: var(--muted);
  font-size: 12px;
}

.category-list:not(.sidebar-cat-tree) a.active .cat-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.products-area {
  flex: 1;
  min-width: 0;
}

.products-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.products-heading {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.products-meta {
  color: var(--muted);
  font-weight: 600;
}

.products-grid,
.related-grid,
.stats-grid,
.values-grid,
.contacts-grid,
.delivery-grid {
  display: grid;
  gap: 20px;
}

.products-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 100%;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 1 / 0.9;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafc 100%);
  padding: 22px;
}

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

.card-body {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-category {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

.card-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  min-height: 48px;
}

.card-price {
  font-size: 20px;
  line-height: 1.2;
}

.card-price strong {
  font-size: 19px;
  font-weight: 700;
}

.card-buy {
  height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  margin-top: auto;
  font-size: 15px;
}

.empty-state {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 56px 20px;
}

.empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.sub-hero {
  margin-bottom: 24px;
}

.hero-card {
  padding: 32px;
  background: linear-gradient(135deg, #fff7f2 0%, #ffffff 55%, #eef5ff 100%);
  border: 1px solid rgba(255, 128, 43, 0.12);
}

.hero-card h1 {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.hero-card p {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
}

.product-page-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.product-title-block {
  flex: 1;
  min-width: 0;
}

.share-btn {
  margin-left: auto;
}

.head-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--primary-dark);
  border-color: rgba(255, 128, 43, 0.5);
}

.share-icon {
  width: 22px;
  height: 24px;
  display: block;
}

.product-title-block h1 {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.product-title-block p {
  color: var(--muted);
  margin-top: 4px;
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.86fr) 260px;
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}

.slider-wrap {
  position: relative;
  min-width: 0;
}

.slider-stage {
  position: relative;
  aspect-ratio: 1 / 0.92;
  border-radius: 28px;
  background: #fff;
  border: 1.5px solid rgba(255, 128, 43, 0.7);
  overflow: hidden;
  padding: 22px;
}

.slider-stage img {
  position: absolute;
  inset: 22px;
  width: calc(100% - 44px);
  height: calc(100% - 44px);
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.slider-stage img.active {
  opacity: 1;
}

.sl-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 2;
}

.sl-btn.prev {
  left: 14px;
}

.sl-btn.next {
  right: 14px;
}

.sl-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.sl-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: #d9dce7;
  cursor: pointer;
}

.sl-dot.active {
  width: 28px;
  background: var(--primary);
}

.sl-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.sl-thumb {
  width: 86px;
  height: 86px;
  flex-shrink: 0;
  object-fit: contain;
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 128, 43, 0.6);
  padding: 8px;
  cursor: pointer;
}

.sl-thumb.active {
  box-shadow: 0 0 0 3px rgba(255, 128, 43, 0.12);
}

.product-info {
  padding-top: 8px;
}

.info-section-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 18px;
}

.info-card {
  padding: 22px;
  margin-bottom: 16px;
}

.info-card h3 {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 12px;
}

.info-list {
  display: grid;
  gap: 12px;
}

.info-list div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.info-list div:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.info-list strong {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.info-list span,
.desc-text {
  font-size: 15px;
}

.buy-card {
  position: sticky;
  top: 112px;
  padding: 16px;
}

.buy-card h3 {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 14px;
}

.buy-card-image {
  background: #fff;
  border: 1.5px solid rgba(255, 128, 43, 0.7);
  border-radius: 22px;
  padding: 14px;
  aspect-ratio: 1 / 0.92;
  margin-bottom: 14px;
}

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

.buy-price {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 12px;
}

.buy-card .btn,
.prod-actions .btn {
  width: 100%;
}

.qty-row {
  display: inline-flex;
  align-items: center;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.qty-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
}

.qty-input {
  width: 68px;
  height: 42px;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  outline: none;
  background: #fff;
  font-weight: 700;
}

.prod-actions {
  display: grid;
  gap: 10px;
}

.quick-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.qs-item {
  background: #fff6f0;
  border-radius: 16px;
  padding: 12px 14px;
}

.qs-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.qs-value {
  font-size: 14px;
  font-weight: 800;
}

.detail-section {
  padding: 24px;
  margin-bottom: 18px;
}

.detail-section h2 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 16px;
}

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

.specs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.specs-table td:first-child {
  width: 38%;
  color: var(--muted);
  font-weight: 700;
}

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

.related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 22px;
  margin-bottom: 24px;
}

.about-story-image,
.about-panel {
  overflow: hidden;
}

.about-story-image img {
  width: 100%;
  aspect-ratio: 1 / 0.78;
  object-fit: cover;
}

.about-panel {
  padding: 28px;
}

.about-panel h2 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 12px;
}

.about-panel p {
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 15px;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}

.stat-card,
.value-card {
  padding: 24px;
}

.stat-num {
  color: var(--primary);
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 10px;
}

.stat-label {
  color: var(--muted);
  font-weight: 600;
}

.values-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}

.value-card h3 {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 10px;
}

.value-card p {
  color: var(--muted);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.team-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.team-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.team-card-body {
  padding: 16px;
}

.team-card-body strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 4px;
}

.team-card-body span {
  color: var(--muted);
}

.contacts-grid {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  margin-bottom: 22px;
}

.contact-card,
.contact-map {
  padding: 24px;
}

.contact-card h2,
.contact-map h2 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 16px;
}

.contact-list {
  display: grid;
  gap: 12px;
}

.contact-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 18px;
  text-decoration: none;
}

.contact-item strong {
  display: block;
  margin-bottom: 4px;
}

.contact-item span {
  color: var(--muted);
}

.contact-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.map-frame {
  border-radius: 22px;
  overflow: hidden;
  height: 420px;
  background: #f2f4fb;
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.delivery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.delivery-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.delivery-card h3 {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 10px;
}

.delivery-card p {
  color: var(--muted);
}

footer {
  margin-top: auto;
  padding: 0 16px 20px;
}

.footer-panel {
  padding: 26px;
  background: linear-gradient(180deg, #1d1f27 0%, #15171d 100%);
  color: #d4d7e1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 18px;
}

.footer-logo {
  font-family: "Stalinist One", cursive;
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 10px;
}

.footer-desc {
  color: #b7bbc7;
  max-width: 360px;
}

.footer-col h4 {
  color: #fff;
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

.footer-col a {
  text-decoration: none;
  color: #c1c6d4;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9ca3b4;
  font-size: 13px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  background: #15171d;
  color: #fff;
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .products-grid,
  .related-grid,
  .values-grid,
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  }

  .buy-card {
    grid-column: 1 / -1;
    position: static;
    max-width: 360px;
  }

  .stats-grid,
  .delivery-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .search-wrap {
    order: 3;
    max-width: none;
    width: 100%;
  }

  .page-wrap,
  .about-layout,
  .contacts-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .page-wrap {
    gap: 16px;
  }

  .sidebar {
    width: 100%;
    position: static;
  }

  .cat-toggle-btn {
    display: flex;
  }

  .category-list {
    display: none;
    margin-top: 10px;
  }

  .category-list.open {
    display: flex;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card h1 {
    font-size: 34px;
  }

  .stats-grid,
  .values-grid,
  .delivery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header {
    padding-inline: 10px;
    padding: 6px;
  }

  .header-inner,
  .hero-card,
  .sidebar-card,
  .detail-section,
  .contact-card,
  .contact-map,
  .about-panel,
  .stat-card,
  .value-card,
  .footer-panel {
    border-radius: 22px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1;
    min-width: 0;
  }

  .main-nav {
    padding-inline: 10px;
  }

  .main-nav-inner {
    overflow-x: auto;
    white-space: nowrap;
  }

  .page-wrap,
  .content-full {
    padding-inline: 10px;
  }

  /* --- Mobile: sidebar стека вертикально --- */
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Категории идут первыми — порядок переопределяем через order */
  .cat-card   { order: 1; }
  .sidebar > .sidebar-card:first-child { order: 2; } /* Фильтр/Сортировка */
  .price-card { order: 3; }

  /* Крупные кнопки применить/сброс на мобилке */
  .price-actions {
    gap: 12px;
    margin-top: 14px;
  }

  .btn-apply {
    display: block;
    padding: 8px ;
    font-size: 16px;
    border-radius: 16px;
  }

  .products-grid,
  .related-grid,
  .team-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .card-img-wrap {
    aspect-ratio: 1 / 0.82;
    padding: 18px;
  }

  .card-body {
    padding: 0 16px 16px;
    gap: 8px;
  }

  .card-name {
    font-size: 16px;
    min-height: 42px;
  }

  .card-price {
    font-size: 18px;
  }

  .card-price strong {
    font-size: 17px;
  }

  .card-buy {
    height: 44px;
    font-size: 14px;
  }

  .products-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-page-head {
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .product-page-head .product-title-block {
    width: 100%;
    order: 3;
  }

  .product-page-head .back-btn {
    order: 1;
  }

  .product-page-head .share-btn {
    order: 2;
    margin-left: auto;
  }

  .head-left {
    align-items: flex-start;
    flex-direction: column;
  }

  .products-heading,
  .info-section-title,
  .detail-section h2,
  .contact-card h2,
  .contact-map h2 {
    font-size: 24px;
  }

  .hero-card h1 {
    font-size: 28px;
  }

  .product-layout {
    grid-template-columns: 1fr;
  }

  .slider-stage {
    aspect-ratio: 1 / 0.96;
  }

  .quick-specs {
    grid-template-columns: 1fr;
  }

  .specs-table td:first-child {
    width: 44%;
  }

  .map-frame {
    height: 300px;
  }

  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .logo-mark {
    font-size: 27px;
  }

  .search-wrap input {
    height: 42px;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .card-img-wrap {
    aspect-ratio: 1 / 0.78;
    padding: 16px;
  }

  .product-title-block h1 {
    font-size: 18px;
  }

  .sl-thumb {
    width: 72px;
    height: 72px;
  }

  .detail-section,
  .buy-card,
  .contact-card,
  .contact-map {
    padding: 18px;
  }

  .price-actions,
  .map-actions {
    flex-direction: column;
  }
}

/* ── Django-specific additions ─────────────────────────────────────────── */

/* Sidebar category tree */
.sidebar-cat-tree { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-cat-item { display: flex; flex-direction: column; }

.sidebar-cat-link {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: .92rem; font-weight: 600;
  color: var(--text); text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-cat-link:hover { background: var(--bg); color: var(--primary); }
.sidebar-cat-link.active { background: transparent; color: var(--primary); font-weight: 700; }

.sidebar-cat-item:has(.sidebar-sub-list) .sidebar-cat-link::after {
  content: "›";
  font-size: 1.2rem;
  line-height: 1;
  display: inline-block;
  margin-left: auto;
  padding-left: 6px;
  transition: transform .2s;
  transform: rotate(0deg);
  color: var(--muted);
}
.sidebar-cat-item:has(.sidebar-sub-list) .sidebar-cat-link.active::after {
  transform: rotate(90deg);
  color: var(--primary);
}

.sidebar-cat-icon { font-size: 1rem; }

.sidebar-sub-list {
  list-style: none;
  padding: 2px 0 4px 24px;
  margin: 0;
  display: none;
  flex-direction: column;
  gap: 1px;
}
.sidebar-sub-list.open { display: flex; }

.sidebar-sub-link {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: .88rem; font-weight: 500;
  color: var(--muted); text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-sub-link:hover { background: var(--bg); color: var(--primary); }
.sidebar-sub-link.active { color: var(--primary); font-weight: 700; }

.categories-main-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .categories-main-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .categories-main-grid { grid-template-columns: 1fr; }
}

.category-main-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  padding: 28px 24px 24px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, border-color .2s, transform .15s;
  cursor: pointer;
}
.category-main-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(255,128,43,.12);
  transform: translateY(-2px);
}

.cat-main-icon {
  font-size: 2.4rem;
  margin-bottom: 14px;
  line-height: 1;
}
.cat-main-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.cat-main-title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.cat-main-desc { font-size: .93rem; color: var(--muted); margin: 0; }

.cat-sub-chip {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .8rem;
  color: var(--muted);
  margin: 2px 4px 2px 0;
}

.cat-main-btn {
  margin-top: auto;
  padding-top: 16px;
  align-self: flex-start;
}

/* Product card (server-rendered) */
.product-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(255,128,43,.12);
}
.card-img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.card-img-placeholder { font-size: 3rem; color: var(--muted); }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-meta { font-size: .8rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.card-title { font-size: 1rem; font-weight: 700; margin: 0; }
.card-summary { font-size: .88rem; color: var(--muted); flex: 1; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.card-price { font-size: 1.15rem; font-weight: 800; color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: .85rem; }

/* Slider slides */
.sl-slide { display: none; }
.sl-slide.active { display: flex; align-items: center; justify-content: center; }
.sl-slide img { width: 100%; height: 100%; object-fit: contain; }

.sl-thumb { cursor: pointer; opacity: .5; transition: opacity .15s; border-radius: 8px; }
.sl-thumb.active { opacity: 1; outline: 2px solid var(--primary); }

/* Specs table */
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table tr:nth-child(even) td { background: var(--bg); }
.specs-table td { padding: 10px 14px; font-size: .92rem; border-bottom: 1px solid var(--line); }
.spec-label { color: var(--muted); width: 45%; }

/* Related grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 720px) {
  .related-grid { grid-template-columns: 1fr 1fr; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: .95rem;
  z-index: 9999;
  animation: fadeInUp .25s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
