/**
 * Fiche produit hero — layout + placeholders
 */

.sonate-product-hero {
  --sph-gap: 48px;
  --sph-image-col: 40%;
  display: grid;
  grid-template-columns: minmax(0, var(--sph-image-col)) minmax(0, 1fr);
  gap: var(--sph-gap);
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.sonate-product-hero *,
.sonate-product-hero *::before,
.sonate-product-hero *::after {
  box-sizing: border-box;
}

/* ---------- Colonne image ---------- */

.sonate-product-hero__media {
  width: 100%;
}

.sonate-product-hero__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding: 1.5rem;
  border-radius: 40px;
  border: 3px solid #040405;
  background: #fff;
  box-shadow: 12px 12px 0 0 #040405;
  overflow: hidden;
}

.sonate-product-hero__edition {
  position: absolute;
  top: 1.1rem;
  left: 1.1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 0.35em 0.85em;
  border-radius: 999px;
  background: #c8ff00;
  color: #040405;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.sonate-product-hero__img {
  display: block;
  max-width: 70%;
  max-height: 88%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.sonate-product-hero__img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 55%;
  height: 75%;
  border: 2px dashed #c5c5c5;
  border-radius: 16px;
  background: repeating-linear-gradient(
    -45deg,
    #f4f4f4,
    #f4f4f4 8px,
    #ebebeb 8px,
    #ebebeb 16px
  );
  color: #888;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}

/* ---------- Colonne contenu ---------- */

.sonate-product-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-width: 0;
}

.sonate-product-hero__title {
  margin: 0;
  color: #040405;
  font-size: clamp(2rem, 4.5vw, 3.75rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  word-break: break-word;
}

/* ---------- Badges ---------- */

.sonate-product-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sonate-product-hero__badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: #c8ff00;
  color: #040405;
  border: 2px solid #040405;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
}

/* ---------- Meta / description ---------- */

.sonate-product-hero__meta {
  margin: 0;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
}

.sonate-product-hero__description {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  line-height: 1.5;
}

.sonate-product-hero__description p {
  margin: 0 0 0.5em;
  text-align: left !important;
  width: 80%;
}

.sonate-product-hero__description p:last-child {
  margin-bottom: 0;
}

