/**
 * Estilos para el Modal de Checkout por Pasos - Eres Leyenda
 */

:root {
  --lcc-primary: #f97316;
  --lcc-primary-hover: #ea580c;
  --lcc-primary-light: #fff7ed;
  --lcc-secondary: #0f172a;
  --lcc-accent: #e11d48;
  --lcc-success: #10b981;
  --lcc-text: #1e293b;
  --lcc-muted: #64748b;
  --lcc-border: #e2e8f0;
  --lcc-bg: #ffffff;
  --lcc-card-bg: #f8fafc;
  --lcc-radius: 16px;
  --lcc-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Backdrop */
.lcc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 16px;
  box-sizing: border-box;
}

.lcc-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Contenedor del Modal */
.lcc-modal-container {
  background: #ffffff;
  width: 100%;
  max-width: 860px;
  max-height: 94vh;
  border-radius: var(--lcc-radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--lcc-text);
}

.lcc-modal-overlay.active .lcc-modal-container {
  transform: scale(1) translateY(0);
}

/* Header del Modal */
.lcc-modal-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 20px 24px 16px;
  position: relative;
  border-bottom: 2px solid rgba(249, 115, 22, 0.3);
}

.lcc-modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.lcc-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lcc-modal-badge {
  background: linear-gradient(135deg, #f97316 0%, #e11d48 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 20px;
}

.lcc-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.lcc-modal-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--lcc-transition);
}

.lcc-modal-close:hover {
  background: #e11d48;
  transform: rotate(90deg);
}

/* Stepper / Indicador de Pasos */
.lcc-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 8px;
}

.lcc-stepper-progress-bg {
  position: absolute;
  top: 15px;
  left: 35px;
  right: 35px;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  z-index: 1;
}

.lcc-stepper-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f97316, #e11d48);
  transition: width 0.35s ease;
}

.lcc-step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.lcc-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: var(--lcc-transition);
}

.lcc-step-item.active .lcc-step-circle {
  background: #f97316;
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.35);
}

.lcc-step-item.completed .lcc-step-circle {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.lcc-step-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  transition: var(--lcc-transition);
}

.lcc-step-item.active .lcc-step-label {
  color: #ffffff;
  font-weight: 700;
}

.lcc-step-item.completed .lcc-step-label {
  color: #10b981;
}

/* Cuerpo del Modal */
.lcc-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
}

.lcc-step-pane {
  display: none;
  animation: lccFadeIn 0.3s ease;
}

.lcc-step-pane.active {
  display: block;
}

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

/* PASO 1: Carrito y Recomendados */
.lcc-section-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--lcc-secondary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lcc-cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.lcc-cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--lcc-card-bg);
  border: 1px solid var(--lcc-border);
  border-radius: 12px;
  transition: var(--lcc-transition);
}

.lcc-cart-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.lcc-cart-item-img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--lcc-border);
  background: #ffffff;
}

.lcc-cart-item-info {
  flex: 1;
  min-width: 0;
}

.lcc-cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--lcc-secondary);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lcc-cart-item-meta {
  font-size: 12px;
  color: var(--lcc-muted);
}

.lcc-cart-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--lcc-primary);
}

.lcc-qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--lcc-border);
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}

.lcc-qty-btn {
  background: none;
  border: none;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--lcc-muted);
  font-weight: bold;
  transition: var(--lcc-transition);
}

.lcc-qty-btn:hover {
  background: #f1f5f9;
  color: var(--lcc-secondary);
}

.lcc-qty-val {
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.lcc-cart-item-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  font-size: 16px;
  transition: var(--lcc-transition);
}

.lcc-cart-item-remove:hover {
  color: var(--lcc-accent);
  background: #fee2e2;
}

/* Upsell / Otros Productos */
.lcc-upsell-wrapper {
  margin-top: 24px;
  padding: 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
}

