/**
 * Installments Info Styles
 * Badge inline con calculadora de cuotas sin interés
 *
 * Diseño basado en confianza (azul) vs urgencia (rojo del delivery timer)
 * Posicionado debajo del precio para relación visual clara
 */

/* ========== BADGE INLINE (siempre visible) ========== */

.t3d-installments-info {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #eff6ff; /* Azul muy claro - confianza */
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.t3d-installments-info:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.t3d-inst-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #1e40af; /* Azul oscuro */
  line-height: 1.4;
}

.t3d-inst-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.t3d-inst-text {
  flex: 1;
}

.t3d-inst-text strong {
  font-weight: 700;
  color: #1e3a8a; /* Azul más oscuro para énfasis */
}

.t3d-inst-toggle {
  background: none;
  border: none;
  color: #2563eb; /* Azul medio - acción */
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.t3d-inst-toggle:hover {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
  text-decoration: none;
}

.t3d-inst-toggle:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ========== MODAL ========== */

.t3d-inst-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.t3d-inst-modal[hidden] {
  display: none;
}

.t3d-inst-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}

.t3d-inst-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.3s ease;
}

.t3d-inst-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.t3d-inst-modal-close:hover {
  color: #111827;
  background: #f3f4f6;
}

.t3d-inst-modal-close:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.t3d-inst-modal-content h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  padding-right: 32px; /* Espacio para botón cerrar */
}

/* ========== OPCIONES DE CUOTAS ========== */

.t3d-inst-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.t3d-inst-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.t3d-inst-option:hover {
  border-color: #bfdbfe;
  background: #f8fafc;
}

.t3d-inst-option input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.t3d-inst-option input[type="radio"]:checked {
  border-color: #2563eb;
  border-width: 6px;
}

.t3d-inst-option input[type="radio"]:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.t3d-inst-option input[type="radio"]:checked + .t3d-inst-option-label {
  color: #1e40af;
}

.t3d-inst-option-selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.t3d-inst-option-label {
  flex: 1;
  font-size: 15px;
  color: #374151;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.t3d-inst-option-label strong {
  font-weight: 700;
  color: #111827;
}

.t3d-inst-badge-featured {
  display: inline-block;
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* ========== SUMMARY ========== */

.t3d-inst-summary {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 16px;
}

.t3d-inst-summary p {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #374151;
}

.t3d-inst-summary p:last-child {
  margin-bottom: 0;
}

.t3d-inst-summary strong {
  font-weight: 700;
  color: #111827;
}

.t3d-inst-no-charge {
  font-size: 13px;
  color: #059669;
  font-weight: 500;
}

.t3d-inst-terms-link {
  display: inline-block;
  font-size: 13px;
  color: #6b7280;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.t3d-inst-terms-link:hover {
  color: #111827;
}

/* ========== ANIMACIONES ========== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  .t3d-installments-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .t3d-inst-toggle {
    align-self: flex-start;
  }

  .t3d-inst-modal-content {
    padding: 20px;
    margin: 0 10px;
  }

  .t3d-inst-modal-content h3 {
    font-size: 18px;
  }

  .t3d-inst-option {
    padding: 12px;
  }

  .t3d-inst-option-label {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .t3d-inst-badge {
    font-size: 13px;
  }

  .t3d-inst-icon {
    font-size: 16px;
  }

  .t3d-inst-toggle {
    font-size: 12px;
  }

  .t3d-inst-modal {
    padding: 10px;
  }

  .t3d-inst-modal-content {
    padding: 16px;
  }
}
