/* =====================================================================
   AFTraduction — Single-product purchase-box redesign
   Scope: body.single-product only. Brand: navy #10356D + gold #F5A51D.
   Loaded by product-pages.php on is_product().
   ===================================================================== */

.single-product {
  --aft-navy: #10356D;
  --aft-navy-700: #0c2a57;
  --aft-gold: #F5A51D;
  --aft-gold-600: #e0940f;
  --aft-ink: #33425f;
  --aft-muted: #5b6b8c;
  --aft-line: #d7dceb;
  --aft-line-soft: #eef1f8;
  --aft-bg-soft: #f4f6fb;
}

/* ---- Price line (re-printed by product-pages.php, sits above the form) ---- */
.single-product .aft-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .2rem 0 1.1rem;
}
.single-product .aft-price__from { font-size: .95rem; color: var(--aft-muted); font-weight: 500; }
.single-product .aft-price__amount { font-size: 2rem; font-weight: 800; color: var(--aft-navy); line-height: 1; }
.single-product .aft-price__amount .woocommerce-Price-amount,
.single-product .aft-price__amount bdi,
.single-product .aft-price__amount .woocommerce-Price-currencySymbol {
  font-size: inherit; font-weight: inherit; color: inherit;
}
.single-product .aft-price__unit { font-size: .95rem; color: var(--aft-muted); }

/* ---- Variations table → clean stacked rows (labels were wrapping in a th) -- */
.single-product table.variations,
.single-product table.variations tbody,
.single-product table.variations tr,
.single-product table.variations th,
.single-product table.variations td {
  display: block;
  width: auto;
  border: 0;
  padding: 0;
}
.single-product table.variations { margin: 0 0 .4rem; }
.single-product table.variations tr { margin-bottom: 1rem; }
.single-product table.variations th.label,
.single-product table.variations th.label_file_upload {
  text-align: left;
  padding: 0 0 .35rem;
  font-weight: 600;
  color: var(--aft-navy);
  white-space: normal;
  line-height: 1.25;
}
.single-product table.variations th.label label,
.single-product table.variations th.label_file_upload label { margin: 0; font-weight: 600; }

/* ---- Select dropdowns (combinaison langue / urgent) ---- */
.single-product table.variations select {
  width: 100%;
  min-height: 54px;
  border: 1.6px solid var(--aft-line);
  border-radius: 12px;
  padding: .5rem 2.6rem .5rem 1rem;
  color: var(--aft-navy);
  font-size: 1rem;
  font-weight: 500;
  background-color: #fff;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2310356D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  cursor: pointer;
}
.single-product table.variations select:focus {
  outline: none;
  border-color: var(--aft-gold);
  box-shadow: 0 0 0 3px rgba(245,165,29,.18);
}

/* ---- File upload: hide the native input, brand the styled button --------- */
.single-product input#aftraduction_file_upload {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.single-product .value_file_upload__button {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  justify-content: flex-start;
  cursor: pointer;
  background: #fff;
  border: 1.6px dashed #b9c2da;
  color: var(--aft-navy);
  font-weight: 600;
  font-size: .98rem;
  padding: .9rem 1.15rem;
  border-radius: 12px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.single-product .value_file_upload__button:hover { border-color: var(--aft-gold); background: #fffaf0; }
.single-product .value_file_upload__button:focus-visible { outline: none; border-color: var(--aft-gold); box-shadow: 0 0 0 3px rgba(245,165,29,.18); }
.single-product .value_file_upload__button.has-file { border-style: solid; border-color: #9fd3a8; background: #f5fbf6; }
.single-product .value_file_upload__button-icon { display: inline-flex; }
.single-product .value_file_upload__button-icon svg { width: 22px; height: 22px; display: block; }
.single-product .value_file_upload__button::after {
  content: "PDF · JPG · PNG";
  margin-left: auto;
  font-weight: 500;
  font-size: .78rem;
  color: #9aa6c0;
  white-space: nowrap;
}
.single-product .value_file_upload__filename {
  display: block;
  margin-top: .45rem;
  font-size: .88rem;
  color: var(--aft-muted);
  word-break: break-word;
}
.single-product .value_file_upload__filename:empty { display: none; }

/* ---- Selection hint (injected by JS while no language combo is chosen) ---- */
.single-product .aft-select-hint {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .1rem 0 1rem;
  font-size: .9rem;
  color: var(--aft-navy);
  background: #fff6e6;
  border: 1px solid #ffe3ad;
  border-radius: 10px;
  padding: .6rem .85rem;
}
.single-product .aft-select-hint svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--aft-gold); }
.single-product.aft-variation-ready .aft-select-hint { display: none; }

