/* === MODAL OVERLAY === */
.cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3); /* fond semi-transparent */
  display: none;
  z-index: 1000;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 80px;
  padding-right: 20px;
}

/* === BOÎTE MODALE COMPACTE === */
.cart-modal-content {
  background: #f9f9f9;
  width: 420px;
  max-width: 95%;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;

  max-height: 50vh; /* Limite par défaut sur desktop */
  overflow: hidden;
}

/* === EN-TÊTE === */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  gap: 10px;
}

.close-cart {
  cursor: pointer;
  font-size: 24px;
  color: #777;
}

.tax-toggle {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: normal;
}

.tax-toggle span {
  margin: 0 4px;
}

.tax-toggle .switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.tax-toggle .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tax-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.tax-toggle .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.tax-toggle input:checked + .slider {
  background-color: #e50000;
}

.tax-toggle input:checked + .slider:before {
  transform: translateX(20px);
}

/* === CONTENU DU PANIER === */
.cart-body {
  padding: 20px;
  overflow-y: auto;
}

/* === PRODUITS === */
.custom-cart-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.custom-cart-item {
  display: flex;
  align-items: stretch;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  position: relative;
}

.item-image {
  height: 100px;
  width: auto;
  margin-right: 15px;
  flex-shrink: 0;
}

.item-image img {
  height: 100%;
  width: auto;
  object-fit: cover;
  border-radius: 5px;
}

.item-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-name {
  font-size: 16px;
  margin: 0;
  color: #333;
}

.item-price {
  font-weight: bold;
  color: #222;
  margin: 0;
}

.item-price .item-total {
  font-weight: normal;
  margin-left: 4px;
}

.item-qty {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

.item-qty label {
  margin-right: 5px;
}

.item-qty input {
  width: 60px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  color: #333;
}

.remove-item {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #777;
}

.remove-item:hover {
  color: #333;
  background: none;
}

/* === RÉCAP === */
.cart-summary {
  margin: 0 0 8px;
  font-size: 15px;
  color: #444;
}

.cart-summary p {
  margin: 0 0 4px;
}

.cart-note {
  color: #000;
  font-size: 13px;
  margin: 8px 0;
}

.empty-cart-message {
  text-align: center;
  margin: 20px 0;
  color: #444;
}

.creating-message {
  text-align: center;
  margin: 20px 0;
  color: #444;
}

/* === PIED DE MODAL === */
.cart-footer {
  padding: 20px;
  border-top: 1px solid #ddd;
  background: #eee;
}

.checkout-button {
  display: block;
  width: 100%;
  text-align: center;
  padding: 15px;
  background-color: #e50000;
  color: white;
  text-decoration: none;
  font-weight: bold;
  border-radius: 8px;
  font-size: 16px;
}
