/* ==================== MODAL STYLES ==================== */

.modal {
  display: none !important;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex !important;
}

.modal-content {
  background: #FFFFFF;
  border-radius: 24px;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
  animation: modalSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Cart Modal - Wider */
.cart-modal {
  max-width: 560px;
}

/* ==================== MODAL HEADER ==================== */

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 20px;
  border-bottom: 1px solid #F1F5F9;
}

.modal-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.3px;
  font-family: 'Montserrat', sans-serif;
}

.modal-header h3 i {
  color: #0066FF;
  margin-right: 12px;
  font-size: 1.3rem;
}

.close-modal {
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  color: #94A3B8;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  background: transparent;
  border: none;
}

.close-modal:hover {
  color: #0F172A;
  background: #F1F5F9;
  transform: rotate(90deg);
}

/* ==================== MODAL BODY ==================== */

.modal-body {
  padding: 28px 28px 32px;
}

.modal-body .form-group {
  margin-bottom: 18px;
}

.modal-body .form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
  font-family: 'Inter', sans-serif;
}

.modal-body .form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  background: #FAFBFC;
  color: #0F172A;
  box-sizing: border-box;
}

.modal-body .form-group input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

.modal-body .form-group input:focus {
  outline: none;
  border-color: #0066FF;
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

/* ==================== MODAL DIVIDER ==================== */

.modal-divider {
  text-align: center;
  margin: 24px 0 20px;
  position: relative;
}

.modal-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #E2E8F0;
}

.modal-divider span {
  background: #FFFFFF;
  padding: 0 14px;
  position: relative;
  color: #94A3B8;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
}

/* ==================== BUTTONS ==================== */

.btn-blue {
  background: #0066FF;
  color: #FFFFFF;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
  text-align: center;
  letter-spacing: -0.2px;
  display: inline-block;
  box-sizing: border-box;
}

.btn-blue:hover {
  background: #0052CC;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 102, 255, 0.3);
}

.btn-blue:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid #E2E8F0;
  color: #0F172A;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  width: 100%;
  text-align: center;
  display: inline-block;
  box-sizing: border-box;
}

.btn-outline:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}

.btn-full {
  width: 100%;
}

/* ==================== CART STYLES ==================== */

.cart-list {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.cart-list::-webkit-scrollbar {
  width: 5px;
}

.cart-list::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 10px;
}

.cart-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 10px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #F1F5F9;
  gap: 12px;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  color: #0F172A;
  font-size: 0.95rem;
  display: block;
  font-family: 'Inter', sans-serif;
}

.cart-item-cycle {
  font-size: 0.75rem;
  color: #94A3B8;
  font-weight: 500;
}

.cart-item-price {
  font-weight: 700;
  color: #0F172A;
  font-size: 1rem;
  flex-shrink: 0;
}

.cart-remove {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.cart-remove:hover {
  background: #FEE2E2;
  color: #EF4444;
}

.empty-cart {
  text-align: center;
  color: #94A3B8;
  padding: 40px 0 30px;
  font-size: 1rem;
}

.empty-cart i {
  font-size: 3rem;
  color: #E2E8F0;
  display: block;
  margin-bottom: 16px;
}

.empty-cart .empty-text {
  font-weight: 500;
  color: #64748B;
  font-size: 1.1rem;
}

.empty-cart .empty-sub {
  font-size: 0.85rem;
  color: #94A3B8;
  margin-top: 4px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 20px;
  border-top: 2px solid #E2E8F0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0F172A;
}

.cart-total span:first-child {
  color: #64748B;
  font-weight: 600;
}

.cart-total .total-amount {
  color: #0066FF;
  font-size: 1.4rem;
}

/* ==================== PAYMENT DETAILS ==================== */

.payment-details {
  background: #F8FAFC;
  border-radius: 16px;
  padding: 20px 20px 16px;
  margin-bottom: 24px;
  border: 1px solid #F1F5F9;
}

.payment-service,
.payment-amount,
.payment-cycle {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
}

.payment-service span,
.payment-amount span,
.payment-cycle span {
  color: #64748B;
  font-weight: 500;
}

.payment-service strong,
.payment-amount strong,
.payment-cycle strong {
  color: #0F172A;
  font-weight: 700;
}

.payment-amount strong {
  color: #0066FF;
  font-size: 1.1rem;
}

.payment-note {
  font-size: 0.75rem;
  color: #94A3B8;
  text-align: center;
  margin-top: 18px;
  line-height: 1.5;
}

/* ==================== LOADING OVERLAY ==================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100001;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.loading-overlay.show {
  display: flex !important;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: #0066FF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    margin: 10px;
    border-radius: 20px;
  }
  
  .cart-modal {
    max-width: 95%;
  }
  
  .modal-header {
    padding: 20px 20px 16px;
  }
  
  .modal-header h3 {
    font-size: 1.2rem;
  }
  
  .modal-body {
    padding: 20px 20px 24px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    max-width: 98%;
    border-radius: 16px;
    margin: 8px;
  }
  
  .modal-header h3 {
    font-size: 1.05rem;
  }
  
  .modal-header h3 i {
    font-size: 1rem;
  }
  
  .modal-body .form-group input {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  
  .btn-blue {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  
  .btn-outline {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .payment-service,
  .payment-amount,
  .payment-cycle {
    font-size: 0.85rem;
  }
}