/* =========================================
   DARK MODE ONLY – PROFESSIONAL CART UI
   ========================================= */
:root {
  --bg-body: #020617;
  --bg-glass: rgba(15, 23, 42, 0.7);
  --bg-glass-hover: rgba(15, 23, 42, 0.85);
  --border-glass: rgba(255, 255, 255, 0.06);
  --text-primary: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --accent: #38bdf8;
  --accent2: #8b5cf6;
  --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent2));
  --gradient-success: linear-gradient(135deg, #10b981, #059669);
  --gradient-danger: #ef4444;
  --gradient-warning: #f59e0b;
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

.glass {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.glass:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

/* ---------- CONTAINER ---------- */
.cart-container {
  width: min(1100px, 94%);
  margin: 40px auto 80px;
}

/* ---------- HEADER ---------- */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}
.cart-header-icon {
  font-size: 2.5rem;
  color: var(--accent);
}
.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- EMPTY CART ---------- */
.empty-cart {
  text-align: center;
  padding: 80px 30px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
}
.empty-cart-icon {
  font-size: 4rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 16px;
}
.empty-cart p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* ---------- ITEMS LIST ---------- */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

/* ---------- SINGLE ITEM ---------- */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}
.cart-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(56,189,248,0.3);
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}
.cart-item-img-wrapper {
  position: relative;
  flex-shrink: 0;
}
.cart-item-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(255,255,255,0.04);
}
.discount-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--gradient-success);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16,185,129,0.4);
}

.cart-item-details h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.cart-item-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.product-old-price {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 0.85rem;
}
.product-sale-price {
  color: #10b981;
  font-weight: 700;
  font-size: 1.1rem;
}
.product-current-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}
.download-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- ACTIONS ---------- */
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ---------- BUTTONS ---------- */
.btn-remove-item,
.btn-clear,
.btn-checkout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-remove-item {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-remove-item:hover {
  background: #ef4444;
  color: #fff;
  transform: translateY(-2px);
}
.btn-clear {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.btn-clear:hover {
  background: #f59e0b;
  color: #0f172a;
  transform: translateY(-2px);
}
.btn-checkout {
  background: var(--gradient-accent);
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(56,189,248,0.25);
  padding: 12px 28px;
  font-size: 0.95rem;
}
.btn-checkout:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(56,189,248,0.4);
}

/* ---------- SUMMARY ---------- */
.cart-summary {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  padding: 24px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow-md);
}
.summary-detail {
  display: flex;
  align-items: center;
  gap: 16px;
}
.summary-label {
  font-size: 1.2rem;
  color: var(--text-muted);
}
.total-amount {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(56,189,248,0.3);
}
.action-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- FLASH MESSAGE ---------- */
.cart-flash-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin: 0 auto 20px;
  max-width: 800px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  font-weight: 500;
  border: 1px solid transparent;
}
.flash-success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #d1fae5; }
.flash-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #fef3c7; }
.flash-error   { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #fee2e2; }
.flash-info    { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: #dbeafe; }
.icon-success { color: #10b981; }
.icon-warning { color: #f59e0b; }
.icon-error   { color: #ef4444; }
.icon-info    { color: #3b82f6; }

/* ---------- MOBILE ---------- */
@media (max-width: 900px) {
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .cart-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .cart-summary {
    flex-direction: column;
    align-items: flex-start;
  }
  .action-buttons {
    width: 100%;
    flex-direction: column;
  }
  .btn-clear,
  .btn-checkout {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .cart-container {
    margin-top: 20px;
  }
  .cart-item {
    padding: 16px;
  }
  .cart-item-info {
    flex-direction: column;
    align-items: flex-start;
  }
  .cart-item-img {
    width: 100%;
    height: auto;
    max-height: 200px;
  }
  .section-title {
    font-size: 1.8rem;
  }
  .total-amount {
    font-size: 1.4rem;
  }
  .glass,
  .cart-item,
  .cart-summary {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #1e293b;
  }
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
  .cart-item:hover,
  .btn-remove-item:hover,
  .btn-clear:hover,
  .btn-checkout:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}