/**
 * OVERRIDE FINAL - PANIER
 * heleneriu.fr - 2024-12-23
 * CE FICHIER DOIT ÊTRE CHARGÉ EN DERNIER
 * Override TOUS les styles du panier
 */

/* ==========================================================================
   RESET COMPLET TOUCHSPIN - Supprimer les styles moches
   ========================================================================== */

/* Supprimer le gradient rouge/orange horrible */
.qty .input-group.bootstrap-touchspin::before,
.bootstrap-touchspin::before,
.input-group.bootstrap-touchspin::before {
  display: none !important;
  content: none !important;
  background: none !important;
  opacity: 0 !important;
}

/* Reset tous les effets */
.qty .btn-touchspin::after,
.btn-touchspin::after {
  display: none !important;
  content: none !important;
}

/* ==========================================================================
   TOUCHSPIN - STYLE PROPRE ET MODERNE
   ========================================================================== */

.bootstrap-touchspin,
.input-group.bootstrap-touchspin,
.qty .input-group.bootstrap-touchspin {
  display: inline-flex !important;
  align-items: stretch !important;
  background: #ffffff !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  width: auto !important;
  max-width: 130px !important;
  box-shadow: none !important;
}

.bootstrap-touchspin:hover,
.input-group.bootstrap-touchspin:hover,
.qty .input-group.bootstrap-touchspin:hover {
  border-color: #8b7355 !important;
}

.bootstrap-touchspin:focus-within,
.input-group.bootstrap-touchspin:focus-within,
.qty .input-group.bootstrap-touchspin:focus-within {
  border-color: #8b7355 !important;
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15) !important;
}

/* ==========================================================================
   INPUT QUANTITÉ
   ========================================================================== */

.bootstrap-touchspin input,
.bootstrap-touchspin .form-control,
.js-cart-line-product-quantity,
.qty input,
.qty .form-control,
#quantity_wanted {
  width: 55px !important;
  min-width: 55px !important;
  max-width: 55px !important;
  height: 44px !important;
  text-align: center !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #333 !important;
  background: #fff !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -moz-appearance: textfield !important;
  -webkit-appearance: none !important;
}

.bootstrap-touchspin input::-webkit-outer-spin-button,
.bootstrap-touchspin input::-webkit-inner-spin-button,
.js-cart-line-product-quantity::-webkit-outer-spin-button,
.js-cart-line-product-quantity::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
  display: none !important;
}

/* ==========================================================================
   BOUTONS +/-
   ========================================================================== */

.input-group-btn-vertical,
.bootstrap-touchspin .input-group-btn-vertical,
.qty .input-group-btn-vertical {
  display: flex !important;
  flex-direction: column !important;
  background: #f5f5f5 !important;
  border-left: 1px solid #e0e0e0 !important;
  width: 36px !important;
  min-width: 36px !important;
}

.btn-touchspin,
.bootstrap-touchspin .btn-touchspin,
.qty .btn-touchspin {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #f5f5f5 !important;
  border: none !important;
  border-radius: 0 !important;
  color: #666 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  position: relative !important;
}

.btn-touchspin:hover,
.bootstrap-touchspin .btn-touchspin:hover,
.qty .btn-touchspin:hover {
  background: #8b7355 !important;
  color: #fff !important;
}

.btn-touchspin:active,
.bootstrap-touchspin .btn-touchspin:active,
.qty .btn-touchspin:active {
  background: #7a6548 !important;
}

.bootstrap-touchspin-up,
.qty .bootstrap-touchspin-up {
  border-bottom: 1px solid #e0e0e0 !important;
}

.bootstrap-touchspin-down,
.qty .bootstrap-touchspin-down {
  border-top: none !important;
}

/* ==========================================================================
   ICÔNES +/- AVEC SYMBOLES UNICODE
   ========================================================================== */

