:root {
  --primary: #ee4d2d;
  --primary-dark: #d73a1e;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --text-primary: #222222;
  --text-secondary: #757575;
  --border: #f1f1f1;
  --radius: 4px;
  --font: 'Inter', sans-serif;
}

/* =========================
   CART PAGE
   ========================= */
.cart-page,
.section {
  padding: 40px 0;
  background: var(--bg);
  min-height: 80vh;
  font-family: var(--font);
}

.cart-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

/* Shopee has a wide table layout */
.cart-layout {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* =========================
   CART LIST & HEADER
   ========================= */
.cart-header-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr 1fr;
  background: var(--card-bg);
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  color: #888;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .05);
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* =========================
   CART ITEM
   ========================= */
.cart-item {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1fr 1fr;
  align-items: center;
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .05);
  transition: .2s ease;
  border: 1px solid transparent;
}

.cart-item:hover {
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}

/* Product Column (Image + Info) */
.cart-product-col {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.cart-image {
  width: 80px;
  height: 80px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-info h3 {
  font-size: 14px;
  font-weight: normal;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-info p {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
}

/* Price Column */
.price {
  font-size: 14px;
  color: var(--text-primary);
}

/* Quantity Column */
.qty-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
}

.qty-box a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  text-decoration: none;
  background: #fff;
  transition: background .2s;
}

.qty-box a:hover {
  background: #f8f8f8;
}

.qty-box span {
  width: 50px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-primary);
}

/* Subtotal Column */
.subtotal {
  font-size: 14px;
  color: var(--primary);
  font-weight: bold;
}

/* Action Column */
.delete {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
}

.delete:hover {
  color: var(--primary);
}

/* =========================
   CART SUMMARY (Bottom Sticky Bar)
   ========================= */
.summary {
  position: sticky;
  bottom: 0;
  background: var(--card-bg);
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .05);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  z-index: 100;
  border: 1px solid var(--border);
  margin-top: 10px;
}

.summary h3 {
  display: none;
  /* Hide heading in inline layout */
}

.summary-row {
  display: none;
  /* Hide details for sticky bar simplicity */
}

.summary hr {
  display: none;
}

.summary-total {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--text-primary);
}

.summary-total strong {
  font-size: 24px;
  color: var(--primary);
  font-weight: normal;
}

.checkout-btn {
  background: var(--primary);
  color: #fff;
  padding: 12px 36px;
  border-radius: 2px;
  font-size: 16px;
  text-decoration: none;
  transition: background .2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-btn i {
  display: none;
  /* Shopee Checkout btn is just text */
}

.checkout-btn:hover {
  background: var(--primary-dark);
}

/* =========================
   EMPTY CART
   ========================= */
.empty-cart-modern {
  background: #fff;
  border-radius: 16px;
  padding: 60px 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  margin: 30px auto;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ec-illustration {
  margin-bottom: 25px;
}

.ec-illustration img {
  max-width: 200px;
  height: auto;
  opacity: 0.9;
}

.empty-cart-modern h2 {
  font-size: 24px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 12px;
}

.empty-cart-modern p {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 30px;
  line-height: 1.6;
  max-width: 400px;
}

.btn-ec-shop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 35px;
  background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
  color: #fff;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  transition: all 0.3s ease;
}

.btn-ec-shop i {
  font-size: 18px;
}

.btn-ec-shop:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
  color: #fff;
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */
@media (max-width: 768px) {
  .cart-header-row {
    display: none;
    /* Hide header row on mobile */
  }

  .cart-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    position: relative;
    padding: 15px;
  }

  .cart-product-col {
    width: 100%;
    padding-right: 40px; /* space for delete button */
  }

  .price {
    color: var(--primary);
    font-weight: bold;
    flex: 1;
    font-size: 16px;
  }

  .subtotal {
    display: none;
  }

  .qty-box {
    position: static;
    margin-left: auto;
  }

  .delete {
    position: absolute;
    top: 15px;
    right: 15px;
  }

  .summary {
    flex-direction: column;
    align-items: flex-end;
    padding: 12px;
  }

  .summary-total {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .cart-actions {
    width: 100%;
    display: flex;
    gap: 10px;
    flex-direction: row;
  }

  .checkout-btn, .shop-more-btn {
    flex: 1;
    justify-content: center;
    text-align: center;
    padding: 12px 0; /* ensure padding is consistent */
  }

  /* Stock alert styling */
  :root {
    --alert-bg: rgba(255, 237, 237, 0.9);
    --alert-border: #ef4444;
    --alert-color: #b91c1c;
  }

  .stock-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-left: 4px solid var(--alert-border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--alert-color);
    background: var(--alert-bg);
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
    position: relative;
    overflow: hidden;
    animation: slideDownFade 0.4s ease-out forwards;
  }

  .stock-alert i {
    font-size: 18px;
  }

  .stock-alert .close {
    margin-left: auto;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    color: var(--alert-color);
    background: transparent;
    border: none;
    transition: color 0.2s ease;
  }

  .stock-alert .close:hover {
    color: #dc2626;
  }

  @keyframes slideDownFade {
    0% {
      opacity: 0;
      transform: translateY(-8px);
    }

    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
}