/* Lista de presentes. Herda tokens, fontes, botões e o palco de /styles.css. */

body.gifts { overflow-y: auto; }
body.has-modal { overflow: hidden; }

/* o jardim fica atrás, mais apagado: aqui a leitura é longa */
.gifts__veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(248, 241, 229, .5);
}
.gifts__veil .mist__layer { opacity: .9; }

.gifts__body {
  position: relative;
  z-index: 1;
  padding: max(5svh, calc(env(safe-area-inset-top) + 18px)) 0 calc(28px + env(safe-area-inset-bottom));
}

.gifts__head {
  width: min(88vw, 420px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  container-type: inline-size;
  text-shadow: 0 0 12px rgba(252, 247, 238, .95), 0 0 4px rgba(252, 247, 238, .9);
}
.gifts .a2__name { font-size: 15cqw; }

.letter {
  margin-top: 5cqw;
  font-style: italic;
  font-size: max(16px, 4.3cqw);
  line-height: 1.45;
  color: var(--sepia);
}
.letter p + p { margin-top: .7em; }
.letter__sign {
  font-family: var(--script);
  font-style: normal;
  font-size: 1.9em;
  line-height: 1.1;
  color: var(--bronze);
}

/* entrada dos elementos (aqui não há vídeo antes) */
.gifts .r { animation: rise 1s cubic-bezier(.2, .7, .2, 1) calc(.1s + var(--i, 0) * .08s) both; }

/* ───────── cards ───────── */

.grid {
  list-style: none;
  margin: 34px auto 0;
  padding: 0;
  width: min(92vw, 900px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  appearance: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 10px 16px;
  border-radius: 18px;
  background: #FBF6EE;
  box-shadow: inset 0 0 0 1px rgba(148, 102, 84, .16),
              0 10px 26px -16px rgba(102, 74, 59, .45);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(148, 102, 84, .28), 0 16px 30px -16px rgba(102, 74, 59, .5); }
.card:active { transform: scale(.97); }
.card:focus-visible { outline: 2px solid var(--bronze); outline-offset: 3px; }
.card__img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.card__title {
  margin-top: 2px;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.15;
  color: var(--sepia);
  text-wrap: balance;
}
.card__desc {
  margin-top: 6px;
  font-style: italic;
  font-weight: 500;
  font-size: 16.5px;
  line-height: 1.3;
  color: var(--sepia);
  text-wrap: pretty;
}

.gifts__foot {
  width: min(88vw, 340px);
  margin: 36px auto 0;
  display: flex;
  flex-direction: column;
}

/* ───────── modal (folha de baixo no celular) ───────── */

.sheet {
  margin: auto auto 0;
  width: 100%;
  max-width: 520px;
  max-height: 92svh;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: #FBF6EE;
  color: var(--sepia);
  box-shadow: 0 -10px 40px rgba(52, 34, 24, .25);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet[open] { animation: sheet-up .45s cubic-bezier(.2, .8, .2, 1) both; }
.sheet::backdrop {
  background: rgba(52, 34, 24, .42);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade-in .3s ease both;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 640px) {
  .sheet { margin: auto; border-radius: 24px; max-height: 90vh; }
}

.sheet__inner {
  position: relative;
  padding: 14px 24px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.sheet__inner::before {
  content: "";
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(148, 102, 84, .25);
  margin-bottom: 4px;
}
@media (min-width: 640px) { .sheet__inner::before { display: none; } }
.sheet__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(148, 102, 84, .08);
  color: var(--sepia);
  cursor: pointer;
}
.sheet__close svg { width: 18px; height: 18px; }
.sheet__close:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
.sheet__img { width: min(58%, 240px); height: auto; aspect-ratio: 1; margin-top: 4px; }
.sheet__title {
  margin-top: 2px;
  font-weight: 600;
  font-size: 25px;
  line-height: 1.15;
  color: var(--sepia);
  text-wrap: balance;
}
.sheet__desc {
  margin-top: 8px;
  font-style: italic;
  font-weight: 500;
  font-size: 18.5px;
  line-height: 1.4;
  color: var(--sepia);
  max-width: 34ch;
}

.sheet__status {
  min-height: 1.4em;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-soft);
}
.sheet__status.is-ok { color: #55704A; }
.sheet__status svg { width: 18px; height: 18px; flex: none; }
.sheet__status.pulse { animation: status-in .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes status-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.pix {
  margin-top: 10px;
  width: 100%;
  padding: 12px 14px 13px;
  border-radius: 16px;
  background: rgba(148, 102, 84, .07);
  box-shadow: inset 0 0 0 1px rgba(148, 102, 84, .14);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pix__label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.pix__key {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: .01em;
  color: var(--sepia);
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
}
.pix__holder { font-style: italic; font-weight: 500; font-size: 16px; color: var(--sepia); }

.sheet__actions {
  margin-top: 14px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qr {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.qr[hidden] { display: none; }
.qr img {
  width: 230px;
  height: 230px;
  padding: 10px;
  border-radius: 14px;
  background: #FCF7EE;
  box-shadow: inset 0 0 0 1px rgba(148, 102, 84, .2);
}
.qr p {
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 30ch;
}

@media (prefers-reduced-motion: reduce) {
  .gifts .r, .sheet[open], .sheet::backdrop, .sheet__status.pulse { animation: none; }
}
