/* =============================================
   CART SIDEBAR — Slide-in panel
   ============================================= */

/* Overlay */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
.cart-overlay.active {
  opacity: 1; pointer-events: auto;
}

/* Sidebar panel */
.cart-sidebar {
  position: fixed; top: 0; right: 0;
  width: 545px; height: 100vh; height: 100dvh;
  background: var(--dark, #19161D);
  z-index: 9999;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
}
.cart-sidebar.open {
  transform: translateX(0);
}

/* Header */
.cart-sidebar__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 45px 57px 0;
  flex-shrink: 0;
}
.cart-sidebar__title {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-weight: 700;
  font-size: 25px; line-height: 30px;
  color: #fff;
  margin: 0;
}
.cart-sidebar__count {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-weight: 400;
  font-size: 15px; line-height: 18px;
  color: #fff;
  margin: 7px 0 0;
}
.cart-sidebar__close {
  background: none; border: none; cursor: pointer;
  padding: 8px; margin: -4px -4px 0 0;
  display: flex; align-items: center; justify-content: center;
}
.cart-sidebar__close:hover svg line { stroke: var(--green, #67FF09); }

/* Scrollable cart items */
.cart-sidebar__items {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 28px 47px;
  display: flex; flex-direction: column;
  gap: 14px;
}
.cart-sidebar__items::-webkit-scrollbar { width: 4px; }
.cart-sidebar__items::-webkit-scrollbar-track { background: transparent; }
.cart-sidebar__items::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.cart-sidebar__empty {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-size: 14px; color: rgba(255,255,255,0.5);
  text-align: center; padding: 60px 0;
}

/* Cart item card */
.cart-item {
  display: flex; align-items: flex-start;
  gap: 12px;
  border: 1px solid #666;
  border-radius: 0;
  padding: 11px 12px;
  position: relative;
  background: transparent;
}

.cart-item__img {
  width: 125px; height: 125px;
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item__img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.cart-item__info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  justify-content: space-between;
  min-height: 125px;
}

.cart-item__top {
  display: flex; flex-direction: column; gap: 2px;
}
.cart-item__name {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-weight: 700;
  font-size: 13px; line-height: 1.35;
  color: #fff;
}
.cart-item__variant {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-weight: 400;
  font-size: 11px; line-height: 15px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}

.cart-item__bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: auto;
}

/* Qty selector */
.cart-item__qty {
  display: flex; align-items: center;
  border: 1px solid #666;
  border-radius: 4px;
  overflow: hidden;
  height: 36px;
}
.cart-item__qty-btn {
  width: 32px; height: 100%;
  background: none; border: none;
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-size: 16px; color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.cart-item__qty-btn:hover { background: rgba(255,255,255,0.1); }
.cart-item__qty-val {
  width: 30px; text-align: center;
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-size: 14px; font-weight: 400; color: #fff;
}

/* Price */
.cart-item__price {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-weight: 400; font-size: 14px;
  color: #fff; text-align: right;
  white-space: nowrap;
}
.cart-item__price-old {
  color: rgba(255,255,255,0.5);
  font-size: 11px; margin-right: 6px;
}
.cart-item__price-sale {
  color: var(--green, #67FF09);
  font-weight: 700;
}

/* Remove button */
.cart-item__remove {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; cursor: pointer;
  padding: 4px;
  opacity: 0.5; transition: opacity .15s;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.cart-item__remove:hover { opacity: 1; }
.cart-item__remove svg line { stroke: #fff; }
.cart-item__remove--loading svg { display: none; }
.cart-item__remove--loading {
  opacity: 1;
  pointer-events: none;
}
.cart-item__remove--loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cart-spin .6s linear infinite;
}
@keyframes cart-spin {
  to { transform: rotate(360deg); }
}

/* ---- Promo code section ---- */
.cart-sidebar__promo {
  padding: 0 47px 16px;
  flex-shrink: 0;
}
.cart-sidebar__promo-label {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-weight: 700; font-size: 11px;
  line-height: 12px; color: #fff;
  display: block; margin-bottom: 8px;
}
.cart-sidebar__promo-row {
  display: flex; align-items: center;
  border: 1px solid #666;
  border-radius: 4px;
  background: #fff;
  height: 48px; overflow: hidden;
}
.cart-sidebar__promo-input {
  flex: 1; border: none; outline: none;
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-size: 14px; line-height: 18px;
  padding: 0 16px; color: #000;
  background: transparent; height: 100%;
}
.cart-sidebar__promo-input::placeholder { color: #666; }
.cart-sidebar__promo-submit {
  width: 48px; height: 100%;
  background: none; border: none; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
}
.cart-sidebar__promo-msg {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-size: 11px; line-height: 15px;
  margin: 6px 0 0; color: rgba(255,255,255,0.7);
  min-height: 0;
}
.cart-sidebar__promo-msg.success { color: #fff; }
.cart-sidebar__promo-msg.error { color: #ff5555; }

/* Coupon tag */
.cart-sidebar__coupon-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: #dfdfdf;
  border-radius: 5px;
  padding: 8px 10px;
  margin-top: 8px;
}
.cart-sidebar__coupon-tag span {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-weight: 700; font-size: 11px;
  line-height: 12px; color: #000;
}
.cart-sidebar__coupon-remove {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}

/* Footer / totals */
.cart-sidebar__footer {
  padding: 16px 47px 32px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.cart-sidebar__subtotal {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.cart-sidebar__subtotal span {
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-weight: 700; font-size: 15px;
  color: #fff;
}
.cart-sidebar__checkout {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 52px;
  background: var(--green, #67FF09);
  color: #000; border: none; border-radius: 4px;
  font-family: var(--font-sporting, 'Sporting Grotesque', sans-serif);
  font-weight: 700; font-size: 14px;
  text-decoration: none; cursor: pointer;
  transition: opacity .15s;
}
.cart-sidebar__checkout:hover { opacity: .85; }
