/* ============================================================================
   CHECKOUT PAGE - Multi-Step Single Page
   ========================================================================== */

/* ============================================================================
   VARIABLES
   ========================================================================== */
:root {
  --checkout-primary: #2563eb;
  --checkout-primary-hover: #1d4ed8;
  --checkout-success: #10b981;
  --checkout-error: #ef4444;
  --checkout-warning: #f59e0b;
  --checkout-gray-50: #f9fafb;
  --checkout-gray-100: #f3f4f6;
  --checkout-gray-200: #e5e7eb;
  --checkout-gray-300: #d1d5db;
  --checkout-gray-600: #4b5563;
  --checkout-gray-700: #374151;
  --checkout-gray-900: #111827;
  --checkout-border-radius: 8px;
  --checkout-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --checkout-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Dark Mode */
body.dark_mode {
  --checkout-gray-50: #1f2937;
  --checkout-gray-100: #111827;
  --checkout-gray-200: #374151;
  --checkout-gray-300: #4b5563;
  --checkout-gray-600: #9ca3af;
  --checkout-gray-700: #d1d5db;
  --checkout-gray-900: #f9fafb;
}

/* ============================================================================
   LAYOUT
   ========================================================================== */
.checkout-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.checkout-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  margin-top: 2rem;
}

/* ============================================================================
   PROGRESS BAR
   ========================================================================== */
.checkout-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--checkout-gray-200);
  color: var(--checkout-gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.125rem;
  transition: all 0.3s ease;
}

.step-label {
  font-size: 0.875rem;
  color: var(--checkout-gray-600);
  font-weight: 500;
  transition: color 0.3s ease;
}

/* Active Step */
.progress-step.active .step-number {
  background: var(--checkout-primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.progress-step.active .step-label {
  color: var(--checkout-primary);
  font-weight: 600;
}

/* Completed Step */
.progress-step.completed .step-number {
  background: var(--checkout-success);
  color: white;
}

.progress-step.completed .step-label {
  color: var(--checkout-success);
}

/* Progress Line */
.progress-line {
  width: 120px;
  height: 2px;
  background: var(--checkout-gray-200);
  position: relative;
  z-index: 1;
}

.progress-line.completed {
  background: var(--checkout-success);
}

/* ============================================================================
   STEPS CONTENT
   ========================================================================== */
.checkout-steps {
  background: white;
  border-radius: var(--checkout-border-radius);
  box-shadow: var(--checkout-shadow);
  padding: 2rem;
}

body.dark_mode .checkout-steps {
  background: var(--checkout-gray-100);
}

.step-content {
  display: none;
  animation: fadeInSlide 0.4s ease;
}

.step-content.active {
  display: block;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--checkout-gray-900);
  margin-bottom: 1.5rem;
}

.section-subtitle {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--checkout-gray-900);
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--checkout-gray-200);
}

/* ============================================================================
   FORM STYLES
   ========================================================================== */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group label.required::after {
  content: " *";
  color: var(--checkout-error);
}

/* Usar clase global .form-input con ajustes específicos de checkout */
.form-group .form-input,
.form-group input.form-input,
.form-group select.form-input,
.form-group textarea.form-input {
  border-width: 1px; /* Override: checkout usa borde de 1px */
}

/* Dark mode específico de checkout */
body.dark_mode .form-group .form-input {
  background: var(--checkout-gray-50);
  border-color: var(--checkout-gray-200);
}

/* Mantener compatibilidad con inputs sin clase (si existen) */
.form-group input:not(.form-input),
.form-group select:not(.form-input),
.form-group textarea:not(.form-input) {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--checkout-gray-300);
  border-radius: var(--checkout-border-radius);
  font-size: 1rem;
  color: var(--checkout-gray-900);
  background: white;
  transition: all 0.2s ease;
}

body.dark_mode .form-group input:not(.form-input),
body.dark_mode .form-group select:not(.form-input),
body.dark_mode .form-group textarea:not(.form-input) {
  background: var(--checkout-gray-50);
  border-color: var(--checkout-gray-200);
}

