/* ============================================================
   === PAGE PANIER PERSONNALISÉE — STYLE GLOBAL ===
   ============================================================ */

/* --- Conteneur principal de la page panier --- */
.custom-cart-page {
  max-width: 1200px;
  margin: 10px auto 40px auto !important;
  padding: 0 20px;
  transition: margin-top 0.3s ease;
}

/* Ajuste la marge si une notification WooCommerce est visible */
body:has(.woocommerce-notices-wrapper:not(:empty)) .custom-cart-page {
  margin-top: 140px;
}

/* ============================================================
   === LISTE DES ARTICLES DU PANIER ===
   ============================================================ */

/* Conteneur général des articles */
.custom-cart-page .custom-cart-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  margin-bottom: 10px;
}

/* --- Titre du panier avec icône --- */
.custom-cart-page .cart-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 100px;
}

.custom-cart-page .cart-title .cart-icon {
  width: 40px;
  height: auto;
  margin-bottom: 10px;
}

.custom-cart-page .cart-title h2 {
  margin: 0 0 10px 0;
  font-size: 1.5rem;
  font-weight: 400;
  color: #333;
}

/* --- Bloc individuel d’un article --- */
.custom-cart-page .cart-item {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ccc;
  padding: 20px 0;
}

.custom-cart-page .cart-item:last-child {
  border-bottom: none;
}

/* Image produit */
.custom-cart-page .cart-item-image img {
  width: 80px;
  height: auto;
  object-fit: contain;
  margin-right: 30px;
}

/* Détails produit */
.custom-cart-page .cart-item-details {
  flex: 1;
  font-weight: 500;
}

.custom-cart-page .product-name {
  font-weight: 700;
}

.custom-cart-page .product-attributes {
  font-weight: 400;
  font-size: 0.9rem;
  color: #666;
}

/* --- Gestion de la quantité --- */
.custom-cart-page .cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
  min-width: fit-content;
}

/* Lien "Retirer" */
.custom-cart-page .cart-item-quantity .remove {
  all: unset;
  position: relative;
  display: inline-block;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 500;
  color: #222 !important;
  text-decoration: none !important;
  margin: 0 5px 0 0;
  transition: color 0.3s ease;
}

.custom-cart-page .cart-item-quantity .remove::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  width: 100%;
  background: #b38b5d;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.custom-cart-page .cart-item-quantity .remove:hover {
  color: #b38b5d !important;
  background: transparent;
}

.custom-cart-page .cart-item-quantity .remove:hover::after {
  transform: scaleX(1);
}

/* Conteneur quantité (boutons + champ) */
.custom-cart-page .cart-item-quantity .quantity {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  height: 25px;
  gap: 2px;
}

