/* Checkout Modal Styles */
.checkout-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 20, 15, 0.65);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999998 !important;
}

.checkout-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.checkout-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%) scale(0.95);
  width: 92%;
  max-width: 520px;
  max-height: 88vh;
  max-height: 88dvh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999999 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.checkout-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.checkout-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  background: #014940;
  color: #ffffff;
  flex-shrink: 0;
}

.checkout-modal-close {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  padding: 4px 8px;
  cursor: pointer;
}

.checkout-modal-body {
  padding: 1.1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  background: #f8faf9;
}

.checkout-section-card {
  border: 1px solid #e2ebe6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.checkout-section-header {
  padding: 0.75rem 0.95rem;
  background: #f4f8f6;
  font-weight: 700;
  font-size: 0.92rem;
  color: #173439;
  border-bottom: 1px solid #e8efeb;
}

.checkout-section-body {
  padding: 0.9rem;
}

/* Fix radio buttons egg shape distortion */
.checkout-modal .form-check-input,
.checkout-modal .form-check-input[type="radio"],
.checkout-exit-overlay .form-check-input,
.checkout-exit-overlay .form-check-input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  aspect-ratio: 1 / 1 !important;
  margin-top: 0.15rem !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  accent-color: #014940 !important;
}

/* Floating Exit Intent Card Overlay */
.checkout-exit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 20, 15, 0.65);
  z-index: 1000005 !important;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4vh;
  overflow-y: auto;
  animation: fadeInExit 0.25s ease forwards;
}

@keyframes fadeInExit {
  from { opacity: 0; }
  to { opacity: 1; }
}

.checkout-exit-modal-card {
  width: 90%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border: 1px solid #e2ebe6;
  margin-bottom: 2rem;
  animation: slideUpCard 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.exit-door-icon {
  font-size: 3rem;
  line-height: 1;
}

.address-chip {
  cursor: pointer;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.address-chip:hover, .address-chip.active {
  background: #014940;
  color: #ffffff;
  border-color: #014940;
}

body.checkout-modal-open {
  overflow: hidden;
}

@media (max-width: 575px) {
  .checkout-modal {
    width: 96%;
    max-height: 94vh;
    border-radius: 16px;
  }
  .checkout-modal-body {
    padding: 0.85rem;
  }
  .checkout-exit-overlay {
    padding-top: 2vh;
  }
}
