:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f7f7fb;
  background: #0f1014;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --bg: #0f1014;
  --panel: #191a20;
  --panel-strong: #202129;
  --line: #2d2f39;
  --green: #22c55e;
  --green-dark: #16a34a;
  --muted: #a4a7b5;
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 24% 18%, rgb(34 197 94 / 13%), transparent 25%),
    radial-gradient(circle at 82% 12%, rgb(111 66 193 / 12%), transparent 24%),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  min-height: 226px;
  place-items: center;
  padding: 34px 22px 72px;
  overflow: hidden;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(90deg, rgb(12 13 17 / 94%), rgb(12 13 17 / 42%)),
    linear-gradient(135deg, #262a36, #14151b 46%, #243327);
  border-bottom: 1px solid #22242b;
}

.hero__content {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.catalog-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgb(0 0 0 / 32%);
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.catalog-shell {
  position: relative;
  z-index: 2;
  width: min(100% - 28px, var(--max));
  margin: -46px auto 0;
  padding-bottom: 56px;
}

.search-card {
  display: flex;
  min-height: 82px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: 0 18px 42px rgb(0 0 0 / 24%);
}

.search-card input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgb(255 255 255 / 4%);
  border-radius: 10px;
  color: #f7f7fb;
  background: var(--panel);
  outline: 0;
  padding: 0 16px;
  font-size: 15px;
}

.search-card input::placeholder {
  color: #7f8391;
}

.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  padding: 22px 0 27px;
}

.topic-pill {
  min-height: 42px;
  max-width: 100%;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #f7f7fb;
  background: var(--panel);
  box-shadow: 0 8px 18px rgb(0 0 0 / 13%);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.topic-pill.is-active {
  border-color: transparent;
  color: #07110b;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.topic-pill:active {
  transform: scale(0.98);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 5px 0 8px;
  color: var(--green);
}

.section-heading span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: rgb(34 197 94 / 14%);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(23px, 4vw, 34px);
  font-weight: 950;
  text-transform: uppercase;
}

.result-count {
  margin: 0 0 18px;
  color: #d9def3;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.subsection-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: #f7f7fb;
}

.subsection-heading span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  color: #07110b;
  background: var(--green);
  font-size: 11px;
  font-weight: 950;
}

.subsection-heading h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
  text-transform: uppercase;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

.product {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition:
    border-color 150ms ease,
    transform 150ms ease;
}

.product:hover {
  border-color: rgb(34 197 94 / 62%);
  transform: translateY(-2px);
}

.product__button {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.poster,
.details__banner {
  display: grid;
  aspect-ratio: 16 / 9;
  align-items: end;
  padding: 14px;
  background:
    linear-gradient(0deg, rgb(0 0 0 / 76%), transparent 62%),
    var(--banner);
}

.poster span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  color: #07110b;
  background: var(--green);
  font-size: 11px;
  font-weight: 950;
}

.product__body {
  padding: 13px;
}

.product h3 {
  min-height: 44px;
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.22;
}

.product__topic {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.product__price {
  margin: 0 0 4px;
  color: #f7f7fb;
  font-size: 15px;
  font-weight: 950;
}

.product__category {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  padding: 38px 0;
  color: var(--muted);
  text-align: center;
}

.details {
  width: min(92vw, 520px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.details::backdrop {
  background: rgb(0 0 0 / 70%);
  backdrop-filter: blur(3px);
}

.details__panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
}

.details__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgb(0 0 0 / 55%);
  font-size: 25px;
}

.details__banner {
  min-height: 230px;
}

.details__body {
  display: grid;
  gap: 11px;
  padding: 18px;
}

.details h2,
.details p {
  margin: 0;
}

.details h2 {
  font-size: 26px;
  line-height: 1.08;
}

.details__type {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#details-description {
  color: var(--muted);
  line-height: 1.5;
}

.details__price {
  color: #fff;
  font-size: 20px;
}

.details__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 850;
}

.primary-button {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.secondary-button {
  border: 1px solid var(--line);
  background: #2a2c35;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 640px) {
  .hero {
    min-height: 204px;
    padding-bottom: 66px;
  }

  .catalog-shell {
    width: min(100% - 20px, var(--max));
  }

  .topic-pills {
    gap: 10px;
  }

  .topic-pill {
    min-height: 40px;
    padding: 0 14px;
    font-size: 12px;
  }

  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product h3 {
    min-height: 42px;
    font-size: 14px;
  }

  .details__actions {
    grid-template-columns: 1fr;
  }
}

/* Fixed, centered poster frames keep every catalogue row aligned. */
.catalog {
  grid-template-columns: repeat(auto-fit, minmax(190px, 220px));
  justify-content: center;
  align-items: stretch;
}
.product__button {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #111318;
  flex: none;
}
.poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.product__body {
  width: 100%;
}
.product h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  height: 2.44em;
  min-height: 0;
  overflow: hidden;
}
.details__banner {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  min-height: 0;
  max-height: 60vh;
  padding: 0;
  overflow: hidden;
  background: #111318;
}
.details__banner img {
  position: absolute;
  inset: 0;
  object-fit: contain;
  object-position: center;
}
@media (max-width: 640px) {
  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Detail view shows the complete original banner without a cropped frame. */
.details__banner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  min-height: 0;
  max-height: none;
  padding: 0;
}
.details__banner img {
  position: static;
  inset: auto;
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: none;
  object-fit: contain !important;
  object-position: center;
}

/* Overlay details and purchase action on the lower part of the full poster. */
.details {
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
.details__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: min(780px, 138vw, calc(100dvh - 32px));
  overflow: hidden;
}
.details__banner {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
}
.details__banner img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center;
}
.details__body {
  grid-area: 1 / 1;
  align-self: end;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  max-height: 80%;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 60px 20px 20px;
  background: linear-gradient(to bottom, transparent, rgb(8 10 14 / 86%) 20%, rgb(8 10 14 / 98%) 72%);
}
.details__body #details-description {
  min-height: 0;
  max-height: min(18dvh, 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #e0e2e8;
  text-shadow: 0 1px 3px #000;
}
.details__body h2 {
  font-size: clamp(20px, 4.8vw, 26px);
  text-shadow: 0 2px 5px #000;
}
.details__actions {
  grid-template-columns: minmax(0, 1fr);
}
.details__actions button {
  width: 100%;
  min-height: 44px;
}
.details__actions button[hidden] {
  display: none;
}
.details__close {
  z-index: 3;
}

.checkout { max-width: 440px; width: calc(100% - 24px); }
.checkout .details__body { display: grid; gap: 14px; }
.checkout #checkout-qr { width: min(100%, 280px); margin: auto; background: white; border-radius: 16px; padding: 12px; }
.checkout textarea { width: 100%; min-height: 72px; box-sizing: border-box; overflow-wrap: anywhere; }
.checkout [hidden] { display: none !important; }
