/* Carte cadeau : carte + configurateur
   @file carte_cadeau/assets/giftcard.css */

:root {
  --gc-sage: #577573;
  --gc-sage-dark: #435c5a;
  --gc-cream: #f7f4ec;
  --gc-sand: #E7E5D3;
  --gc-ink: #2f3a39;
  --gc-overlay: .86; /* opacité du voile par défaut, surchargée par fond (manager, Fonds de carte) */
}

/* ------------------------------------------------------------------ */
/* Carte (ratio A5 paysage 210 x 148). Tailles en cqw : la carte      */
/* s'adapte à toute largeur, aperçu comme impression.                 */
/* ------------------------------------------------------------------ */
.gc-card {
  container-type: inline-size;
  --gc-u: 1cqw; /* 1 % de la largeur de la carte (écran) */
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 148;
  overflow: hidden;
  border-radius: 12px;
  background: var(--gc-cream);
  color: var(--gc-ink);
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.gc-card__bg {
  position: absolute;
  inset: 0;
  background: url('bg_01.jpg') 72% center / cover no-repeat;
}

/* voile crème à gauche pour la lisibilité, l'image respire à droite */
.gc-card__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(247, 244, 236, var(--gc-overlay)) 0%,
    rgba(247, 244, 236, var(--gc-overlay)) 48%,
    rgba(247, 244, 236, calc(var(--gc-overlay) * .4)) 72%,
    rgba(247, 244, 236, calc(var(--gc-overlay) * .1)) 100%);
}

.gc-card__body {
  position: absolute;
  left: calc(6 * var(--gc-u));
  top: calc(5 * var(--gc-u));
  width: calc(52 * var(--gc-u));
  display: flex;
  flex-direction: column;
  gap: calc(1.6 * var(--gc-u));
}

.gc-card__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: calc(7.6 * var(--gc-u));
  font-weight: 600;
  line-height: 1;
  color: var(--gc-sage-dark);
  margin-bottom: calc(1 * var(--gc-u));
}

.gc-card__label {
  display: block;
  font-size: calc(1.55 * var(--gc-u));
  letter-spacing: calc(.25 * var(--gc-u));
  text-transform: uppercase;
  color: var(--gc-sage);
  margin-bottom: calc(.3 * var(--gc-u));
}

.gc-card__value {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: calc(3.9 * var(--gc-u));
  font-weight: 600;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.gc-card__msg {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: calc(2.5 * var(--gc-u));
  line-height: 1.3;
  border-left: calc(.35 * var(--gc-u)) solid var(--gc-sage);
  padding-left: calc(1.6 * var(--gc-u));
  max-height: calc(10 * var(--gc-u));
  overflow: hidden;
  overflow-wrap: anywhere;
}

.gc-card__amount span:last-child {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: calc(7 * var(--gc-u));
  font-weight: 700;
  line-height: 1;
  color: var(--gc-sage-dark);
}

.gc-card__foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: calc(2 * var(--gc-u));
  padding: calc(1.8 * var(--gc-u)) calc(17 * var(--gc-u)) calc(2 * var(--gc-u)) calc(6 * var(--gc-u));
  font-size: calc(1.45 * var(--gc-u));
  line-height: 1.5;
  background: rgba(247, 244, 236, .92);
  border-top: calc(.15 * var(--gc-u)) solid rgba(87, 117, 115, .35);
}

.gc-card__meta {
  text-align: right;
  white-space: nowrap;
}

.gc-card__meta span { display: block; }

.gc-card__ref {
  font-weight: 700;
  letter-spacing: calc(.2 * var(--gc-u));
  color: var(--gc-sage-dark);
}

.gc-card__qr {
  position: absolute;
  right: calc(3 * var(--gc-u));
  bottom: calc(2 * var(--gc-u));
  width: calc(11 * var(--gc-u));
  height: calc(11 * var(--gc-u));
  padding: calc(.8 * var(--gc-u));
  background: #fff;
  border-radius: calc(.8 * var(--gc-u));
  opacity: .9;
}

.gc-card__qr img,
.gc-card__qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Impression : unités fixes en mm (Chrome gère mal les cqw à l'impression,
   les textes étaient coupés). 1 % de 210 mm = 2,1 mm */
@media print {
  .gc-card { container-type: normal; --gc-u: 2.1mm; width: 210mm; height: 148mm; }
}

