﻿:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #1b2b3a;
  --muted: #607285;
  --line: #dbe4ee;
  --accent: #0a5fb8;
  --accent-dark: #08498d;
  --ok: #0c8f61;
  --shadow: 0 12px 28px rgba(15, 40, 73, 0.12);
  --radius: 16px;
  --card-min-width: 310px;
  --card-min-height: 440px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, #e8f2ff 0, transparent 35%),
    radial-gradient(circle at 100% 100%, #edf7f1 0, transparent 38%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

#content {
  max-width: 1560px;
  margin: 0 auto;
  padding: 140px 24px 60px;
}

.breadcrumbs {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid #d7e3f5;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(2px);
  font-size: 14px;
  color: #44607f;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.breadcrumbs a {
  color: #0f5cae;
  text-decoration: none;
  font-weight: 600;
}

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

.crumb-sep {
  color: #89a0bc;
}

.hero {
  background: linear-gradient(135deg, #072d57 0%, #0b5eb5 60%, #2d8fff 100%);
  color: #fff;
  border-radius: 20px;
  padding: 28px 28px 30px;
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
}

.hero p {
  margin: 0;
  max-width: 820px;
  color: #d9e8ff;
  font-size: 16px;
  line-height: 1.5;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--card-min-width));
  gap: 20px;
  justify-content: center;
}

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

.subcat-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--card-min-width));
  gap: 18px;
  margin-bottom: 8px;
  justify-content: center;
}

.subcat-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(20, 48, 83, 0.08);
  transition: transform .2s ease, box-shadow .2s ease;
  min-height: var(--card-min-height);
}

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

.subcat-media {
  height: 150px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, #f8fbff 0%, #eef4fb 100%);
  display: grid;
  place-items: center;
}

.subcat-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subcat-placeholder {
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: 10px;
  border: 1px dashed #b5c8de;
  display: grid;
  place-items: center;
  color: #335a80;
  font-weight: 700;
  text-align: center;
  padding: 8px;
}

.subcat-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: flex-end;
}

.subcat-body h2 {
  margin: auto 0 0;
  font-size: 19px;
  line-height: 1.25;
}

.subcat-body p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  min-height: 38px;
}

.subcat-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(20, 48, 83, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  min-height: var(--card-min-height);
  height: var(--card-min-height);
  position: relative;
}

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

.product-card.js-open-page-card {
  cursor: pointer;
}

.product-media {
  position: relative;
  height: 240px;
  padding: 12px;
  background: #f5f8fd;
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  width: 100%;
  z-index: 0;
}

.card-media {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.card-media .card-photo,
.product-photo {
  width: 100%;
  max-width: 300px;
  height: 200px;
  border-radius: 12px;
  object-fit: contain;
  object-position: center;
  border: 1px solid #d8e4f2;
  background: #eef3fb;
}

.card-media .card-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #d1def0;
  background: rgba(255,255,255,0.9);
  color: #0f4da3;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(15, 77, 163, 0.18);
  pointer-events: auto;
  z-index: 3;
}

.card-media .card-nav.prev { left: 8px; }
.card-media .card-nav.next { right: 8px; }

.card-media .card-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  border: 1px solid #d7e3f5;
  pointer-events: auto;
  z-index: 3;
}

.card-media .card-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b7c7df;
  cursor: pointer;
}

.card-media .card-dots .dot.active {
  background: #2b7bff;
}

.product-illustration {
  width: min(300px, 100%);
  height: 200px;
  border-radius: 12px;
  border: 1px solid #bdd3ea;
  background: linear-gradient(135deg, #fefefe 0%, #e8f1fb 50%, #fefefe 100%);
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  color: #24507d;
  font-weight: 700;
  padding: 14px;
}

.product-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  position: relative;
  z-index: 1;
  margin-top: 0;
  color: var(--text);
  text-shadow: none;
  pointer-events: auto;
}

.product-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  color: #102549;
}

.product-specs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: #5f6b82;
  font-size: 14px;
  line-height: 1.35;
}

.product-specs li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.product-desc {
  margin: 2px 0 0;
  color: #425468;
  font-size: 14px;
  line-height: 1.45;
  flex: 1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.product-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: static;
}

.page-open-hint {
  color: #0a5fb8;
  font-size: 13px;
  font-weight: 700;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, transform .15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

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

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.92);
  color: #0f2f4c;
}