.form-group input:not(.form-input):focus,
.form-group select:not(.form-input):focus,
.form-group textarea:not(.form-input):focus {
  outline: none;
  border-color: var(--checkout-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input:not(.form-input):disabled,
.form-group select:not(.form-input):disabled {
  background: var(--checkout-gray-100);
  cursor: not-allowed;
  opacity: 0.6;
}

.field-error {
  font-size: 0.875rem;
  color: var(--checkout-error);
  display: none;
}

.field-error.show {
  display: block;
}

/* Form Rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row.three-col {
  grid-template-columns: repeat(3, 1fr);
}

/* Textarea */
textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* ============================================================================
   PAYMENT METHODS
   ========================================================================== */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.payment-method-card {
  border: 2px solid var(--checkout-gray-200);
  border-radius: var(--checkout-border-radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.payment-method-card:hover:not(.disabled) {
  border-color: var(--checkout-primary);
  background: rgba(37, 99, 235, 0.02);
}

.payment-method-card.active {
  border-color: var(--checkout-primary);
  background: rgba(37, 99, 235, 0.05);
}

.payment-method-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--checkout-gray-50);
}

.payment-method-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-method-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.payment-method-icon {
  width: 48px;
  height: 48px;
  background: var(--checkout-gray-100);
  border-radius: var(--checkout-border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--checkout-gray-600);
}

.payment-method-card.active .payment-method-icon {
  background: rgba(37, 99, 235, 0.1);
  color: var(--checkout-primary);
}

.payment-method-info {
  flex: 1;
}

.payment-method-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--checkout-gray-900);
  margin-bottom: 0.25rem;
}

.payment-method-description {
  font-size: 0.875rem;
  color: var(--checkout-gray-600);
}

.payment-method-badge {
  background: var(--checkout-success);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Security Info */
.security-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--checkout-border-radius);
  color: var(--checkout-success);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.security-info svg {
  flex-shrink: 0;
}

/* ============================================================================
   STEP ACTIONS
   ========================================================================== */
.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--checkout-gray-200);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--checkout-border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--checkout-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--checkout-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--checkout-shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--checkout-gray-700);
  border: 1px solid var(--checkout-gray-300);
}

body.dark_mode .btn-secondary {
  background: var(--checkout-gray-50);
  color: var(--checkout-gray-900);
  border-color: var(--checkout-gray-200);
}

.btn-secondary:hover {
  background: var(--checkout-gray-50);
  border-color: var(--checkout-gray-400);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================================
   CONFIRMATION (STEP 3)
   ========================================================================== */
.confirmation-container {
  text-align: center;
  padding: 3rem 1rem;
}

.confirmation-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s ease;
}

.confirmation-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--checkout-success);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.confirmation-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--checkout-gray-900);
  margin-bottom: 1rem;
}

.confirmation-message {
  font-size: 1.125rem;
  color: var(--checkout-gray-600);
  margin-bottom: 2rem;
}

.order-number-box {
  display: inline-block;
  background: var(--checkout-gray-50);
  padding: 1rem 2rem;
  border-radius: var(--checkout-border-radius);
  margin-bottom: 2rem;
}

.order-number-label {
  font-size: 0.875rem;
  color: var(--checkout-gray-600);
  margin-right: 0.5rem;
}

.order-number-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--checkout-primary);
  font-family: monospace;
}

.next-steps {
  text-align: left;
  max-width: 400px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--checkout-gray-50);
  border-radius: var(--checkout-border-radius);
}

.next-steps h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--checkout-gray-900);
  margin-bottom: 1rem;
}

.next-steps ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.next-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  color: var(--checkout-gray-700);
  font-size: 0.9375rem;
}

.next-steps li svg {
  color: var(--checkout-success);
  flex-shrink: 0;
}

.confirmation-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* ============================================================================
   CHECKOUT SUMMARY (RIGHT SIDEBAR)
   ========================================================================== */
