/* ============================= */
/* CHECKOUT                      */
/* ============================= */

/* ── Header compartido (checkout + confirmación) ── */
.checkout-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0a1f44;
  padding: 0 5%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

.checkout-back {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  min-width: 100px;
}

.checkout-back:hover {
  color: white;
}

.checkout-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  flex-shrink: 0;
}

.checkout-logo {
  height: 34px;
  object-fit: contain;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.checkout-secure {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  min-width: 100px;
  justify-content: flex-end;
}

.checkout-secure svg {
  width: 13px;
  height: 13px;
  stroke: var(--celeste-acento);
  flex-shrink: 0;
}

/* ── Main ── */
.checkout-main {
  background: #f7f9fc;
  min-height: calc(100vh - 64px);
  padding: 40px 5% 80px;
}

.checkout-container {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Steps / breadcrumb ── */
.checkout-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}

.checkout-step {
  font-size: 13px;
  font-weight: 600;
  color: rgba(10, 31, 68, 0.3);
}

.checkout-step.active {
  color: var(--celeste-acento);
}

.checkout-step.done {
  color: rgba(10, 31, 68, 0.5);
}

.checkout-step-sep {
  font-size: 11px;
  color: rgba(10, 31, 68, 0.2);
}

/* ── Layout dos columnas ── */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: start;
}

/* ── Tarjeta formulario ── */
.checkout-form-wrap {
  background: white;
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 4px 24px rgba(10, 31, 68, 0.06);
  border: 1px solid #edf0f5;
}

.checkout-form-wrap > h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--azul-principal);
  margin-bottom: 28px;
}

/* ── Secciones del formulario ── */
.form-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid #f0f3f8;
}

.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--celeste-acento);
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--azul-principal);
  letter-spacing: 0.1px;
}

.form-group input,
.form-group select {
  padding: 11px 14px;
  border: 1.5px solid #dde3ed;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #1a2a44;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

/* Select con flecha custom */
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230a1f44' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--celeste-acento);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.12);
}

.form-group input.error,
.form-group select.error {
  border-color: #ff4d4d;
  box-shadow: 0 0 0 3px rgba(255, 77, 77, 0.1);
}

.form-group input::placeholder {
  color: rgba(10, 31, 68, 0.3);
}

/* ── Radio persona natural / jurídica ── */
.radio-group {
  display: flex;
  gap: 10px;
}

.radio-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid #dde3ed;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--azul-principal);
  user-select: none;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-option.selected {
  border-color: var(--celeste-acento);
  background: rgba(0, 194, 255, 0.06);
}

.radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #dde3ed;
  flex-shrink: 0;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
}

.radio-option.selected .radio-dot {
  border-color: var(--celeste-acento);
  background: var(--celeste-acento);
}

.radio-dot-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
  display: none;
}

.radio-option.selected .radio-dot-inner {
  display: block;
}

/* ── Botón PSE ── */
.btn-pse {
  width: 100%;
  padding: 15px 28px;
  background: linear-gradient(135deg, var(--celeste-acento), #009ed6);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(0, 194, 255, 0.28);
  margin-bottom: 14px;
}

.btn-pse:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 194, 255, 0.38);
}

.btn-pse:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-pse svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

/* ── Spinner de carga ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: coSpin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

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

/* ── Disclaimer pago seguro ── */
.checkout-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: rgba(10, 31, 68, 0.42);
  line-height: 1.55;
}

.checkout-disclaimer svg {
  width: 14px;
  height: 14px;
  stroke: var(--celeste-acento);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Mensaje de error ── */
.checkout-error {
  background: #fff5f5;
  border: 1px solid #ffcdd2;
  border-radius: 10px;
  padding: 12px 16px;
  color: #c62828;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  line-height: 1.5;
}

.checkout-error.visible {
  display: block;
}

/* ============================= */
/* RESUMEN DEL PEDIDO (columna derecha) */
/* ============================= */

.checkout-resumen {
  background: white;
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 4px 24px rgba(10, 31, 68, 0.06);
  border: 1px solid #edf0f5;
  position: sticky;
  top: 84px;
}

.checkout-resumen > h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--azul-principal);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f3f8;
}

.resumen-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.resumen-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resumen-item-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #edf0f5;
  flex-shrink: 0;
  background: #f0f3f8;
}

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

.resumen-item-nombre {
  font-size: 13px;
  font-weight: 600;
  color: var(--azul-principal);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resumen-item-qty {
  font-size: 12px;
  color: rgba(10, 31, 68, 0.42);
  margin-top: 2px;
}

.resumen-item-precio {
  font-size: 13px;
  font-weight: 700;
  color: var(--azul-principal);
  white-space: nowrap;
  flex-shrink: 0;
}

.resumen-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 2px solid #f0f3f8;
  margin-bottom: 16px;
}

.resumen-total-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gris-texto);
}

.resumen-total-valor {
  font-size: 22px;
  font-weight: 800;
  color: var(--azul-principal);
}

.resumen-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid #f0f3f8;
}

.resumen-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(10, 31, 68, 0.42);
}

.resumen-badge svg {
  width: 13px;
  height: 13px;
  stroke: var(--celeste-acento);
  flex-shrink: 0;
}

.resumen-vacio {
  text-align: center;
  font-size: 14px;
  color: rgba(10, 31, 68, 0.42);
  padding: 20px 0;
  line-height: 1.7;
}

.resumen-vacio a {
  color: var(--celeste-acento);
  text-decoration: none;
  font-weight: 600;
}

/* ============================= */
/* RESPONSIVE                    */
/* ============================= */

@media (max-width: 960px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-resumen {
    position: static;
    order: -1;
  }
}

@media (max-width: 600px) {
  .checkout-main {
    padding: 24px 4% 60px;
  }

  .checkout-form-wrap {
    padding: 24px 18px;
    border-radius: 14px;
  }

  .checkout-resumen {
    padding: 22px 18px;
    border-radius: 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .radio-group {
    flex-direction: column;
    gap: 8px;
  }

  .checkout-steps {
    gap: 5px;
  }

  .checkout-step {
    font-size: 12px;
  }

  .checkout-logo {
    height: 28px;
  }
}