.btn-outline:hover { background: #f3f8ff; }

.status {
  margin-left: auto;
  align-self: center;
  font-size: 13px;
  color: var(--ok);
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s ease;
}

.status.show { opacity: 1; }

.empty-state {
  grid-column: 1 / -1;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #4e6073;
  text-align: center;
  box-shadow: 0 8px 18px rgba(20, 48, 83, 0.08);
}

.detail-shell {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(20, 48, 83, 0.13);
  padding: 22px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(760px, 1.35fr) minmax(380px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 16px;
}

.detail-photo {
  width: 100%;
  height: 420px;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  border: 1px solid #d8e4f2;
  background: #eef3fb;
}

.detail-gallery {
  position: relative;
  display: grid;
  grid-template-columns: auto;
  justify-items: center;
  align-items: center;
  background: #f7f9ff;
  border-radius: 16px;
  padding: 12px 48px;
  border: 1px solid #dbe6f4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.gallery-main {
  width: 100%;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #c7d6eb;
  background: #fff;
  color: #0f3d86;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(17, 52, 104, 0.15);
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.gallery-nav:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 8px 18px rgba(17, 52, 104, 0.22);
}

.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-thumbs .thumb {
  border: 1px solid #d4e0f1;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  width: 70px;
  height: 60px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(18, 44, 89, 0.08);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.gallery-thumbs .thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gallery-thumbs .thumb.active {
  border-color: #2b7bff;
  box-shadow: 0 6px 14px rgba(43, 123, 255, 0.2);
  transform: translateY(-1px);
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 40, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  padding: 18px;
}

.lightbox-backdrop.open {
  display: flex;
}

.lightbox-card {
  background: #0f1d34;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  padding: 14px;
  position: relative;
  max-width: min(90vw, 1100px);
  width: 100%;
  color: #e8f0ff;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.lightbox-img {
  max-height: 70vh;
  max-width: 100%;
  object-fit: contain;
  background: #0a1728;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px;
}

.lightbox-nav {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
}

.lightbox-thumbs {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lightbox-thumbs button {
  width: 70px;
  height: 60px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  padding: 4px;
  cursor: pointer;
}

.lightbox-thumbs img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-thumbs button.active {
  border-color: #5fb0ff;
  background: rgba(95,176,255,0.12);
}

.detail-illus {
  width: 100%;
  min-height: 320px;
  border-radius: 12px;
  border: 2px solid #bdd3ea;
  background: linear-gradient(135deg, #fefefe 0%, #e8f1fb 50%, #fefefe 100%);
  display: grid;
  place-items: center;
  text-align: center;
  color: #24507d;
  font-weight: 700;
  padding: 16px;
}

.detail-title {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.detail-desc {
  margin: 0 0 8px;
  color: #415972;
  line-height: 1.65;
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-side {
  position: sticky;
  top: 120px;
}

.offer-box {
  margin-top: 0;
  border: 1px solid #dbe5f6;
  border-radius: 14px;
  padding: 12px;
  background:
    radial-gradient(circle at 100% 0%, rgba(20, 101, 204, 0.08), transparent 36%),
    linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 150px);
}

.offer-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #14345f;
}

.offer-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 90px;
  gap: 8px;
  font-size: 12px;
  color: #5d7192;
  margin-bottom: 8px;
  padding: 0 6px;
}

.offer-list {
  display: grid;
  gap: 7px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  max-height: calc(100vh - 320px);
  overscroll-behavior: contain;
}

.offer-list::-webkit-scrollbar {
  width: 8px;
}

.offer-list::-webkit-scrollbar-thumb {
  background: #c8d6ee;
  border-radius: 999px;
}

.offer-list::-webkit-scrollbar-track {
  background: #eef3fb;
  border-radius: 999px;
}

.offer-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 90px;
  gap: 8px;
  align-items: center;
  border: 1px solid #dce6f8;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.offer-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.offer-thumb {
  width: 34px;
  height: 34px;
  border: 1px solid #cbd8f1;
  border-radius: 8px;
  background: #fff;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  flex: 0 0 34px;
}

.offer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.offer-text {
  min-width: 0;
}

.offer-main input[type="checkbox"] {
  margin-top: 4px;
}

.offer-main strong {
  display: block;
  font-size: 14px;
  color: #142f53;
  line-height: 1.25;
}

.offer-main small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #63789a;
}

.offer-main small .offer-status-instock {
  color: #1f8f43;
  font-weight: 700;
}

.offer-main small .offer-status-order {
  color: #c43b2f;
  font-weight: 700;
}

.variant-image-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
}

.variant-image-modal.open {
  display: block;
}

.variant-image-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 45, 0.68);
  backdrop-filter: blur(2px);
}

