/* === Final Cart Drawer Styling === */
#cart-drawer {
  position: fixed;
  top: 50px;
  right: -400px; /* Hidden by default */
  width: 350px;
  height: 100vh;
  background-color: #fdfcf7;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* hide outer scroll */
  color: #000000;
}

#cart-drawer.open {
  right: 0;
}

/* === Scrollable Body Section === */
.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* === Cart Header (Shortened Height) === */
#cart-drawer .cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #ccc;
  background-color: #fdfcf7;
}

/* Close Button */
#close-cart {
  background: none;
  border: none;
  font-size: 20px;
  color: #003366;
  cursor: pointer;
}

/* === Cart Items Section === */
#cart-drawer .cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* === Individual Cart Item, size of the letters === */ 
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.75rem;
  gap: 8px;
}

.item-name {
  flex: 2;
  font-size:0.85rem;
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  background-color: #2c432d;
  color: white;
  border: none;
  padding: 5px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}

.item-qty {
  min-width: 20px;
  text-align: center;
  font-size:0.75rem;
}

.item-price {
  flex: 1;
  text-align: right;
  font-size:0.75rem;
}

/* === Cart Footer (Sticky) === */
#cart-drawer .cart-footer {
  position: sticky;
  bottom: 0;
  background-color: #fdfcf7;
  padding: 0.8rem 0.8rem;
  border-top: 1px solid #ccc;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
  z-index: 1;
  font-size:0.9rem; 
}

/* Totals */
#cart-subtotal,
#cart-shipping,
#cart-total {
  margin: 4px 0;
  font-weight: bold;
}

/* === Payment Select Dropdown === */
#payment-method {
  width: 100%;
  padding: 6px;
  margin-top: 10px;
  border: 1px solid #aaa;
  border-radius: 5px;
  font-size: 0.7rem;
}

/* === Buttons === */
#pay-now,
#clear-cart {
  margin-top: 7px;
  width: 100%;
  padding: 10px;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 3px;
  border: none;
  cursor: pointer;
}

#pay-now {
  background-color: #2c432d;
  color: white;
}

#clear-cart {
  background-color: #ccc;
  color: #003366;
}

/* === Quantity Input (if used) === */
.quantity-control input {
  width: 35px;
  text-align: center;
  font-size: 16px;
  color: #000;
  background-color: #fff;
  border: 1px solid #ccc;
}

/* === Mobile Responsiveness === */
@media (max-width: 600px) {
  #cart-drawer {
    width: 100%;
    right: -100%;
  }

  #cart-drawer.open {
    right: 0;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    font-size: 1rem;
  }

  .item-controls {
    justify-content: flex-start;
    gap: 10px;
    margin: 4px 0;
  }

  #cart-drawer .cart-footer {
    position: sticky;
    bottom: 0;
    background-color: #fdfcf7;
    padding-bottom: 1rem;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
  }

  #pay-now,
  #clear-cart {
    font-size: 1.1rem;
    padding: 14px;
  }

  #payment-method {
    font-size: 0.7rem;
  }

  #subscribe-details {
    padding-bottom: 5rem; /* Prevent footer from covering it */
  }
}

/* === Purchase Toggle Buttons === */
.purchase-toggle {
  padding: 0.4rem;
  border-bottom: 1px solid #ccc;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.purchase-btn {
  flex: 1;
  background-color: white;
  color: #000;
  padding: 0.7rem;
  border-radius: 4px;
  border: 2px solid #ccc;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.2s ease-in-out;
}

.purchase-btn.active {
  background-color: #cfe8dc;
  border: 2px solid #007a33;
}

.purchase-btn strong {
  display: block;
  font-size: 0.75rem;
  font-weight: bold;
  margin-top: 2px;
}

/* Discount format inside subscribe toggle */
.purchase-btn del {
  color: #999;
  font-weight: normal;
  margin-right: 4px;
}

.purchase-btn span {
  color: green;
  font-weight: bold;
}