.checkout-summary {
  position: relative;
}

.summary-card {
  background: white;
  border-radius: var(--checkout-border-radius);
  box-shadow: var(--checkout-shadow);
  padding: 1.5rem;
}

body.dark_mode .summary-card {
  background: var(--checkout-gray-100);
}

.summary-card.sticky {
  position: sticky;
  top: 1rem;
}

.summary-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--checkout-gray-900);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--checkout-gray-200);
}

/* Summary Products */
.summary-products {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.summary-product {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--checkout-gray-200);
}

.summary-product:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-product-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--checkout-gray-100);
}

.summary-product-info {
  flex: 1;
  min-width: 0;
}

.summary-product-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--checkout-gray-900);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.summary-product-details {
  font-size: 0.75rem;
  color: var(--checkout-gray-600);
}

.summary-product-price {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--checkout-gray-900);
  white-space: nowrap;
}

/* Coupon Section */
.summary-coupon {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--checkout-gray-200);
}

.coupon-input-group {
  display: flex;
  gap: 0.5rem;
}

.coupon-input-group input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--checkout-gray-300);
  border-radius: var(--checkout-border-radius);
  font-size: 0.875rem;
  text-transform: uppercase;
}

.btn-apply-coupon {
  padding: 0.625rem 1rem;
  background: var(--checkout-gray-900);
  color: white;
  border: none;
  border-radius: var(--checkout-border-radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.btn-apply-coupon:hover {
  background: var(--checkout-gray-700);
}

.coupon-message {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  display: none;
}

.coupon-message.show {
  display: block;
}

.coupon-message.success {
  color: var(--checkout-success);
}

.coupon-message.error {
  color: var(--checkout-error);
}

/* ═══════════════════════════════════════════════════════════════
   LISTA DE CUPONES APLICADOS (Múltiples cupones)
   ═══════════════════════════════════════════════════════════════ */
.coupons-applied-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.coupon-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--checkout-border-radius);
  transition: all 0.2s ease;
}

.coupon-applied:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.coupon-applied-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--checkout-success);
  font-size: 0.875rem;
  flex: 1;
}

.coupon-applied-info svg {
  flex-shrink: 0;
}

.coupon-code {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.coupon-discount {
  font-weight: 600;
  margin-right: 0.5rem;
}

.coupon-applied-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.coupon-applied-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coupon-applied-main .coupon-discount {
  margin-left: auto;
}

.coupon-product-scope {
  font-size: 0.75rem;
  color: var(--checkout-gray-600, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.btn-remove-coupon {
  background: none;
  border: none;
  color: var(--checkout-gray-600);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border-radius: 4px;
  flex-shrink: 0;
}

.btn-remove-coupon:hover {
  color: var(--checkout-error);
  background: rgba(239, 68, 68, 0.1);
}

.btn-remove-coupon:active {
  transform: scale(0.95);
}

/* Summary Totals */
.summary-totals {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
  color: var(--checkout-gray-700);
}

.summary-row.discount-row {
  color: var(--checkout-success);
}

.summary-row.discount-row .discount-amount {
  font-weight: 600;
}

.summary-row.total-row {
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 2px solid var(--checkout-gray-200);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--checkout-gray-900);
}

/* Trust Badges */
.summary-trust {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--checkout-gray-50);
  border-radius: var(--checkout-border-radius);
  color: var(--checkout-gray-700);
  font-size: 0.875rem;
}

.trust-badge svg {
  color: var(--checkout-success);
  flex-shrink: 0;
}

/* ============================================================================
   IZIPAY MODAL
   ========================================================================== */
.izipay-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.izipay-modal-overlay.show {
  display: flex;
}

.izipay-modal {
  background: white;
  border-radius: var(--checkout-border-radius);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--checkout-shadow-lg);
  animation: slideUp 0.3s ease;
}

body.dark_mode .izipay-modal {
  background: var(--checkout-gray-100);
}

