/* ============================================================
   REGALA ART: catàleg (regala.html) i fitxa (regal.html)
   La fitxa fa servir la mateixa estructura que la de les làmines (lamines.css)
   ============================================================ */

/* ---------- Catàleg ---------- */
.gifts { padding: clamp(84px, 9vw, 140px) clamp(16px, 6.3vw, 100px) clamp(40px, 6vw, 90px); }
.gifts__grid {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: 1240px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(36px, 5vw, 80px) clamp(40px, 7.5vw, 146px);
}
.gift { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 90ms + 100ms); }
.gift a { display: block; color: var(--red); text-decoration: none; }
.gift__frame {
  display: block; overflow: hidden;
  box-shadow: 3px 4px 5px rgba(60, 0, 0, .35);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s ease;
}
.gift__frame img { width: 100%; height: 100%; object-fit: cover; }
.gift__meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1em;
  margin-top: .4em;
  font: 700 clamp(17px, 1.9vw, 30px)/1 var(--serif); text-transform: none;
}
.gift__price { flex: none; }
.gift a:hover .gift__frame, .gift a:focus-visible .gift__frame {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 8px 12px 16px rgba(60, 0, 0, .3);
}
.gift:nth-child(even) a:hover .gift__frame, .gift:nth-child(even) a:focus-visible .gift__frame { transform: translateY(-6px) rotate(1deg); }
.gift a:focus-visible { outline: none; }
.gift a:focus-visible .gift__title { text-decoration: underline; }

/* ---------- Fitxa ---------- */
.gift-page { align-items: start; }
.gift-page__media { overflow: visible; }
.gift-page__media img {
  aspect-ratio: auto; height: auto; object-fit: contain;
  box-shadow: 3px 4px 6px rgba(60, 0, 0, .3);
}
.gift-form { min-height: 100%; }
.gift-form .product__price { margin-top: .5em; }
.gift-form .product__desc { text-align: justify; hyphens: auto; }

/* files amb camps (comentaris, nom, correu) i fitxers */
.row--input, .row--files { grid-template-columns: 1fr 2fr; cursor: text; }
.row--files { grid-template-columns: 1fr auto auto; cursor: default; }
.gift-input {
  width: 100%; min-width: 0; border: 0; border-radius: 0;
  background: #fff1d6; color: var(--red);
  font: 700 clamp(13px, calc(var(--w) * 0.017), 18px)/1.3 var(--serif);
  padding: .3em .5em; resize: none; overflow: hidden;
}
.gift-input::placeholder { color: rgba(207, 0, 0, .4); font-weight: 400; }
.gift-input:focus { outline: 2px solid var(--red); outline-offset: 0; }
.gift-pick {
  position: relative; overflow: hidden; cursor: pointer;
  padding: .3em 1.4em; background: #ffd67a; color: var(--red);
  font: 700 clamp(12px, calc(var(--w) * 0.015), 16px)/1.2 var(--serif);
  transition: filter .2s ease;
}
.gift-pick:hover { filter: brightness(1.05); }
.gift-pick:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.gift-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gift-files {
  list-style: none; margin: 0; padding: 0; min-width: 0;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 10px;
  font: 400 clamp(11px, calc(var(--w) * 0.013), 14px)/1.2 var(--text);
}
.gift-files li { display: flex; gap: 4px; align-items: center; max-width: 14em; }
.gift-files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-files button { border: 0; background: none; color: var(--red); cursor: pointer; font: 700 1.2em/1 var(--serif); padding: 0 2px; }

.gift-consent {
  display: flex; gap: .6em; align-items: start; margin-top: 1em;
  font: 400 clamp(12px, calc(var(--w) * 0.013), 14px)/1.35 var(--text); text-transform: none; cursor: pointer;
}
.gift-consent input { accent-color: var(--red); width: 1.1em; height: 1.1em; margin: .1em 0 0; flex: none; }
.gift-consent a { color: var(--red); }

/* pendent d'omplir */
.gift-form .is-missing { box-shadow: inset 0 0 0 2px var(--red); background: rgba(255, 255, 255, .25); }
.gift-consent.is-missing { box-shadow: none; background: none; text-decoration: underline wavy; text-underline-offset: 3px; }

.gift-thanks { margin-top: calc(var(--w) * 0.04); animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
.gift-thanks__title { margin: 0; font: 700 calc(var(--w) * 0.05)/1 var(--serif); }

@media (max-width: 900px) {
  .gifts__grid { grid-template-columns: 1fr; max-width: 520px; }
  .gift-thanks__title { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .gift, .gift-thanks { animation: none; }
}
.gift-page .product__title { text-transform: none; }

/* més exemples, petits sota el dibuix principal */
.gift-page__media img { transition: opacity .25s ease, transform .35s ease; }
.gift-page__media img.is-swapping { opacity: 0; transform: scale(.985); }
.gift-thumbs { display: flex; flex-wrap: wrap; gap: calc(var(--w) * 0.012); margin-top: calc(var(--w) * 0.012); }
.gift-thumbs[hidden] { display: none; }
.gift-thumb {
  position: relative; display: block;
  width: calc(var(--w) * 0.085); aspect-ratio: 1; padding: 0; border: 0; cursor: pointer; background: none;
  box-shadow: 2px 3px 4px rgba(60, 0, 0, .3); opacity: .8;
  transition: transform .2s ease, opacity .2s ease;
  outline: none;
}
.gift-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* marc de la seleccionada: just a la vora del dibuix (per sobre de la imatge) */
.gift-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 3px transparent; transition: box-shadow .2s ease;
}
.gift-thumb:hover { opacity: 1; transform: translateY(-2px); }
.gift-thumb[aria-pressed="true"] { opacity: 1; }
.gift-thumb[aria-pressed="true"]::after { box-shadow: inset 0 0 0 3px var(--red); }
.gift-thumb:focus-visible::after { box-shadow: inset 0 0 0 3px var(--blue); }
@media (max-width: 900px) { .gift-thumb { width: 64px; } }
