:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --color-bg: #f7f5f2;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-accent: #111827;
  --color-accent-contrast: #ffffff;
  --color-hover: #f3f4f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 4px 14px rgba(17, 24, 39, 0.08);
  --shadow-md: 0 10px 30px rgba(17, 24, 39, 0.18);

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;

  --transition-fast: 140ms ease;
  --transition-normal: 220ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 1px solid rgba(17, 24, 39, 0.35);
  outline-offset: 1px;
}

.modal__btn:focus-visible,
.open-modal:focus-visible,
.modal__close:focus-visible,
.modal__pix-copy:focus-visible {
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.15);
}

.page {
  padding: 2rem 1.5rem;
  min-height: 100vh;
  width: min(1200px, 100%);
  margin: 0 auto;
}

.page-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 2rem 0 1.5rem;
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 400;
  color: #1a1a1a;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

.page-header h1::before,
.page-header h1::after {
  content: '';
  display: block;
  height: 1px;
  background: #c9b99a;
  flex: 1;
}

.page-header__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px auto;
  width: fit-content;
}

.page-header__line {
  display: block;
  width: 60px;
  height: 1px;
  background: #c9b99a;
}

.page-header__diamond {
  font-size: 8px;
  color: #c9b99a;
  line-height: 1;
}

.page-header__names {
  font-family: 'Dancing Script', cursive;
  font-size: 36px;
  color: #1a1a1a;
  margin: 0;
}

.page-header__date {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #aaaaaa;
  margin-top: 10px;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 0;
}

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

@media (max-width: 520px) {
  .product-card .card-name {
    text-align: center;
  }

  .product-card .card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .product-card .card-price {
    text-align: center;
  }

  .open-modal {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.product-card .card-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card .image-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card .image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.product-card .card-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.4;
  flex: 1;
}

.product-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 0.5px solid #e8e8e8;
}

.product-card .card-price {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
}

.open-modal {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: #1a1a1a;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s;
}

.open-modal:hover {
  background: #333333;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal {
  width: 90%;
  max-width: 500px;
  max-height: min(90vh, 680px);
  border: none;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  color: var(--color-text);
  font-family: inherit;
}

.modal__body {
  padding: var(--space-4);
  display: grid;
  gap: var(--space-4);
  overflow-y: auto;
}

.modal__item-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.modal__item-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-accent);
}

.modal__pix {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.modal__pix h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.modal__pix-code {
  font-family: ui-monospace, SFMono-Regular, Menlo;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #111827;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px;
  word-break: break-all;
  min-height: 52px;
}

.modal__pix-copy {
  justify-self: stretch;
  border: 1px solid #c4c9d4;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--color-text);
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.modal__pix-copy:hover {
  background: var(--color-hover);
}

.modal__pix-copy[data-copied='true'] {
  color: #16a34a;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.modal__footer {
  padding: 0 var(--space-4) var(--space-4);
  display: grid;
  gap: var(--space-2);
}

.modal__btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    filter var(--transition-fast);
}

.modal__btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}

.modal__btn--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e8e8e8;
}

.modal__title {
  margin: 0;
}

.modal__close {
  background: #1a1a1a;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #ffffff;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
