/* ========================================
   CHECKOUT PAGE STYLES
   ======================================== */

/* Authentication Section */
.auth-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--bs-gray-200);
}

.auth-header h4 {
  color: var(--bs-dark);
  font-weight: 600;
}

.doc-type-btn {
  height: 120px;
  border: 2px solid var(--bs-gray-300);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  text-decoration: none;
}

.doc-type-btn:hover {
  border-color: var(--bs-primary);
  background: var(--bs-light);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(var(--bs-primary-rgb), 0.2);
}

.doc-type-btn.selected {
  border-color: var(--bs-primary);
  background: linear-gradient(135deg, var(--bs-primary) 0%, #0056b3 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(var(--bs-primary-rgb), 0.4);
}

.auth-step {
  min-height: 200px;
}

.welcome-message .alert {
  border-radius: 12px;
  border: none;
}

.customer-summary .alert {
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--bs-success) 0%, #157347 100%);
  color: white;
}

.customer-summary .btn-outline-danger {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.customer-summary .btn-outline-danger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

/* Form Fields in Auth */
.auth-card .form-control {
  border: 2px solid var(--bs-gray-200);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.auth-card .form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.1);
  transform: translateY(-1px);
}

.auth-card .form-label {
  font-weight: 600;
  color: var(--bs-dark);
  margin-bottom: 0.5rem;
}

.auth-card .form-label i {
  color: var(--bs-primary);
}

/* Animation for step transitions */
.auth-step {
  opacity: 1;
  transform: translateX(0);
  transition: all 0.3s ease;
}

.auth-step.d-none {
  opacity: 0;
  transform: translateX(20px);
}

/* Document number formatting */
#documentNumber {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-align: center;
}

/* Registration form styling */
.dni-fields, .ruc-fields {
  transition: all 0.3s ease;
}

/* Responsive auth section */
@media (max-width: 768px) {
  .auth-card {
    padding: 1.5rem;
    border-radius: 15px;
  }
  
  .doc-type-btn {
    height: 100px;
    font-size: 0.9rem;
  }
  
  .doc-type-btn i {
    font-size: 1.5rem !important;
  }
}

/* Checkout Progress */
.checkout-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: none;
}

.step-icon {
  width: 50px;
  height: 50px;
  border: 3px solid var(--bs-gray-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  color: var(--bs-gray-500);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.progress-step.completed .step-icon {
  border-color: var(--bs-success);
  background: var(--bs-success);
  color: white;
}

.progress-step.active .step-icon {
  border-color: var(--bs-primary);
  background: var(--bs-primary);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.3);
}

.step-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bs-gray-600);
  text-align: center;
}

.progress-step.completed .step-label,
.progress-step.active .step-label {
  color: var(--bs-dark);
  font-weight: 600;
}

.progress-line {
  height: 3px;
  width: 80px;
  background: var(--bs-gray-300);
  margin: 0 1rem;
  position: relative;
  top: -25px;
  transition: all 0.3s ease;
}

.progress-line.completed {
  background: var(--bs-success);
}

/* Responsive Progress */
@media (max-width: 768px) {
  .checkout-progress {
    scale: 0.8;
  }
  
  .progress-line {
    width: 40px;
    margin: 0 0.5rem;
  }
  
  .step-label {
    font-size: 0.75rem;
  }
}

/* Checkout Sections */
.checkout-form {
  background: white;
  border-radius: 15px;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.checkout-section {
  border-bottom: 1px solid var(--bs-gray-200);
}

.checkout-section:last-child {
  border-bottom: none;
}

.section-header {
  background: linear-gradient(135deg, var(--bs-primary) 0%, #0056b3 100%);
  color: white;
  padding: 1.5rem 2rem;
  margin: 0;
}

.section-header h4 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.section-header p {
  margin: 0.5rem 0 0 0;
  opacity: 0.9;
}

.section-content {
  padding: 2rem;
}

/* Form Styling */
.form-label {
  font-weight: 600;
  color: var(--bs-dark);
  margin-bottom: 0.5rem;
}

.form-label i {
  color: var(--bs-primary);
}

.form-control,
.form-select {
  border: 2px solid var(--bs-gray-200);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.1);
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: var(--bs-gray-400);
}

/* Delivery Time Display */
.delivery-time-display {
  display: flex;
  align-items: center;
  font-weight: 500;
  color: var(--bs-success);
}

.delivery-time-display i {
  margin-right: 0.5rem;
}

/* Payment Methods */
.payment-methods {
  display: grid;
  gap: 1rem;
}

.payment-method {
  position: relative;
}

.payment-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-label {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  border: 2px solid var(--bs-gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  margin: 0;
}

.payment-label:hover {
  border-color: var(--bs-primary);
  background: var(--bs-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.payment-radio:checked + .payment-label {
  border-color: var(--bs-primary);
  background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1) 0%, rgba(var(--bs-primary-rgb), 0.05) 100%);
  box-shadow: 0 4px 20px rgba(var(--bs-primary-rgb), 0.2);
}

.payment-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-light);
  border-radius: 10px;
  margin-right: 1rem;
  font-size: 1.5rem;
  color: var(--bs-primary);
  transition: all 0.3s ease;
}

