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

:root {
  --bg: #f3f5f7;
  --surface: #fff;
  --text: #333;
  --muted: #888;
  --border: #e5e5e5;
  --header: #4b4f54;
  --header-surface: #fff;
  --accent: #b87333;
  --accent-hover: #9a6129;
  --link: #333;
  --radius: 4px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --font: 'Noto Sans Georgian', Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  overflow-x: clip;
}

img, video, svg {
  max-width: 100%;
  height: auto;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
}

/* Header */
.header {
  background: var(--header-surface);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  font-family: Montserrat, "Noto Sans Georgian", Arial, sans-serif;
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 10px 0;
}

.logo {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
  min-height: 51px;
}

.logo__img {
  display: block;
  height: 51px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.header__contact {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header__phone-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  user-select: none;
}

.header__phone {
  color: #333;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.header__phone:hover { color: var(--accent); }

.main { padding: 24px 0 48px; }

.page-title {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs__sep { color: #ccc; }

.section { margin-bottom: 32px; }
.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Catalog root — sections like isoterm.ru */
.sections-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.section-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}

.section-item:hover {
  border-color: #ccc;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

.section-item__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.section-item__image {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

.section-item__image img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.section-item__info {
  padding: 12px 14px 16px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-item__title {
  font-size: clamp(12px, 2.8vw, 13px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
}

.section-item__count {
  font-size: 11px;
  color: var(--muted);
}

/* Category grid (subcategories) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.category-card {
  display: block;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
}

.category-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.category-card__title { font-size: 14px; font-weight: 600; display: block; }
.category-card__count { font-size: 11px; color: var(--muted); margin-top: 4px; display: block; }

.page-title__count {
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.product-grid--compact { grid-template-columns: repeat(3, 1fr); }

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.product-card__img {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background: #fafafa;
}

.product-card__img img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
}

.product-card__body { padding: 12px 14px; flex: 1; }

.product-card__specs {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  font-size: 11px;
  color: var(--muted);
}

.product-card__specs li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px solid #f0f0f0;
}

.product-card__specs strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.product-card__title {
  font-size: clamp(12px, 2.8vw, 13px);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.product-card__price {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.product-card__actions {
  padding: 0 14px 14px;
}

/* Catalog detail */
.catalog-detail__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 0;
}

.catalog-detail__gallery,
.catalog-detail__info {
  min-width: 0;
}

.gallery__main {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  margin-bottom: 12px;
}

.gallery__main img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gallery__thumb {
  width: 64px;
  height: 64px;
  padding: 4px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.gallery__thumb.is-active { border-color: var(--accent); }

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

.catalog-detail__title {
  font-size: clamp(1.1rem, 3.5vw, 1.375rem);
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.catalog-detail__price {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 16px;
}

.catalog-detail__lead {
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0;
  line-height: 1.6;
}

/* SKU options */
.sku-props { margin-bottom: 16px; }

.sku-props__heading {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.sku-prop { margin-bottom: 14px; }

.sku-prop__label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.sku-prop__values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sku-value {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.35;
}

.sku-value:hover { border-color: #aaa; }

.sku-value.is-active {
  border-color: var(--accent);
  background: rgba(184,115,51,.08);
  color: var(--accent);
  font-weight: 600;
}

.sku-summary {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  background: #f8f8f8;
  border-radius: 4px;
  margin-top: 8px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* Tabs */
.tabs { margin-bottom: 32px; }

.tabs__nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tabs__btn {
  padding: 12px 24px;
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tabs__btn.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tabs__pane {
  display: none;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.tabs__pane.is-active { display: block; }

.detail-text {
  font-size: clamp(13px, 2.5vw, 14px);
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-text img {
  max-width: 100%;
  height: auto;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.specs-table th,
.specs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.specs-table th {
  width: 40%;
  color: var(--muted);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .2s;
}

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

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

.btn--details {
  background: #f0f0f0;
  color: var(--text);
  width: 100%;
  font-size: 13px;
}

.btn--details:hover { background: #e5e5e5; color: var(--text); }

/* Order form */
.order-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.order-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.order-form__grid .full { grid-column: 1 / -1; }

.order-configuration__label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.order-configuration .sku-summary {
  margin-top: 0;
}

.order-form label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.order-form input,
.order-form textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 16px;
}

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

.order-form input:focus,
.order-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Footer */
.footer {
  background: var(--header);
  color: rgba(255,255,255,.85);
  padding: 32px 0 0;
  margin-top: 48px;
}

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

.footer__col strong { display: block; margin-bottom: 8px; color: #fff; }
.footer__col p { font-size: 13px; margin-bottom: 4px; }
.footer__col a { color: rgba(255,255,255,.85); }
.footer__col a:hover { color: #fff; }

.footer__copy {
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
  opacity: .7;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #333;
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s, transform .3s;
  z-index: 200;
  pointer-events: none;
}

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

/* Responsive */
@media (max-width: 1100px) {
  .sections-list { grid-template-columns: repeat(3, 1fr); }
  .product-grid,
  .product-grid--compact { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .container { padding: 0 12px; }

  .main { padding: 16px 0 32px; }

  .header__inner {
    min-height: 60px;
    gap: 12px;
  }

  .logo__img {
    height: 42px;
    max-width: min(180px, 52vw);
  }

  .header__phone-label { font-size: 13px; }

  .header__phone {
    font-size: 13px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .sections-list { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .product-grid,
  .product-grid--compact { grid-template-columns: repeat(2, 1fr); }

  .catalog-detail__top {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 16px;
  }

  .gallery__main {
    min-height: 220px;
    padding: 12px;
  }

  .gallery__main img { max-height: 280px; }

  .order-form__grid { grid-template-columns: 1fr; }
  .order-section { padding: 16px; }

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

  .tabs__pane { padding: 14px; }

  .tabs__btn { padding: 10px 16px; font-size: 13px; }

  .page-title__count {
    display: block;
    margin-left: 0;
    margin-top: 4px;
    font-size: 14px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .specs-table,
  .specs-table tbody,
  .specs-table tr,
  .specs-table th,
  .specs-table td {
    display: block;
    width: 100%;
  }

  .specs-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .specs-table th {
    padding: 0 0 4px;
    border-bottom: none;
    font-size: 12px;
  }

  .specs-table td {
    padding: 0 0 4px;
    font-weight: 600;
  }

  .product-card__specs li {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .product-card__specs strong { text-align: left; }
}

@media (max-width: 480px) {
  .sections-list { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .product-grid,
  .product-grid--compact { grid-template-columns: 1fr; }

  .header__inner {
    flex-wrap: wrap;
    padding: 8px 0;
  }

  .header__contact {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    padding-top: 4px;
    border-top: 1px solid var(--border);
  }

  .section-title { font-size: 16px; }

  .btn {
    width: 100%;
    padding: 12px 16px;
  }

  .catalog-detail__top .btn--primary {
    width: 100%;
  }
}