.variant-image-modal__card {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, 760px);
  max-height: 86vh;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #cfdbf2;
  box-shadow: 0 24px 50px rgba(8, 20, 45, 0.3);
  padding: 14px;
}

.variant-image-modal__img {
  width: 100%;
  max-height: calc(86vh - 28px);
  object-fit: contain;
  border-radius: 10px;
  display: block;
  background: #f4f8ff;
}

.variant-image-modal__close {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(16, 38, 74, 0.72);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.offer-price {
  font-size: 14px;
  color: #0a5fb8;
  font-weight: 700;
}

.offer-qty {
  width: 84px;
  border: 1px solid #c9d8ee;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.offer-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(246, 251, 255, 0) 0%, #f3f8ff 26%, #f3f8ff 100%);
  padding-top: 10px;
}

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


#sidepanels-hotzone {
  position: fixed;
  top: 0;
  left: 0;
  width: 18px;
  height: 100vh;
  z-index: 1100;
  cursor: pointer;
}

#sidepanels-hotzone::after {
  content: ">";
  position: fixed;
  left: 0;
  top: 52%;
  transform: translateY(-50%);
  width: 16px;
  height: 84px;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, #0b5eb5 0%, #0a4d95 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(7, 33, 67, 0.35);
  transition: width .2s ease, background-color .2s ease, box-shadow .2s ease;
}

#sidepanels-placeholder .side-panels {
  position: fixed !important;
  top: 140px !important;
  left: 0 !important;
  transform: translateX(calc(-100% + 18px));
  opacity: .92;
  filter: saturate(.93);
  transition: transform .28s ease, opacity .2s ease, filter .2s ease;
  z-index: 1150 !important;
  box-shadow: 0 14px 30px rgba(18, 44, 79, 0.22);
}

#sidepanels-hotzone:hover ~ #sidepanels-placeholder .side-panels,
#sidepanels-placeholder .side-panels:hover {
  transform: translateX(0);
  opacity: 1;
  filter: saturate(1);
}

#sidepanels-hotzone:hover::after {
  width: 22px;
  background: linear-gradient(180deg, #0c69c9 0%, #08509a 100%);
  box-shadow: 0 10px 22px rgba(8, 46, 90, 0.45);
}

@media (max-width: 1100px) {
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subcat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #content { padding-top: 120px; }
}

@media (max-width: 900px) {
  #sidepanels-hotzone,
  #sidepanels-placeholder .side-panels { display: none; }
}

@media (max-width: 720px) {
  #content { padding: 100px 14px 40px; }
  .hero { padding: 22px 16px; border-radius: 16px; }
  .products-grid { grid-template-columns: 1fr; }
  .subcat-grid { grid-template-columns: 1fr; }
  .product-media { height: auto; min-height: 180px; }
  .product-illustration { height: 166px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .detail-photo,
  .detail-illus { min-height: 220px; height: auto; max-height: 320px; }
  .product-body { padding: 14px; }
  .product-actions { flex-direction: column; }
  .product-actions .btn { width: 100%; }
  .card-media .card-nav { width: 28px; height: 28px; }
  .offer-head,
  .offer-row {
    grid-template-columns: 1fr;
  }
  .offer-box {
    max-height: none;
  }
  .offer-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .offer-qty {
    width: 100%;
  }
  .offer-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .offer-foot .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  #content { padding: 96px 12px 36px; }
  .hero { padding: 18px 14px; }
  .breadcrumbs { font-size: 12px; padding: 8px 10px; }
  .product-media { padding: 10px; }
  .card-media .card-photo,
  .product-photo {
    max-width: 100%;
    height: auto;
    max-height: 180px;
  }
  .detail-photo { height: auto; max-height: 320px; }
  .detail-gallery { padding: 10px 38px; }
  .detail-shell { padding: 16px; }
  .gallery-main { display: flex; justify-content: center; }
  .gallery-main img { width: 100%; height: auto; max-height: 320px; }
  .gallery-nav { width: 30px; height: 30px; font-size: 18px; }
  .gallery-thumbs .thumb { width: 60px; height: 52px; }
  .product-title { font-size: 18px; }
  .product-specs { font-size: 13px; }
  .product-desc { font-size: 13px; }
}
