/* =============== Overlay & Panel =============== */

.nt-cart-overlay{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease; z-index: 1040;
}

.nt-cart-overlay[aria-hidden="false"]{ opacity:1; pointer-events:auto; }

.nt-cart-drawer{
  position: fixed; top:0; right:0; height:100%;
  width: min(420px, 95vw);
  background:#fff; box-shadow:-4px 0 18px rgba(0,0,0,.12);
  transform: translateX(100%); transition: transform .3s ease;
  z-index:1041; display:flex; flex-direction:column;
}

.nt-cart-drawer[aria-hidden="false"]{ transform: translateX(0); }

body.nt-cart-open{ overflow:hidden; }

/* =============== Header =============== */

.nt-cart-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px; border-bottom:1px solid #e9e9ec;
}

.nt-cart-title{ margin:0; font-size:1rem; font-weight:600; color:#111; display:flex; gap:.5rem; align-items:center; }

.nt-cart-count{ min-width:22px; height:22px; padding:0 6px; border-radius:999px; font-size:.78rem; line-height:22px; text-align:center; background:#111; color:#fff; }

.nt-cart-close{ background:transparent; border:0; font-size:1.25rem; line-height:1; cursor:pointer; color:#222; opacity:.75; }

.nt-cart-close:hover{ opacity:1; }

/* =============== Contents wrapper =============== */

.nt-cart-contents{ flex:1 1 auto; overflow:auto; padding:10px 18px; }

/* =============== Items =============== */

.nt-mini-cart-list{ list-style:none; margin:0; padding:0; }

.nt-item{
  display:grid; grid-template-columns: 72px 1fr; gap:12px;
  align-items:start; padding:14px 0; border-bottom:1px solid #eee;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.nt-item:last-child{ border-bottom:0; }

/* Media */
.nt-item-media img{ width:72px; height:72px; object-fit:cover; border:1px solid #eee; border-radius:6px; display:block; }

/* Main */
.nt-item-main{ display:flex; flex-direction:column; gap:8px; min-width:0; }

/* Row: title + price */
.nt-item-row{
  display:flex; align-items:flex-start; gap:10px;
}

.nt-item-title{
  flex:1 1 auto; min-width:0;
  color:#111; font-weight:600; text-decoration:none;
}

.nt-item-title:hover{ text-decoration:underline; }

.nt-item-price{ white-space:nowrap; color:#111; font-weight:600; }

/* Row: qty + subtotal */
.nt-item-row-qty{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}

/* Qty controls */
.nt-qty-wrap{
  display:inline-flex; align-items:center; gap:6px;
  border:1px solid #e5e5ea; border-radius:999px;
  padding:2px 6px; background:#fff;
}

.nt-qty-btn{
  width:24px; height:24px; display:inline-flex; align-items:center; justify-content:center;
  border:0; border-radius:999px; font-size:16px; line-height:1; cursor:pointer; color:#111; background:#f4f4f5;
}

.nt-qty-btn:hover{ background:#ececee; }

.nt-qty-input{
  width:34px; border:0; text-align:center; font-size:.95rem; background:transparent; outline:none;
}

.nt-qty-input::-webkit-outer-spin-button,
.nt-qty-input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }

.nt-item-subtotal{ font-weight:600; color:#333; white-space:nowrap; }

/* =============== Promo =============== */

.nt-cart-promo{ border-top:1px solid #e9e9ec; border-bottom:1px solid #e9e9ec; margin-top:10px; padding:8px 0; }

.nt-promo-toggle{
  width:100%; text-align:left; background:#fff; border:0; padding:8px 0;
  font-weight:600; color:#111; display:flex; align-items:center; justify-content:space-between; cursor:pointer;
}

.nt-promo-caret{ color:#666; }

.nt-promo-panel{ padding:8px 0 2px; }

.nt-promo-inputs{ display:grid; grid-template-columns:1fr auto; gap:8px; }

.nt-input{
  border:1px solid #e5e5ea; border-radius:8px; height:40px; padding:0 12px; font-size:.95rem;
}

.nt-btn{ height:40px; padding:0 14px; border-radius:8px; font-weight:600; border:1px solid #111; background:#fff; color:#111; }

.nt-btn-light{ background:#f7f7f8; border-color:#ddd; }

/* =============== Total & note =============== */

.nt-cart-total{
  display:flex; align-items:center; justify-content:space-between;
  margin:14px 0 6px; padding-top:12px; border-top:1px solid #e9e9ec; font-weight:600;
}

.nt-total-label{ color:#333; }

.nt-total-value{ color:#111; white-space:nowrap; }

.nt-checkout-note{ margin:0 0 10px; color:#777; font-size:.85rem; line-height:1.4; }

/* =============== Footer buttons =============== */

.nt-cart-footer{
  padding:14px 18px 18px; border-top:1px solid #e9e9ec;
  display:grid; gap:10px;
}

.nt-cart-btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:48px; border-radius:10px; font-weight:700; text-decoration:none; border:1px solid #111;
}

.nt-cart-btn-primary{ background:#111; color:#fff; }

.nt-cart-btn-primary:hover{ filter:brightness(1.05); }

.nt-cart-btn-secondary{ background:#fff; color:#555; border-color:transparent; }

.nt-cart-btn-secondary:hover{ background:#f4f4f5; }

/* =============== Responsive =============== */

@media (max-width: 480px){
  .nt-cart-drawer{ width:100vw; }
  .nt-cart-header{ padding:14px; }
  .nt-cart-contents{ padding:10px 14px; }
  .nt-cart-footer{ padding:12px 14px 16px; }
}

/* =============== Bouton "×" de suppression sur miniature =============== */

.nt-item-media-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.nt-item-remove {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #555;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 0 2px rgba(0,0,0,0.2);
  z-index: 2;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nt-item-remove:hover {
  background: #dc3545;
  color: #fff;
  transform: scale(1.1);
}

.nt-item-remove:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* =============== SPINNER BOOTSTRAP - Bouton suppression =============== */

.nt-item-remove .spinner-border-sm {
  width: 12px;
  height: 12px;
  border-width: 2px;
}

/* =============== Loading state sur un item (suppression en cours) =============== */

.nt-item.is-removing {
  opacity: .5;
  pointer-events: none;
  position: relative;
  transform: scale(0.98);
}

.nt-item-media-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(255,255,255,.7);
  border-radius: 6px;
}

.nt-item.is-removing .nt-item-media-wrap::after {
  display: grid;
}

/* Animation de chargement sur mise à jour de quantité */

.nt-qty-wrap.is-loading {
  position: relative;
  opacity: .6;
  pointer-events: none;
}

.nt-qty-wrap.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.6);
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.nt-qty-wrap.is-loading::after:before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #111;
  border-right-color: transparent;
  display: inline-block;
  animation: nt-spin .6s linear infinite;
}

@keyframes nt-spin {
  to { transform: rotate(360deg); }
}

/* =============== Bouton Panier --- version icône propre sans bordure =============== */

.btn-cart {
  background: none !important;
  border: none !important;
  padding: 0.25rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  color: var(--bs-body-color);
  transition: color .25s ease, transform .15s ease;
}

/* Icône du panier */
.btn-cart .bi {
  font-size: 1.4rem;
  line-height: 1;
}

/* Effet hover */
.btn-cart:hover,
.btn-cart:focus {
  color: var(--bs-primary);
  transform: translateY(-1px);
}

/* Badge de nombre d'articles */
.btn-cart .cart-count {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(30%, -30%);
  font-size: 0.65rem;
  min-width: 1.1rem;
  height: 1.1rem;
  line-height: 1.1rem;
  border-radius: 50%;
  text-align: center;
  background-color: var(--bs-primary);
  color: #fff;
  font-weight: 500;
}

/* Supprime les effets bouton Bootstrap */
.btn-cart:focus,
.btn-cart:active {
  box-shadow: none !important;
  outline: none !important;
}

/* Variante mobile (icône légèrement plus grande) */
@media (max-width: 991px) {
  .btn-cart .bi {
    font-size: 1.6rem;
  }
}

/* =============== Améliorations Promo =============== */

.nt-promo-feedback.is-success {
  background: #d1e7dd !important;
  color: #0f5132 !important;
  border: 1px solid #badbcc !important;
}

.nt-promo-feedback.is-error {
  background: #f8d7da !important;
  color: #721c24 !important;
  border: 1px solid #f1aeb5 !important;
}

.nt-promo-feedback.is-info {
  background: #cff4fc !important;
  color: #055160 !important;
  border: 1px solid #9eeaf9 !important;
}

.nt-applied-coupons-list {
  animation: nt-slideDown .3s ease;
}

.nt-remove-coupon {
  transition: all .2s ease;
}

.nt-remove-coupon:hover {
  background: #dc3545 !important;
  color: #fff !important;
  transform: scale(1.1);
}

.nt-remove-coupon:disabled {
  opacity: .6;
  cursor: not-allowed;
}

@keyframes nt-slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state pour le bouton promo */
#applyPromoBtn.is-loading {
  position: relative;
  color: transparent;
}

#applyPromoBtn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid #111;
  border-radius: 50%;
  animation: nt-spin .8s linear infinite;
}

/* Amélioration visuelle quand des coupons sont appliqués */
.nt-promo-applied {
  animation: nt-fadeIn .4s ease;
}

@keyframes nt-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =============== Animation de fade out pour suppression =============== */

@keyframes nt-fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}