.izipay-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--checkout-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.izipay-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--checkout-gray-900);
  margin: 0;
}

.izipay-modal-body {
  padding: 1.5rem;
}

/* Izipay form styles (override default) */
.kr-embedded {
  min-height: 300px;
}

/* ============================================================================
   GUEST REGISTRATION MODAL
   ========================================================================== */
.guest-register-modal {
  max-width: 450px;
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--checkout-gray-900);
  margin-bottom: 0.5rem;
}

.modal-header p {
  font-size: 0.9375rem;
  color: var(--checkout-gray-600);
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-actions .btn {
  flex: 1;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .checkout-content {
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
  }

  .progress-line {
    width: 80px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .checkout-container {
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .checkout-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .checkout-summary {
    order: -1;
  }

  .summary-card.sticky {
    position: static;
  }

  .checkout-progress {
    padding: 1rem 0;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .step-label {
    font-size: 0.75rem;
  }

  .progress-line {
    width: 60px;
  }

  .checkout-steps {
    padding: 1.5rem;
  }

  .step-title {
    font-size: 1.25rem;
  }

  .form-row,
  .form-row.three-col {
    grid-template-columns: 1fr;
  }

  .step-actions {
    flex-direction: column-reverse;
  }

  .step-actions .btn {
    width: 100%;
  }

  .confirmation-title {
    font-size: 1.5rem;
  }

  .confirmation-actions {
    flex-direction: column;
  }

  .confirmation-actions .btn {
    width: 100%;
  }
}

/* ============================================================================
   ADDRESS SELECTOR (for authenticated users)
   ========================================================================== */
.address-selector-container {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--checkout-gray-50);
  border-radius: var(--checkout-border-radius);
  border: 1px solid var(--checkout-gray-200);
}

.address-selector {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.address-selector label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--checkout-gray-700);
  margin-bottom: 0.375rem;
}

.address-selector .address-dropdown {
  flex: 1;
  min-width: 200px;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  border: 1px solid var(--checkout-gray-300);
  border-radius: var(--checkout-border-radius);
  background: white;
  color: var(--checkout-gray-900);
  cursor: pointer;
}

body.dark_mode .address-selector .address-dropdown {
  background: var(--checkout-gray-100);
  border-color: var(--checkout-gray-300);
  color: var(--checkout-gray-900);
}

.address-selector .address-dropdown:focus {
  outline: none;
  border-color: var(--checkout-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-add-address {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--checkout-primary);
  background: white;
  border: 1px solid var(--checkout-primary);
  border-radius: var(--checkout-border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-add-address:hover {
  background: var(--checkout-primary);
  color: white;
}

.btn-add-address svg {
  width: 16px;
  height: 16px;
}

body.dark_mode .btn-add-address {
  background: transparent;
}

/* ============================================================================
   ADD ADDRESS MODAL
   ========================================================================== */
.add-address-modal {
  max-width: 560px;
  width: 95%;
}

.add-address-modal .modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--checkout-gray-900);
  margin-bottom: 0.25rem;
}

.add-address-modal .modal-header p {
  font-size: 0.875rem;
  color: var(--checkout-gray-600);
  margin: 0;
}

.add-address-modal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.add-address-modal .form-group {
  margin-bottom: 1rem;
}

.add-address-modal .checkbox-group {
  margin-top: 0.5rem;
}

.add-address-modal .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--checkout-gray-700);
}

.add-address-modal .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--checkout-primary);
}

.add-address-modal .form-alert {
  margin-top: 1rem;
}

.add-address-modal .form-alert .alert {
  padding: 0.75rem 1rem;
  border-radius: var(--checkout-border-radius);
  font-size: 0.875rem;
}

.add-address-modal .form-alert .alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.add-address-modal .form-alert .alert-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Responsive */
@media (max-width: 600px) {
  .address-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .address-selector .address-dropdown {
    width: 100%;
  }

  .btn-add-address {
    justify-content: center;
  }

  .add-address-modal .form-row.three-col {
    flex-direction: column;
  }
}