/* ---- Upload guidance note (top of the add-to-cart form) ------------------- */
.single-product .aft-upload-note {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 0 0 1.1rem;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--aft-navy);
  background: #f4f7fb;
  border: 1px solid #dbe5f1;
  border-left: 3px solid var(--aft-gold);
  border-radius: 10px;
  padding: .7rem .9rem;
}
.single-product .aft-upload-note svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; color: var(--aft-gold); }
.single-product .aft-upload-note strong { color: var(--aft-navy); font-weight: 700; }

/* ---- Add-to-cart row: quantity stepper + CTA on one aligned line ---------- */
.single-product .woocommerce-variation-add-to-cart,
.single-product form.cart:not(.variations_form) {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: .4rem;
}
/* The yurcom-image-override plugin wraps the button and forces height:240px. */
.single-product .yurcom-add-to-cart-wrap {
  flex: 1 1 240px;
  display: block;
  margin: 0;
  padding: 0;
  height: auto !important;
}

.single-product .quantity-input-wrapper {
  display: inline-flex !important;
  align-items: stretch;
  flex: 0 0 auto;
  height: 58px;
  border: 1.6px solid var(--aft-line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.single-product .quantity-input-wrapper .quantity-actionner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; flex: 0 0 48px;
  font-size: 1.5rem; line-height: 1; font-weight: 600;
  color: var(--aft-navy); background: var(--aft-bg-soft);
  cursor: pointer; user-select: none;
  transition: background .15s, color .15s;
}
.single-product .quantity-input-wrapper .quantity-actionner:hover { background: var(--aft-navy); color: #fff; }
.single-product .quantity-input-wrapper .quantity { margin: 0 !important; display: flex; }
.single-product .quantity-input-wrapper .quantity .qty {
  width: 56px; height: auto;
  border: 0; border-left: 1.6px solid var(--aft-line-soft); border-right: 1.6px solid var(--aft-line-soft);
  text-align: center; font-weight: 700; font-size: 1.05rem; color: var(--aft-navy);
  background: #fff; border-radius: 0; -moz-appearance: textfield;
}
.single-product .quantity-input-wrapper .qty::-webkit-outer-spin-button,
.single-product .quantity-input-wrapper .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- The primary CTA — enabled (gold) + disabled (clean "waiting") -------- */
.single-product .single_add_to_cart_button.button,
.single-product .single_add_to_cart_button.button.alt {
  background: var(--aft-gold) !important;
  color: var(--aft-navy) !important;
  border: 0 !important;
  border-radius: 12px !important;
  font-weight: 800 !important;
  font-size: 1.06rem !important;
  letter-spacing: .005em;
  text-transform: none !important;
  padding: 0 2rem !important;
  min-height: 58px;
  height: 58px !important;
  flex: 1 1 240px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(245,165,29,.30);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.single-product .single_add_to_cart_button.button:hover,
.single-product .single_add_to_cart_button.button.alt:hover {
  background: #ffb637 !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(245,165,29,.42);
}
.single-product .single_add_to_cart_button.disabled,
.single-product .single_add_to_cart_button[disabled],
.single-product .single_add_to_cart_button.wc-variation-selection-needed,
.single-product .single_add_to_cart_button.button.disabled,
.single-product .single_add_to_cart_button.button.alt.disabled {
  background: #e9edf6 !important;
  color: #8a93a8 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
  opacity: 1 !important;
}

/* ---- Reset ("Effacer") + checkboxes ---- */
.single-product a.reset_variations {
  display: inline-block;
  margin: .35rem 0 0;
  font-size: .85rem;
  color: var(--aft-muted);
  text-decoration: underline;
}
.single-product form.cart label { color: var(--aft-ink); }
.single-product form.cart input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--aft-navy); vertical-align: middle;
}

/* ---- Trust-badge row (printed by product-pages.php under the form) -------- */
.single-product .aft-trustrow {
  list-style: none !important;
  margin: 1.3rem 0 0 !important;
  padding: 1.1rem 0 0 !important;
  border-top: 1px solid var(--aft-line-soft);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem 1.4rem;
}
.single-product .aft-trustrow li::before,
.single-product .aft-trustrow li::marker { content: none !important; display: none !important; }
.single-product .aft-trustrow__item {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0;
  font-size: .92rem;
  line-height: 1.25;
  color: var(--aft-ink);
  font-weight: 500;
}
.single-product .aft-trustrow__item svg { width: 21px; height: 21px; flex: 0 0 21px; color: var(--aft-gold); }

/* =====================================================================
   Phase 3 — hero balance, description, tabs, shipping option
   ===================================================================== */

/* Shipping option ("Besoin d'une expédition ?") → its own line below the CTA */
.single-product .yurcom-add-to-cart-wrap { display: block !important; }
.single-product .yurcom-shipping-option {
  display: flex !important;
  width: 100% !important;
  flex: none !important;
  float: none !important;
  clear: both !important;
  position: static !important;
  margin: .85rem 0 0 !important;
  align-items: center;
  gap: .5rem;
  font-size: .92rem;
  color: var(--aft-ink);
}
.single-product .yurcom-shipping-option label { margin: 0; }

/* Remove the image duplicated inside the description (already shown in gallery) */
.single-product .description-content-wrapper figure.image-wrapper,
.single-product .description-content-wrapper .image-wrapper { display: none !important; }
.single-product .description-content-wrapper { display: block; max-width: 880px; }

/* A single lonely tab reads as unfinished → hide the tab chrome, show content */
.single-product .woocommerce-tabs > ul.tabs { display: none; }
.single-product .woocommerce-tabs .woocommerce-Tabs-panel { display: block !important; }

/* Reassurance card under the product image (fills the short left column) */
.single-product .woocommerce-product-gallery { overflow: visible; }
.single-product .aft-reassure {
  margin-top: 18px;
  border: 1px solid #e7ebf3;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcfe, #f4f7fc);
  padding: 18px 20px;
}
.single-product .aft-reassure__title {
  font-weight: 700; color: var(--aft-navy); margin: 0 0 .8rem; font-size: 1.02rem;
}
.single-product .aft-reassure__steps {
  list-style: none !important; margin: 0 0 .9rem !important; padding: 0 !important; display: grid; gap: .55rem;
}
.single-product .aft-reassure__steps li {
  display: flex; align-items: flex-start; gap: .6rem; margin: 0; color: var(--aft-ink); font-size: .9rem; line-height: 1.3;
}
.single-product .aft-reassure__steps li::before,
.single-product .aft-reassure__steps li::marker { content: none !important; display: none !important; }
.single-product .aft-reassure__num {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--aft-navy); color: #fff; font-size: .76rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.single-product .aft-reassure__phone {
  display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--aft-navy);
  text-decoration: none; padding-top: .8rem; border-top: 1px solid #e7ebf3;
}
.single-product .aft-reassure__phone svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--aft-gold); }

