/**
 * =====================================================================================
 * HELLA 3D MANAGEMENT SUITE: CART PAGE STYLESHEET
 * =====================================================================================
 * @file        cart.css
 * @description Premium Glassmorphism UI for Cart Review and Checkout routing.
 * @version     1.0.0
 * @cleared     Jul 5, 2026
 * * ARCHITECTURE OVERVIEW:
 * 1. Flexbox Architecture: Utilizes a robust flex-based layout to cleanly separate 
 * scalable product item rows from the sticky checkout summary column.
 * 2. Visual Feedback Loops: Implements cubic-bezier CSS animations (.qty-pop) to 
 * provide immediate tactile feedback when interacting with Optimistic UI elements.
 * 3. Sticky Subtotal: The right column leverages position: sticky to keep the checkout 
 * CTA constantly accessible on long carts.
 * =====================================================================================
 */

:root {
  --brand-red: #ff3b3b;
}

.smooth-scroll {
  scroll-behavior: smooth;
}

/* --- PERFORMANCE OVERRIDES --- */
.h3d-liquid-bg {
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.h3d-liquid-bg .blob {
  animation: none !important;
  transition: none !important;
  transform: translate3d(0, 0, 0);
}

/* --- CART LAYOUT --- */
.page-main-content {
  position: relative;
  z-index: 10;
  padding-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 60vh;
}

.cart-header {
  width: calc(100% - 40px);
  max-width: 1400px;
  margin: 0 auto 2rem auto;
}

.cart-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.cart-layout {
  display: flex;
  gap: 3rem;
  width: calc(100% - 40px);
  max-width: 1400px;
  margin: 0 auto 6rem auto;
  align-items: flex-start;
}

/* --- LEFT COLUMN: CART ITEMS --- */
.cart-items-column {
  flex: 1.8;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cart-item-card {
  background-color: var(--glass-bg);
  background-image: var(--glass-noise);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  position: relative;
}

.cart-item-image {
  width: 140px;
  aspect-ratio: 3/2;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cart-item-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cart-item-title:hover {
  color: var(--brand-red);
}

.cart-item-variants {
  font-size: 0.85rem;
  color: #a0a0a0;
  font-weight: 500;
}

/* --- PRICE ANCHORING --- */
.price-breakdown {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.9rem;
  color: #b0b0b0;
}

.sale-badge {
  background-color: var(--brand-red);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.original-price {
  text-decoration: line-through;
  opacity: 0.6;
}

.cart-item-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-red);
  margin-top: 0.2rem;
}

.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

/* --- QUANTITY SELECTOR --- */
.qty-selector {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
  width: 130px;
  height: 48px;
}

.qty-btn {
  flex: 0 0 40px;
  width: 40px;
  height: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.qty-btn:active {
  transform: scale(0.85);
  background: rgba(255, 255, 255, 0.2);
}

.qty-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  color: #fff;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
  padding: 0;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.15s ease;
}

.qty-input:focus {
  background: rgba(255, 255, 255, 0.05);
}

.qty-input.qty-pop {
  transform: scale(1.25);
  color: var(--brand-red);
}

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

.remove-btn {
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease;
}

.remove-btn:hover {
  color: var(--brand-red);
}

/* --- RIGHT COLUMN: CHECKOUT SUMMARY --- */
.cart-summary-column {
  flex: 1;
  background-color: var(--glass-bg);
  background-image: var(--glass-noise);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
  padding: 2.5rem;
  position: sticky;
  top: 120px;
}

.summary-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  color: #b0b0b0;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.summary-row.total-row {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.checkout-btn {
  width: 100%;
  background-color: var(--brand-red);
  color: #ffffff;
  border: none;
  padding: 16px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 59, 59, 0.3);
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.checkout-btn:hover {
  background-color: #ff1f1f;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 59, 59, 0.4);
}

.secure-checkout-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #888;
  font-size: 0.8rem;
  margin-top: 1.5rem;
}

/* --- EMPTY CART STATE --- */
.empty-cart-state {
  width: 100%;
  background-color: var(--glass-bg);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-cart-state svg {
  width: 64px;
  height: 64px;
  color: #555;
  margin-bottom: 1rem;
}

.empty-cart-state h2 {
  font-size: 1.8rem;
  color: #ffffff;
}

.empty-cart-state p {
  color: #a0a0a0;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.btn-outline {
  padding: 12px 30px;
  border: 2px solid var(--brand-red);
  color: var(--brand-red);
  background: transparent;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: rgba(255, 59, 59, 0.1);
}

@media (max-width: 968px) {
  .cart-layout {
    flex-direction: column;
  }

  .cart-summary-column {
    position: static;
    width: 100%;
    box-sizing: border-box;
  }

  .cart-item-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .cart-item-image {
    width: 100%;
    height: 200px;
  }

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

/* --- GAMIFICATION PROGRESS BAR ANIMATIONS --- */
@keyframes shippingPulse {
  0% { 
    box-shadow: 0 0 0 rgba(255, 255, 255, 0); 
    border-color: rgba(255, 255, 255, 0.08); 
    background: rgba(255, 255, 255, 0.03); 
  }
  50% { 
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15); 
    border-color: rgba(255, 255, 255, 0.3); 
    background: rgba(255, 255, 255, 0.08); 
  }
  100% { 
    box-shadow: 0 0 0 rgba(255, 255, 255, 0); 
    border-color: rgba(255, 255, 255, 0.08); 
    background: rgba(255, 255, 255, 0.03); 
  }
}

.pulse-glow {
  animation: shippingPulse 0.6s ease-out !important;
}