/* ================= CART PAGE ================= */

.cart_page {
  margin-top: 2rem;

  display: grid;

  grid-template-columns: 2fr 1fr;

  gap: 3rem;

  align-items: start;
}

.cart_page h1 {
  grid-column: 1 / -1;

  margin-bottom: 1rem;
}

/* LEFT SIDE */

.cart_items {
  display: flex;

  flex-direction: column;

  gap: 2rem;
}

/* SINGLE ITEM */

.cart_item {
  display: flex;

  gap: 1.5rem;

  border: 1px solid #ddd;

  border-radius: 12px;

  padding: 1.5rem;

  background: #fff;
}

.cart_item img {
  width: 140px;

  height: 140px;

  object-fit: contain;

  border-radius: 10px;

  background: #fff;
}

.cart_item_info {
  flex: 1;
}

.cart_item_info h3 {
  font-size: 1.2rem;

  line-height: 1.5;

  margin-bottom: 0.7rem;
}

.cart_item_info p {
  margin-bottom: 0.5rem;
}

.cart_qty {
  font-weight: 600;

  margin-bottom: 0.7rem;
}

/* =========================
   CART QUANTITY CONTROLS
========================= */

.cart_qty_container {
  display: flex;

  align-items: center;

  gap: 1rem;

  margin: 1rem 0;
}

.qty_label {
  font-weight: 600;
}

.cart_qty_controls {
  display: flex;

  align-items: center;

  gap: 0.8rem;
}

.cart_qty_btn {
  width: 34px;

  height: 34px;

  border-radius: 8px;

  background: #f1f1f1;

  font-size: 1.2rem;

  font-weight: 700;

  cursor: pointer;

  transition: 0.25s ease;
}

.cart_qty_btn:hover {
  background: #ddd;
}

.cart_qty_btn:disabled {
  opacity: 0.45;

  cursor: not-allowed;
}

.cart_qty_number {
  min-width: 20px;

  text-align: center;

  font-weight: 600;
}

.cart_stock_warning {
  color: #dc2626;

  font-size: 1.4rem;

  font-weight: 600;

  margin-top: 0.6rem;
}

.cart_tax_breakdown {
  margin-top: 0.7rem;

  font-size: 0.95rem;

  color: #555;

  line-height: 1.6;
}

/* REMOVE BUTTON */

.remove_btn {
  margin-top: 0.5rem;

  padding: 0.8rem 1.2rem;

  border-radius: 8px;

  background: #f44336;

  color: white;

  cursor: pointer;

  font-weight: 600;
}

/* RIGHT SUMMARY */

.cart_summary {
  position: sticky;

  top: 10rem;

  border: 1px solid #ddd;

  border-radius: 12px;

  padding: 2rem;

  background: #fff;
}

.cart_summary h3 {
  margin-bottom: 1.5rem;
}

.summary_row,
.summary_total {
  display: flex;

  justify-content: space-between;

  margin-bottom: 1rem;
}

.summary_total {
  font-size: 1.2rem;

  font-weight: 700;
}

/* CHECKOUT BUTTON */

.checkout_btn {
  width: 100%;

  margin-top: 1.5rem;

  padding: 1rem;

  border-radius: 999px;

  background: #ffd814;

  font-size: 1rem;

  font-weight: 700;

  cursor: pointer;
}

/* EMPTY CART */

.empty_cart {
  text-align: center;

  padding: 4rem 2rem;

  border: 1px solid #ddd;

  border-radius: 12px;
}

.empty_cart h2 {
  margin-bottom: 1rem;
}

.disabled_checkout {
  opacity: 0.5;

  cursor: not-allowed;

  pointer-events: none;
}

.start_shopping_btn {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  margin-top: 1.5rem;

  padding: 1rem 2rem;

  border-radius: 999px;

  background: var(--color-primary);

  color: white;

  font-weight: 600;

  transition: 0.25s ease;
}

.start_shopping_btn:hover {
  background: #1548d4;
}

.cart_coupon_section {
  margin-top: 20px;
}

.coupon_input_wrapper {
  display: flex;
  gap: 10px;
}

#couponInput {
  flex: 1;
  height: 45px;
  padding: 0 14px;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  font-size: 15px;
}

#applyCouponBtn {
  height: 45px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #1faa59;
  color: white;
  font-weight: 600;
}

#couponMessage {
  margin-top: 12px;
  font-size: 14px;
}

.applied_coupon_chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e6e6e6;
  color: #0a0a0a;
  border: 1px solid #000000;
  padding: 8px 12px;
  border-radius: 50px;
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}

.remove_coupon_btn {
  width: 28px;

  height: 28px;

  border-radius: 50%;

  border: none;

  background: #050505;

  color: #fff;

  font-size: 1.4rem;

  font-weight: 600;

  cursor: pointer;

  display: flex;

  align-items: center;

  justify-content: center;

  line-height: 1;
}

/* ================= TABLET ================= */

@media screen and (max-width: 1024px) {
  .cart_page {
    grid-template-columns: 1fr;
  }

  .cart_summary {
    position: static;
  }
}

/* ================= MOBILE ================= */

@media screen and (max-width: 600px) {
  .cart_item {
    flex-direction: column;

    align-items: center;

    text-align: center;
  }

  .cart_item img {
    width: 100%;

    max-width: 220px;

    height: auto;
  }
}
