/* Carte cadeau : formulaire de la fiche (custom-carte-cadeau.php). Pastilles au style du « Pour » des charms à l'unité. */
.ody-cc {
  display: grid;
  gap: 2.2rem;
  margin: 0 0 2.4rem;
  color: #3a343c;
  font-family: 'Manrope', sans-serif;
}
.ody-cc__bloc {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ody-cc__titre {
  margin: 0 0 1rem;
  padding: 0;
  font: 600 1.2rem/1.2 'Manrope', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ody-cc__choix {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.ody-cc__pastille {
  position: relative;
  cursor: pointer;
}
.ody-cc__pastille input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.ody-cc__pastille span {
  display: block;
  height: 100%;
  padding: 1.1rem 1.8rem;
  border: 1px solid #d8d1dc;
  border-radius: 4px;
  background: #fff;
  color: #3a343c;
  font: 500 1.4rem/1.2 'Manrope', sans-serif;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ody-cc__pastille span small {
  display: block;
  margin-top: 0.4rem;
  font-size: 1.2rem;
  font-weight: 400;
  opacity: 0.75;
}
.ody-cc__pastille input:checked + span {
  border-color: #3a343c;
  background: #3a343c;
  color: #fff;
}
.ody-cc__pastille input:focus-visible + span {
  outline: 2px solid #3a343c;
  outline-offset: 2px;
}
.ody-cc__choix--envoi {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Montant libre et e-mail : visibles seulement quand on les a choisis */
.ody-cc .ody-cc__libre,
.ody-cc .ody-cc__champ--email,
.ody-cc .ody-cc__champ--date {
  display: none;
}
.ody-cc:has(input[name='ody_cc_choix'][value='libre']:checked) .ody-cc__libre,
.ody-cc.is-libre .ody-cc__libre {
  display: block;
  margin-top: 1.2rem;
}
.ody-cc:has(input[name='ody_cc_envoi'][value='direct']:checked) .ody-cc__champ--email,
.ody-cc:has(input[name='ody_cc_envoi'][value='direct']:checked) .ody-cc__champ--date,
.ody-cc.is-direct .ody-cc__champ--email,
.ody-cc.is-direct .ody-cc__champ--date {
  display: flex;
}
.ody-cc__libre label {
  display: block;
  margin-bottom: 0.6rem;
  font: 500 1.3rem/1.2 'Manrope', sans-serif;
}
.ody-cc__euro {
  position: relative;
  max-width: 18rem;
}
.ody-cc__euro span {
  position: absolute;
  top: 50%;
  right: 1.4rem;
  transform: translateY(-50%);
  font: 500 1.5rem/1 'Manrope', sans-serif;
  pointer-events: none;
}

.ody-cc__champs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem 1.6rem;
}
.ody-cc__champ {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
}
.ody-cc__champ--mot {
  grid-column: 1 / -1;
}
.ody-cc__champ label {
  font: 500 1.3rem/1.2 'Manrope', sans-serif;
}
.ody-cc__champ label span {
  display: inline;
  font-weight: 400;
  opacity: 0.6;
}
.ody-cc input[type='text'],
.ody-cc input[type='email'],
.ody-cc input[type='number'],
.ody-cc textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 1.1rem 1.2rem;
  border: 1px solid #d8d1dc;
  border-radius: 4px;
  background: #fff;
  color: #3a343c;
  font: 400 1.6rem/1.3 'Manrope', sans-serif; /* 16 px : pas de zoom automatique sur iPhone */
}
/* Le thème cache les champs nombre du formulaire d'achat (quantité) : pas celui du montant libre */
.ody-cc .ody-cc__euro input[type='number'] {
  display: block;
  height: auto;
  padding-right: 3.4rem;
  -moz-appearance: textfield;
}
.ody-cc input:focus,
.ody-cc textarea:focus {
  border-color: #3a343c;
  outline: none;
}
.ody-cc textarea {
  min-height: 8.4rem;
  resize: vertical;
}
.ody-cc__compteur {
  align-self: flex-end;
  font-size: 1.1rem;
  opacity: 0.6;
}
.ody-cc__info {
  margin: 0;
  padding: 1.2rem 1.4rem;
  border-radius: 4px;
  background: #f4eff6;
  color: #6e4a5a;
  font-size: 1.3rem;
  line-height: 1.5;
}
.ody-cc-solde {
  font-weight: 400;
  opacity: 0.7;
}
/* Panier : pas de +/- sur une carte cadeau (une ligne = une carte) */
.cart-summary__item:has(.ody-cc-ligne) .cart-summary__item__qty-wrapper {
  display: none;
}


/* ---------- Date d'envoi (Mathilde 18/11) ---------- */
.ody-cc__quand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
}
.ody-cc input[type='date'],
.ody-cc select {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 4.4rem;
  margin: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid #d8d1dc;
  border-radius: 4px;
  background-color: #fff;
  color: #3a343c;
  font: 400 1.6rem/1.3 'Manrope', sans-serif; /* 16 px : pas de zoom sur iPhone */
  -webkit-appearance: none;
  appearance: none;
}
.ody-cc input[type='date']::-webkit-date-and-time-value {
  text-align: left;
}
.ody-cc select {
  padding-right: 3.2rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%233a343c' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 1.2rem center / 1rem;
  cursor: pointer;
}
.ody-cc input[type='date']:focus,
.ody-cc select:focus {
  border-color: #3a343c;
  outline: none;
}
.ody-cc__aide {
  font-size: 1.2rem;
  line-height: 1.4;
  color: #6e4a5a;
}
.ody-cc__aide button {
  margin: 0 0 0 0.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: #3a343c;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
  cursor: pointer;
}

/* ---------- Aperçu en direct de la carte (même dessin que la vraie carte, en px de la maquette 840 × 594) ----------
   Textes agrandis le 21/11 (Mathilde : « on a du mal à lire ») : mêmes tailles dans custom-carte-cadeau-visuel.php. */
.ody-cc-carte {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 840 / 594;
  overflow: hidden;
  background: #eeecee url(carte-cadeau/fond.jpg) center / cover no-repeat;
  color: #3a343c;
  text-align: center;
}
.ody-cc-carte__in {
  --p: calc(100cqw / 840);
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(44 * var(--p)) calc(70 * var(--p)) calc(40 * var(--p));
  font-family: 'Manrope', sans-serif;
}
/* Spécificité renforcée : la galerie du thème met ses images en 100 % × 100 % */
.ody-cc-carte img.ody-cc-carte__logo {
  display: block;
  width: auto;
  height: calc(62 * var(--p));
  max-width: none;
  object-fit: contain !important;
}
.ody-cc-carte__titre {
  margin-top: calc(12 * var(--p));
  color: #6e4a5a;
  font: italic 400 calc(34 * var(--p)) / 1.25 'Erode', serif;
  letter-spacing: 0.01em;
}
.ody-cc-carte__montant {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: calc(6 * var(--p));
  font: 400 calc(88 * var(--p)) / 1 'Erode', serif;
  letter-spacing: -0.01em;
}
.ody-cc-carte__chiffres {
  position: relative;
  display: inline-grid;
  justify-items: center;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ody-cc-carte__nb {
  grid-area: 1 / 1;
  white-space: nowrap;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease, filter 0.4s ease;
}
.ody-cc-carte__nb.is-entree {
  transform: translateY(0.4em);
  opacity: 0;
  filter: blur(0.05em);
}
.ody-cc-carte__nb.is-sortie {
  transform: translateY(-0.4em);
  opacity: 0;
  filter: blur(0.05em);
}
.va-bas > .ody-cc-carte__nb.is-entree {
  transform: translateY(-0.4em);
}
.va-bas > .ody-cc-carte__nb.is-sortie {
  transform: translateY(0.4em);
}
.ody-cc-carte__montant sup {
  margin: calc(4 * var(--p)) 0 0 calc(6 * var(--p));
  font-size: 0.42em;
  line-height: 1;
  vertical-align: baseline;
}
.ody-cc-carte__qui {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: calc(12 * var(--p));
  max-width: calc(740 * var(--p));
  margin-top: calc(14 * var(--p));
  font: 500 calc(19 * var(--p)) / 1.4 'Manrope', sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ody-cc-carte__qui b {
  font-weight: 700;
  transition: opacity 0.3s ease;
}
.ody-cc-carte__qui.is-deux > span {
  flex-basis: 100%;
}
.ody-cc-carte__qui.is-deux .ody-cc-carte__point {
  display: none;
}
.ody-cc-carte__mot {
  max-width: calc(640 * var(--p));
  max-height: calc(133 * var(--p));
  margin-top: calc(10 * var(--p));
  overflow: hidden;
  color: #6e4a5a;
  font: 400 calc(42 * var(--p)) / 1.05 'Reenie Beanie', cursive;
  white-space: pre-line;
  overflow-wrap: anywhere;
  transition: opacity 0.3s ease;
}
.ody-cc-carte__qui.is-deux + .ody-cc-carte__mot {
  max-height: calc(107 * var(--p));
}
.ody-cc-carte__mot.t37 { font-size: calc(37 * var(--p)); }
.ody-cc-carte__mot.t32 { font-size: calc(32 * var(--p)); }
.ody-cc-carte__mot.t28 { font-size: calc(28 * var(--p)); }
.ody-cc-carte .is-vide {
  opacity: 0.5;
}
.ody-cc-carte__bas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(10 * var(--p));
  margin-top: auto;
}
.ody-cc-carte__code {
  padding: calc(13 * var(--p)) calc(22 * var(--p)) calc(12 * var(--p));
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 calc(2 * var(--p)) calc(10 * var(--p)) rgba(58, 52, 60, 0.07);
  font: 700 calc(24 * var(--p)) / 1.2 'Manrope', sans-serif;
  letter-spacing: 0.16em;
}
.ody-cc-carte__code small {
  display: block;
  margin-bottom: calc(3 * var(--p));
  font-size: calc(12 * var(--p));
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.65;
}
.ody-cc-carte__valid {
  font-size: calc(16 * var(--p));
  line-height: 1.3;
  letter-spacing: 0.03em;
  opacity: 0.85;
}
/* Reflet qui passe sur la carte quand le montant change */
.ody-cc-carte::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.55) 50%, transparent 62%);
  transform: translateX(-130%);
  pointer-events: none;
}
.ody-cc-carte.is-brille::after {
  animation: ody-cc-reflet 0.95s cubic-bezier(0.3, 0.6, 0.3, 1);
}
@keyframes ody-cc-reflet {
  from { transform: translateX(-130%); }
  to { transform: translateX(130%); }
}

