:root {
  --primary: #279cff;
  --accent: #82c620;
  --bg: #f4f8fb;
  --text-dark: #1f2937;
  --text-light: #6b7280;
}

/* GLOBAL RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
}

.back-to-shop {
  padding: 12px 50px;
  background: #eef5ff;
}

.back-to-shop a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.back-to-shop a:hover {
  text-decoration: underline;
}

/* ---------------- HEADER ---------------- */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 50px;
  background: linear-gradient(90deg, var(--primary), #1e7edc);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.cart-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-header img {
  height: 42px;
}

.secure-text {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.95;
}

.cart-header-right a {
  margin-left: 22px;
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}

.cart-header-right a:hover {
  opacity: 1;
}

.auth-btn {
  margin-left: 20px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-btn:hover {
  background: #fff;
  color: var(--primary);
}

/* ---------------- PAGE LAYOUT ---------------- */
.cart-page {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 32px;
  padding: 40px 50px;
}

/* ---------------- CART ITEMS ---------------- */
.cart-item {
  background: #d8ecff;
  display: flex;
  align-items: center;
  padding: 22px;
  border-radius: 14px;
  margin-bottom: 22px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
  transition: transform .2s ease;
}

.cart-item:hover {
  transform: translateY(-2px);
}

.cart-item-img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #eee;
}

.cart-item-info {
  flex: 1;
  padding: 0 22px;
}

.cart-item-info h3 {
  margin-bottom: 6px;
  color: var(--text-dark);
  font-size: 18px;
}

.delivery-info {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 14px;
}

/* ---------------- QTY ---------------- */
.qty-control {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 30px;
  padding: 4px;
}

.qty-control button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.qty-control span {
  width: 32px;
  text-align: center;
  font-weight: 600;
}

/* ---------------- PRICE ---------------- */
.cart-item-price {
  text-align: right;
  font-weight: 600;
  color: var(--text-dark);
}

.remove-item {
  display: block;
  margin-top: 10px;
  background: none;
  color: #e11d48;
  border: none;
  font-size: 13px;
  cursor: pointer;
}

/* ---------------- ORDER SUMMARY ---------------- */
.order-summary {
  background: #fff;
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.08);
  position: sticky;
  top: 25px;
}

.order-summary h3 {
  margin-bottom: 18px;
  font-size: 20px;
  color: var(--text-dark);
}

/* COUPON */
.coupon-box {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 10px;
  margin-bottom: 18px;
}

.coupon-box input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

.coupon-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.coupon-box button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

/* SUMMARY ROWS */
.summary-row {
  display: flex;
  justify-content: space-between;
  margin: 14px 0;
  font-size: 15px;
  color: var(--text-light);
}

.summary-row.total {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  border-top: 1px dashed #e5e7eb;
  padding-top: 14px;
}

/* CHECKOUT */
.checkout-btn {
  width: 100%;
  padding: 14px;
  margin-top: 22px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.checkout-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.login-note {
  text-align: center;
  font-size: 13px;
  margin-top: 12px;
  color: #64748b;
}

/* ---------------- EMPTY CART ---------------- */
.empty-cart {
  background: #fff;
  border-radius: 16px;
  padding: 60px 30px;
  text-align: center;
  box-shadow: 0 10px 26px rgba(0,0,0,0.08);
}

.empty-cart i {
  font-size: 46px;
  color: var(--primary);
  margin-bottom: 16px;
}

.empty-cart h3 {
  font-size: 20px;
  color: var(--text-dark);
}

.empty-cart p {
  font-size: 14px;
  color: var(--text-light);
  margin: 10px 0 20px;
}

.shop-btn {
  display: inline-block;
  padding: 10px 22px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
  text-decoration: none;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
}

/* ================ DESKTOP & LAPTOP (≥1024px)======== */
@media (min-width: 1024px) {
  .cart-page {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    align-items: flex-start;
  }

  .order-summary {
    position: sticky;
    top: 25px;
  }
}

/* ======================================================
   TABLETS & BELOW (≤1023px)
   STACKED layout + normal scrolling
====================================================== */
@media (max-width: 1023px) {
  .cart-page {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static; 
    margin-top: 24px;
  }
}

/* ======================================================
   MOBILE (≤768px)
====================================================== */
@media (max-width: 768px) {
  .cart-header {
    padding: 14px 20px;
  }

  .secure-text {
    display: none;
  }

  .cart-header-right a {
    display: none;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-item-img {
    width: 100%;
    height: auto;
  }

  .cart-item-info {
    padding: 14px 0;
  }

  .cart-item-price {
    width: 100%;
    text-align: left;
  }

  .coupon-box {
    flex-direction: column;
  }
}

/* ======================================================
   SMALL MOBILE (≤480px)
====================================================== */
@media (max-width: 480px) {
  .cart-header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .auth-btn {
    font-size: 12px;
    padding: 5px 12px;
  }

  .checkout-btn {
    font-size: 15px;
  }
}