.lcc-upsell-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.lcc-upsell-card {
  background: #ffffff;
  border: 1px solid var(--lcc-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  transition: var(--lcc-transition);
}

.lcc-upsell-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: var(--lcc-primary);
}

.lcc-upsell-img-wrap {
  position: relative;
  width: 100%;
  height: 110px;
  margin-bottom: 8px;
}

.lcc-upsell-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

.lcc-upsell-img-wrap .lcc-upsell-img {
  margin-bottom: 0;
  height: 100%;
}

.lcc-upsell-badge-carrera {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
  z-index: 2;
}

.lcc-upsell-card.is-carrera {
  border: 1.5px solid rgba(249, 115, 22, 0.4);
  background: #fffbf7;
}

.lcc-upsell-card.is-carrera:hover {
  border-color: #f97316;
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.2);
}

.lcc-upsell-card.is-carrera .lcc-btn-add-upsell {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.lcc-upsell-card.is-carrera .lcc-btn-add-upsell:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.lcc-upsell-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--lcc-secondary);
  line-height: 1.3;
  height: 32px;
  overflow: hidden;
  margin-bottom: 6px;
}

.lcc-upsell-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--lcc-primary);
  margin-bottom: 8px;
}

.lcc-btn-add-upsell {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background: var(--lcc-secondary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--lcc-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.lcc-btn-add-upsell:hover {
  background: var(--lcc-primary);
}

.lcc-btn-add-upsell.added {
  background: var(--lcc-success);
}

/* Cupones & Totales */
.lcc-cart-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--lcc-border);
}

.lcc-coupon-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.lcc-coupon-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid var(--lcc-border);
  border-radius: 8px;
  font-size: 13px;
}

.lcc-coupon-btn {
  padding: 9px 16px;
  background: #334155;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lcc-totals-summary {
  background: var(--lcc-card-bg);
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--lcc-border);
}

.lcc-totals-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--lcc-muted);
}

.lcc-totals-row.final {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--lcc-border);
  font-size: 18px;
  font-weight: 800;
  color: var(--lcc-secondary);
}

.lcc-totals-row.final span:last-child {
  color: var(--lcc-primary);
}

/* PASO 2: Formularios de Atletas */
.lcc-atleta-card {
  background: var(--lcc-card-bg);
  border: 1px solid var(--lcc-border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.lcc-atleta-badge-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lcc-secondary);
  color: #ffffff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.lcc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.lcc-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lcc-form-group.full-width {
  grid-column: span 2;
}

.lcc-form-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.lcc-form-label .required {
  color: var(--lcc-accent);
}

.lcc-form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--lcc-border);
  border-radius: 8px;
  font-size: 13px;
  transition: var(--lcc-transition);
  background: #ffffff;
  font-family: inherit;
}

.lcc-form-control:focus {
  outline: none;
  border-color: var(--lcc-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

/* Checkbox Facturar a otra persona */
.lcc-billing-toggle-card {
  margin: 20px 0;
  padding: 16px 18px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
}

.lcc-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--lcc-secondary);
  margin: 0;
}

.lcc-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--lcc-primary);
  cursor: pointer;
}

.lcc-billing-fields-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--lcc-border);
  display: none;
}

.lcc-billing-fields-box.open {
  display: block;
}

/* PASO 3: Métodos de Pago */
.lcc-gateways-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0;
}

.lcc-gateway-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--lcc-card-bg);
  border: 1.5px solid var(--lcc-border);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--lcc-transition);
}

.lcc-gateway-item.selected,
.lcc-gateway-item:hover {
  border-color: var(--lcc-primary);
  background: var(--lcc-primary-light);
}

.lcc-gateway-radio {
  margin-top: 4px;
  accent-color: var(--lcc-primary);
}

.lcc-gateway-info {
  flex: 1;
}

.lcc-gateway-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--lcc-secondary);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lcc-gateway-desc {
  font-size: 12px;
  color: var(--lcc-muted);
  margin: 0;
  line-height: 1.4;
}

