:root {
  --bg: #f1f1f1;
  --panel: #ffffff;
  --text: #10202f;
  --muted: #667482;
  --line: #d9e0e7;
  --accent: #0044a9;
  --accent-strong: #002e73;
  --ok: #0e7a45;
  --wait: #8a5a00;
  --shadow: 0 10px 30px rgba(16, 32, 47, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

#t-header .searchinput .t838__input.t-input {
  width: 314px;
  height: 45px;
  border: 0;
  padding-left: 65px;
}

#t-header .searchinput .t838__search-icon {
  width: 25px;
  height: 25px;
  box-sizing: content-box;
}

.site-header {
  position: relative;
  z-index: 20;
  display: block;
  height: 70px;
  min-height: 70px;
  padding: 0;
  background: #f1f1f1;
  overflow: visible;
}

.brand {
  position: absolute;
  top: -15px;
  left: clamp(22px, calc(50% - 245px), 56px);
  display: block;
  overflow: hidden;
  width: 226px;
  height: 104px;
  background: url("/images/europlast-logo.png") center / cover no-repeat;
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.top-nav,
.header-contacts,
.site-footer > div {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-nav {
  position: absolute;
  top: 18px;
  left: clamp(250px, calc(50% + 4px), 304px);
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 44px;
}

.top-nav a,
.header-contacts a,
.site-footer a {
  text-decoration: none;
}

.top-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.top-nav a:hover {
  color: var(--accent);
}

.top-nav a[aria-current="page"] {
  color: inherit;
}

.header-contacts {
  position: absolute;
  top: 15px;
  right: 40px;
  justify-content: flex-end;
  gap: 18px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}

.catalog-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 56px;
}

.catalog-head,
.catalog-toolbar,
.result-line,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.contact-button,
.ghost-button,
.category-button,
.product-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.contact-button,
.product-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  border-color: var(--accent);
  font-weight: 700;
}

.catalog-toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 26px 0 28px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-field,
.select-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 260px;
  align-self: end;
}

.search-field::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 11px;
  width: 24px;
  height: 24px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 88 88'%3E%3Cpath fill='%230144a9' d='M85 31.1c-.5-8.7-4.4-16.6-10.9-22.3C67.6 3 59.3 0 50.6.6c-8.7.5-16.7 4.4-22.5 11-11.2 12.7-10.7 31.7.6 43.9l-5.3 6.1-2.5-2.2-17.8 20 9 8.1 17.8-20.2-2.1-1.8 5.3-6.1c5.8 4.2 12.6 6.3 19.3 6.3 9 0 18-3.7 24.4-10.9 5.9-6.6 8.8-15 8.2-23.7zM72.4 50.8c-9.7 10.9-26.5 11.9-37.6 2.3-10.9-9.8-11.9-26.6-2.3-37.6 4.7-5.4 11.3-8.5 18.4-8.9h1.6c6.5 0 12.7 2.4 17.6 6.8 5.3 4.7 8.5 11.1 8.9 18.2.5 7-1.9 13.8-6.6 19.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.select-field {
  min-width: 184px;
}

input,
select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

#catalog-search {
  padding-right: 54px;
}

#catalog-search::-webkit-search-cancel-button {
  margin-right: 34px;
}

select {
  appearance: none;
  min-width: 184px;
  padding-right: 42px;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #10202f 50%),
    linear-gradient(135deg, #10202f 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 20px,
    calc(100% - 15px) 20px;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
  box-shadow: 0 1px 0 rgba(16, 32, 47, 0.03);
  font-weight: 700;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(0, 68, 169, 0.14);
  outline-offset: 0;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 22px;
}

.catalog-filters {
  align-self: start;
  position: sticky;
  top: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.filter-title {
  margin-bottom: 12px;
  font-weight: 500;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 9px 10px;
  border-color: transparent;
  background: transparent;
  text-decoration: none;
  text-align: left;
}

.category-button.is-active {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.category-button.child {
  margin-left: 14px;
  width: calc(100% - 14px);
  padding-left: 20px;
  color: #23384a;
  font-size: 14px;
}

.category-button.child::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  transform: translateY(-50%);
}

.category-button.child.is-active::before {
  background: var(--accent);
}

.ghost-button {
  padding: 0 14px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  box-shadow: none;
}

.ghost-button--link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.category-page-head {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 22px;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.category-page-cover {
  display: grid;
  min-height: 180px;
  place-items: center;
  border-radius: 8px;
  background: #eef2f5;
}

.category-page-cover img {
  max-width: 92%;
  max-height: 220px;
  object-fit: contain;
}

.category-page-description {
  max-width: 760px;
  margin: 12px 0 0;
  color: #2c3d4d;
  line-height: 1.6;
}

.result-line {
  justify-content: flex-end;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}

.category-intro {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.category-intro[hidden] {
  display: none;
}

.category-intro img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.category-intro h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.category-intro p:not(.eyebrow) {
  margin: 0;
  color: #2c3d4d;
  line-height: 1.55;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  display: grid;
  grid-template-rows: 210px auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.product-image {
  display: grid;
  place-items: center;
  background: #ffffff;
}

.product-image img {
  max-width: 92%;
  max-height: 190px;
  object-fit: contain;
}

.product-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.product-title {
  margin: 0;
  min-height: 44px;
  font-size: 16px;
  line-height: 1.35;
}

.product-meta,
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-specs {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-spec {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.product-spec:first-child {
  border-top: 0;
}

.product-spec dt,
.product-spec dd {
  margin: 0;
}

.product-spec dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.product-spec dd {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.available {
  background: #d9ecff;
  color: var(--accent-strong);
}

.badge.order {
  background: #d9ecff;
  color: var(--accent-strong);
}

.product-button {
  width: 100%;
  min-height: 46px;
  border-color: transparent;
  border-radius: 18px;
  background: linear-gradient(180deg, #000000 0%, #001a44 36%, #004db6 100%);
  box-shadow: 0 8px 18px rgba(0, 68, 169, 0.18);
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.product-button:hover {
  filter: brightness(1.04);
  box-shadow: 0 10px 22px rgba(0, 68, 169, 0.24);
  transform: translateY(-1px);
}

.empty-state {
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
  color: var(--muted);
}

.site-footer {
  padding: 26px clamp(16px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
}

.site-footer > div {
  flex-wrap: wrap;
}

.site-footer strong {
  color: var(--text);
}

.product-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(16, 32, 47, 0.52);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.dialog-product {
  display: grid;
  grid-template-columns: minmax(260px, 38%) 1fr;
  gap: 24px;
  padding: 28px;
}

.dialog-product img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
  background: #eef2f5;
}

.dialog-product h2 {
  margin: 0 46px 12px 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.description {
  color: #2c3d4d;
  line-height: 1.55;
}

.characteristics {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 14px;
}

.characteristics th,
.characteristics td {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.characteristics th {
  width: 45%;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 980px) {
  .header-contacts {
    display: none;
  }

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

  .category-page-head {
    grid-template-columns: 1fr;
  }

  .catalog-filters {
    position: static;
  }

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

@media (max-width: 640px) {
  .brand {
    left: clamp(18px, calc(50% - 245px), 56px);
  }

  .top-nav {
    left: calc(50% + 4px);
    gap: 50px;
  }

  .catalog-head,
  .catalog-toolbar,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

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

  .product-card {
    grid-template-rows: 190px auto;
  }

  .dialog-product {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .category-intro {
    grid-template-columns: 1fr;
  }

  .dialog-product h2 {
    font-size: 22px;
  }
}
