/* PDP one-step order form beside product */
.single-product .site-main.zora-wrap,
.single-product main.site-main {
  max-width: 1120px;
}

.single-product div.product.has-zora-pdp-order,
.woocommerce div.product.has-zora-pdp-order {
  display: grid !important;
  grid-template-columns: minmax(240px, 420px) minmax(280px, 400px) !important;
  justify-content: center;
  gap: 0.55rem 1rem !important; /* photo directly beside the form */
  align-items: start;
  max-width: 1080px !important;
  width: 100% !important;
  margin: 0 auto 1.25rem;
  /* Contain sticky form inside the product block only (related is outside). */
  overflow: clip;
  isolation: isolate;
}

.single-product .has-zora-pdp-order .zora-pdp-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.single-product .has-zora-pdp-order .woocommerce-product-gallery {
  max-width: none;
  width: 100%;
  margin: 0 !important;
}

.single-product .has-zora-pdp-order .summary.entry-summary {
  max-width: 420px;
  padding-top: 0.35rem !important;
  margin-top: 0 !important;
}

.single-product .has-zora-pdp-order .zora-pdp-order {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  height: auto;
  min-height: 0;
  overflow: visible;
  position: relative;
  top: auto;
  z-index: 1;
}

.single-product .has-zora-pdp-order .zora-pdp-desc {
  margin: 0.25rem 0 0;
  max-width: 420px;
}

.stock.out-of-stock,
p.stock.out-of-stock {
  display: none !important;
}

.single-product .has-zora-pdp-order .woocommerce-tabs {
  grid-column: 1 / -1;
}

/* Hide classic cart CTAs — order is the purple form button */
.single-product .has-zora-pdp-order form.cart .single_add_to_cart_button,
.single-product .has-zora-pdp-order form.cart .zora-buy-now,
.single-product .has-zora-pdp-order form.cart .quantity {
  display: none !important;
}

.zora-pdp-order {
  background: color-mix(in srgb, #fff8f3 72%, #f3e4df);
  border: 1px solid #e8cfc8;
  border-radius: 8px;
  padding: 0.8rem 0.75rem 0.9rem;
  box-shadow: 0 3px 12px rgba(61, 42, 40, 0.04);
}

.zora-pdp-order__form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.zora-pdp-order__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}

.zora-pdp-order__label {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  color: #3d2a28;
  font-weight: 500;
}

.zora-pdp-order__label em {
  color: #e11d48;
  font-style: normal;
}

.zora-pdp-order__field input,
.zora-pdp-order__field select {
  width: 100%;
  border: 1px solid #e8cfc8;
  border-radius: 5px;
  background: #fff8f3;
  padding: 0.48rem 0.65rem;
  min-height: 36px;
  font-size: 0.86rem;
  color: #3d2a28;
  appearance: none;
}

/* Téléphone : +213 + 10 chiffres */
.zora-phone {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid #e8cfc8;
  border-radius: 5px;
  background: #fff8f3;
  overflow: hidden;
  min-height: 36px;
}