/* PASO 4: Confirmación y QR */
.lcc-confirmation-wrapper {
  text-align: center;
  padding: 20px 10px;
}

.lcc-success-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin-bottom: 14px;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.lcc-confirmation-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--lcc-secondary);
  margin: 0 0 8px;
}

.lcc-confirmation-subtitle {
  font-size: 14px;
  color: var(--lcc-muted);
  max-width: 500px;
  margin: 0 auto 24px;
}

.lcc-qr-card {
  background: var(--lcc-card-bg);
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 24px;
  display: inline-block;
  max-width: 320px;
  margin: 0 auto 20px;
}

.lcc-qr-image {
  width: 200px;
  height: 200px;
  margin: 0 auto 14px;
  display: block;
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lcc-qr-instruction {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin: 0 0 14px;
}

/* Footer / Botones de Acción */
.lcc-modal-footer {
  padding: 16px 24px;
  background: #ffffff;
  border-top: 1px solid var(--lcc-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lcc-btn {
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--lcc-transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
}

.lcc-btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.lcc-btn-primary:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
}

.lcc-btn-outline {
  background: #ffffff;
  color: var(--lcc-secondary);
  border: 1.5px solid #cbd5e1;
}

.lcc-btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.lcc-btn:disabled,
.lcc-btn.lcc-loading {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

#lcc-btn-submit {
  min-height: 48px;
  white-space: nowrap;
  word-break: normal;
}

/* Spinner */
.lcc-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: lccSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes lccSpin {
  to { transform: rotate(360deg); }
}

/* Botón flotante para abrir el modal si hay carrito */
.lcc-floating-cart-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: 2px solid #f97316;
  transition: var(--lcc-transition);
}

.lcc-floating-cart-trigger:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 30px rgba(249, 115, 22, 0.35);
}

.lcc-floating-cart-count {
  background: #f97316;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 640px) {
  .lcc-modal-container {
    max-height: 98vh;
    border-radius: 12px;
  }
  .lcc-modal-header {
    padding: 14px 16px 12px;
  }
  .lcc-modal-body {
    padding: 16px;
  }
  .lcc-form-grid {
    grid-template-columns: 1fr;
  }
  .lcc-form-group.full-width {
    grid-column: span 1;
  }
  .lcc-step-label {
    display: none;
  }
  .lcc-stepper-progress-bg {
    left: 20px;
    right: 20px;
  }
  .lcc-modal-footer {
    flex-direction: column-reverse;
  }
  .lcc-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Banner de Checkout Clásico */
.lcc-classic-checkout-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 16px 22px;
  border-radius: 14px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  border: 1.5px solid rgba(249, 115, 22, 0.35);
}

/* Caja de Términos y Condiciones */
.lcc-terms-box {
  margin: 16px 0 22px;
  padding: 14px 18px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  font-size: 13px;
}

/* Ajustes responsivos para banner clásico */
@media (max-width: 640px) {
  .lcc-classic-checkout-banner {
    flex-direction: column;
    text-align: center;
    align-items: stretch;
    padding: 16px;
  }
  .lcc-classic-checkout-banner button {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================== */
/* Bloque de Cuenta / Inicio de Sesión y Registro */
/* ============================================== */
.lcc-account-wrapper {
  margin-bottom: 20px;
}

.lcc-account-card {
  background: var(--lcc-card-bg);
  border: 1.5px solid var(--lcc-border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: var(--lcc-transition);
}

.lcc-account-logged-in {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  padding: 12px 16px;
}

.lcc-create-account-row {
  margin-bottom: 6px;
}

.lcc-modal-login-box {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 10px;
  padding: 16px;
  transition: all 0.25s ease-in-out;
}

.lcc-modal-login-box .lcc-form-control {
  background: #ffffff;
}

#lcc-login-error {
  font-size: 12px;
  border-radius: 6px;
  line-height: 1.4;
}

