/* =============================================================
   ThaïGuide — EDD Checkout v5
   /wp-content/themes/generatepress-child/edd/edd-checkout.css
   ============================================================= */

/* ── Page ── */
body.edd-checkout { background: #f4f3ef !important; }
body.edd-checkout .site-main,
body.edd-checkout .entry-content { max-width: 100% !important; padding: 0 !important; }
body.edd-checkout .entry-content > h1 {
  max-width: 960px; margin: 2rem auto 1.5rem; padding: 0 1.5rem;
  font-size: 24px; font-weight: 700; color: #1a1a1a;
}
body.edd-checkout .wp-block-edd-checkout {
  max-width: 960px; margin: 0 auto; padding: 0 1.5rem 4rem;
}

/* ── Layout ── */
#tg-wrap { display: flex; flex-direction: column; }
.tg-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; margin-bottom: 1rem; }
.tg-full { width: 100%; margin-bottom: 1rem; }

/* ── Cartes ── */
.tg-card {
  background: #fff; border: 1px solid #e6e3dc;
  border-radius: 12px; padding: 1.5rem; margin: 15px 0 0 0;
}
.tg-card--submit { background: #faf9f7 !important; }

/* ── Labels de section ── */
.tg-block-label {
  font-size: 11px !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: .08em; color: #aaa !important;
  padding-bottom: 10px; margin: 0 0 1.25rem 0 !important;
  border-bottom: 1px solid #f0ede6; display: block;
}

/* ── Masquer legends EDD ── */
body.edd-checkout .wp-block-edd-checkout legend { display: none !important; }

/* ── Neutraliser border/padding natifs d'EDD ── */
body.edd-checkout .wp-block-edd-checkout #edd_purchase_form .edd-blocks-form {
  border: none !important;
  padding: 0 !important;
}

/* ── Supprimer tous les fonds/bordures internes EDD ── */
body.edd-checkout .edd-blocks__cart,
body.edd-checkout .edd-blocks__cart > form,
body.edd-checkout #edd_checkout_cart,
body.edd-checkout #edd_checkout_cart_form,
body.edd-checkout .edd-blocks-cart,
body.edd-checkout .edd-blocks__purchase-form,
body.edd-checkout .edd-blocks__purchase-form > form,
body.edd-checkout .edd-blocks__user-details,
body.edd-checkout .edd-blocks__payment-details,
body.edd-checkout .edd-blocks__checkout-user,
body.edd-checkout .edd-checkout-block__personal-info,
body.edd-checkout fieldset#edd_checkout_user_info,
body.edd-checkout fieldset#edd_cc_address,
body.edd-checkout fieldset#edd_cc_fields,
body.edd-checkout fieldset#edd_purchase_submit {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

/* ── Boutons connexion / invité ── */
body.edd-checkout .edd-blocks__checkout-forms { display: flex; gap: 8px; margin-bottom: 1rem; }
body.edd-checkout .edd-blocks__checkout-forms button,
body.edd-checkout .edd-button-secondary {
  height: 36px; padding: 0 14px;
  border: 1.5px solid #e0ddd5 !important; border-radius: 8px !important;
  font-size: 13px; font-weight: 500;
  background: #faf9f7 !important; color: #666 !important; cursor: pointer;
}
body.edd-checkout .edd-blocks__checkout-forms button:hover {
  border-color: #e07b00 !important; color: #e07b00 !important;
}

