/* =========================================================
   STYLES COMMUNS – ÉDITION & VALIDATION PANIER
   ========================================================= */

/* Texte */
.box-validation-panier p,
.box-edition-panier p,
.box.information {
  font-size: 1.3em !important;
}

.box-edition-panier .client-concerne {
  color: #1f318b;
  font-size: 24px;
  text-align: center;
  margin-bottom: 30px;
}

.cart-products-table thead th {
  color: #1f318b !important;
}

.box-validation-panier th,
.box-validation-panier td,
.box-edition-panier th,
.box-edition-panier td {
  text-align: center;
}

.box-validation-panier th.first-item,
.box-validation-panier td.product-name,
.box-edition-panier th.first-item,
.box-edition-panier td.product-name {
  text-align: left;
  padding: 15px 20px;
}

/* =========================================================
   TABLE PANIER – DESKTOP
   ========================================================= */

.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.cart-products-table {
  width: 100%;
  min-width: 800px;
  margin-bottom: 0;
}

.cart-products-table th {
  white-space: nowrap;
  font-weight: bold;
  font-size: 18px;
  color: #1f318b;
  background-color: #f3f9fe;
}

.cart-products-table .quantity-input {
  width: 100px;
  margin: 0 auto;
}

.cart-products-table .btn-delete {
  padding: 6px 12px;
}

/* Total global */
.cart-total-global-wrapper {
  font-size: 18px;
  text-align: end;
  padding: 10px;
  border-top: 1px solid #ddd;
}

/* =========================================================
   MODULE AJOUT PRODUIT
   ========================================================= */

.add-product-module {
  margin: 20px 0;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.add-product-module h4 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 500;
  color: #1f318b;
}

.add-product-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  flex: 1 1 300px;
  position: relative;
}

.quantity-wrapper {
  flex: 0 0 120px;
}

.add-btn-wrapper {
  flex: 0 0 auto;
}

/* Autocomplete */
.search-results-list {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ccc;
  width: 100%;
  display: none;
  list-style: none;
  padding: 0;
  margin: 2px 0 0;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.search-results-list li {
  padding: 8px 12px;
  cursor: pointer;
}

.search-results-list li:hover {
  background: #f0f0f0;
}

/* =========================================================
   BOUTONS FOOTER
   ========================================================= */
.box-edition-panier .btn-validation {
  color: white;
  background: green !important;
  border-color: green !important;
}

.box-edition-panier .btn-validation:hover {
  color: green !important;
  background: #f1e904 !important;
  border-color: #f1e904 !important;
}

.box-edition-panier .footer_links {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
}

.box-edition-panier .footer_links>li {
  min-width: 255px;
}

.box-edition-panier .sub_footer_links {
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 0;
}

.box-edition-panier .sub_footer_links>li a,
.box-edition-panier .sub_footer_links>li button {
  min-width: 255px;
}

/* =========================================================
   TABLE → CARTES PRODUIT (MOBILE)
   ========================================================= */

@media (max-width: 850px) {
  #breadcrumb:has(.navigation-pipe) {
    margin-top: 0;
  }

  .box-edition-panier .client-concerne {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 20px;
  }

  /* Désactivation scroll horizontal */
  .table-responsive-wrapper {
    overflow-x: visible;
    border: none;
  }

  .cart-products-table {
    min-width: 100%;
    border: none;
  }

  /* Masquer entête */
  .cart-products-table thead {
    display: none;
  }

  /* Carte produit */
  .cart-products-table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 10px;
    position: relative;
  }

  /* Ligne label / valeur */
  .cart-products-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    /* font-size: 14px; */
    border-bottom: 1px solid #eee;
  }

  .cart-products-table .quantity-input {
    margin: 0;
  }

  /* Pas de border sur le total ni pour la corbeille */
  .cart-products-table tbody td.product-total {
    border-bottom: none;
    font-weight: 600;
    padding-top: 10px;
  }

  .cart-products-table tbody td.action {
    border-bottom: none;
  }

  .cart-products-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #1f318b;
  }

  /* Nom produit */
  .cart-products-table td.product-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    text-align: left;
  }

  .cart-products-table td.product-name::before {
    display: none;
  }

  /* Quantité */
  .cart-products-table .quantity-input {
    width: 80px;
  }

  /* Action */
  .cart-products-table td.action {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0;
    margin: 0;
    justify-content: flex-end;
    background: transparent;
  }

  .cart-products-table td.action button {
    padding: 4px 6px;
    min-width: auto;
    line-height: 1;
  }

  .cart-products-table td.action ion-icon {
    font-size: 18px;
  }

  .cart-products-table td.action::before {
    display: none;
  }


  /* Total global */
  .cart-total-global-wrapper {
    font-size: 20px;
    text-align: center;
  }

  /* Boutons */
  .box-edition-panier .footer_links,
  .box-edition-panier .sub_footer_links {
    flex-direction: column;
    align-items: center;
  }

  /* Largeur uniforme des boutons */
  .box-edition-panier .footer_links .btn-default,
  .box-edition-panier .sub_footer_links .btn-default,
  .box-edition-panier .sub_footer_links button {
    width: 255px;
    max-width: 255px;
  }

  /* Centrage */
  .box-edition-panier .footer_links>li,
  .box-edition-panier .sub_footer_links>li {
    display: flex;
    justify-content: center;
  }
}

