/* ==========================================
   VARIABLES Y ESTILOS BASE (SANS-SERIF)
   ========================================== */
:root {
  --bg-light: #f7f7f8;
  --bg-white: #ffffff;
  --primary-orange: #ff4e2a;
  --primary-orange-hover: #e03e1b;
  --text-main: #111111;
  --text-muted: #666666;
  --border-color: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: #ffffff;
  color: var(--text-main);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* ==========================================
   DISTRIBUCIÓN EN 2 COLUMNAS
   ========================================== */
.checkout-container {
  display: grid;
  grid-template-columns: 520px 380px; /* Anchos fijos exactos para emular Clip */
  justify-content: center; /* Centra las columnas en la pantalla */
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
}
/* Columna Izquierda */
.checkout-left {
  background-color: #ffffff;
  padding: 40px 32px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  justify-content: space-between; /* Mantiene el footer siempre abajo */
}

.lang-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
  font-size: 1.2rem;
}

.merchant-header {
  text-align: center;
  margin-bottom: 30px;
}

.merchant-header h1,
.merchant-header h2 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.merchant-header p {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  font-size: 0.55rem;
  color: var(--text-muted);
}

.logo-circle {
  width: 60px;
  height: 60px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  overflow: hidden;
  background-color: #ffffff;
}

.logo-img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