/* Boutons + et - */
.custom-cart-page .cart-item-quantity .quantity button {
  background-color: transparent;
  color: #333;
  border: none;
  font-size: 0.9rem;
  width: 22px;
  height: 28px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.custom-cart-page .cart-item-quantity .quantity button:hover {
  background-color: #f0f0f0;
}

/* Champ input quantité */
.custom-cart-page .cart-item-quantity .quantity input.qty {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 0.75rem;
  color: #333;
  outline: none;
  padding: 0;
  margin: 0;
}

/* Suppression des flèches des inputs numériques */
.custom-cart-page input[type="number"]::-webkit-inner-spin-button,
.custom-cart-page input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.custom-cart-page input[type="number"] {
  -moz-appearance: textfield;
}

/* Prix du produit */
.custom-cart-page .cart-item-price {
  width: 120px;
  font-weight: 500;
  text-align: right;
}

/* ============================================================
   === SUPPRESSION DE LA LIGNE DE FIN DE PANIER ===
   ============================================================ */


/* Supprimer uniquement la ligne finale du tableau des totaux du panier */
.cart-totals table.shop_table tr:last-child {
  border-bottom: none !important;
}


/* ============================================================
   === ACTIONS DU PANIER (Boutons) ===
   ============================================================ */

/* Conteneur des actions */
.custom-cart-page .cart-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

/* Harmonisation des boutons (suppression du btn-update-cart) */
.custom-cart-page .btn-continue,
.cart-discount-code button.apply-coupon {
  background-color: #000 !important;
  color: #fff !important;
  border: none;
  border-radius: 4px !important;
  padding: 4px 24px !important;
  font-size: 0.9rem !important;
  font-weight: 300 !important;
  text-transform: lowercase;
  letter-spacing: 0.04em !important;
  text-align: center;
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1.2;
  font-family: inherit;
}

.custom-cart-page .btn-continue:hover,
.cart-discount-code button.apply-coupon:hover {
  background-color: #333 !important;
  color: #fff !important;
}

/* ============================================================
   === CODE PROMO & TOTAUX PANIER — STYLE HARMONISÉ ===
   ============================================================ */

/* Alignement à droite global */
.cart-discount-code,
.cart-summary {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

/* Suppression des bordures et fonds WooCommerce */
.woocommerce table.shop_table,
.woocommerce table.shop_table th,
.woocommerce table.shop_table td,
.cart-totals,
.cart-summary,
.cart-discount-code,
.cart-discount-code form {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* --- Bloc Code Promo --- */
.cart-discount-code form {
  width: 350px;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  padding: 20px 0;
}

.cart-discount-code h3 {
  font-size: 15px;
  font-weight: 400;
  margin: 0 0 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.cart-discount-code p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.cart-discount-code input.input-text {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid #ccc;
  font-size: 0.9rem;
  background: transparent;
  transition: border-color 0.2s ease;
}

.cart-discount-code input.input-text:focus {
  border-color: #000;
  outline: none;
}

/* --- Bloc Totaux Panier --- */
.cart-summary {
  margin-top: 0;
  padding-top: 0;
}

.cart-totals {
  width: 350px;
  border-top: 1px solid #ddd;
  padding-top: 20px;
}

.cart-totals table.shop_table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid #ddd;
}

.cart-totals table.shop_table tr {
  border-bottom: 1px solid #eee;
}

.cart-totals table.shop_table tr:last-child {
  border-bottom: 1px solid #ddd;
}

.cart-totals th,
.cart-totals td {
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 0.95rem;
  color: #333;
}

.cart-totals th {
  font-weight: 400;
  text-align: left;
}

.cart-totals td {
  text-align: right;
}

/* Bouton "Valider la commande" */
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  background: #000 !important;
  color: #fff !important;
  text-transform: uppercase;
  font-weight: 100;
  padding: 4px 20px;
  border-radius: 4px;
  text-align: center;
  display: block;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  background: #333 !important;
}

/* ============================================================
   === NOTIFICATIONS WOO — STYLE PERSONNALISÉ MINIMALISTE ===
   ============================================================ */

.woocommerce-notices-wrapper,
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  width: 100%;
  max-width: 800px;
  margin: 0;
  padding: 15px 20px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  box-shadow: none;
}

/* Styles spécifiques aux messages */
.woocommerce-message { background-color: #f9f9f9; border: 1px solid #ddd; color: #222; }
.woocommerce-error { background-color: #fff5f5; border: 1px solid #ffcccc; color: #c0392b; }
.woocommerce-info { background-color: #f8f8f8; border: 1px solid #ddd; color: #555; }

/* Supprimer les icônes Woo par défaut */
.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce-info::before { display: none !important; }

/* Liens dans les messages */
.woocommerce-message a,
.woocommerce-error a,
.woocommerce-info a {
  display: inline-block;
  margin-left: 10px;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: background-color 0.3s ease;
}

.woocommerce-message a:hover,
.woocommerce-error a:hover,
.woocommerce-info a:hover { background-color: #333; }

/* Affichage d’une seule notification à la fois */
.woocommerce-notices-wrapper > *:not(:first-child) { display: none !important; }

/* Centrer la notification sous le logo */
.woocommerce-notices-wrapper {
  display: flex;
  justify-content: center;
  margin: 10px auto;
  max-width: 800px;
}

/* Masquer le wrapper si aucune notice */
.woocommerce-notices-wrapper:empty,
.woocommerce-notices-wrapper:not(:has(.woocommerce-message, .woocommerce-error, .woocommerce-info)) {
  display: none !important;
}

/* Supprimer bordure et espace si pas de notifications */
body:not(:has(.woocommerce-message, .woocommerce-error, .woocommerce-info)) .custom-cart-items {
  border-top: none !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* === Animation de disparition des notifications Woo === */
.woo-fade-out {
  opacity: 0;
  transition: opacity 1s ease-out;
}

/* ============================================================
   === PANIER VIDE — STYLE UNIFIÉ AVEC NOTIFICATIONS ===
   ============================================================ */
.woocommerce-cart .cart-empty {
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  padding: 15px 20px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  color: #222;
}

/* Bouton "Retour à la boutique" harmonisé */
.woocommerce-cart .cart-empty a.button {
  display: inline-block;
  margin-top: 10px;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.85rem;
  transition: background-color 0.3s ease;
}

.woocommerce-cart .cart-empty a.button:hover {
  background-color: #333;
}

/* ============================================================
   === LIEN "MODIFIER L’ADRESSE" — VERSION FINALE CLEAN ===
   ============================================================ */

.shipping-calculator-button {
  all: unset;                 /* Supprime les styles natifs */
  display: inline-block;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 400;
  color: #222;
  margin-top: 8px;             /* 👈 ESPACE AVEC LE CONTENU AU-DESSUS */
  margin-bottom: 12px;         /* 👈 ESPACE AVEC LE FORMULAIRE */
  position: relative;
  text-decoration: none !important; /* 🔥 supprime underline natif */
}

/* Surlignement animé uniquement */
.shipping-calculator-button::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 1px;
  width: 100%;
  background: #b38b5d;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.shipping-calculator-button:hover::after {
  transform: scaleX(1);
}


/* ============================================================
   === FORMULAIRE EXPÉDITION — INPUTS MINIMALISTES ===
   ============================================================ */

/* Conteneur formulaire */
.woocommerce-shipping-calculator {
  margin-top: 10px;
}

/* Espacement entre champs */
.woocommerce-shipping-calculator .form-row {
  margin-bottom: 12px;
}

/* Labels discrets */
.woocommerce-shipping-calculator label {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 4px;
  display: block;
}

/* Inputs texte */
.woocommerce-shipping-calculator input.input-text {
  width: 100%;
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 6px 2px;
  font-size: 0.85rem;
  background: transparent;
}

.woocommerce-shipping-calculator input.input-text:focus {
  border-color: #000;
  outline: none;
}

/* Select (pays) */
.woocommerce-shipping-calculator select,
.woocommerce-shipping-calculator .select2-container--default .select2-selection--single {
  border: none !important;
  border-bottom: 1px solid #ccc !important;
  border-radius: 0 !important;
  background: transparent !important;
  height: 32px;
}

/* Select2 texte */
.select2-selection__rendered {
  padding-left: 0 !important;
  font-size: 0.85rem;
}

/* ============================================================
   === BOUTON "METTRE À JOUR" — STYLE GLOBAL ===
   ============================================================ */

.woocommerce-shipping-calculator button.button {
  background-color: #000 !important;
  color: #fff !important;
  border: none;
  border-radius: 4px;
  padding: 4px 20px;
  font-size: 0.85rem;
  font-weight: 300;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.woocommerce-shipping-calculator button.button:hover {
  background-color: #333 !important;
}


/* ============================================================
   === EXPÉDITION — ALIGNEMENT FINAL + NETTOYAGE ===
   ============================================================ */

/* Titre "Expédition" */
.cart-totals tr.woocommerce-shipping-totals th {
  text-align: left;
  vertical-align: top;
  font-weight: 400;
}

/* Contenu expédition */
.cart-totals tr.woocommerce-shipping-totals td {
  text-align: right;
}

/* Suppression du bullet point */
.cart-totals ul.woocommerce-shipping-methods {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Ligne méthode */
.cart-totals ul.woocommerce-shipping-methods li {
  text-align: right;
}

/* Texte destination */
.cart-totals .woocommerce-shipping-destination {
  text-align: right;
  font-size: 0.85rem;
  color: #666;
}

/* Formulaire aligné à droite */
.cart-totals .woocommerce-shipping-calculator {
  text-align: right;
}

/* Labels à droite */
.cart-totals .woocommerce-shipping-calculator label {
  text-align: right;
}

/* Inputs & select alignés à droite */
.cart-totals .woocommerce-shipping-calculator input,
.cart-totals .woocommerce-shipping-calculator select,
.cart-totals .woocommerce-shipping-calculator .select2-container {
  text-align: right;
}



/* ============================================================
   === RESPONSIVE DESIGN ===
   ============================================================ */
@media (max-width: 600px) {

  .custom-cart-page .cart-title {
    flex-direction: column;
    gap: 10px;
  }

  .custom-cart-page .cart-title h2 {
    font-size: 1.5rem;
  }

  .custom-cart-page .cart-item {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .custom-cart-page .cart-item-price {
    text-align: left;
    width: 100%;
  }

  .cart-discount-code form,
  .cart-totals {
    width: 100%;
  }
}