/* =========================================================
   TRÈS PETITS ÉCRANS
   ========================================================= */

@media (max-width: 480px) {

  .box-edition-panier h1.page-heading {
    font-size: 18px;
  }

  .cart-products-table tbody td {
    /* font-size: 13px; */
  }

  .box-edition-panier .addresses.row div {
    padding: 0;
  }
}

/* =========================================================
   TABLE VALIDATION PANIER → CARTES (MOBILE)
   ========================================================= */

@media (max-width: 850px) {

  .box-validation-panier .table-responsive-wrapper {
    overflow-x: visible;
    border: none;
  }

  .box-validation-panier .cart-products-table {
    min-width: 100%;
    border: none;
  }

  /* Masquer l'entête */
  .box-validation-panier .cart-products-table thead {
    display: none;
  }

  /* Carte */
  .box-validation-panier .cart-products-table tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 12px;
  }

  /* Lignes label / valeur */
  .box-validation-panier .cart-products-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none !important;
    border-bottom: 1px solid #eee !important;
    text-align: right;
    /* font-size: 15px; */
  }

  .box-validation-panier .cart-products-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #1f318b;
    text-align: left;
  }

  /* =========================
     STATUT
     ========================= */

  .box-validation-panier .cart-products-table td[data-label="Statut"] {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding-top: 12px;
  }

  .box-validation-panier .cart-products-table td[data-label="Statut"]::before {
    display: none;
  }

  .box-validation-panier span.badge {
    font-size: 13px;
    width: fit-content;
    margin: 0 auto;
  }

  /* =========================
     ACTIONS
     ========================= */

  .box-validation-panier .cart-products-table td[data-label="Actions"] {
    justify-content: center;
    align-items: center;
    padding-top: 12px;
    border-bottom: none !important;
  }

  .box-validation-panier .cart-products-table td[data-label="Actions"]::before {
    display: none;
  }

  .box-validation-panier .cart-products-table td[data-label="Actions"] a {
    width: auto;
    min-width: unset;
    text-align: center;
  }
}

/* Style pastille indiquant le nombre de panier à valider ou en cours de validation */
#my-account ul.myaccount-link-list li a.lien-opartsavecart {
  display: flex;
  align-items: center;
  gap: 6px;
}

#my-account ul.myaccount-link-list li a.lien-opartsavecart .menu-label {
  display: inline;
}

#my-account ul.myaccount-link-list li a.lien-opartsavecart .badge-oparts {
  margin: 0 4px 0 0;
  padding: 16px 13px !important;
  font-size: 19px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 18px;
  height: 18px;
  padding-inline: 6px;

  background-color: #f1e904;
  color: #1f318b;

  font-size: 11px;
  font-weight: 700;
  line-height: 1;

  border-radius: 50%;
  white-space: nowrap;
}

#my-account ul.myaccount-link-list li a.lien-opartsavecart:hover .badge-oparts {
  background-color: #1f318b;
  color: #f1e904;
}

/* Style badge dans table validation : En attente validation, En attente validation finale... */
.box-validation-panier span.badge {
  display: inline-block;

  font-size: 14px;
  font-weight: 600;

  border-radius: 3px;
  background-color: #FF8C00;
  border: 1px solid #FF8C00;
  line-height: 1.4;
}

.box-validation-panier span.badge ion-icon {
  font-size: 14px;
  vertical-align: middle;
}