/* CART SECTION */
.cart-section {
  padding: 2rem 1rem;
  background: #f3f9f4;
  min-height: 80vh;
}

.cart-section h1 {
  text-align: center;
  color: #2e7d32;
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

/* CART CONTAINER */
#cart-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

/* CART ITEMS */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-left: 6px solid #2e7d32;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
  transition: transform 0.2s ease;
}

.cart-item:hover {
  transform: scale(1.01);
}

.cart-item img {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #e0f2e9;
}

.cart-item-details {
  flex: 1;
  margin-left: 1rem;
  min-width: 200px;
}

.cart-item-details h3 {
  margin: 0;
  color: #1b5e20;
  font-size: 1rem;
}

.cart-item-details p {
  color: #555;
  font-size: 0.9rem;
}

/* CART BUTTONS */
.cart-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-actions button {
  background: #2e7d32;
  color: #fff;
  border: none;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.cart-actions button:hover {
  background: #1b5e20;
}

.remove-btn {
  background: #e53935 !important;
}

.remove-btn:hover {
  background: #b71c1c !important;
}

/* DELIVERY & SUMMARY SECTIONS */
.delivery-section,
.summary {
  max-width: 900px;
  margin: 2rem auto;
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.delivery-section h2,
.summary h2 {
  color: #2e7d32;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.delivery-section select {
  width: 100%;
  padding: 0.7rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-top: 0.5rem;
  font-family: inherit;
}

/*
.delivery-note {
  font-size: 0.85rem;
  color: #555;
  margin-top: -4px;
  margin-bottom: 6px;
  line-height: 1.4;
}
  */

.delivery-note {
  font-size: 0.75rem;
  color: #555;
  margin-top: -6px;
  margin-bottom: 4px;
  line-height: 1.25;
}

/* SUMMARY */
.summary p {
  font-size: 1rem;
  margin: 0.6rem 0;
  color: #333;
}

.summary .total {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1b5e20;
}

#pay-btn {
  width: 100%;
  padding: 0.8rem;
  background: #2e7d32;
  border: none;
  color: white;
  font-size: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

#pay-btn:hover {
  background: #1b5e20;
}

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
  color: #2e7d32;
}

.modal-content button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: #2e7d32;
  border: none;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

.modal-content button:hover {
  background: #1b5e20;
}

.payment-status {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: #f1f8f4;
  color: #2e7d32;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
}

.payment-status.error {
  background: #fdecea;
  color: #c62828;
}

.payment-status.success {
  background: #e8f5e9;
  color: #1b5e20;
}

.hidden {
  display: none;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .cart-item img {
    width: 100%;
    height: auto;
  }

  .cart-actions {
    margin-top: 0.8rem;
    justify-content: flex-start;
  }

  .summary,
  .delivery-section {
    margin: 1rem;
  }

  .cart-section h1 {
    font-size: 1.8rem;
  }
}

.cart-section p {
  font-size: 1.1rem;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 1rem;
  border-radius: 8px;
  width: fit-content;
  margin: 1rem auto;
}

/* --- BACK TO PRODUCTS BUTTON --- */
/*
.back-to-products {
  max-width: 900px;
  margin: 2rem auto 0;
  text-align: left;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: #2e7d32;
  color: #fff;
}
*/

/* --- DELIVERY FORM --- */
.delivery-section form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.delivery-section label {
  font-weight: 600;
  color: #2e7d32;
}

.delivery-section input,
.delivery-section select {
  width: 100%;
  padding: 0.7rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: inherit;
  transition: border 0.3s ease;
}

.delivery-section input:focus,
.delivery-section select:focus {
  border-color: #2e7d32;
  outline: none;
  box-shadow: 0 0 4px rgba(46, 125, 50, 0.3);
}

/* --- FLOATING BACK TO PRODUCTS BUTTON --- */
.floating-back-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 55px;
  height: 55px;
  background: #2e7d32;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  text-decoration: none;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  z-index: 2000;
  transition: transform 0.3s ease, background 0.3s ease;
}

.floating-back-btn:hover {
  background: #1b5e20;
  transform: scale(1.1);
}

/* --- CART ACTION BAR --- */
.cart-actions-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

#clear-cart {
  background: #b71c1c;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

#clear-cart:hover {
  background: #d32f2f;
}

.modal input {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 0.8rem;
  font-size: 1rem;
}

.modal button {
  width: 100%;
  margin-top: 1rem;
  padding: 0.8rem;
  border: none;
  border-radius: 8px;
  background: #2e7d32;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.modal button:hover {
  background: #1b5e20;
}

/* ===== M-PESA MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 380px;
  padding: 1.8rem;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h3 {
  color: #2e7d32;
  margin-bottom: 1rem;
}

.modal-content label {
  display: block;
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #2e7d32;
}

.modal-content input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-bottom: 1rem;
}

.modal-content input:focus {
  border-color: #2e7d32;
  outline: none;
  box-shadow: 0 0 6px rgba(46, 125, 50, 0.3);
}

.modal-content button {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

#confirm-mpesa {
  background: #2e7d32;
  color: #fff;
}

#confirm-mpesa:hover {
  background: #1b5e20;
}

.cancel-btn {
  margin-top: 0.6rem;
  background: #e53935;
  color: #fff;
}

.cancel-btn:hover {
  background: #c62828;
}

.continue-shopping-top {
  text-align: left;
  margin-bottom: 12px;
}

.continue-shopping-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f8e9;
  border: 1px solid #81c784;
  color: #2e7d32;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.continue-shopping-btn:hover {
  background: #2e7d32;
  color: #fff;
  transform: translateY(-1px);
}

.continue-shopping-top,
.continue-shopping-bottom {
  max-width: 900px;
  margin: 0 auto 1rem;
  text-align: left;
}

.continue-shopping-bottom {
  margin-top: 1.5rem;
}

.continue-shopping-btn {
  animation: slideFade 0.4s ease;
}

@keyframes slideFade {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
