/* ===================================================================
   PANIER.CSS  — Cart page & mini-cart — chargeurdeportable.com
   =================================================================== */

:root {
  --cp-navy:   #0f172a;
  --cp-blue:   #1e3a5f;
  --cp-orange: #e85d04;
  --cp-green:  #16a34a;
  --cp-red:    #dc2626;
  --cp-bg:     #f8fafc;
  --cp-white:  #ffffff;
  --cp-border: #e2e8f0;
  --cp-text:   #1e293b;
  --cp-muted:  #64748b;
  --cp-radius: 12px;
  --cp-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

/* -------------------------------------------------------
   PAGE WRAPPER
------------------------------------------------------- */
.cart-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 72px;
  color: var(--cp-text);
}

.cart-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 28px;
  color: var(--cp-navy);
}

/* -------------------------------------------------------
   EMPTY CART
------------------------------------------------------- */
.cart-empty {
  text-align: center;
  padding: 72px 24px;
  background: var(--cp-white);
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
  border: 1px solid var(--cp-border);
}
.cart-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: var(--cp-muted);
  opacity: .5;
}
.cart-empty p {
  font-size: 1.05rem;
  color: var(--cp-muted);
  margin: 0 0 28px;
}

/* -------------------------------------------------------
   TWO-COLUMN LAYOUT
------------------------------------------------------- */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 920px) {
  .cart-layout { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------
   ITEMS LIST
------------------------------------------------------- */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* -------------------------------------------------------
   SINGLE ITEM ROW
------------------------------------------------------- */
.cart-item {
  display: grid;
  grid-template-columns: 88px 1fr 110px 100px 110px 44px;
  align-items: center;
  gap: 14px;
  background: var(--cp-white);
  border-radius: var(--cp-radius);
  padding: 16px;
  box-shadow: var(--cp-shadow);
  border: 1px solid var(--cp-border);
  transition: box-shadow .18s, opacity .25s, transform .25s;
}
.cart-item:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.09);
}
.cart-item.removing {
  opacity: 0;
  transform: translateX(24px);
}

@media (max-width: 680px) {
  .cart-item {
    grid-template-columns: 68px 1fr 44px;
    grid-template-rows: auto auto auto;
  }
  .cart-item-pu   { display: none; }
}

/* ---- Image ---- */
.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cp-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cart-item-no-img {
  color: var(--cp-muted);
  opacity: .45;
}

/* ---- Info ---- */
.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.cart-item-name {
  font-weight: 600;
  font-size: .94rem;
  color: var(--cp-navy);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.cart-item-name:hover { color: var(--cp-orange); }

.cart-item-ref {
  font-size: .76rem;
  color: var(--cp-muted);
}
.cart-item-option {
  display: inline-block;
  font-size: .76rem;
  color: var(--cp-blue);
  background: #eff6ff;
  border-radius: 5px;
  padding: 2px 8px;
}

/* ---- Quantity ---- */
.cart-item-qty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.qty-label,
.price-label {
  font-size: .7rem;
  color: var(--cp-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.qty-select {
  border: 1.5px solid var(--cp-border);
  border-radius: 8px;
  padding: 7px 28px 7px 10px;
  font-size: .88rem;
  color: var(--cp-text);
  background: var(--cp-white);
  cursor: pointer;
  width: 72px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color .15s;
}
.qty-select:focus {
  outline: none;
  border-color: var(--cp-orange);
  box-shadow: 0 0 0 3px rgba(232,93,4,.1);
}

/* ---- Prices ---- */
.cart-item-pu,
.cart-item-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
.price-value {
  font-size: .94rem;
  font-weight: 600;
  color: var(--cp-text);
}
.cart-item-total .price-value {
  color: var(--cp-navy);
  font-size: 1rem;
}

/* ---- Delete ---- */
.cart-item-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cp-muted);
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.cart-item-delete:hover {
  color: var(--cp-red);
  background: #fef2f2;
}

/* -------------------------------------------------------
   ORDER SUMMARY (right column)
------------------------------------------------------- */
.cart-summary {
  background: var(--cp-white);
  border-radius: var(--cp-radius);
  padding: 24px;
  box-shadow: var(--cp-shadow);
  border: 1px solid var(--cp-border);
  position: sticky;
  top: 100px;
}
.cart-summary-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cp-navy);
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cp-border);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  font-size: .9rem;
  color: var(--cp-text);
  border-bottom: 1px solid var(--cp-bg);
}
.summary-discount { color: var(--cp-green); font-weight: 500; }
.summary-total {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cp-navy);
  margin-top: 6px;
  padding-top: 14px;
  border-top: 2px solid var(--cp-border);
  border-bottom: none;
}