.zora-phone__prefix {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 0.55rem;
  border-inline-end: 1px solid #e8cfc8;
  background: color-mix(in srgb, #f3e4df 65%, #fff);
  color: #3d2a28;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.zora-phone input[name="phone_local"],
.zora-pdp-order__field .zora-phone input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 34px;
}

.zora-phone input:focus {
  outline: none;
  box-shadow: none;
}

.zora-phone:focus-within {
  border-color: #c9958c;
  box-shadow: 0 0 0 2px rgba(201, 149, 140, 0.25);
}

.zora-phone.is-valid {
  border-color: #22c55e;
}

.zora-pdp-order__field select {
  background-color: #fff8f3;
  background-image: linear-gradient(45deg, transparent 50%, #7a5c57 50%),
    linear-gradient(135deg, #7a5c57 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-inline-end: 2rem;
}

.zora-pdp-order__field input:focus,
.zora-pdp-order__field select:focus {
  outline: none;
  border-color: #c9958c;
  box-shadow: 0 0 0 2px rgba(201, 149, 140, 0.25);
}

.zora-pdp-order__field input.is-valid {
  border-color: #22c55e;
}

.zora-pdp-order__delivery {
  margin: 0.1rem 0 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e8cfc8;
  border-radius: 6px;
  background: color-mix(in srgb, #fff8f3 55%, #f3e4df);
}

.zora-pdp-order__delivery legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.2rem;
  font-weight: 600;
  font-size: 0.82rem;
  color: #111;
}

.zora-pdp-order__truck {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
}

.zora-pdp-order__ship-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.3rem 0;
  cursor: pointer;
  font-size: 0.84rem;
}

.zora-pdp-order__ship-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.zora-pdp-order__ship-price {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.zora-pdp-order__error {
  margin: 0;
  padding: 0.55rem 0.7rem;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 6px;
  font-size: 0.88rem;
}

.zora-pdp-order__options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.1rem;
}

.zora-pdp-order__row-top {
  display: flex;
  flex-flow: row nowrap;
  align-items: flex-end; /* taille + quantité sur la même ligne */
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
}

@media (max-width: 380px) {
  .zora-pdp-order__row-top {
    flex-wrap: wrap;
  }
}

/* Taille — haut gauche */
.zora-pdp-order__sizes {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.zora-pdp-order__sizes-label,
.zora-pdp-order__qty-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #2b2b2b;
  text-align: left;
}

.zora-pdp-order__sizes .zora-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-start;
}

/* Quantité — même ligne que les tailles, à droite */
.zora-pdp-order__qty {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  margin-left: auto;
  margin-top: 0;
}

.zora-qty {
  display: inline-flex;
  align-items: stretch;
  height: 2rem;
  border: 1px solid #e8cfc8;
  border-radius: 5px;
  background: #fff8f3; /* même fond que les champs */
  overflow: hidden;
}

.zora-qty__btn {
  position: relative;
  width: 1.85rem;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
}

.zora-qty__btn:hover {
  background: color-mix(in srgb, #f3e4df 70%, #fff);
}

/* + / − dessinés en CSS */
.zora-qty__btn::before,
.zora-qty__btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #3d2a28;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.zora-qty__btn::before {
  width: 11px;
  height: 2px;
  border-radius: 1px;
}

.zora-qty__btn--plus::after {
  width: 2px;
  height: 11px;
  border-radius: 1px;
}

.zora-qty__val {
  min-width: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-inline: 1px solid #e8cfc8;
  font-size: 0.9rem;
  font-weight: 600;
  color: #3d2a28;
  background: #fff8f3;
}

/* Couleurs — bas droite + bouton panier style champ */
.zora-pdp-order__row-colors {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.zora-pdp-order__colors {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  width: 100%;
}

.zora-pdp-order__colors .zora-simple-colors__label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #2b2b2b;
  text-align: right;
}

.zora-pdp-order__colors .zora-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

/* Rose foncé — bande commander compacte */
.zora-pdp-order__add-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: #f6ebe8;
  color: #8f5e56 !important;
  border: 1px solid #e4c4bc;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: none;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.zora-pdp-order__add-cart:hover {
  filter: none;
  background: #fbf4f2;
  box-shadow: none;
}

.zora-pdp-order__add-cart:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(168, 93, 109, 0.5);
}

.zora-pdp-order__add-cart:disabled {
  opacity: 0.7;
  cursor: wait;
  filter: none;
}

.zora-pdp-order__add-cart.is-added {
  background: linear-gradient(180deg, #c8e6c9 0%, #a5d6a7 100%);
  color: #fff !important;
  box-shadow: none;
}

.zora-pdp-order__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
  margin: 0.1rem 0 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e8cfc8;
  border-radius: 6px;
  background: #fff;
}

.zora-pdp-order__total-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #3d2a28;
}

.zora-pdp-order__total-value {
  font-size: 1rem;
  font-weight: 700;
  color: #8f5e56;
  white-space: nowrap;
}

.zora-stock-note {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #f3c1a4;
  color: #7c2d12;
  font-size: 0.92rem;
  line-height: 1.45;
}

.zora-size {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border: 1px solid #e8cfc8;
  border-radius: 5px;
  background: #fff8f3;
  color: #3d2a28;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.zora-size:hover {
  border-color: #c9958c;
}

.zora-size.is-active {
  border-color: #8f5e56;
  background: #8f5e56;
  color: #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, #fff8f3 70%, #f3e4df);
}

.zora-pdp-order__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: fit-content;
  min-width: 11.5rem;
  margin-top: 0.65rem;
  margin-left: auto;
  margin-right: 0;
  align-self: flex-end;
  border: 0;
  border-radius: 6px;
  background: #d48a96;
  background: linear-gradient(180deg, #e4a4b0 0%, #c97b8a 100%);
  color: #fff !important;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(180, 90, 110, 0.26);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.zora-pdp-order__submit-fr {
  display: none;
}

.zora-pdp-order__submit:hover {
  filter: brightness(1.04);
  box-shadow: 0 8px 22px rgba(180, 90, 110, 0.38);
}

.zora-pdp-order__submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.zora-pdp-order__bag {
  flex-shrink: 0;
}

/* Vibration / shake du bouton Commander */
@keyframes zora-cta-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  12% {
    transform: translateX(-5px) rotate(-1deg);
  }
  24% {
    transform: translateX(5px) rotate(1deg);
  }
  36% {
    transform: translateX(-4px) rotate(-0.6deg);
  }
  48% {
    transform: translateX(4px) rotate(0.6deg);
  }
  60% {
    transform: translateX(-3px);
  }
  72% {
    transform: translateX(3px);
  }
  84% {
    transform: translateX(-2px);
  }
}

.zora-pdp-order__submit.is-pulse,
.zora-pdp-order__submit.is-pulse-once {
  /* 0.4s × 5 = one 2s shake, then the button stays still. */
  animation: zora-cta-shake 0.4s ease-in-out 5;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  .zora-pdp-order__submit.is-pulse,
  .zora-pdp-order__submit.is-pulse-once {
    animation: none !important;
  }
}