/* ── Champs ── */
body.edd-checkout .edd-blocks-form__group { margin-bottom: .85rem; }
body.edd-checkout .edd-label {
  font-size: 12px !important; font-weight: 600 !important;
  color: #666 !important; margin-bottom: 5px; display: block;
}
body.edd-checkout .edd-input,
body.edd-checkout .wp-block-edd-checkout input[type="text"],
body.edd-checkout .wp-block-edd-checkout input[type="email"],
body.edd-checkout .wp-block-edd-checkout input[type="tel"] {
  height: 42px !important; padding: 0 13px !important;
  border: 1.5px solid #e0ddd5 !important; border-radius: 8px !important;
  font-size: 14px !important; background: #faf9f7 !important;
  color: #1a1a1a !important; width: 100% !important; box-shadow: none !important;
  transition: border-color .18s, background .18s;
}
body.edd-checkout .edd-input:focus,
body.edd-checkout .wp-block-edd-checkout input:focus {
  border-color: #e07b00 !important; background: #fff !important; outline: none !important;
}
body.edd-checkout .edd-description { font-size: 11px !important; color: #bbb !important; margin-top: 3px; }

/* ── Panier : lignes ── */
body.edd-checkout .edd-blocks-cart__row-header {
  display: flex; justify-content: space-between;
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: #ccc; font-weight: 600;
  padding-bottom: 8px; border-bottom: 1px solid #f0ede6; margin-bottom: 4px;
}
body.edd-checkout .edd-blocks-cart__row-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid #f5f3ef;
}
body.edd-checkout .edd-blocks-cart__row-item .edd_cart_item_name {
  font-size: 14px; font-weight: 500; color: #1a1a1a; flex: 1; min-width: 0; margin-right: 10px;
}
body.edd-checkout .edd-blocks-cart__row-item .edd_cart_item_price {
  font-size: 14px; font-weight: 700; color: #1a1a1a; white-space: nowrap;
}
body.edd-checkout .edd_cart_footer_row .edd_cart_total {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 16px !important; font-weight: 700 !important; color: #1a1a1a !important;
  margin-top: 10px; padding-top: 12px; border-top: 2px solid #f0ede6;
}
/* ── Bouton supprimer un article du panier (EDD 3.6) ── */
/* On force l'affichage du lien réel + d'éventuels conteneurs, sans masquer son contenu natif */
body.edd-checkout .edd-blocks-cart__row-buttons,
body.edd-checkout .edd-blocks-cart__actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  margin-left: 12px;
  flex-shrink: 0;
}
body.edd-checkout a.edd-blocks-cart__action-remove,
body.edd-checkout a.edd_cart_remove_item_btn {
  display: inline-block !important;
  visibility: visible !important;
  width: 18px !important;
  height: 18px !important;
  margin-left: 12px;
  flex-shrink: 0;
  /* icône corbeille dessinée par nous, colorée via la couleur du texte */
  background-color: #c0392b !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
  /* on neutralise tout contenu natif (texte/icône vide) */
  font-size: 0 !important;
  color: transparent !important;
  border: none !important;
  padding: 0 !important;
  text-decoration: none !important;
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s;
}
/* si EDD insère sa propre icône enfant, on la masque pour éviter le doublon */
body.edd-checkout a.edd-blocks-cart__action-remove > *,
body.edd-checkout a.edd_cart_remove_item_btn > * { display: none !important; }
body.edd-checkout a.edd-blocks-cart__action-remove:hover,
body.edd-checkout a.edd_cart_remove_item_btn:hover { opacity: 1 !important; }

/* Masquer les boutons connexion/invité dans le panier */
body.edd-checkout .edd-blocks__cart .edd-blocks__checkout-user,
body.edd-checkout .edd-blocks__cart .edd-blocks__checkout-forms,
body.edd-checkout .edd-blocks__cart .edd-blocks__user-details,
body.edd-checkout .edd-blocks__cart .edd-button-secondary,
body.edd-checkout .tg-full .edd-blocks__checkout-user,
body.edd-checkout .tg-full .edd-blocks__user-details { display: none !important; }

/* Code remise */
body.edd-checkout .edd_discount_link {
  font-size: 13px; color: #e07b00 !important;
  background: none !important; border: none !important;
  padding: 0 !important; cursor: pointer; text-decoration: underline;
}
body.edd-checkout .edd-discount-code-field-wrap { display: flex; margin-top: .5rem; }
body.edd-checkout #edd-discount {
  flex: 1; border-radius: 8px 0 0 8px !important; border-right: none !important; height: 40px !important;
}
body.edd-checkout .edd-apply-discount {
  height: 40px; padding: 0 14px;
  background: #f4f3ef !important; border: 1.5px solid #e0ddd5 !important;
  border-left: none !important; border-radius: 0 8px 8px 0 !important;
  font-size: 13px; font-weight: 500; color: #555 !important; cursor: pointer; width: auto !important;
}

/* ── Paiement ── */
body.edd-checkout #edd_secure_site_wrapper {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: #aaa; margin-bottom: 1rem;
}
body.edd-checkout #edd-card-wrap {
  border: 1.5px solid #e0ddd5; border-radius: 9px; padding: 12px; background: #faf9f7;
}

/* ── CGV ── */
body.edd-checkout .edd-show-terms a,
body.edd-checkout #edd-show-privacy-policy a {
  font-size: 12px; color: #e07b00 !important; text-decoration: none; display: inline-block; margin-bottom: 5px;
}
body.edd-checkout .edd-terms-agreement,
body.edd-checkout .edd-privacy-policy-agreement {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: #555; margin: 6px 0;
}
body.edd-checkout #edd_agree_to_terms,
body.edd-checkout #edd-agree-to-privacy-policy {
  accent-color: #e07b00; width: 15px !important; height: 15px !important; flex-shrink: 0;
}

/* ── Bouton Acheter ── */
body.edd-checkout #edd-purchase-button {
  display: block; width: 100% !important; height: 50px !important;
  background: #e07b00 !important; color: #fff !important;
  border: none !important; border-radius: 10px !important;
  font-size: 16px !important; font-weight: 700 !important;
  cursor: pointer; margin-top: 1.25rem; transition: background .18s;
}
body.edd-checkout #edd-purchase-button:hover:not([disabled]) { background: #c86e00 !important; }
body.edd-checkout #edd-purchase-button[disabled] { background: #d4a96a !important; cursor: not-allowed !important; }

/* ── Erreurs ── */
body.edd-checkout .edd_errors {
  background: #fff2f2; border: 1.5px solid #f5c1c1;
  border-radius: 9px; padding: 1rem 1.25rem; margin-bottom: 1rem;
}
body.edd-checkout .edd_errors li { font-size: 13px; color: #b91c1c; list-style: none; }

/* ── Mobile ── */
@media (max-width: 600px) {
  .tg-row { grid-template-columns: 1fr; }
}