.payment-radio:checked + .payment-label .payment-icon {
  background: var(--bs-primary);
  color: white;
  transform: scale(1.1);
}

.payment-info {
  flex: 1;
}

.payment-info strong {
  display: block;
  color: var(--bs-dark);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.payment-info small {
  display: block;
  line-height: 1.3;
}

.payment-check {
  width: 30px;
  height: 30px;
  border: 2px solid var(--bs-gray-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.3s ease;
}

.payment-radio:checked + .payment-label .payment-check {
  border-color: var(--bs-primary);
  background: var(--bs-primary);
  color: white;
  transform: scale(1.1);
}

/* Order Summary */
.order-summary-card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 100px;
}

.card-title {
  color: var(--bs-dark);
  font-weight: 600;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bs-light);
}



.item-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 1rem;
}

.item-info {
  flex: 1;
}

.item-name {
  font-weight: 600;
  color: var(--bs-dark);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.item-details {
  font-size: 0.875rem;
  color: var(--bs-gray-600);
}

.item-price {
  font-weight: 600;
  color: var(--bs-primary);
  font-size: 1rem;
  text-align: right;
}

/* Order Totals */
.order-totals {
  border-top: 2px solid var(--bs-light);
  padding-top: 1.5rem;
  margin-bottom: 2rem;
}

.total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.total-line span:first-child {
  color: var(--bs-gray-700);
}

.total-line span:last-child {
  font-weight: 600;
  color: var(--bs-dark);
}

.total-final {
  border-top: 1px solid var(--bs-gray-200);
  padding-top: 0.75rem;
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.total-final span {
  color: var(--bs-primary) !important;
}

/* Checkout Actions */
.checkout-actions {
  border-top: 2px solid var(--bs-light);
  padding-top: 2rem;
}

#checkoutBtn {
  background: linear-gradient(135deg, var(--bs-success) 0%, #157347 100%);
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(var(--bs-success-rgb), 0.3);
  transition: all 0.3s ease;
}

#checkoutBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--bs-success-rgb), 0.4);
}

#checkoutBtn:disabled {
  background: var(--bs-gray-400);
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.security-badges {
  text-align: center;
}

.security-badges i {
  font-size: 1.5rem;
  margin: 0 0.25rem;
}

/* Benefits Card */
.benefits-card {
  background: linear-gradient(135deg, var(--bs-light) 0%, white 100%);
  border-radius: 15px;
  padding: 1.5rem;
  border: 1px solid var(--bs-gray-200);
}

.benefits-card h6 {
  color: var(--bs-dark);
  font-weight: 600;
  margin-bottom: 1rem;
}

.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefits-list li {
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  color: var(--bs-gray-700);
}

.benefits-list i {
  width: 20px;
  text-align: center;
}

/* Success Modal */
.success-icon {
  animation: successPulse 1s ease-in-out;
}

@keyframes successPulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.order-info .alert {
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--bs-info) 0%, #0dcaf0 100%);
  color: white;
}

/* Responsive Design */
@media (max-width: 991px) {
  .order-summary-card {
    position: static;
    margin-top: 2rem;
  }
}

@media (max-width: 768px) {
  .section-header {
    padding: 1rem 1.5rem;
  }
  
  .section-content {
    padding: 1.5rem;
  }
  
  .checkout-form {
    border-radius: 10px;
  }
  
  .payment-label {
    padding: 1rem;
  }
  
  .payment-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .order-summary-card {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .payment-methods {
    gap: 0.75rem;
  }
  
  .payment-label {
    flex-direction: column;
    text-align: center;
    padding: 1rem 0.75rem;
  }
  
  .payment-icon {
    margin-right: 0;
    margin-bottom: 0.75rem;
  }
  
  .payment-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
  }
}

/* Loading States */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Form Validation */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--bs-danger);
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: var(--bs-success);
}

.invalid-feedback {
  display: block;
  color: var(--bs-danger);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.valid-feedback {
  display: block;
  color: var(--bs-success);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}
