/* ============================================================
   FinalGrow – Cart Drawer Styles
   ============================================================ */

/* Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: #12122a;
  border-left: 1px solid rgba(108, 63, 197, 0.2);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
}
.cart-drawer.open {
  transform: translateX(0);
}

/* Header */
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.cart-drawer-header h3 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-drawer-header h3 svg { width: 20px; height: 20px; color: var(--purple-light); }
.cart-close-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}
.cart-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.cart-close-btn svg { width: 18px; height: 18px; }

/* Body */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(108,63,197,0.3) transparent;
}
.cart-drawer-body::-webkit-scrollbar { width: 4px; }
.cart-drawer-body::-webkit-scrollbar-track { background: transparent; }
.cart-drawer-body::-webkit-scrollbar-thumb { background: rgba(108,63,197,0.3); border-radius: 4px; }

/* Cart Loading */
.cart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--purple-light);
}
.cart-loading svg { width: 32px; height: 32px; }

/* Cart Empty */
.cart-empty {
  text-align: center;
  padding: 60px 20px;
}
.cart-empty-icon {
  width: 80px; height: 80px;
  background: rgba(108, 63, 197, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.cart-empty-icon svg { width: 36px; height: 36px; color: var(--purple-light); }
.cart-empty h4 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.cart-empty p { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

/* Cart Items */
.cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: flex-start;
  animation: fadeInItem 0.3s ease;
}
.cart-item:last-child { border-bottom: none; }
@keyframes fadeInItem { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.cart-item-img {
  width: 70px; height: 70px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(22, 22, 42, 1);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.06);
}
.cart-item-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.cart-item-details { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.cart-item-price .original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 400;
  margin-left: 4px;
}

/* Quantity Controls */
.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-qty-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
  font-weight: 700;
}
.cart-qty-btn:hover { background: rgba(108, 63, 197, 0.25); border-color: var(--purple); }
.cart-qty-value {
  font-size: 14px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}
.cart-item-remove {
  padding: 6px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-remove:hover { color: #fca5a5; background: rgba(239,68,68,0.1); }
.cart-item-remove svg { width: 16px; height: 16px; }

/* Footer */
.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  background: rgba(10,10,20,0.8);
}
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.cart-subtotal span { font-size: 14px; color: var(--text-secondary); }
.cart-subtotal strong { font-size: 22px; font-weight: 800; }
.cart-shipping-note {
  font-size: 12px;
  color: var(--green);
  margin-bottom: 16px;
}
.cart-shipping-note.paid { color: var(--text-muted); }
.cart-actions { display: flex; flex-direction: column; gap: 8px; }

/* Mini item count badge */
.cart-item-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Free shipping bar */
.free-shipping-bar {
  margin-bottom: 16px;
}
.free-shipping-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.free-shipping-text strong { color: var(--green); }
.shipping-progress-track {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.shipping-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--orange));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Responsive */
@media (max-width: 480px) {
  .cart-drawer { width: 100vw; }
}

/* ============================================================
   Cart Page (cart.php) Styles
   ============================================================ */

.cart-page-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* Cart page item row */
.cart-page-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  transition: background 0.2s ease;
}
.cart-page-item:hover {
  background: rgba(108, 63, 197, 0.04);
}

.cart-page-img {
  width: 90px;
  height: 90px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(22, 22, 42, 1);
  border: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  display: block;
}
.cart-page-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.cart-page-img:hover img {
  transform: scale(1.05);
}

.cart-page-info {
  flex: 1;
  min-width: 0;
}
.cart-page-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.cart-page-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cart-page-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.cart-page-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 140px;
}

.cart-page-remove {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.cart-page-remove:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}
.cart-page-remove i {
  width: 14px;
  height: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
  .cart-page-layout {
    grid-template-columns: 1fr;
  }
  .cart-page-right {
    min-width: 100px;
  }
}

@media (max-width: 640px) {
  .cart-page-item {
    flex-wrap: wrap;
    padding: 16px;
    gap: 14px;
  }
  .cart-page-img {
    width: 70px;
    height: 70px;
  }
  .cart-page-right {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: 4px;
  }
}
