/* ============================
   HEADER CART ICON + BADGE
============================ */
.cart-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 28px;
}

.cart-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  cursor: pointer;
}

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

#cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #27ae60;
  color: white;
  padding: 2px 6px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
}

/* ============================
   CART PAGE LAYOUT
============================ */
.cart-page {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  font-family: "Inter", sans-serif;
}

.cart-page h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 25px;
}

/* ============================
   CART ROW — PERFECT ALIGNMENT
============================ */
.cart-row {
  display: grid;
  grid-template-columns: 1fr 120px 100px; /* NAME | QTY | TOTAL */
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #e5e5e5;
  gap: 20px;
}

/* ============================
   LEFT COLUMN: NAME + REMOVE
============================ */
.cart-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.item-name {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.remove-btn {
  background: red;
  color: white;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ============================
   MIDDLE COLUMN: QUANTITY
============================ */
.qty-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.qty-btn {
  background: #eee;
  border: none;
  padding: 6px 12px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
}

.qty-btn:hover {
  background: #ddd;
}

.qty-number {
  font-size: 18px;
  font-weight: 600;
  width: 28px;
  text-align: center;
}

/* ============================
   RIGHT COLUMN: TOTAL PRICE
============================ */
.math-section {
  text-align: right;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.math-total {
  color: #000;
}

/* ============================
   SUMMARY BOX
============================ */
.summary-box {
  text-align: right;
  margin: 25px 0;
}

.summary-line {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

/* ============================
   CHECKOUT BUTTON
============================ */
.checkout-btn {
  margin-top: 15px;
  background: #27ae60;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}

.checkout-btn:hover {
  background: #1e8e4f;
}

/* ============================
   TOAST
============================ */
.toast {
  position: fixed;
  bottom: -80px;
  right: 30px;
  background: #2e7d32;
  color: #fff;
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.45s ease;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.toast.show {
  opacity: 1;
  bottom: 30px;
  transform: translateY(0);
}

/* ============================
   CART ICON BOUNCE
============================ */
@keyframes cartBounce {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.25);
  }
  60% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.cart-icon img.bounce {
  animation: cartBounce 0.6s ease;
}

/* ================================
   ⭐ MOBILE HEADER (CART PAGE ONLY)
================================ */
.mobile-header-cart {
  display: none;
}

@media (max-width: 768px) {
  /* ⭐ Only hide header on CART page */
  .cart-page-body .main-header {
    display: none !important;
  }

  .cart-page-body .mobile-header-cart {
    display: block;
    width: 100%;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  }

  .mobile-header-top-cart {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
  }

  .mobile-logo-cart img {
    width: 55px;
  }

  .mobile-cart-icon-cart {
    position: relative;
  }

  .mobile-cart-icon-cart img {
    width: 32px;
    height: 32px;
  }

  #cart-count-mobile-cart {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #27ae60;
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
  }

  .mobile-menu-btn-cart {
    width: 100%;
    text-align: center;
    padding: 14px 0;
    background: #f8f8f8;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
  }

  .mobile-dropdown-cart {
    display: none;
    flex-direction: column;
    background: #ffffff;
    border-bottom: 1px solid #eee;
  }

  .mobile-dropdown-cart.active {
    display: flex;
  }

  .mobile-dropdown-cart a {
    padding: 14px 20px;
    font-size: 17px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
  }

  .mobile-dropdown-cart a:last-child {
    border-bottom: none;
  }
}

/* ============================
   ⭐ MOBILE FIX — NO CUTTING OFF
============================ */
@media (max-width: 768px) {
  .item-name {
    white-space: normal;
    font-size: 16px;
    line-height: 1.3;
  }

  .cart-row {
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
  }

  .qty-btn {
    padding: 4px 8px;
    font-size: 16px;
  }

  .qty-number {
    width: 24px;
    font-size: 16px;
  }

  .math-section {
    font-size: 16px;
    text-align: right;
  }

  .cart-page {
    padding: 15px;
    overflow-x: hidden;
  }
}
