/* =====================================================================
   CONEXIONES PANEL - GLOBPAY MERCHANT DASHBOARD
   Tokens: Turquesa #0BB6B5, Fondos #ffffff / #f8fafc, Bordes #e2e8f0, Texto #0f172a
   ===================================================================== */

#view-conexiones {
  display: none;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 0 40px 0;
  box-sizing: border-box;
}

#view-conexiones.is-active {
  display: block;
}

/* 1. CABECERA DE LA PÁGINA */
.connections-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.connections-header-text {
  flex: 1 1 auto;
}

.connections-title {
  margin: 0 0 6px 0;
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.connections-subtitle {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.4;
}

.connections-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.btn-refresh-connections {
  height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-refresh-connections:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-refresh-connections:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.refresh-icon-svg {
  width: 16px;
  height: 16px;
  color: #475569;
  transition: transform 0.3s ease;
}

.is-refreshing .refresh-icon-svg {
  animation: connectionsSpin 0.8s linear infinite;
}

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

.last-check-text {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
}

/* 2. BANNER INFORMATIVO "TODO EN UN SOLO LUGAR" */
.connections-hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  border-radius: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
}

.hero-banner-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0BB6B5;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-banner-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.hero-banner-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-banner-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.hero-banner-desc {
  margin: 0;
  font-size: 13px;
  color: #0f766e;
}

.hero-banner-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #0f766e;
  background: #ffffff;
  border: 1px solid #99f6e4;
  padding: 4px 12px;
  border-radius: 9999px;
  white-space: nowrap;
}

/* 3. PARRILLA DE 3 TARJETAS PRINCIPALES */
.connections-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.service-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.service-card:hover {
  box-shadow: 0 4px 8px -2px rgba(15, 23, 42, 0.08);
}

.service-card-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Cabecera de la tarjeta del servicio */
.service-header-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.service-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  color: #0BB6B5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-avatar-wrap svg {
  width: 22px;
  height: 22px;
}

.service-title-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.service-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.service-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

/* Badges de estado */
.badge-status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-status-pill.badge-verified {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-status-pill.badge-simulation {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.badge-status-pill.badge-managed {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-status-pill.badge-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-status-pill.badge-testing {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.badge-status-pill.badge-pending-theme {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.service-description {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

/* Lista de detalles de verificación */
.service-details-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 0 6px 0;
  border-top: 1px solid #f1f5f9;
}

.service-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.detail-icon-wrap {
  color: #64748b;
  flex-shrink: 0;
  margin-top: 1px;
}

.detail-icon-wrap svg {
  width: 15px;
  height: 15px;
}

.detail-text-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.detail-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.detail-subtitle {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Bloque inferior: Botón en tu tienda (Shopify Card) */
.service-subblock-button {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-top: 14px;
}

.subblock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 6px;
}

.subblock-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.subblock-desc {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

/* Notas al pie de cada tarjeta */
.service-footer-note {
  margin: 12px 0 14px 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

/* Botones de acción de las tarjetas */
.service-card-action {
  width: 100%;
  padding-top: 12px;
}

.btn-service-action {
  width: 100%;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  text-decoration: none;
}

.btn-service-action.btn-outline-neutral {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

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

.btn-service-action.btn-outline-turquoise {
  background: #ffffff;
  border: 1px solid #0BB6B5;
  color: #0BB6B5;
}

.btn-service-action.btn-outline-turquoise:hover {
  background: #f0fdfa;
  border-color: #099e9d;
  color: #099e9d;
}

/* 4. BLOQUE INFERIOR: ESTADO DE TUS SERVICIOS */
.services-status-summary-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.summary-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.summary-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.summary-card-subtitle {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.summary-card-tag {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 9999px;
}

.services-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.summary-item-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
}

.summary-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0BB6B5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-item-icon svg {
  width: 17px;
  height: 17px;
}

.summary-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.summary-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-item-status {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 5. BANNER PROBAR FORMULARIO */
.demo-test-callout-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.demo-callout-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
}

.demo-callout-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  color: #0BB6B5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo-callout-icon svg {
  width: 18px;
  height: 18px;
}

.demo-callout-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-callout-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.demo-callout-desc {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
}

.btn-try-form-action {
  height: 38px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  background: #0BB6B5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-try-form-action:hover {
  background: #099e9d;
}

/* 6. AVISO AL PIE */
.connections-footer-disclaimer {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0;
  text-align: left;
}

/* 7. MODALES INFORMATIVOS (YAPPY Y BOTÓN) */
.connections-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.connections-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}

.connections-modal-card {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  padding: 24px;
  box-sizing: border-box;
  z-index: 1001;
}

.connections-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.connections-modal-title {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.btn-close-connections-modal {
  background: none;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.btn-close-connections-modal:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.connections-modal-body {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.55;
}

.modal-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0;
  padding-left: 0;
  list-style: none;
}

.modal-step-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.modal-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.modal-notice-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  font-size: 12.5px;
  color: #64748b;
  margin-top: 16px;
}

.connections-modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.btn-modal-close-action {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background: #f1f5f9;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-modal-close-action:hover {
  background: #e2e8f0;
}

/* =====================================================================
   RESPONSIVIDAD
   ===================================================================== */

@media (max-width: 1024px) {
  .connections-cards-grid {
    grid-template-columns: 1fr;
  }

  .services-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .connections-header {
    flex-direction: column;
    align-items: stretch;
  }

  .connections-header-text {
    flex: 0 0 auto;
    width: 100%;
  }

  .connections-header-actions {
    align-items: stretch;
  }

  .btn-refresh-connections {
    width: 100%;
    justify-content: center;
  }

  .last-check-text {
    text-align: center;
  }

  .connections-hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-banner-left {
    flex: 0 0 auto;
    width: 100%;
  }

  .hero-banner-badge {
    align-self: flex-start;
  }

  .services-summary-grid {
    grid-template-columns: 1fr;
  }

  .demo-test-callout-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .demo-callout-left {
    flex: 0 0 auto;
    width: 100%;
  }

  .btn-try-form-action {
    width: 100%;
    justify-content: center;
  }

  .service-card {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .connections-title {
    font-size: 22px;
  }
  
  .connections-subtitle {
    font-size: 13px;
  }

  .service-header-row {
    gap: 10px;
  }

  .service-avatar-wrap {
    width: 36px;
    height: 36px;
  }

  .service-title {
    font-size: 15px;
  }

  .service-card {
    padding: 14px;
  }
}

@media (max-width: 360px) {
  .connections-title {
    font-size: 20px;
  }

  .badge-status-pill {
    font-size: 10.5px;
    padding: 2px 6px;
  }

  .service-card {
    padding: 12px;
  }

  .btn-refresh-connections {
    font-size: 12.5px;
    padding: 0 12px;
  }
}
