/*
 * Cartouches Discount — habillage du panier et du paiement.
 * Portée volontairement limitée aux pages WooCommerce transactionnelles.
 * Aucun élément de paiement n'est masqué ou déplacé par JavaScript.
 */

body.cdco-site-shell-active.woocommerce-cart,
body.cdco-site-shell-active.woocommerce-checkout {
  --cd-checkout-navy: #071a3a;
  --cd-checkout-blue: #0969c7;
  --cd-checkout-blue-dark: #0755a3;
  --cd-checkout-red: #e3062c;
  --cd-checkout-border: #c9d9ea;
  --cd-checkout-muted: #52637a;
  --cd-checkout-surface: #fff;
  --cd-checkout-soft: #f4f8fc;
}

body.cdco-site-shell-active.woocommerce-checkout #customer_details {
  min-width: 0;
}

body.cdco-site-shell-active.woocommerce-checkout #order_review_heading {
  color: var(--cd-checkout-navy) !important;
  font-size: clamp(1.35rem, 2vw, 1.7rem) !important;
  line-height: 1.25 !important;
}

body.cdco-site-shell-active.woocommerce-checkout #order_review {
  min-width: 0;
}

body.cdco-site-shell-active.woocommerce-checkout .woocommerce-billing-fields > h3,
body.cdco-site-shell-active.woocommerce-checkout .woocommerce-shipping-fields > h3,
body.cdco-site-shell-active.woocommerce-checkout .woocommerce-additional-fields > h3 {
  margin: 0 0 18px !important;
  color: var(--cd-checkout-navy) !important;
  font-size: 1.35rem !important;
  line-height: 1.3 !important;
}

body.cdco-site-shell-active.woocommerce-checkout .form-row {
  margin: 0 0 15px !important;
}

body.cdco-site-shell-active.woocommerce-checkout .form-row label {
  display: block !important;
  margin: 0 0 6px !important;
  color: var(--cd-checkout-navy) !important;
  font-size: .92rem !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
}

body.cdco-site-shell-active.woocommerce-checkout .form-row .optional {
  color: var(--cd-checkout-muted) !important;
  font-size: .82rem !important;
  font-weight: 500 !important;
}

body.cdco-site-shell-active.woocommerce-checkout .input-text,
body.cdco-site-shell-active.woocommerce-checkout select,
body.cdco-site-shell-active.woocommerce-checkout .select2-selection {
  width: 100% !important;
  min-height: 48px !important;
  box-sizing: border-box !important;
  border: 1.5px solid #9fbfe0 !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: var(--cd-checkout-navy) !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  box-shadow: none !important;
}

body.cdco-site-shell-active.woocommerce-checkout textarea.input-text {
  min-height: 104px !important;
  padding: 12px 14px !important;
  resize: vertical;
}

body.cdco-site-shell-active.woocommerce-checkout .input-text:focus,
body.cdco-site-shell-active.woocommerce-checkout select:focus,
body.cdco-site-shell-active.woocommerce-checkout .select2-container--focus .select2-selection {
  border-color: var(--cd-checkout-blue) !important;
  outline: 3px solid rgb(9 105 199 / 20%) !important;
  outline-offset: 1px !important;
}

body.cdco-site-shell-active.woocommerce-checkout .woocommerce-invalid .input-text,
body.cdco-site-shell-active.woocommerce-checkout .woocommerce-invalid select {
  border-color: #b42318 !important;
}

body.cdco-site-shell-active.woocommerce-checkout .woocommerce-validated .input-text,
body.cdco-site-shell-active.woocommerce-checkout .woocommerce-validated select {
  border-color: #2d7a4c !important;
}

/* Résumé de commande : lisible et compact. */
body.cdco-site-shell-active.woocommerce-checkout #order_review table.shop_table {
  width: 100% !important;
  margin: 0 0 18px !important;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

body.cdco-site-shell-active.woocommerce-checkout #order_review table.shop_table th,
body.cdco-site-shell-active.woocommerce-checkout #order_review table.shop_table td {
  padding: 12px 10px !important;
  border-bottom: 1px solid #e1e9f1 !important;
  color: var(--cd-checkout-navy) !important;
  font-size: .94rem !important;
  line-height: 1.45 !important;
  vertical-align: top !important;
}

body.cdco-site-shell-active.woocommerce-checkout #order_review table.shop_table th:last-child,
body.cdco-site-shell-active.woocommerce-checkout #order_review table.shop_table td:last-child {
  width: 34%;
  text-align: right !important;
}

body.cdco-site-shell-active.woocommerce-checkout #payment {
  margin-top: 18px !important;
  border: 1px solid var(--cd-checkout-border) !important;
  border-radius: 12px !important;
  background: var(--cd-checkout-soft) !important;
}

body.cdco-site-shell-active.woocommerce-checkout #payment ul.payment_methods {
  margin: 0 !important;
  padding: 10px 16px !important;
  border-bottom: 1px solid var(--cd-checkout-border) !important;
}

body.cdco-site-shell-active.woocommerce-checkout #payment li.wc_payment_method {
  margin: 0 !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid #dfe8f1;
}

