* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #e5dfd3;
  color: #2a241d;
  font-family: "Cardo", serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.productlist-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 8px 20px;
}

.breadcrumbs {
  margin: 30px 20px 30px;
  font-size: 14px;
}

.productlist-header {
  text-align: center;
  position: relative;
  margin-bottom: 20px;
}

h1 {
  text-align: center;
  font-weight: 400;
}

.subcategory-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 18px;
}

.subcategory-nav button {
  border: 1px solid #8b7a65;
  background: rgba(255, 255, 255, 0.35);
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  padding: 6px 12px;
  line-height: 1;
}

.subcategory-nav button:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.6);
}

.subcategory-nav button.active {
  background: #8b7a65;
  color: #fff;
}

#sorter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 40px 28px;
}

#sorter button {
  border: 1px solid #8b7a65;
  background: rgba(255, 255, 255, 0.35);
  color: #2a241d;
  font-family: "Cardo", serif;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

#sorter button:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.product-grid {
  display: grid;
  width: min(1200px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.product-grid > a {
  display: block;
  height: 100%;
}

.product-card {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: grid;
  transition: transform 0.18s ease;
}
.product-card:hover {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.18);
}

.product-card__image-wrap {
  aspect-ratio: 0.9 / 1;
  overflow: hidden;
  background: #ddd6ca;
}

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

.product-card__content {
  grid-row: 2 / span 3;
  display: grid;
  grid-template-rows: auto auto auto auto;
  padding: 8px 8px 12px;
  font-family: "Inter", sans-serif;
}

.product-card__name {
  grid-row: 1;
  margin: 0;
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.3;
  font-family: "Inter", sans-serif;
}

.product-card__brand {
  grid-row: 2;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  color: #3d372f;
  font-family: "Inter", sans-serif;
  font-style: italic;
}

.price-old {
  grid-row: 3;
  margin: 0;
  font-size: 14px;
  text-decoration: line-through;
  color: #3d372f;
}

.price-now,
.price-regular {
  grid-row: 4;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: "Inter", sans-serif;
}

.price-sale {
  color: var(--the-red);
}

.sale-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--the-red);
  color: white;
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 999px;
  line-height: 1;
}

.sold-out {
  position: absolute;
  inset: 0;
}

.sold-out::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(235, 230, 223, 0.62);
}

.sold-out__text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--the-red);
  font-style: italic;
  font-weight: 700;
  font-family: "Inter", sans-serif;
}

@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    width: min(800px, 100%);
  }
}

@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr;
    width: min(400px, 100%);
  }
}
