@font-face {
  font-family: "Inter Local";
  src: url("/assets/font/Inter_28pt-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter Local";
  src: url("/assets/font/Inter_18pt-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

:root {
  --gap: 80px;
  --bg: #f6f6f6;
  --panel: #ffffff;
  --text: #161616;
  --muted: #747474;
  --line: #e6e6e6;
  --accent: #EF7F1A;
  --accent-dark: #d86f12;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter Local", "Segoe UI", Arial, sans-serif;
  font-weight: 400;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: calc(100% - 80px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 0 0;
}

.logo {
  display: block;
  width: 128px;
  text-decoration: none;
}

.logo img {
  display: block;
  width: 128px;
  height: auto;
}

.navigation {
  display: flex;
  align-items: center;
  gap: 32px;
}

.navigation--right {
  justify-content: flex-end;
}

.navigation a {
  color: inherit;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  transition: color 180ms ease, opacity 180ms ease;
}

.navigation a:hover,
.navigation a:focus-visible,
.navigation a.is-active {
  color: var(--accent);
  opacity: 1;
}

.hero,
.page {
  width: calc(100% - 80px);
  max-width: 1200px;
  margin: var(--gap) auto 0;
}

.hero__top {
  text-align: center;
}

.hero__title {
  width: 600px;
  max-width: 100%;
  margin: 0 auto;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.search {
  width: 100%;
  height: 72px;
  margin: var(--gap) auto 0;
}

.search__input,
.catalog-tools select {
  width: 100%;
  height: 100%;
  padding: 0 28px;
  border: 0;
  border-radius: 20px;
  outline: none;
  background: var(--panel);
  color: var(--text);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search__input::placeholder {
  color: #8a8a8a;
  opacity: 1;
}

.search__input:focus-visible,
.catalog-tools select:focus-visible {
  border-color: rgba(239, 127, 26, 0.45);
  box-shadow: 0 0 0 2px rgba(239, 127, 26, 0.28);
}

.section-heading,
.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: var(--gap);
}

.page-title {
  align-items: start;
  margin-top: 0;
}

.section-heading h2,
.page-title h1,
.product-detail h1,
.route__title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.catalog__title {
  margin: var(--gap) 0 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.section-heading a,
.back-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.page-title p,
.contacts p,
.empty {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: var(--gap);
}

.filter-panel {
  border-radius: 20px;
  background: var(--panel);
}

.product-grid--with-filter .filter-panel {
  grid-row: span 3;
}

.product-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: var(--panel);
  transition: box-shadow 180ms ease;
}

.product-card:hover,
.product-card:focus-within {
  box-shadow: 0 0 0 2px rgba(239, 127, 26, 0.28);
}

.product-card__media,
.product-detail__media {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  place-items: center;
  background: #f6f6f6;
  color: var(--muted);
  text-decoration: none;
}

.product-detail__media span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.product-card__article {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.product-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}

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

.product-card p {
  color: var(--muted);
  line-height: 1.45;
}

.product-card__footer,
.product-detail__buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}

.product-card strong,
.product-detail__buy strong {
  font-size: 16px;
  white-space: nowrap;
}

button,
.catalog-tools button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

button:hover,
.catalog-tools button:hover {
  background: var(--accent-dark);
}

[data-add-to-cart] {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  line-height: 1;
}

[data-add-to-cart]:hover,
[data-add-to-cart]:focus-visible {
  background: transparent;
  color: var(--muted);
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px 120px;
  gap: 12px;
  height: 60px;
  margin: 32px 0;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 40px;
  margin-top: 24px;
}

.product-detail__media {
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 20px;
}

.product-detail__content {
  padding: 8px 0;
}

.product-detail__content p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.product-detail dl {
  display: grid;
  gap: 12px;
  margin: 32px 0;
}

.product-detail dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.product-detail dt {
  color: var(--muted);
}

.product-detail dd {
  margin: 0;
  font-weight: 700;
}

.route {
  margin-top: var(--gap);
  padding-bottom: var(--gap);
}

.cart {
  margin-top: 32px;
}

.cart table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

.cart th,
.cart td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.cart tfoot td {
  font-size: 20px;
  font-weight: 800;
}

.cart-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

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

  .product-grid--with-filter .filter-panel {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 180px;
  }

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

@media (max-width: 680px) {
  :root {
    --gap: 60px;
  }

  .header {
    width: calc(100% - 32px);
    grid-template-columns: 1fr;
    gap: 18px;
    justify-items: center;
  }

  .navigation,
  .navigation--right {
    justify-content: center;
    gap: 16px;
  }

  .navigation a {
    font-size: 16px;
  }

  .hero,
  .page {
    width: calc(100% - 32px);
  }

  .hero__title {
    font-size: 40px;
  }

  .section-heading,
  .page-title {
    display: grid;
    align-items: start;
  }

  .section-heading h2,
  .page-title h1,
  .product-detail h1,
  .route__title {
    font-size: 20px;
  }

  .catalog-tools {
    grid-template-columns: 1fr;
    height: auto;
  }

  .catalog-tools .search__input,
  .catalog-tools select,
  .catalog-tools button {
    height: 56px;
  }

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

  .product-grid--with-filter .filter-panel {
    min-height: 160px;
  }

  .product-card {
    min-height: 280px;
  }

  .product-detail__media {
    min-height: 300px;
  }

}