/* Téléphone : l'aperçu sous le petit mot (sur ordinateur, il est sur la photo, toujours visible) */
.ody-cc__apercu {
  display: none;
}
.ody-cc__apercu .ody-cc-carte {
  border-radius: 1.2rem;
  box-shadow: 0 1.6rem 3rem -1.4rem rgba(58, 52, 60, 0.35), 0 0.3rem 0.8rem rgba(58, 52, 60, 0.08);
}

/* Ordinateur et téléphone : la photo de la fiche devient la carte en direct (même mise en scène que la photo) */
.woocommerce-product-gallery__image:has(> .ody-cc-scene) {
  position: relative;
}
.ody-cc-scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  container-type: size;
  overflow: hidden;
  background: #eeecee url(carte-cadeau/fond.jpg) center / cover no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.ody-cc-scene.is-visible {
  opacity: 1;
}
.ody-cc-scene__pile {
  --u: min(calc(100cqw / 1080), calc(100cqh / 1350));
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(840 * var(--u));
  height: calc(594 * var(--u));
  transform: translate(-50%, -50%);
}
.ody-cc-scene__dos,
.ody-cc-scene__face {
  position: absolute;
  overflow: hidden;
  box-shadow: 0 calc(34 * var(--u)) calc(60 * var(--u)) calc(-24 * var(--u)) rgba(58, 52, 60, 0.3), 0 calc(6 * var(--u)) calc(16 * var(--u)) rgba(58, 52, 60, 0.07);
}
.ody-cc-scene__dos {
  left: 5%;
  top: 5%;
  width: 90%;
  height: 90%;
  border-radius: calc(18 * var(--u));
  background: #eeecee url(carte-cadeau/fond.jpg) center / cover no-repeat;
}
.ody-cc-scene__dos--1 {
  transform: translate(calc(-22 * var(--u)), calc(-30 * var(--u))) rotate(-7deg);
}
.ody-cc-scene__dos--2 {
  transform: translate(calc(26 * var(--u)), calc(20 * var(--u))) rotate(5deg);
}
.ody-cc-scene__face {
  left: 4%;
  top: 4%;
  width: 92%;
  height: 92%;
  border-radius: calc(18.4 * var(--u));
  transform: translate(0, calc(4 * var(--u))) rotate(-1deg);
}
.ody-cc-scene.is-visible .ody-cc-scene__face {
  animation: ody-cc-pose 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
}
@keyframes ody-cc-pose {
  from { transform: translate(0, calc(26 * var(--u))) rotate(-3.5deg); }
  to { transform: translate(0, calc(4 * var(--u))) rotate(-1deg); }
}