.sonate-product-hero__read-more {
  color: #fff;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sonate-product-hero__read-more:hover,
.sonate-product-hero__read-more:focus {
  opacity: 0.85;
}

/* ---------- Contenance ---------- */

.sonate-product-hero__volume {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 12rem;
  max-width: 100%;
  padding: 0.7rem 1.15rem;
  border: 1.5px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
}

.sonate-product-hero__volume-label {
  opacity: 0.9;
  font-weight: 500;
}

.sonate-product-hero__volume-value {
  font-weight: 800;
}

.sonate-product-hero__volume-select-wrap {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.sonate-product-hero__volume-select {
  width: 100%;
  height: 100%;
}

.sonate-product-hero__volume-chevron {
  margin-left: auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  flex-shrink: 0;
}

/* ---------- Prix + CTA ---------- */

.sonate-product-hero__price-bar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
  width: auto;
  max-width: 100%;
  padding: 20px 27px;
  border: 3px solid #040405;
  border-radius: 32px;
  background: #fff;
}

.sonate-product-hero__price {
  color: #040405;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.sonate-product-hero__price .amount,
.sonate-product-hero__price .woocommerce-Price-amount {
  font-weight: inherit;
}

.sonate-product-hero__price-suffix {
  display: inline-block;
  margin-left: 0.15em;
  font-weight: 700;
  font-size: 0.55em;
  line-height: 1;
  vertical-align: super;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Les règles du bouton sont préfixées par le wrapper : Elementor impose
   `.elementor a { box-shadow: none }`, plus spécifique qu'une simple classe,
   qui écraserait sinon le relief. */
.sonate-product-hero .sonate-product-hero__cta {
  --sph-cta-bg: #040405;
  --sph-cta-color: #fff;
  --sph-cta-shadow: rgba(4, 4, 5, 0.35);
  --sph-cta-disabled-bg: #d9d9dc;
  --sph-cta-disabled-color: #6b6b70;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  background: var(--sph-cta-bg);
  color: var(--sph-cta-color);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  /* Épaisseur sous le bouton : c'est elle qui se réduit quand il s'enfonce. */
  transform: translateY(0);
  box-shadow: 0 4px 0 0 var(--sph-cta-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease,
    background-color 0.25s ease, color 0.25s ease;
}

/* Les états interactifs excluent explicitement le bouton désactivé : sans ça,
   leur spécificité l'emporterait sur le style « rupture de stock » plus bas. */
.sonate-product-hero
  .sonate-product-hero__cta:hover:not([disabled]):not([aria-disabled="true"]),
.sonate-product-hero
  .sonate-product-hero__cta:focus-visible:not([disabled]):not([aria-disabled="true"]) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 0 var(--sph-cta-shadow);
  filter: brightness(1.18);
}

.sonate-product-hero .sonate-product-hero__cta:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Clic : enfoncé à fond, l'ombre passe à l'intérieur. */
.sonate-product-hero
  .sonate-product-hero__cta:active:not([disabled]):not([aria-disabled="true"]) {
  transform: translateY(4px);
  box-shadow: 0 0 0 0 var(--sph-cta-shadow),
    inset 0 3px 7px rgba(0, 0, 0, 0.45);
  transition-duration: 0.06s;
}

/* Coche de confirmation : largeur nulle tant que le produit n'est pas ajouté. */
.sonate-product-hero .sonate-product-hero__cta-check {
  position: relative;
  display: inline-block;
  width: 0;
  height: 0.85em;
  opacity: 0;
  transform: scale(0.4);
  transition: width 0.25s ease, margin 0.25s ease, opacity 0.2s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sonate-product-hero .sonate-product-hero__cta-check::before {
  content: "";
  position: absolute;
  left: 18%;
  top: 50%;
  width: 0.3em;
  height: 0.6em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-62%) rotate(45deg);
}

/* Ajout au panier en cours (classe posée par WooCommerce). */
.sonate-product-hero .sonate-product-hero__cta.loading {
  pointer-events: none;
}

.sonate-product-hero .sonate-product-hero__cta.loading .sonate-product-hero__cta-label {
  opacity: 0.35;
}

.sonate-product-hero .sonate-product-hero__cta.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: sph-cta-spin 0.6s linear infinite;
}

/* Confirmation après ajout. */
.sonate-product-hero .sonate-product-hero__cta.is-added {
  background: #1f9d55;
  color: #fff;
  animation: sph-cta-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sonate-product-hero .sonate-product-hero__cta.is-added .sonate-product-hero__cta-check {
  width: 0.85em;
  margin-left: 0.5em;
  opacity: 1;
  transform: scale(1);
}

/* Rupture de stock / produit non commandable : à plat, sans relief. */
.sonate-product-hero .sonate-product-hero__cta--disabled,
.sonate-product-hero .sonate-product-hero__cta[disabled],
.sonate-product-hero .sonate-product-hero__cta[aria-disabled="true"] {
  background: var(--sph-cta-disabled-bg);
  color: var(--sph-cta-disabled-color);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.sonate-product-hero .sonate-product-hero__cta.is-denied {
  animation: sph-cta-shake 0.4s ease;
}

.sonate-product-hero__price-bar .added_to_cart {
  color: #040405;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

@keyframes sph-cta-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sph-cta-pop {
  0% {
    transform: scale(0.94);
  }
  55% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes sph-cta-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* ---------- Réassurances ---------- */

.sonate-product-hero__trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  width: 80%;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  color: #fff;
}

.sonate-product-hero__trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
}

.sonate-product-hero__trust-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
}

.sonate-product-hero__trust-icon svg {
  width: 1.25em;
  height: 1.25em;
  fill: currentColor;
}

.sonate-product-hero__trust-label {
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .sonate-product-hero .sonate-product-hero__cta,
  .sonate-product-hero .sonate-product-hero__cta::after,
  .sonate-product-hero .sonate-product-hero__cta-check {
    transition: none;
    animation: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .sonate-product-hero {
    --sph-gap: 32px;
  }

  .sonate-product-hero__trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .sonate-product-hero {
    grid-template-columns: 1fr;
    --sph-gap: 28px;
  }

  .sonate-product-hero__frame {
    max-width: 22rem;
    margin-inline: auto;
    aspect-ratio: 3 / 4;
  }

  .sonate-product-hero__price-bar {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 5px 5px 5px 1rem;
    border-radius: 32px;
  }

  .sonate-product-hero .sonate-product-hero__cta {
    padding: 0.75rem 1.1rem;
    font-size: 0.72rem;
  }

  .sonate-product-hero__trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 0.75rem;
  }
}