/* ------------------------------------------------------------------ */
/* Configurateur                                                      */
/* ------------------------------------------------------------------ */
/* padding-top/bottom seulement : un shorthand écraserait les gouttières latérales du .container */
.gc-page { padding-top: 40px; padding-bottom: 60px; }

.gc-page h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  color: var(--gc-sage-dark);
  margin-bottom: 30px;
}

.gc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 48px;
  align-items: start;
}

.gc-preview { position: sticky; top: calc(var(--fg-h-scrolled, 64px) + 20px); } /* sous le header sticky */
/* texte de présentation (manager, Pages, slug carte-cadeau) */
.gc-intro { max-width: 75ch; margin: -10px 0 36px; line-height: 1.65; color: #444; }
.gc-intro > :last-child { margin-bottom: 0; }
.gc-intro ul { padding-left: 1.2em; }
.gc-intro li { margin-bottom: .5em; }

.gc-preview__intro { margin-top: 22px; font-size: .95rem; line-height: 1.6; color: #555; }
.gc-preview__intro p { margin-bottom: .8em; }
.gc-preview__intro > :last-child { margin-bottom: 0; }
.gc-preview__intro ul { padding-left: 1.1em; margin-bottom: .8em; }
.gc-preview__intro li { margin-bottom: .45em; }
.gc-preview__intro a { color: var(--gc-sage-dark); font-weight: 700; }
.gc-preview__intro a { color: var(--gc-sage-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.gc-section { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid #e3e0d4; }
.gc-section:last-of-type { border-bottom: 0; }

.gc-section h2 {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gc-ink);
  margin-bottom: 12px;
}

.gc-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.gc-amount {
  border: 1px solid #d9d6c9;
  background: #fff;
  padding: 12px 6px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.gc-amount:hover { border-color: var(--gc-sage); }
.gc-amount.is-active { border: 2px solid var(--gc-sage); background: #eef3f2; }

.gc-other { margin-top: 10px; display: none; }
.gc-other.is-open { display: block; }

.gc-input {
  position: relative;
  margin-bottom: 12px;
}

.gc-input label {
  display: block;
  font-size: .78rem;
  color: #666;
  margin-bottom: 3px;
}

.gc-input input,
.gc-input textarea {
  width: 100%;
  border: 1px solid #d9d6c9;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 1rem;
  background: #fff;
}

.gc-input input:focus,
.gc-input textarea:focus {
  outline: none;
  border-color: var(--gc-sage);
  box-shadow: 0 0 0 3px rgba(87, 117, 115, .15);
}

.gc-input textarea { min-height: 80px; resize: vertical; font-family: inherit; }

.gc-count { text-align: right; font-size: .75rem; color: #888; margin-top: 2px; }

.gc-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.gc-consent { display: flex; gap: 10px; font-size: .82rem; line-height: 1.45; color: #555; }
.gc-consent input { margin-top: 3px; flex: none; }

.gc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.gc-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.gc-total { font-size: 1.6rem; font-weight: 800; color: var(--gc-ink); }

.gc-btn {
  background: var(--gc-sage);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 14px 26px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
}

.gc-btn:hover { background: var(--gc-sage-dark); }
.gc-btn[disabled] { opacity: .6; cursor: wait; }

.gc-alert { padding: 12px 14px; border-radius: 4px; margin-top: 14px; font-size: .92rem; }
.gc-alert--error { background: #fbeaea; color: #8a2b2b; }

.gc-done {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.gc-done i { font-size: 2.6rem; color: var(--gc-sage); margin-bottom: 14px; }

.gc-wero {
  background: var(--gc-cream);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 20px auto;
  max-width: 460px;
  text-align: left;
  line-height: 1.8;
}

.gc-wero__ref { font-size: 1.5rem; font-weight: 800; letter-spacing: .06em; color: var(--gc-sage-dark); }

@media (max-width: 991px) {
  .gc-grid { grid-template-columns: 1fr; gap: 28px; }
  /* aperçu au-dessus du formulaire, texte de présentation après */
  .gc-preview { display: contents; }
  .gc-preview > .gc-card { order: -1; }
  .gc-preview__intro { order: 1; margin-top: 0; }
}

@media (max-width: 575px) {
  .gc-page { padding-left: 20px; padding-right: 20px; padding-top: 24px; }
}

@media (max-width: 480px) {
  .gc-amounts { grid-template-columns: repeat(2, 1fr); }
  .gc-row2 { grid-template-columns: 1fr; }
  .gc-submit { flex-direction: column; align-items: stretch; text-align: center; }
}