/* Reset material icons */
.btn-touchspin .material-icons,
.btn-touchspin i,
.qty .btn-touchspin .material-icons,
.qty .btn-touchspin i,
.touchspin-up,
.touchspin-down {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

/* Flèche haut */
.bootstrap-touchspin-up .material-icons::before,
.bootstrap-touchspin-up i::before,
.touchspin-up::before,
.btn-touchspin.js-increase-product-quantity i::before,
.qty .bootstrap-touchspin-up .material-icons::before {
  content: "+" !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 18px !important;
  font-weight: bold !important;
  line-height: 1 !important;
  color: inherit !important;
}

/* Flèche bas */
.bootstrap-touchspin-down .material-icons::before,
.bootstrap-touchspin-down i::before,
.touchspin-down::before,
.btn-touchspin.js-decrease-product-quantity i::before,
.qty .bootstrap-touchspin-down .material-icons::before {
  content: "−" !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 18px !important;
  font-weight: bold !important;
  line-height: 1 !important;
  color: inherit !important;
}

/* Cacher préfixes/suffixes */
.bootstrap-touchspin-prefix,
.bootstrap-touchspin-postfix,
.input-group-addon.bootstrap-touchspin-prefix,
.input-group-addon.bootstrap-touchspin-postfix {
  display: none !important;
}

/* ==========================================================================
   LIGNE PRODUIT PANIER - STRUCTURE
   ========================================================================== */

.cart-items .cart-item,
.cart-grid-body .cart-item {
  padding: 20px 0 !important;
  border-bottom: 1px solid #eee !important;
  margin: 0 !important;
}

.product-line-grid {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 15px !important;
}

.product-line-grid-left {
  flex: 0 0 90px !important;
  width: 90px !important;
  max-width: 90px !important;
}

.product-line-grid-left img {
  width: 100% !important;
  height: auto !important;
  border-radius: 8px !important;
  border: 1px solid #eee !important;
}

.product-line-grid-body {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.product-line-grid-body .product-line-info a {
  font-weight: 600 !important;
  color: #333 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  display: block !important;
}

.product-line-grid-right {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
}

.product-line-grid-right > .row {
  display: flex !important;
  align-items: center !important;
  gap: 20px !important;
  margin: 0 !important;
  flex-wrap: nowrap !important;
}

.product-line-grid-right .row .row {
  display: flex !important;
  align-items: center !important;
  gap: 20px !important;
  flex-wrap: nowrap !important;
}

/* Colonnes du panier */
.product-line-grid-right .col-xs-4.hidden-md-up {
  display: none !important;
}

.product-line-grid-right .qty,
.product-line-grid-right .col-md-6.col-xs-6.qty {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
}

.product-line-grid-right .price,
.product-line-grid-right .col-md-6.col-xs-2.price {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  text-align: right !important;
}

.product-line-grid-right .col-md-2.col-xs-2 {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
}

/* ==========================================================================
   PRIX
   ========================================================================== */

.product-line-grid-right .product-price,
.cart-item .product-price {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #8b7355 !important;
  white-space: nowrap !important;
}

.product-line-grid-right .product-price strong {
  font-weight: 700 !important;
}

/* ==========================================================================
   BOUTON SUPPRIMER
   ========================================================================== */

.cart-line-product-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.remove-from-cart {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  background: #fff !important;
  border: 2px solid #dc3545 !important;
  border-radius: 50% !important;
  color: #dc3545 !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

.remove-from-cart:hover {
  background: #dc3545 !important;
  color: #fff !important;
  transform: scale(1.05) !important;
}

.remove-from-cart .material-icons {
  font-size: 18px !important;
  float: none !important;
  line-height: 1 !important;
}

/* ==========================================================================
   MOBILE PANIER
   ========================================================================== */

@media (max-width: 767px) {
  .product-line-grid {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .product-line-grid-left {
    flex: 0 0 70px !important;
    width: 70px !important;
    max-width: 70px !important;
  }

  .product-line-grid-body {
    flex: 1 1 calc(100% - 85px) !important;
  }

  .product-line-grid-right {
    flex: 0 0 100% !important;
    width: 100% !important;
    padding-top: 12px !important;
    border-top: 1px dashed #eee !important;
    margin-top: 5px !important;
  }

  .product-line-grid-right > .row,
  .product-line-grid-right .row .row {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .product-line-grid-right .col-md-10.col-xs-6 {
    flex: 1 !important;
  }

  .bootstrap-touchspin,
  .input-group.bootstrap-touchspin {
    max-width: 110px !important;
  }

  .bootstrap-touchspin input,
  .js-cart-line-product-quantity {
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    height: 40px !important;
    font-size: 15px !important;
  }

  .input-group-btn-vertical {
    width: 32px !important;
    min-width: 32px !important;
  }

  .btn-touchspin {
    width: 32px !important;
    height: 20px !important;
  }

  .product-line-grid-right .product-price {
    font-size: 16px !important;
  }

  .remove-from-cart {
    width: 36px !important;
    height: 36px !important;
  }
}

/* ==========================================================================
   RÉSUMÉ PANIER
   ========================================================================== */

.cart-summary {
  background: #faf8f5 !important;
  border-radius: 12px !important;
  padding: 20px !important;
  border: 1px solid #eee !important;
}

.cart-summary-line {
  display: flex !important;
  justify-content: space-between !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid #eee !important;
}

.cart-summary-line:last-child {
  border-bottom: none !important;
}

.cart-total .value {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #8b7355 !important;
}

/* Bouton commander */
.checkout .btn-primary,
.checkout a.btn,
a.btn-primary[href*="commande"] {
  display: block !important;
  width: 100% !important;
  padding: 16px 24px !important;
  background: #8b7355 !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  text-align: center !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border: none !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3) !important;
}

.checkout .btn-primary:hover,
.checkout a.btn:hover {
  background: #7a6548 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 16px rgba(139, 115, 85, 0.4) !important;
}

/* ==========================================================================
   FIX DARK MODE - Désactiver les couleurs bizarres
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  .bootstrap-touchspin,
  .input-group.bootstrap-touchspin,
  .qty .input-group.bootstrap-touchspin {
    background: #fff !important;
    border-color: #ddd !important;
  }

  .input-group-btn-vertical {
    background: #f5f5f5 !important;
    border-color: #ddd !important;
  }

  .btn-touchspin {
    background: #f5f5f5 !important;
    color: #666 !important;
  }

  .bootstrap-touchspin input {
    background: #fff !important;
    color: #333 !important;
  }
}
