:root {
  --black: #000000;
  --white: #ffffff;
  --pink: #ff90e8;
  --gray: #f4f4f0;
  --dark-gray: #242423;
  --red: #dc341e;
  --purple: #90a8ed;
  --body-bg: #f4f4f0;
  --filled: 255 255 255;
  --color: 0 0 0;
  --accent: 255 144 232;
  --contrast-accent: 0 0 0;
  --primary: 255 144 232;
  --contrast-primary: 0 0 0;
  --danger: 220 52 30;
  --info: 144 168 237;
  --border-alpha: 1;
  --gray-3: 0.55;
  --background: #ffffff;
  --foreground: #000000;
  --border: #000000;
  --muted: rgb(0 0 0 / 0.55);
  --accent-color: #ff90e8;
  --primary-color: #ff90e8;
  --primary-fg: #000000;
  --danger-color: rgb(var(--danger));
  --info-color: rgb(var(--info));
  --shadow: 0.2rem 0.2rem 0 var(--black);
  --radius: 0;
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--foreground);
  line-height: 1.45;
}

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

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

button,
input {
  font: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.site-logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.currency-switch {
  display: flex;
  border: 1px solid #000;
}

.currency-switch button {
  margin: 0;
  padding: 0.4rem 0.75rem;
  border: 0;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.currency-switch button + button {
  border-left: 1px solid #000;
}

.currency-switch button.is-selected {
  background: #ff90e8;
}

.page {
  width: min(75.25rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0;
}

.page-catalog {
  width: min(72rem, calc(100% - 2rem));
}

.card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid #000;
  border-radius: 0;
  padding: 0.7rem 1rem;
  cursor: pointer;
  background: #fff;
  color: #000;
  text-align: center;
}

.btn:hover:not(:disabled) {
  transform: translate(-0.2rem, -0.2rem);
  box-shadow: var(--shadow);
}

.btn:active:not(:disabled),
.btn:disabled {
  transform: none;
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

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

.grid-catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid #000;
}

.product-card:hover {
  transform: translate(-0.2rem, -0.2rem);
  box-shadow: var(--shadow);
}

.product-card-cover {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 7 / 5;
  border-bottom: 1px solid #000;
  background: #fff;
}

.product-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-price {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 1;
}

.product-card-body {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 1rem 1rem;
}

.product-card-body h2 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="product"] {
  background: #f4f4f0;
  color: #000;
}

body[data-page="product"] .error-banner {
  width: min(42.5rem, calc(100% - 2rem));
  margin: 0 auto 1rem;
}

.product-page {
  padding: 0.5rem 1rem 3rem;
}

.product-sheet {
  width: min(42.5rem, 100%);
  margin: 0 auto;
  background: #fff;
  border: 1px solid #000;
  color: #000;
}

.product-sheet-cover {
  margin: 0;
  background: #fff;
  border-bottom: 1px solid #000;
  aspect-ratio: 7 / 5;
  overflow: hidden;
}

.product-sheet-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-sheet-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 13.75rem;
}

.product-sheet-main {
  min-width: 0;
  border-right: 1px solid #000;
}

.product-sheet-title {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  padding: 1.15rem 1.25rem 1.05rem;
}

.product-sheet-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.35rem;
  padding: 0.55rem 1.25rem;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
}

.price-ribbon {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 1.85rem;
  padding: 0 1.15rem 0 0.7rem;
  background: #ff90e8;
  color: #000;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  clip-path: polygon(
    0 0,
    calc(100% - 0.7rem) 0,
    100% 50%,
    calc(100% - 0.7rem) 100%,
    0 100%
  );
}

.product-sheet-seller {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-left: 1rem;
  border-left: 1px solid #000;
  min-height: 1.85rem;
}

.product-sheet-seller a {
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.product-sheet-description {
  padding: 1.15rem 1.25rem 1.5rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.product-sheet-buy {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem 1rem 1.25rem;
}

.btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.65rem;
  padding: 0 1rem;
  background: #ff90e8;
  color: #000;
  border: 1px solid #000;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
}

.btn-buy:hover {
  transform: translate(-0.2rem, -0.2rem);
  box-shadow: 0.2rem 0.2rem 0 #000;
}

.avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid #000;
  background: #ff90e8;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #000;
}

.grid-checkout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(22rem, 1fr);
  gap: 3rem;
  align-items: start;
}

.cart-list,
.pay-card {
  overflow: hidden;
}

.cart-item {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 1rem;
  padding: 1.25rem;
  align-items: center;
}

.thumb {
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid #000;
  overflow: hidden;
  background: #fff;
}

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

.cart-item h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
}

.cart-totals {
  display: grid;
  gap: 0.85rem;
  padding: 1.25rem;
  border-top: 1px solid #000;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.row.total {
  font-size: 1.15rem;
  font-weight: 700;
}

.pay-card {
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.fieldset {
  display: grid;
  gap: 0.4rem;
}

.fieldset label {
  font-size: 0.95rem;
}

.input {
  width: 100%;
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  padding: 0.8rem 0.85rem;
  outline: none;
}

.input:focus {
  box-shadow: 0.2rem 0.2rem 0 #000;
}

.fieldset.danger label,
.fieldset.danger .input {
  color: var(--danger-color);
}

.fieldset.danger .input {
  border-color: var(--danger-color);
  box-shadow: none;
}

.exp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.alert {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #000;
  background: #fff;
}

.alert.info {
  background: color-mix(in srgb, var(--info-color) 22%, var(--background));
}

.error-banner {
  color: var(--danger-color);
  font-size: 0.95rem;
}

.receipt {
  max-width: 40rem;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.receipt h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
}

.receipt-copy,
.receipt-summary {
  display: grid;
  gap: 0.75rem;
  padding: 1.25rem;
}

.receipt-summary {
  border-top: 1px solid #000;
}

#pending-code-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

@media (max-width: 900px) {
  .product-sheet-body {
    grid-template-columns: 1fr;
  }

  .product-sheet-main {
    border-right: 0;
    border-bottom: 1px solid #000;
  }

  .grid-checkout,
  .exp-grid {
    grid-template-columns: 1fr;
  }

  .page {
    width: min(100% - 1.5rem, 75.25rem);
  }

  .cart-item {
    grid-template-columns: 3.5rem 1fr;
  }

  .cart-item .price {
    grid-column: 2;
  }

  .grid-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}