/* ---- Buttons ---- */
.btn-cart-checkout,
.btn-cart-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--cp-orange);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  margin-top: 20px;
  transition: background .15s, transform .12s;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}
.btn-cart-checkout:hover,
.btn-cart-primary:hover {
  background: #c84e02;
  transform: translateY(-1px);
}
.btn-cart-quote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 20px;
  background: var(--cp-white);
  color: var(--cp-navy);
  border: 1.5px solid var(--cp-navy);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: .87rem;
  margin-top: 10px;
  transition: background .15s;
  box-sizing: border-box;
}
.btn-cart-quote:hover { background: var(--cp-bg); }
.btn-cart-continue {
  display: block;
  text-align: center;
  color: var(--cp-muted);
  font-size: .84rem;
  text-decoration: none;
  margin-top: 14px;
  transition: color .15s;
}
.btn-cart-continue:hover { color: var(--cp-text); }

/* -------------------------------------------------------
   SHIPPING SECTION
------------------------------------------------------- */
.cart-shipping {
  background: var(--cp-white);
  border-radius: var(--cp-radius);
  border: 1px solid var(--cp-border);
  padding: 20px;
  margin-top: 10px;
  box-shadow: var(--cp-shadow);
}
.cart-shipping h3 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--cp-navy);
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
/* Override old table-based shipping styles */
.cart-shipping table { border-collapse: collapse; width: 100%; }
.cart-shipping td    { padding: 6px 8px; font-size: .88rem; }

/* -------------------------------------------------------
   TRUSTPILOT
------------------------------------------------------- */
.cart-trust {
  margin-top: 36px;
  text-align: center;
}

/* -------------------------------------------------------
   ADD-TO-CART FORM (product page)
------------------------------------------------------- */
.form-add-cart {
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
}
.form-add-cart-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-add-cart-qty-label {
  font-size: .85rem;
  color: var(--cp-muted);
  font-weight: 600;
}
.form-add-cart-qty {
  border: 1.5px solid var(--cp-border);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  font-size: .88rem;
  width: 70px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}
.form-add-cart-option-row {
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- btn-add-cart: loading state ---- */
.btn-add-cart {
  position: relative;
  overflow: hidden;
  transition: opacity .2s;
}
.btn-add-cart.loading {
  opacity: .75;
  pointer-events: none;
}
.btn-add-cart.loading .btn-add-cart-icon i {
  animation: cart-spin .7s linear infinite;
}
@keyframes cart-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.btn-add-cart.added .btn-add-cart-icon i::before {
  content: "\f00c";  /* fa-check */
}

/* -------------------------------------------------------
   TOAST NOTIFICATION
------------------------------------------------------- */
.cart-toast {
  position: fixed;
  bottom: 28px;
  right: 24px;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 500;
  color: #fff;
  background: var(--cp-navy);
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  transform: translateY(80px);
  opacity: 0;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s;
  pointer-events: none;
}
.cart-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.cart-toast.success { background: var(--cp-green); }
.cart-toast.error   { background: var(--cp-red); }

/* -------------------------------------------------------
   MINI-CART BADGE BUMP ANIMATION
------------------------------------------------------- */
.hdr-badge.bump {
  animation: badge-bump .3s ease-out;
}
@keyframes badge-bump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* -------------------------------------------------------
   MINI-CART DROPDOWN — improvements
------------------------------------------------------- */
.dd-cart-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--cp-muted);
  font-size: .88rem;
}
.dd-cart-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.dd-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--cp-border);
}
.dd-cart-img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--cp-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dd-cart-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dd-cart-info {
  flex: 1;
  min-width: 0;
}
.dd-cart-name {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--cp-navy);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dd-cart-name:hover { color: var(--cp-orange); }
.dd-cart-ref {
  font-size: .72rem;
  color: var(--cp-muted);
  margin: 2px 0 0;
}
.dd-cart-price {
  font-size: .88rem;
  font-weight: 700;
  color: var(--cp-navy);
  flex-shrink: 0;
}
.dd-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 8px;
  font-size: .88rem;
}
.dd-cart-total-label { color: var(--cp-muted); }
.dd-cart-total-price {
  font-weight: 700;
  color: var(--cp-navy);
  font-size: 1rem;
}
.dd-cart-cta {
  display: block;
  text-align: center;
  background: var(--cp-orange);
  color: #fff;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .88rem;
  margin-top: 8px;
  transition: background .15s;
}
.dd-cart-cta:hover { background: #c84e02; }