/* Contenedor del monto alineado verticalmente al centro */
.amount-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Etiqueta MXN redondeada y estética estilo píldora */
.currency-tag {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #2d2d2d;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Botón de Propina */
.btn-tip {
  border: 1px solid var(--border-color);
  background: white;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-tip:hover {
  background-color: #f0f0f0;
}

/* Control de tamaño para el icono dentro del botón de propina */
.btn-tip-icon {
  height: 18px;
  width: 18px;
  max-width: 18px;
  max-height: 18px;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0;
}

/* Opciones de pago */
.payment-methods {
  width: 100%;
  max-width: 400px;
}

/* Botón Principal Clip */
.btn-clip-primary {
  width: 100%;
  background: var(--primary-orange, #ff4e2a);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.05rem;
  cursor: pointer;
  margin-bottom: 20px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  transition: background-color 0.2s ease;
}

.btn-clip-primary:hover {
  background-color: var(--primary-orange-hover, #e03e1b);
}

.btn-logo-img {
  height: 22px;
  width: auto;
  object-fit: contain;
  display: block;
}

.option-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.option-card:hover {
  border-color: var(--primary-orange);
}

.option-info {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Fila de logos de marcas */
.logos-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.logos-row img {
  height: 18px;
  width: auto;
  max-width: 48px;
  object-fit: contain;
  display: block;
}

/* Columna Derecha */
.checkout-right {
  background-color: #f8f9fa;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
  color: var(--text-muted);
}

.summary-line.total {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-main);
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

footer {
  margin-top: auto;
  display: flex;
  gap: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================
   CAPA OSCURA (OVERLAY)
   ========================================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 100;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================
   PANELES LATERALES (SIDEBARS)
   ========================================== */
.sidebar-panel {
  position: fixed;
  top: 0;
  right: -350px;
  width: 350px;
  height: 100vh;
  background-color: #ffffff;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.15);
  z-index: 101;
  padding: 30px 25px;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-panel.active {
  right: 0;
}

.close-btn {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #333333;
  line-height: 1;
}

.close-btn:hover {
  color: var(--primary-orange);
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
}

.sidebar-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 35px;
  color: #111111;
}

.sidebar-logo {
  width: 90px;
  height: 90px;
  margin-bottom: 20px;
}

.merchant-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: #111111;
}

/* Opciones de Idioma */
.lang-list {
  list-style: none;
  width: 100%;
  padding: 0;
}

.lang-option {
  padding: 14px 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.lang-option:hover {
  border-color: var(--primary-orange);
  background-color: #fffaf9;
}

.lang-option.active-lang {
  border-color: var(--primary-orange);
  background-color: #fff0ec;
  font-weight: bold;
}

/* ==========================================
   VENTANA MODAL CENTRADA (PROPINA)
   ========================================== */
.modal-tip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background-color: #ffffff;
  padding: 30px 25px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 102;
  width: 90%;
  max-width: 380px;
  text-align: center;

  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
}

.modal-tip.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.modal-tip h3 {
  font-size: 1.25rem;
  color: #111111;
  margin-bottom: 10px;
}

.modal-tip p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 20px;
}

.btn-modal-close {
  background-color: var(--primary-orange);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.95rem;
  width: 100%;
  transition: background-color 0.2s;
}

.btn-modal-close:hover {
  background-color: var(--primary-orange-hover);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .checkout-container {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .checkout-left,
  .checkout-right {
    padding: 40px 20px;
  }
}

/* ==========================================
   VISTA: FORMULARIO DE TARJETA
   ========================================== */
#view-methods,
#view-card-form {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 30px;
}

.back-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-main);
}

.card-form-merchant {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.logo-circle.small {
  width: 34px;
  height: 34px;
  margin-bottom: 0;
}

.lang-selector-inline {
  cursor: pointer;
  font-size: 1.1rem;
}

.form-section-title {
  width: 100%;
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  margin: 15px 0 10px;
}

.form-field {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.form-field input {
  width: 100%;
  border: none;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  background: transparent;
}

.phone-field .country-code {
  padding: 0 10px 0 16px;
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 0.9rem;
}

.card-number-field {
  padding-right: 12px;
  justify-content: space-between;
}

.card-number-field input {
  flex: 1;
}

.card-icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.card-icons img {
  height: 14px;
  width: auto;
  object-fit: contain;
}

.form-row {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
}

.form-row .form-field {
  margin-bottom: 0;
}

.cvv-field {
  padding-right: 12px;
  justify-content: space-between;
}

.cvv-icon {
  font-size: 1rem;
}

.save-info-box {
  display: flex;
  gap: 12px;
  background: var(--bg-light);
  border-radius: 8px;
  padding: 16px;
  margin: 15px 0 25px;
  align-items: flex-start;
  width: 100%;
}

.save-info-box input[type="checkbox"] {
  margin-top: 3px;
}

.save-info-box strong {
  font-size: 0.9rem;
}

.save-info-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.save-info-box a {
  color: var(--text-main);
  text-decoration: underline;
}

/* Badges de confianza */
.trust-badges {
  display: flex;
  justify-content: center; /* Centra las tarjetas de marcas entre sí */
  align-items: center;     /* Nivela verticalmente los logos dentro de las tarjetas */
  gap: 8px;                /* Separación entre cada tarjeta de marca */
  width: 100%;
  margin: 0 auto;
}

.badge {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge img {
  height: 22px;
  width: auto;
  max-width: 70px;
  object-fit: contain;
}

/* ==========================================
   VALIDACIÓN DE CAMPOS
   ========================================== */
.field-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.form-row .field-group .form-field {
  margin-bottom: 0;
}

.field-error {
  display: block;
  min-height: 16px;
  color: #d92d20;
  font-size: 0.75rem;
  margin: -4px 0 8px 4px;
}

.form-field.invalid {
  border-color: #d92d20;
}

/* ==========================================
   VISTA: PROCESANDO TRANSACCIÓN
   ========================================== */
.view-processing {
  flex: 1;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
}

.processing-gif {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 25px;
}

.processing-text {
  font-size: 1rem;
  color: var(--text-main);
  max-width: 320px;
  line-height: 1.5;
}

/* Estado deshabilitado del botón */
.btn-clip-primary.btn-disabled-look {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================
   BARRA DE CARGA SUPERIOR
   ========================================== */
.top-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  overflow: hidden;
  z-index: 300;
  pointer-events: none;
}

.top-loader-bar {
  display: block;
  height: 100%;
  width: 35%;
  background: var(--primary-orange);
  border-radius: 0 4px 4px 0;
  transform: translateX(-100%);
}

.top-loader.active .top-loader-bar {
  animation: top-loader-run 0.7s ease-in-out;
}

@keyframes top-loader-run {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(160%);
  }
  100% {
    transform: translateX(320%);
  }
}
.lang-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
  display: flex;          /* Alinea el icono perfectamente al centro */
  align-items: center;
  justify-content: center;
}

/* Controla el tamaño de tu nuevo icono */
.lang-icon {
  width: 22px;            /* Mantendrá el tamaño equivalente al emoji anterior */
  height: 22px;
  object-fit: contain;
  display: block;
}
/* 1. Contenedor principal de seguridad */
.security-badges {
  display: flex;
  flex-direction: column;
  align-items: center;    /* Centra horizontalmente badges, texto y tag verde */
  justify-content: center;
  text-align: center;     /* Centra el texto */
  width: 100%;
  margin-top: auto;       /* Mantiene el bloque al final de la columna */
  gap: 10px;              /* Espaciado uniforme entre elementos */
}

/* 2. Texto descriptivo en negro con NEGRITAS */
.security-badges p {
  font-size: 0.7rem;      /* Tamaño reducido */
  font-weight: 700;       /* Negrita aplicada al texto negro */
  color: var(--text-muted);
  line-height: 1.3;
  margin: 0;
}

/* 3. Etiqueta verde "Paga seguro con Clip" con NEGRITAS y Prioridad de Color */
.security-badges p.secure-tag,
.security-badges .secure-tag span {
  color: #00875a !important; /* Verde Clip */
  font-size: 0.7rem;
  font-weight: 700 !important; /* Negrita aplicada al texto verde */
}

.secure-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
}

/* Icono SVG del candado en verde */
.secure-tag svg {
  stroke: #00875a !important;
}
/* ==========================================
   PIE DE PÁGINA (FOOTER) UNIFICADO WEB Y MÓVIL
   ========================================== */

/* Sobreescribe y unifica los estilos del footer */
footer {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 20px 0 10px 0;
  margin-top: auto;
}

footer small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: underline;
  font-weight: 500;
}

footer a:hover {
  color: var(--text-main);
}

/* Reglas adicionales para adaptar a pantallas móviles */
@media (max-width: 768px) {
  .checkout-left {
    min-height: 100vh;
    padding-bottom: 30px;
  }

  footer {
    position: relative;
    bottom: 0;
    margin-top: 30px;
  }
}