/* =====================================================================
   Phase 2 — Google-reviews section (replaces the broken Trustindex band)
   ===================================================================== */
.single-product .notes_google { display: none !important; } /* hide broken Trustindex widget */

.single-product .aft-reviews { max-width: 1140px; margin: 2.4rem auto 0; padding: 2rem 1.25rem 0; }
.single-product .aft-reviews__head {
  display: flex; align-items: center; justify-content: center; gap: 1rem 1.4rem;
  flex-wrap: wrap; text-align: center; margin-bottom: 1.6rem;
}
.single-product .aft-reviews__badge { display: flex; align-items: center; gap: .7rem; }
.single-product .aft-reviews__meta { text-align: left; }
.single-product .aft-reviews__score { display: flex; align-items: center; gap: .5rem; }
.single-product .aft-reviews__score strong {
  font-size: 1.7rem; font-weight: 800; color: var(--aft-navy); line-height: 1;
  font-family: "Playfair Display", Georgia, serif;
}
.single-product .aft-reviews__stars { display: inline-flex; gap: 2px; }
.single-product .aft-reviews__star { width: 18px; height: 18px; fill: var(--aft-gold); }
.single-product .aft-reviews__count { font-size: .84rem; color: var(--aft-muted); margin-top: 3px; }
.single-product .aft-reviews__title { font-size: 1.5rem; color: var(--aft-navy); margin: 0; }
.single-product .aft-reviews__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.single-product .aft-reviews__card {
  margin: 0; padding: 1.4rem; border: 1px solid var(--aft-line); border-radius: 14px;
  background: #fff; box-shadow: 0 8px 24px rgba(16,53,109,.05);
  display: flex; flex-direction: column; gap: .7rem;
}
.single-product .aft-reviews__card .aft-reviews__star { width: 15px; height: 15px; }
.single-product .aft-reviews__card blockquote { margin: 0; font-size: .93rem; line-height: 1.55; color: var(--aft-ink); }
.single-product .aft-reviews__card figcaption { display: flex; flex-direction: column; margin-top: auto; }
.single-product .aft-reviews__author { font-weight: 700; color: var(--aft-navy); font-size: .92rem; }
.single-product .aft-reviews__ctx { font-size: .82rem; color: var(--aft-muted); }
@media (max-width: 820px) {
  .single-product .aft-reviews__grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   Phase 5 — FAQ accordion (native <details>, no JS) + FAQPage schema
   ===================================================================== */
.single-product .aft-faq { max-width: 880px; margin: 2.6rem auto 0; padding: 0 1.25rem; }
.single-product .aft-faq__title { font-size: 1.5rem; color: var(--aft-navy); text-align: center; margin: 0 0 1.4rem; }
.single-product .aft-faq__item {
  border: 1px solid var(--aft-line); border-radius: 12px; margin-bottom: .7rem;
  background: #fff; overflow: hidden;
}
.single-product .aft-faq__q {
  cursor: pointer; list-style: none; padding: 1rem 1.2rem;
  font-weight: 600; color: var(--aft-navy);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.single-product .aft-faq__q::-webkit-details-marker { display: none; }
.single-product .aft-faq__q::marker { content: ""; }
.single-product .aft-faq__chev {
  width: 10px; height: 10px; flex: 0 0 auto;
  border-right: 2px solid var(--aft-gold); border-bottom: 2px solid var(--aft-gold);
  transform: rotate(45deg); transition: transform .2s ease;
}
.single-product .aft-faq__item[open] .aft-faq__chev { transform: rotate(-135deg); }
.single-product .aft-faq__a { padding: 0 1.2rem 1.1rem; color: var(--aft-ink); line-height: 1.6; font-size: .95rem; }

/* ---- Small-screen: stack quantity + CTA, single-column sections ---- */
@media (max-width: 560px) {
  .single-product .woocommerce-variation-add-to-cart { gap: .7rem; }
  .single-product .quantity-input-wrapper { width: 100%; justify-content: space-between; }
  .single-product .quantity-input-wrapper .quantity { flex: 1; }
  .single-product .quantity-input-wrapper .quantity .qty { width: 100%; }
  .single-product .yurcom-add-to-cart-wrap { flex: 1 1 100%; }
  .single-product .single_add_to_cart_button.button,
  .single-product .single_add_to_cart_button.button.alt { flex: 1 1 100%; width: 100%; }
  .single-product .aft-trustrow { grid-template-columns: 1fr; }
  .single-product .aft-price__amount { font-size: 1.7rem; }
  .single-product .aft-reviews__head { flex-direction: column; gap: .6rem; }
  .single-product .aft-reviews, .single-product .aft-faq { margin-top: 2rem; }
}