/* ============================================================================
   DELIVERY TYPE TOGGLE (Envío / Pickup)
   ========================================================================== */
.delivery-type-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--checkout-gray-50);
  border-radius: var(--checkout-border-radius);
}

.toggle-option {
  flex: 1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-option input[type="radio"] {
  display: none;
}

.toggle-option .option-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: white;
  border: 2px solid var(--checkout-gray-200);
  border-radius: var(--checkout-border-radius);
  transition: all 0.3s ease;
}

.toggle-option .option-content svg {
  flex-shrink: 0;
  color: var(--checkout-gray-600);
  transition: color 0.3s ease;
}

.toggle-option .option-content span {
  font-weight: 500;
  color: var(--checkout-gray-700);
  transition: color 0.3s ease;
}

.toggle-option:hover .option-content {
  border-color: var(--checkout-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.toggle-option.active .option-content {
  background: var(--checkout-primary);
  border-color: var(--checkout-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.toggle-option.active .option-content svg,
.toggle-option.active .option-content span {
  color: white;
}

/* Dark Mode */
body.dark_mode .toggle-option .option-content {
  background: var(--checkout-gray-100);
  border-color: var(--checkout-gray-300);
}

body.dark_mode .toggle-option.active .option-content {
  background: var(--checkout-primary);
  border-color: var(--checkout-primary);
}

/* ============================================================================
   STORE SELECTOR (Pickup Mode)
   ========================================================================== */
.store-selector-container {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--checkout-gray-50);
  border-radius: var(--checkout-border-radius);
  border: 1px solid var(--checkout-gray-200);
}

.store-selector-container .section-subtitle {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--checkout-gray-900);
  font-size: 1.125rem;
}

.store-dropdown {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--checkout-gray-300);
  border-radius: var(--checkout-border-radius);
  font-size: 1rem;
  color: var(--checkout-gray-900);
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.store-dropdown:focus {
  outline: none;
  border-color: var(--checkout-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.store-dropdown:hover {
  border-color: var(--checkout-primary);
}

/* Store Details */
.store-details {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: white;
  border-radius: var(--checkout-border-radius);
  border: 1px solid var(--checkout-gray-200);
  box-shadow: var(--checkout-shadow);
}

.store-info h4 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: var(--checkout-primary);
  font-weight: 600;
}

.store-info p {
  margin: 0.75rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--checkout-gray-700);
  line-height: 1.6;
}

.store-info p svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--checkout-gray-600);
}

.store-address span {
  flex: 1;
}

/* Dark Mode */
body.dark_mode .store-selector-container {
  background: var(--checkout-gray-100);
  border-color: var(--checkout-gray-300);
}

body.dark_mode .store-dropdown {
  background: var(--checkout-gray-100);
  border-color: var(--checkout-gray-300);
  color: var(--checkout-gray-900);
}

body.dark_mode .store-details {
  background: var(--checkout-gray-100);
  border-color: var(--checkout-gray-300);
}

/* ============================================================================
   RESPONSIVE - Delivery Toggle & Store Selector
   ========================================================================== */
@media (max-width: 768px) {
  .delivery-type-toggle {
    flex-direction: column;
    gap: 0.75rem;
  }

  .toggle-option .option-content {
    padding: 1rem;
  }

  .store-selector-container {
    padding: 1rem;
  }

  .store-details {
    padding: 1rem;
  }

  .store-info h4 {
    font-size: 1.125rem;
  }

  .store-info p {
    font-size: 0.875rem;
  }
}

/* ============================================================================
   PAYMENT MODALS (Yape / Transferencia)
   ========================================================================== */
.payment-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.payment-modal-overlay.active {
  display: flex;
}

.payment-modal {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.3s ease;
}

.payment-modal-large {
  max-width: 900px;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.payment-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--checkout-gray-200);
}

.payment-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--checkout-gray-900);
}

.close-payment-modal {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--checkout-gray-600);
  transition: color 0.2s;
}