@media (max-width: 767px) {
  .ody-cc__choix--envoi,
  .ody-cc__champs {
    grid-template-columns: 1fr;
  }
  .ody-cc__apercu {
    display: block;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ody-cc-carte__chiffres,
  .ody-cc-carte__nb,
  .ody-cc-scene {
    transition: none;
  }
  .ody-cc-carte.is-brille::after,
  .ody-cc-scene.is-visible .ody-cc-scene__face {
    animation: none;
  }
}

/* ---------- Page « Merci, votre commande a été reçue » : la carte cadeau prête (custom-carte-cadeau.php) ---------- */
/* La page est une colonne flex : la carte vient juste sous « Merci. Votre commande a été reçue. » */
.woocommerce-order-received__container:has(> .ody-cc-merci) > * {
  order: 2;
}
.woocommerce-order-received__container:has(> .ody-cc-merci) > .woocommerce-order-received__message {
  order: 0;
}
.woocommerce-order-received__container > .ody-cc-merci {
  order: 1;
  align-self: stretch;
}
.ody-cc-merci {
  margin: 0;
  padding: 2.8rem 2.4rem 2.4rem;
  border-radius: 1.6rem;
  background: #f6f2f8;
  color: #3a343c;
  text-align: center;
}
.ody-cc-merci__titre {
  margin: 0 0 2rem;
  font-family: 'Erode', serif;
  font-size: 2.8rem;
  font-style: italic;
  line-height: 1.2;
  color: #6e4a5a;
}
.ody-cc-merci img.ody-cc-merci__carte {
  display: block;
  margin: 0 auto 2rem;
  width: 100%;
  max-width: 48rem;
  height: auto;
  border-radius: 1.2rem;
  box-shadow: 0 1.6rem 3rem -1.4rem rgba(58, 52, 60, 0.35), 0 0.3rem 0.8rem rgba(58, 52, 60, 0.06);
}
.ody-cc-merci__code {
  margin: 0 0 1.8rem;
  font-family: 'Manrope', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}
.ody-cc-merci__code strong {
  font-weight: 700;
  letter-spacing: 0.12em;
}
.ody-cc-merci__actions {
  margin: 0 0 1.4rem;
}
.ody-cc-merci__bouton {
  display: inline-block;
  padding: 1.4rem 2.8rem;
  border-radius: 99.9rem;
  background: #3a343c;
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}
.ody-cc-merci__bouton:hover,
.ody-cc-merci__bouton:focus-visible {
  background: #6e4a5a;
  color: #fff;
}
.ody-cc-merci__texte {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.3rem;
  line-height: 1.5;
  color: #6b6470;
}
.ody-cc-lien a {
  color: #6e4a5a;
  font-weight: 700;
}
@media (max-width: 767px) {
  .ody-cc-merci {
    padding: 2.2rem 1.6rem 2rem;
  }
  .ody-cc-merci__titre {
    font-size: 2.4rem;
  }
}
