/**
 * Moxie Cart — Styles du panneau latéral
 */

/* ===== BOUTON HEADER ===== */
.moxiecart-header-btn {
  display: inline-block;
}

.moxiecart-trigger {
  position: relative;
  background: transparent;
  border: none;
  color: #0a0a0a;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.moxiecart-trigger:hover {
  opacity: 0.7;
}

.moxiecart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #c1d101;
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
}

/* ===== OVERLAY ===== */
.moxiecart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9998;
}

.moxiecart-overlay.moxiecart-active {
  opacity: 1;
  visibility: visible;
}

/* ===== PANNEAU LATÉRAL ===== */
.moxiecart-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.moxiecart-panel.moxiecart-active {
  right: 0;
}

/* ===== HEADER NOIR ===== */
.moxiecart-header {
  background: #0a0a0a;
  color: #fff;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #c1d101;
  flex-shrink: 0;
}

.moxiecart-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.moxiecart-close {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.moxiecart-close:hover {
  opacity: 1;
}

/* ===== MESSAGE LIVRAISON ===== */
.moxiecart-shipping-notice {
  padding: 16px 24px;
  background: #f8f8f8;
  border-bottom: 0.5px solid #e5e5e5;
  flex-shrink: 0;
}

.moxiecart-shipping-text {
  margin: 0;
  font-size: 13px;
  color: #666;
}

.moxiecart-shipping-success {
  color: #2d7a3e;
  font-weight: 500;
}

/* ===== CONTENU SCROLLABLE ===== */
.moxiecart-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ===== PRODUITS DANS LE PANIER ===== */
.moxiecart-products {
  margin-bottom: 24px;
}

.moxiecart-product {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.moxiecart-product-img {
  width: 80px;
  height: 80px;
  background: #f5f5f5;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moxiecart-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moxiecart-product-noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moxiecart-product-info {
  flex: 1;
  min-width: 0;
}

.moxiecart-product-name {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: #000;
}

.moxiecart-product-attrs {
  margin: 0 0 12px;
  font-size: 13px;
  color: #666;
}

.moxiecart-product-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Sélecteur de quantité */
.moxiecart-qty {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0.5px solid #d1d1d1;
  border-radius: 8px;
  padding: 4px 8px;
}

.moxiecart-qty-btn {
  background: transparent;
  border: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.moxiecart-qty-btn:hover {
  color: #000;
}

.moxiecart-qty-value {
  font-size: 14px;
  font-weight: 500;
  min-width: 20px;
  text-align: center;
}

.moxiecart-product-price {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #000;
}

/* Bouton retirer */
.moxiecart-remove {
  background: transparent;
  border: none;
  color: #666;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.moxiecart-remove:hover {
  color: #000;
}

/* ===== DIVIDER ===== */
.moxiecart-divider {
  height: 0.5px;
  background: #e5e5e5;
  margin: 24px 0;
}

/* ===== PRODUITS COMPLÉMENTAIRES ===== */
.moxiecart-cross-sells {
  margin-bottom: 24px;
}

.moxiecart-cross-title {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 500;
  color: #000;
}

.moxiecart-cross-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
  border: 0.5px solid #e5e5e5;
  margin-bottom: 12px;
}

.moxiecart-cross-img {
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moxiecart-cross-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moxiecart-cross-info {
  flex: 1;
  min-width: 0;
}

.moxiecart-cross-name {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: #000;
}

.moxiecart-cross-price {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #0a0a0a;
}

.moxiecart-cross-add {
  width: 100%;
  height: 40px;
  background: transparent;
  color: #0a0a0a;
  border: 0.5px solid #b1b1b1;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.moxiecart-cross-add:hover {
  background: #fafafa;
  border-color: #0a0a0a;
}

/* ===== INFO TAXES ===== */
.moxiecart-tax-notice {
  padding: 12px;
  background: #f8f8f8;
  border-radius: 8px;
}

.moxiecart-tax-notice p {
  margin: 0;
  font-size: 13px;
  color: #666;
}

/* ===== PANIER VIDE ===== */
.moxiecart-empty {
  text-align: center;
  padding: 60px 24px;
}

.moxiecart-empty svg {
  margin-bottom: 16px;
}

.moxiecart-empty p {
  margin: 0;
  font-size: 15px;
  color: #999;
}

/* ===== FOOTER STICKY ===== */
.moxiecart-footer {
  padding: 20px 24px;
  border-top: 0.5px solid #e5e5e5;
  background: #fff;
  flex-shrink: 0;
}

.moxiecart-btn {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
}

.moxiecart-btn-outline {
  background: transparent;
  color: #0a0a0a;
  border: 0.5px solid #b1b1b1;
  margin-bottom: 12px;
}

.moxiecart-btn-outline:hover {
  background: #fafafa;
  border-color: #0a0a0a;
}

.moxiecart-btn-primary {
  background: #0a0a0a;
  color: #fff;
}

.moxiecart-btn-primary:hover {
  background: #1a1a1a;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .moxiecart-panel {
    width: 100vw;
    right: -100vw;
  }

  .moxiecart-panel.moxiecart-active {
    right: 0;
  }
}

/* ===== ÉTAT DE CHARGEMENT ===== */
.moxiecart-loading {
  pointer-events: none;
  opacity: 0.6;
}

/* Animation du spinner de chargement */
@keyframes moxiecart-spin {
  to { transform: rotate(360deg); }
}

.moxiecart-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-left-color: #0a0a0a;
  border-radius: 50%;
  animation: moxiecart-spin 0.6s linear infinite;
}

/* ===== MASQUER LA MODAL NATIVE PRESTASHOP ===== */
/* Modal "Added to cart" du thème Hummingbird */
#blockcart-modal,
.blockcart-modal,
[id*="blockcart"],
[class*="blockcart-modal"],
.modal.show.fade[id*="product"],
body.modal-open .modal.show {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Empêcher le body d'être bloqué par la modal native */
body.modal-open {
  overflow: auto !important;
  padding-right: 0 !important;
}

/* Masquer le backdrop de la modal */
.modal-backdrop {
  display: none !important;
}
