/* ============================================================
   cart.css — Shopping Bag Page
   Extends style.css — Royal Indian Festival Theme
   Synced with cart.js and cart.html
   ============================================================ */

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.cart-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 140px;
}

/* ============================================================
   PAGE HERO
   ============================================================ */
.page-hero {
  position: relative;
  padding: 60px 0 48px;
  text-align: center;
  overflow: hidden;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(232, 57, 138, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(232, 160, 32, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.page-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.6s ease both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--text-light);
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ============================================================
   EMPTY CART STATE
   MISMATCH #2 FIX — removed .visible class approach entirely.
   JS controls visibility via style.display = "flex" / "none".
   ============================================================ */
.empty-cart-msg {
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 80px 24px;
}

.empty-cart-icon {
  font-size: 4rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.empty-cart-msg h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-light);
}

.empty-cart-msg p {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============================================================
   CART ITEMS LIST
   ============================================================ */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

/* ============================================================
   CART ITEM CARD
   ============================================================ */
.cart-item {
  background: var(--grad-card);
  border: 1px solid rgba(245, 208, 96, 0.1);
  border-radius: var(--radius-card);
  padding: 20px 20px 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  overflow: hidden;
  animation: fadeSlideIn 0.4s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cart-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--grad-gold);
  border-radius: 4px 0 0 4px;
}

.cart-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: rgba(245, 208, 96, 0.25);
}

.cart-item-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 208, 96, 0.1);
  padding: 8px;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.cart-item-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   QUANTITY ROW
   MISMATCH #6 FIX — renamed from .cart-item-qty → .cart-qty-row
   MISMATCH #12 FIX — .qty-label and .qty-value added
   ============================================================ */
.cart-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.qty-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
}

.qty-value {
  font-family: 'Baloo Bhai 2', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-light);
  min-width: 22px;
  text-align: center;
}

.qtyBtn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(245, 208, 96, 0.12);
  border: 1px solid rgba(245, 208, 96, 0.3);
  color: var(--gold-light);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  flex-shrink: 0;
}

.qtyBtn:hover:not(:disabled) {
  background: var(--grad-gold);
  color: var(--text-dark);
  border-color: transparent;
  transform: scale(1.15);
}

.qtyBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   CART ITEM RIGHT — price + remove button
   MISMATCH #11 FIX — .cart-item-right was missing from CSS
   ============================================================ */
.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  align-self: stretch;
}

.cart-item-price {
  font-family: 'Baloo Bhai 2', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-light);
  white-space: nowrap;
}

.cart-remove-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  white-space: nowrap;
}

.cart-remove-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

.cart-remove-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   CART SUMMARY — sticky bottom bar
   MISMATCH #4 FIX — starts hidden; JS toggles style.display
   ============================================================ */
.cart-summary {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(15, 2, 32, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(245, 208, 96, 0.2);
  padding: 14px 24px;
  /* display is controlled by cart.js — starts "none" via HTML style attr */
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 200;
  flex-wrap: wrap;
}

/* ============================================================
   SUMMARY TOTALS
   MISMATCH #10 FIX — .cart-total-row replacing old .cart-total
   ============================================================ */
.cart-summary-totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-total-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
}

.cart-total-row span:last-child {
  color: var(--text-light);
  font-weight: 700;
}

.cart-total-row--amount span:last-child {
  font-family: 'Baloo Bhai 2', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold-light);
}

/* ============================================================
   SUMMARY ACTIONS
   MISMATCH #8 FIX — .btn-continue was completely unstyled
   MISMATCH #13 FIX — .cart-summary-actions wrapper for mobile stacking
   ============================================================ */
.cart-summary-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-continue {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(245, 208, 96, 0.2);
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-continue:hover {
  color: var(--gold-light);
  border-color: rgba(245, 208, 96, 0.4);
  background: rgba(245, 208, 96, 0.05);
}

.checkout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  background: var(--grad-gold);
  color: var(--text-dark);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Baloo Bhai 2', sans-serif;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.checkout-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(232, 160, 32, 0.5);
}

.checkout-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   CART TOAST
   MISMATCH #9 FIX — new styles for #cartToast added to cart.html
   ============================================================ */
.cart-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 2, 32, 0.96);
  border: 1px solid rgba(245, 200, 66, 0.3);
  color: var(--text-light);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 50px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
  backdrop-filter: blur(12px);
}

.cart-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cart-toast--error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .cart-page { padding: 0 16px 150px; }

  .cart-item {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
  }

  .cart-item-img { width: 80px; height: 80px; }
  .cart-item-details { flex: 1; min-width: 0; }

  .cart-item-right {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }

  .cart-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px;
  }

  .cart-summary-totals {
    flex-direction: row;
    justify-content: space-between;
  }

  .cart-summary-actions {
    flex-direction: column;
    gap: 8px;
  }

  .btn-continue,
  .checkout-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .cart-item-img { width: 64px; height: 64px; }
  .cart-total-row--amount span:last-child { font-size: 1.2rem; }
}