:root {
  --red-900: #5c0f13;
  --red-800: #7a1017;
  --red-700: #9f1b23;
  --red-500: #c72f3a;
  --rose-100: #ffe5e7;
  --paper: #fff8f6;
  --ink: #1f1717;
  --muted: #6c5d5e;
  --card-shadow: 0 18px 38px rgba(120, 16, 23, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 10%, rgba(199, 47, 58, 0.18), transparent 35%),
    radial-gradient(circle at 10% 80%, rgba(159, 27, 35, 0.16), transparent 35%),
    var(--paper);
}

.hero {
  padding: 2.5rem 1rem 3rem;
  background: linear-gradient(145deg, var(--red-900), var(--red-700));
  color: #fff;
  text-align: center;
}

.brand {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.76rem;
  opacity: 0.88;
}

h1 {
  margin: 0.5rem auto 0.8rem;
  line-height: 1.15;
}

.subtitle {
  margin: 0 auto 1.4rem;
  max-width: 60ch;
  opacity: 0.95;
}

.container {
  width: min(1080px, 94vw);
  margin: 1.4rem auto 2.2rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.product-card {
  border: 1px solid rgba(159, 27, 35, 0.22);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--card-shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px rgba(120, 16, 23, 0.24);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.product-content {
  padding: 0.9rem;
}

.product-title {
  margin: 0;
  font-size: 1rem;
}

.price {
  margin: 0.5rem 0 0.8rem;
  color: var(--red-800);
  font-weight: 700;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
}

button,
.cta,
.link-btn {
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  text-decoration: none;
}

.cta,
.link-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.62rem 1rem;
}

.cta {
  background: #fff;
  color: var(--red-900);
}

.product-content .cta {
  background: var(--red-700);
  color: #fff;
}

.link-btn {
  background: var(--rose-100);
  color: var(--red-900);
}

.product-dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  width: min(920px, 96vw);
  background: transparent;
}

.product-dialog::backdrop {
  background: rgba(33, 14, 16, 0.72);
}

.dialog-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.dialog-image {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  background: #f2f2f2;
}

.dialog-content {
  padding: 1.1rem;
}

.dialog-content h3 {
  margin-top: 0;
}

.dialog-thumbs {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  display: flex;
  gap: 0.4rem;
}

.thumb-btn {
  border: 2px solid rgba(255, 255, 255, 0.75);
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: transparent;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.close-btn {
  position: absolute;
  right: 0.8rem;
  top: 0.8rem;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 1.3rem;
  color: #fff;
  background: rgba(20, 20, 20, 0.5);
  cursor: pointer;
  z-index: 1;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 0.8rem 1rem 1.6rem;
}

@media (max-width: 740px) {
  .hero {
    padding-top: 2rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .dialog-card {
    grid-template-columns: 1fr;
  }

  .dialog-image {
    max-height: 320px;
  }

  .dialog-thumbs {
    position: static;
    padding: 0.8rem 0.8rem 0;
  }
}