/* Desktop — form + bouton Commander plus petits (rien n’est supprimé) */
@media (min-width: 901px) {
  .single-product div.product.has-zora-pdp-order,
  .woocommerce div.product.has-zora-pdp-order {
    grid-template-columns: minmax(240px, 420px) minmax(280px, 400px) !important;
    justify-content: center;
    gap: 0.5rem 1rem !important;
  }

  .zora-pdp-order {
    padding: 0.55rem 0.55rem 0.65rem;
    border-radius: 7px;
  }

  .zora-pdp-order__form {
    gap: 0.4rem;
  }

  .zora-pdp-order__field {
    gap: 0.18rem;
  }

  .zora-pdp-order__label {
    font-size: 0.72rem;
  }

  .zora-pdp-order__field input,
  .zora-pdp-order__field select {
    min-height: 30px;
    padding: 0.32rem 0.5rem;
    font-size: 0.78rem;
    border-radius: 4px;
  }

  .zora-phone {
    min-height: 30px;
  }

  .zora-phone__prefix {
    font-size: 0.78rem;
    padding: 0 0.45rem;
  }

  .zora-pdp-order__field .zora-phone input {
    min-height: 28px;
    font-size: 0.78rem;
  }

  .zora-pdp-order__field select {
    background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    padding-inline-end: 1.55rem;
  }

  .zora-pdp-order__options {
    gap: 0.4rem;
  }

  .zora-pdp-order__sizes-label,
  .zora-pdp-order__qty-label,
  .zora-pdp-order__colors .zora-simple-colors__label {
    font-size: 0.72rem;
  }

  .zora-size {
    min-width: 1.75rem;
    height: 1.75rem;
    font-size: 0.72rem;
    border-radius: 4px;
  }

  .zora-qty {
    height: 1.75rem;
  }

  .zora-qty__btn {
    width: 1.6rem;
  }

  .zora-qty__val {
    font-size: 0.78rem;
    min-width: 1.6rem;
  }

  .zora-pdp-order__add-cart {
    min-height: 32px;
    padding: 0.38rem 0.55rem;
    font-size: 0.78rem;
    border-radius: 5px;
  }

  .zora-pdp-order__delivery {
    padding: 0.4rem 0.5rem;
  }

  .zora-pdp-order__delivery legend {
    font-size: 0.72rem;
  }

  .zora-pdp-order__ship-option {
    font-size: 0.76rem;
    padding: 0.22rem 0;
  }

  .zora-pdp-order__total {
    padding: 0.4rem 0.5rem;
  }

  .zora-pdp-order__total-label {
    font-size: 0.76rem;
  }

  .zora-pdp-order__total-value {
    font-size: 0.9rem;
  }

  .zora-pdp-order__submit {
    gap: 0.3rem;
    width: fit-content;
    min-width: 10.5rem;
    margin-left: auto;
    padding: 0.55rem 1.15rem;
    font-size: 0.9rem;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(180, 90, 110, 0.22);
  }

  .zora-pdp-order__bag {
    width: 1rem;
    height: 1rem;
  }

  .zora-pdp-order__bag svg {
    width: 1rem;
    height: 1rem;
  }
}

@media (max-width: 900px) {
  .single-product div.product.has-zora-pdp-order,
  .woocommerce div.product.has-zora-pdp-order {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.45rem !important;
    overflow: visible;
    height: auto;
  }

  .single-product .has-zora-pdp-order .zora-pdp-main,
  .single-product .has-zora-pdp-order .woocommerce-product-gallery,
  .single-product .has-zora-pdp-order .summary.entry-summary,
  .single-product .has-zora-pdp-order .zora-pdp-order,
  .single-product .has-zora-pdp-order .zora-pdp-desc {
    grid-column: 1;
    grid-row: auto;
    max-width: 100%;
    max-width: 100%;
    top: auto;
    height: auto;
    min-height: 0;
  }

  /* Keep gallery relative so prev/next arrows stay on the photos */
  .single-product .has-zora-pdp-order .woocommerce-product-gallery {
    position: relative !important;
    max-width: min(92vw, 460px);
    margin-inline: auto !important;
  }

  .single-product .has-zora-pdp-order .summary.entry-summary,
  .single-product .has-zora-pdp-order .zora-pdp-order {
    position: static !important;
  }

  .single-product .has-zora-pdp-order .summary.entry-summary {
    text-align: center;
    margin-inline: auto;
  }

  .zora-pdp-order {
    margin-top: 0.25rem;
  }
}

.zora-pdp-order__lines {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0.15rem 0 0;
  padding: 0.15rem 0.15rem 0;
}
.zora-pdp-order__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #3d2a28;
}
.zora-pdp-order__line strong {
  font-weight: 600;
  color: #8f5e56;
  white-space: nowrap;
}