body.cdco-site-shell-active.woocommerce-checkout #payment li.wc_payment_method:last-child {
  border-bottom: 0;
}

body.cdco-site-shell-active.woocommerce-checkout #payment label {
  color: var(--cd-checkout-navy) !important;
  font-weight: 750 !important;
}

body.cdco-site-shell-active.woocommerce-checkout #payment .payment_box {
  margin: 10px 0 0 !important;
  padding: 14px !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #34445c !important;
  box-shadow: inset 0 0 0 1px #dce7f2;
}

/* Garde l'état de visibilité choisi par Stripe. Link utilise une rangée
 * entière afin que son libellé ne soit pas comprimé par les autres boutons. */
body.cdco-site-shell-active.woocommerce-checkout #wc-stripe-express-checkout-element {
  flex-wrap: wrap;
  min-width: 0;
}

body.cdco-site-shell-active.woocommerce-checkout #wc-stripe-express-checkout-element-link {
  box-sizing: border-box;
  flex: 1 0 100% !important;
  width: 100%;
  min-width: 0;
  padding-inline: 4px;
}

body.cdco-site-shell-active.woocommerce-checkout #place_order {
  width: 100% !important;
  min-height: 54px !important;
  margin: 12px 0 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: var(--cd-checkout-red) !important;
  color: #fff !important;
  font-size: 1rem !important;
  font-weight: 850 !important;
  line-height: 1.25 !important;
  box-shadow: 0 8px 18px rgb(227 6 44 / 22%) !important;
}

body.cdco-site-shell-active.woocommerce-checkout #place_order:hover,
body.cdco-site-shell-active.woocommerce-checkout #place_order:focus-visible {
  background: #bd001e !important;
}

body.cdco-site-shell-active.woocommerce-checkout #place_order:focus-visible,
body.cdco-site-shell-active.woocommerce-checkout a:focus-visible,
body.cdco-site-shell-active.woocommerce-cart a:focus-visible,
body.cdco-site-shell-active.woocommerce-cart button:focus-visible {
  outline: 3px solid rgb(9 105 199 / 35%) !important;
  outline-offset: 3px !important;
}

body.cdco-site-shell-active.woocommerce-checkout #place_order:disabled,
body.cdco-site-shell-active.woocommerce-checkout #place_order.disabled {
  background: #9aa9b8 !important;
  color: #fff !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

body.cdco-site-shell-active.woocommerce-checkout .woocommerce-privacy-policy-text,
body.cdco-site-shell-active.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper {
  color: #3e4f65 !important;
  font-size: .9rem !important;
  line-height: 1.55 !important;
}

body.cdco-site-shell-active.woocommerce-checkout input[type='checkbox'],
body.cdco-site-shell-active.woocommerce-checkout input[type='radio'] {
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  margin-right: 8px !important;
  accent-color: var(--cd-checkout-blue);
}

/* Panier : actions cohérentes et total bien séparé. */
body.cdco-site-shell-active.woocommerce-cart .woocommerce-cart-form,
body.cdco-site-shell-active.woocommerce-cart .cart_totals {
  background: var(--cd-checkout-surface) !important;
}

body.cdco-site-shell-active.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  min-height: 52px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 9px !important;
  font-weight: 850 !important;
}

/* WooCommerce Blocks : mêmes couleurs, sans toucher à la logique des blocs. */
body.cdco-site-shell-active.woocommerce-checkout .wc-block-checkout__main,
body.cdco-site-shell-active.woocommerce-checkout .wc-block-checkout__sidebar {
  min-width: 0;
}

body.cdco-site-shell-active.woocommerce-checkout .wc-block-components-text-input input,
body.cdco-site-shell-active.woocommerce-checkout .wc-block-components-combobox-control input {
  min-height: 48px !important;
  border-radius: 9px !important;
  font-size: 16px !important;
}

body.cdco-site-shell-active.woocommerce-checkout .wc-block-components-checkout-place-order-button {
  min-height: 54px !important;
  border-radius: 9px !important;
  background: var(--cd-checkout-red) !important;
  color: #fff !important;
  font-weight: 850 !important;
}

@media (max-width: 600px) {
  body.cdco-site-shell-active.woocommerce-checkout #order_review table.shop_table th,
  body.cdco-site-shell-active.woocommerce-checkout #order_review table.shop_table td {
    padding: 10px 7px !important;
    font-size: .88rem !important;
  }

  body.cdco-site-shell-active.woocommerce-checkout #payment ul.payment_methods {
    padding-right: 13px !important;
    padding-left: 13px !important;
  }

  body.cdco-site-shell-active.woocommerce-cart .coupon,
  body.cdco-site-shell-active.woocommerce-cart .coupon .input-text,
  body.cdco-site-shell-active.woocommerce-cart .coupon .button,
  body.cdco-site-shell-active.woocommerce-cart button[name='update_cart'],
  body.cdco-site-shell-active.woocommerce-cart .cdco-empty-cart-button {
    width: 100% !important;
    float: none !important;
    margin: 6px 0 !important;
  }
}
