/**
 * WK SARL - Page Panier Dark Mode Luxe (Version Optimisée)
 * Sans débordements, responsive parfait
 */

/* === BASE === */
* {
  box-sizing: border-box;
}

/* === LAYOUT === */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 1200px) {
  .cart-layout {
    grid-template-columns: 1fr 360px;
  }
}

@media (max-width: 1024px) {
  .cart-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* === LISTE ARTICLES === */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* === ARTICLE === */
.cart-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto auto auto;
  gap: 1.25rem;
  padding: 1.25rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  align-items: center;
  transition: all 0.3s ease;
  width: 100%;
}

.cart-item:hover {
  background: #1f1f1f;
  border-color: #D4A017;
}

@media (max-width: 968px) {
  .cart-item {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    position: relative;
  }
}

/* === IMAGE === */
.cart-item-image {
  width: 110px;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a;
  border: 1px solid #333;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 968px) {
  .cart-item-image {
    width: 90px;
    height: 90px;
  }
}

/* === DÉTAILS === */
.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.cart-item-ref {
  font-size: 10px;
  color: #888;
  margin: 0 0 0.15rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cart-item-brand {
  font-size: 12px;
  color: #aaa;
  margin: 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-badge {
  display: inline-block;
  background: #2a2a2a;
  color: #D4A017;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 0.25rem;
  white-space: nowrap;
  width: fit-content;
}

/* === QUANTITÉ === */
.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: #0a0a0a;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  flex-shrink: 0;
}

@media (max-width: 968px) {
  .cart-item-quantity {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 0.75rem;
  }
}

.quantity-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.quantity-btn:hover {
  background: #D4A017;
  border-color: #D4A017;
  color: #000;
}

.quantity-input {
  width: 45px;
  height: 32px;
  text-align: center;
  border: 1px solid #333;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  background: #1a1a1a;
  color: #fff;
  -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quantity-input:focus {
  outline: none;
  border-color: #D4A017;
}

/* === PRIX === */
.cart-item-price {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  text-align: right;
  min-width: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 968px) {
  .cart-item-price {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #2a2a2a;
    font-size: 18px;
  }
}

/* === SUPPRIMER === */
.cart-item-remove {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cart-item-remove svg {
  width: 18px;
  height: 18px;
  color: #888;
}

.cart-item-remove:hover {
  background: #2a1515;
  border-color: #ff4444;
}

.cart-item-remove:hover svg {
  color: #ff4444;
}

@media (max-width: 968px) {
  .cart-item-remove {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
}

/* === RÉSUMÉ COMPACT === */
.cart-summary {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  height: fit-content;
  position: sticky;
  top: 90px;
  width: 100%;
  padding: 1.25rem;
}

@media (max-width: 1024px) {
  .cart-summary {
    position: relative;
    top: 0;
  }
}

/* Bloc compact */
.cart-summary-compact {
  margin-bottom: 1rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 13px;
  color: #aaa;
}

.cart-summary-row span:last-child {
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}

.cart-summary-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 0.75rem 0;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  font-size: 14px;
  color: #fff;
  font-weight: 700;
}

.cart-summary-total span:last-child {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

/* === BOUTON COMMANDER COMPACT === */
.cart-btn-order {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, #D4A017 0%, #c99015 100%);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-bottom: 1rem;
}

.cart-btn-order:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212,160,23,0.35);
}

/* === BLOC PAIEMENT 2× COMPACT === */
.cart-payment-block {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.cart-payment-title {
  font-size: 10px;
  font-weight: 700;
  color: #D4A017;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-payment-split {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.cart-payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #aaa;
}

.cart-payment-row strong {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.cart-payment-footer {
  font-size: 10px;
  color: #888;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #2a2a2a;
}

/* === GARANTIES COMPACTES === */
.cart-guarantees {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
}

.cart-guarantee {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11px;
  color: #aaa;
}

.cart-guarantee svg {
  width: 14px;
  height: 14px;
  color: #22c55e;
  flex-shrink: 0;
}

/* === CONTINUER === */
.cart-continue {
  display: block;
  text-align: center;
  color: #888;
  font-size: 12px;
  padding: 1rem 0;
  text-decoration: none;
  transition: color 0.2s;
}

.cart-continue:hover {
  color: #D4A017;
}

/* === UTILITAIRES === */
.text-success {
  color: #22c55e !important;
  font-weight: 700 !important;
}
