* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.cart-section {
  width: 90%;
  margin: 120px auto 60px;
  padding: 40px 20px;
  background: #fdfdfd;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(31, 61, 43, 0.25);
}

.cart-section h1 {
  text-align: center;
  font-size: 36px;
  font-weight: 800;
  color: #1f3d2b;
  margin-bottom: 40px;
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
  margin-left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  transition: color 0.3s ease;
}

.cart-section h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 3px;
  background: #3c6e4e;
  border-radius: 3px;
  transition: all 0.3s ease;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
}

.cart-section h1:hover::after {
  transform: translateX(-50%) scaleX(1);
  width: 50%;
}

.cart-wrapper {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.cart-items-container {
  flex: 2;
  min-width: 300px;
}

.cart-header-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr;
  padding: 15px 20px;
  background: linear-gradient(135deg, #1f3d2b, #3c6e4e);
  border-radius: 12px 12px 0 0;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.cart-items {
  background: #fff;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.cart-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease;
}

.cart-item:hover {
  background: #f9fdfb;
}

.cart-item:last-child {
  border-bottom: none;
}

.item-details {
  display: flex;
  align-items: center;
  gap: 15px;
}

.item-details img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  background: linear-gradient(135deg, #eaf6f6, #fff);
  padding: 5px;
}

.item-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: #282c3f;
  margin-bottom: 5px;
}

.item-info p {
  font-size: 13px;
  color: #696e79;
}

.item-price {
  font-size: 16px;
  font-weight: 600;
  color: #1f3d2b;
}

.item-total {
  font-size: 16px;
  font-weight: 700;
  color: #1f3d2b;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-controls button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #1f3d2b, #3c6e4e);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-controls button:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(31, 61, 43, 0.3);
}

.quantity-controls span {
  font-size: 16px;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

.remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #e74c3c;
  font-size: 18px;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  transform: scale(1.2);
  color: #c0392b;
}

.empty-cart {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 12px;
}

.empty-cart i {
  font-size: 80px;
  color: #ddd;
  margin-bottom: 20px;
}

.empty-cart h2 {
  font-size: 24px;
  color: #282c3f;
  margin-bottom: 10px;
}

.empty-cart p {
  color: #696e79;
  margin-bottom: 25px;
}

.continue-shopping-btn {
  display: inline-block;
  padding: 12px 30px;
  background: linear-gradient(135deg, #1f3d2b, #3c6e4e);
  color: #fff;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.continue-shopping-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(31, 61, 43, 0.3);
}

.cart-summary {
  flex: 1;
  min-width: 300px;
  background: #fff;
  padding: 30px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.cart-summary h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1f3d2b;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #eee;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 15px;
  color: #555;
}

.summary-row.total-row {
  font-size: 20px;
  font-weight: 700;
  color: #1f3d2b;
  margin-top: 15px;
}

.cart-summary hr {
  border: none;
  height: 1px;
  background: #eee;
  margin: 20px 0;
}
.checkout-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #1f3d2b, #3c6e4e);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.checkout-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(31, 61, 43, 0.3);
}

.checkout-btn i {
  font-size: 14px;
}

.payment-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.payment-icons i {
  font-size: 28px;
  color: #888;
  transition: color 0.3s ease;
}

.payment-icons i:hover {
  color: #1f3d2b;
}
.clear-cart-btn {
  width: 100%;
  padding: 14px;
  margin-bottom: 15px;
  margin-top: 12px;
  background: #fff;
  color: #e74c3c;
  border: 2px solid #e74c3c;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.clear-cart-btn:hover {
  background: #ca584bd8;
  color: #fff;
  box-shadow: 0 10px 25px rgba(231, 76, 60, 0.3);
}

.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #1f3d2b, #3c6e4e);
  color: #fff;
  padding: 15px 25px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(31, 61, 43, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  transform: translateX(150%);
  transition: transform 0.4s ease;
}

.toast.show {
  transform: translateX(0);
}

.toast i {
  font-size: 20px;
}

.toast-content {
  display: flex;
  flex-direction: column;
}

.toast-content strong {
  font-size: 14px;
}

.toast-content span {
  font-size: 12px;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .cart-section {
    padding: 20px 15px;
    margin: 100px auto 40px;
  }

  .cart-section h1 {
    font-size: 24px;
    margin-left: 50%;
  }

  .cart-wrapper {
    flex-direction: column;
  }

  .cart-header-row {
    display: none;
  }

  .cart-item {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }

  .item-details {
    flex-direction: column;
    text-align: center;
  }

  .item-details img {
    width: 120px;
    height: 120px;
  }

  .quantity-controls {
    justify-content: center;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 400px) {
  .cart-section h1 {
    font-size: 20px;
  }

  .cart-summary {
    padding: 20px;
  }

  .promo-code {
    flex-direction: column;
  }

  .toast {
    left: 15px;
    right: 15px;
    bottom: 15px;
  }
}
body.dark-mode .cart-section {
  background: #151b2e;
}

body.dark-mode .cart-header-row {
  background: linear-gradient(135deg, #5dd39e, #3ca876);
  color: #0a0e27;
}

body.dark-mode .cart-item {
  background: #1a2235;
  border-bottom: 1px solid rgba(93, 211, 158, 0.2);
}

body.dark-mode .item-price,
body.dark-mode .item-total {
  color: #5dd39e;
}

body.dark-mode .quantity-controls button {
  background: linear-gradient(135deg, #5dd39e, #3ca876);
  color: #0a0e27;
}

body.dark-mode .cart-summary {
  background: #1a2235;
  border: 1px solid rgba(93, 211, 158, 0.2);
}

body.dark-mode .clear-cart-btn {
  border-color: #5dd39e;
  color: #5dd39e;
}

body.dark-mode .clear-cart-btn:hover {
  background: #5dd39e;
  color: #0a0e27;
}
