:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef6fb;
  --text: #17202a;
  --muted: #667085;
  --line: #d8e0e8;
  --blue: #0877d9;
  --blue-dark: #0457a5;
  --green: #12805c;
  --green-soft: #e6f5ef;
  --orange: #cf6f13;
  --orange-soft: #fff0df;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, #eef6fb 0, #f4f6f8 320px),
    var(--bg);
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand__logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 10px 18px rgba(4, 87, 165, 0.16));
}

.brand__label,
.catalog-header p,
.footer,
.category-filter__label,
.search span {
  color: var(--muted);
}

.brand__label {
  margin: 0 0 3px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  line-height: 1;
}

.topbar__contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.topbar__contact:hover {
  background: var(--blue-dark);
  box-shadow: 0 12px 26px rgba(8, 119, 217, 0.22);
  transform: translateY(-2px);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.catalog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  padding: 28px 0 18px;
}

.catalog-header h2 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 5vw, 3.25rem);
  line-height: 1.05;
}

.catalog-header p {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 1.02rem;
  line-height: 1.55;
}

.catalog-stats {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-dark);
  background: var(--surface);
  font-weight: 800;
  white-space: nowrap;
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  padding: 20px 0 28px;
}

.search {
  display: grid;
  gap: 8px;
}

.search span,
.category-filter__label {
  font-size: 0.86rem;
  font-weight: 800;
}

.search input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(8, 119, 217, 0.14);
}

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

.category-filter__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.category-button:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
  transform: translateY(-1px);
}

.category-button.is-active {
  border-color: var(--blue);
  color: #ffffff;
  background: var(--blue);
}

.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 42px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid rgba(216, 224, 232, 0.92);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.product-card:hover {
  border-color: rgba(8, 119, 217, 0.35);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.13);
  transform: translateY(-4px);
}

.product-card__image {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-soft);
}

.product-card__image-link {
  color: inherit;
  text-decoration: none;
}

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

.photo-placeholder {
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 22px;
  color: var(--blue-dark);
  background:
    linear-gradient(135deg, rgba(8, 119, 217, 0.13), rgba(18, 128, 92, 0.13)),
    #f6fafc;
}

.photo-placeholder__inner {
  display: grid;
  place-items: center;
  width: min(132px, 58%);
  aspect-ratio: 1;
  border: 2px solid rgba(8, 119, 217, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  font-size: clamp(1.25rem, 8vw, 2.3rem);
  font-weight: 900;
}

.photo-placeholder__text {
  max-width: 210px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.product-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-card h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.28;
}

.product-card h3 a {
  color: inherit;
  text-decoration: none;
}

.product-card h3 a:hover {
  color: var(--blue-dark);
}

.price {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--orange);
  font-size: 1.05rem;
  font-weight: 900;
  white-space: nowrap;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge--category {
  color: var(--blue-dark);
  background: var(--surface-soft);
}

.badge--status {
  color: var(--green);
  background: var(--green-soft);
}

.description {
  margin: 0;
  color: #394656;
  line-height: 1.5;
}

.benefits {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.benefits li {
  position: relative;
  padding-left: 18px;
  color: #344054;
  line-height: 1.4;
}

.benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.availability-note {
  margin: auto 0 0;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.buy-button,
.details-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.buy-button {
  color: #ffffff;
  background: var(--green);
}

.buy-button:hover {
  background: #0c664a;
  box-shadow: 0 14px 28px rgba(18, 128, 92, 0.2);
  transform: translateY(-2px);
}

.details-button {
  border: 1px solid var(--line);
  color: var(--blue-dark);
  background: var(--surface);
}

.details-button:hover {
  border-color: var(--blue);
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 14px 28px rgba(8, 119, 217, 0.18);
  transform: translateY(-2px);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 0 22px;
  color: var(--muted);
  font-weight: 800;
}

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

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

.product-detail {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid rgba(216, 224, 232, 0.92);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.product-detail__media {
  display: grid;
  min-height: 420px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.product-detail__media img,
.product-detail__media .photo-placeholder {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.product-detail__content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.product-detail__content h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.05;
}

.product-detail__price {
  width: fit-content;
  padding: 10px 14px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--orange);
  font-size: 1.45rem;
  font-weight: 900;
}

.benefits--large {
  gap: 10px;
  font-size: 1.02rem;
}

.product-detail__note {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--orange-soft);
  color: #7a3d08;
}

.product-detail__actions {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
}

.related-section {
  padding: 34px 0 46px;
}

.related-section h2 {
  margin-bottom: 16px;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

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

.related-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 110px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.related-card:hover {
  border-color: rgba(8, 119, 217, 0.4);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.related-card__image {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.related-card__image img,
.related-card__image .photo-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card__image .photo-placeholder__inner {
  width: 54%;
  font-size: 1.05rem;
}

.related-card__image .photo-placeholder__text {
  display: none;
}

.related-card strong,
.related-card span:not(.badge) {
  display: block;
}

.related-card strong {
  margin: 7px 0 4px;
  line-height: 1.25;
}

.related-card span:not(.badge) {
  color: var(--orange);
  font-weight: 900;
}

.empty-state {
  margin: 10px 0 52px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 30px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

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

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

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

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

@media (max-width: 680px) {
  .topbar,
  .catalog-header,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 14px;
  }

  .topbar__contact {
    width: 100%;
  }

  .catalog-header {
    display: flex;
  }

  .catalog-stats {
    width: fit-content;
  }

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

  .product-card__top {
    display: grid;
  }

  .price {
    width: fit-content;
  }

  .card-actions,
  .product-detail__actions,
  .related-products {
    grid-template-columns: 1fr;
  }

  .product-detail {
    padding: 16px;
  }

  .product-detail__media,
  .product-detail__media img,
  .product-detail__media .photo-placeholder {
    min-height: 300px;
  }
}

@media (max-width: 430px) {
  .topbar,
  main,
  .footer {
    width: min(100% - 22px, 1180px);
  }

  .brand__logo {
    width: 54px;
    height: 54px;
  }

  .category-button {
    flex: 1 1 auto;
  }
}