.close-payment-modal:hover {
  color: var(--checkout-error);
}

.payment-modal-body {
  padding: 2rem 1.5rem;
}

.payment-modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid var(--checkout-gray-200);
  justify-content: flex-end;
}

/* Payment Instructions */
.payment-instructions {
  margin-bottom: 2rem;
}

.payment-instructions h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  color: var(--checkout-gray-900);
}

.payment-instructions ol {
  margin: 0;
  padding-left: 1.5rem;
}

.payment-instructions ol li {
  margin: 0.5rem 0;
  color: var(--checkout-gray-700);
  line-height: 1.6;
}

.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  margin-top: 1rem;
}

.warning-box svg {
  color: #ff9800;
  flex-shrink: 0;
}

.warning-box span {
  color: #856404;
  font-size: 0.9rem;
}

/* Yape QR */
.yape-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0;
  padding: 2rem;
  background: var(--checkout-gray-50);
  border-radius: 12px;
}

.yape-qr {
  width: 280px;
  height: 280px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qr-label {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--checkout-gray-700);
}

/* Bank Accounts */
.bank-accounts {
  margin: 2rem 0;
}

.bank-accounts h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  color: var(--checkout-gray-900);
}

.bank-account-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--checkout-gray-200);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}

.bank-account-card:hover {
  border-color: var(--checkout-primary);
}

.bank-logo {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  background: var(--checkout-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
}

.bank-details {
  flex: 1;
}

.bank-details p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--checkout-gray-700);
}

.bank-titular {
  font-size: 0.8rem !important;
  color: var(--checkout-gray-600) !important;
  font-style: italic;
  margin-top: 0.5rem !important;
}

/* Upload Section */
.proof-upload-section {
  margin: 2rem 0;
}

.proof-upload-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--checkout-gray-900);
}

.upload-dropzone {
  border: 2px dashed var(--checkout-gray-300);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-dropzone:hover {
  border-color: var(--checkout-primary);
  background: rgba(37, 99, 235, 0.02);
}

.upload-dropzone.dragover {
  border-color: var(--checkout-primary);
  background: rgba(37, 99, 235, 0.05);
}

.upload-dropzone svg {
  color: var(--checkout-gray-400);
  margin-bottom: 1rem;
}

.upload-dropzone p {
  margin: 0.5rem 0;
  color: var(--checkout-gray-700);
  font-weight: 500;
}

.upload-hint {
  display: block;
  font-size: 0.875rem;
  color: var(--checkout-gray-500);
  margin-top: 0.5rem;
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.upload-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--checkout-gray-200);
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-preview {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.remove-preview:hover {
  background: var(--checkout-error);
}

/* Payment Divider */
.payment-divider {
  display: flex;
  align-items: center;
  margin: 2rem 0;
  text-align: center;
}

.payment-divider::before,
.payment-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--checkout-gray-300);
}

.payment-divider span {
  padding: 0 1rem;
  color: var(--checkout-gray-500);
  font-weight: 500;
}

/* WhatsApp Section */
.whatsapp-share-section {
  text-align: center;
}

.whatsapp-share-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--checkout-gray-900);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: #25d366;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s;
}

.btn-whatsapp:hover {
  background: #128c7e;
}

.btn-whatsapp svg {
  width: 24px;
  height: 24px;
}

.whatsapp-hint {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--checkout-gray-600);
}

/* Dark Mode */
body.dark_mode .payment-modal {
  background: var(--checkout-gray-100);
}

body.dark_mode .bank-account-card {
  border-color: var(--checkout-gray-300);
}

body.dark_mode .upload-dropzone {
  border-color: var(--checkout-gray-300);
}

/* Responsive */
@media (max-width: 768px) {
  .payment-modal {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .yape-qr {
    width: 220px;
    height: 220px;
  }

  .bank-account-card {
    flex-direction: column;
  }

  .bank-logo {
    width: 100%;
    height: 50px;
  }
}
