/**
 * ======================================================
 * ARCHIVO: home-hub.css
 * UBICACIÓN: frontend/public/styles/
 * VERSIÓN: 1.2 — Carrusel logos centrado verticalmente
 * ÚLTIMA ACTUALIZACIÓN: 2026-06-28 12:00
 *
 * 🎯 PROPÓSITO:
 * Estilos layout hub: servicio del día, grid accesos rápidos y carrusel de logos.
 *
 * ======================================================
 * 📋 REGLAS PARA PRODUCCIÓN:
 * ------------------------------------------------------
 * - Console.log marcados con // @strip se eliminan al generar build para cliente
 * - Esta cabecera se elimina al generar versión para cliente (documentación interna)
 *
 * ======================================================
 * 📋 HISTORIAL DE CAMBIOS:
 * ------------------------------------------------------
 * [1.2] - 2026-06-28 12:00
 *    ✅ Flex centrado logo+texto en carrusel empresas (HU-072 ajuste visual)
 * [1.1] - 2026-06-17 20:00
 *    ✅ Layout hub inicial
 * ======================================================
 */

body.soluciones-home {
  --hub-accent: #1f4fd8;
  --hub-radius: 12px;
  --hub-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --hub-max: 1180px;
}

.hub-main {
  display: block;
}

/* ---------- Hero servicio del día ---------- */
.hub-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 48%, #0f172a 100%);
  color: #f8fafc;
  padding: clamp(32px, 5vh, 56px) 56px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(320px, 48vh, 480px);
}

/* Banda de controles debajo del recuadro hero (fuera del fondo oscuro) */
.hub-hero-controls-band {
  background: transparent;
  max-width: var(--hub-max);
  margin: 0 auto;
  padding: 20px 24px 12px;
}

.hub-hero-controls-band .hub-carousel-controls,
#hub-brands-controls-mount .hub-carousel-controls {
  margin-top: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  width: 100%;
  padding: 0;
}

#hub-brands-controls-mount {
  max-width: var(--hub-max);
  margin: 16px auto 0;
  padding: 0 24px;
  background: transparent;
}

/* ---------- Controles unificados de carrusel (hero + marcas) ---------- */
.hub-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 24px);
  margin-top: 28px;
  position: relative;
  z-index: 2;
  min-height: 36px;
}

.hub-carousel-controls--on-dark {
  color: #0f172a;
}

.hub-carousel-controls--on-light {
  color: #0f172a;
}

.hub-carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.hub-carousel-btn:hover {
  opacity: 0.72;
}

.hub-carousel-btn:active {
  transform: scale(0.94);
}

.hub-carousel-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 50%;
}

.hub-carousel-icon {
  display: block;
}

.hub-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
}

.hub-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.hub-carousel-dot.is-active {
  background: currentColor;
}

.hub-carousel-dot:hover {
  transform: scale(1.08);
}

.hub-hero-copy--in {
  animation: hub-hero-fade 0.35s ease;
}

@keyframes hub-hero-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hub-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--hub-accent) 35%, transparent), transparent 55%);
  pointer-events: none;
}

.hub-hero-inner {
  max-width: var(--hub-max);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hub-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hub-hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-hero-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--hub-accent) 80%, #fff);
  margin: 0 0 12px;
}

.hub-hero-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 16px;
}

.hub-hero-desc {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #cbd5e1;
  margin: 0 0 12px;
  max-width: 520px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hub-hero-teaser {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}

.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.hub-btn-primary {
  background: var(--hub-accent);
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--hub-accent) 45%, transparent);
}

.hub-btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.hub-btn-outline {
  background: #fff;
  color: var(--hub-accent, #1f4fd8);
  border: 1px solid #e2e8f0;
  margin-top: auto;
}

.hub-btn-outline:hover {
  border-color: var(--hub-accent, #1f4fd8);
  box-shadow: 0 4px 16px rgba(31, 79, 216, 0.12);
}

.hub-btn-secondary {
  background: #fff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.hub-hero-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.hub-hero-card img {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.hub-hero-card--emoji {
  font-size: 4rem;
}

.hub-hero-card-fallback {
  font-size: 4rem;
  align-items: center;
  justify-content: center;
}

/* ---------- Accesos rápidos ---------- */
.hub-quicklinks-section {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 24px 20px;
}

.hub-quicklinks {
  max-width: var(--hub-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hub-quicklink {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  border-radius: var(--hub-radius);
  text-decoration: none;
  color: #0f172a;
  transition: background 0.15s;
}

.hub-quicklink:hover {
  background: #f1f5f9;
}

.hub-quicklink-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.hub-quicklink-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-bottom: 10px;
  background: linear-gradient(145deg, var(--hub-accent, #1f4fd8) 0%, #163fc1 100%);
  box-shadow: 0 4px 14px rgba(31, 79, 216, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.95);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hub-quicklink:hover .hub-quicklink-dot {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(31, 79, 216, 0.45);
}

.hub-quicklink-label {
  font-weight: 600;
  color: var(--hub-accent, #1f4fd8);
  font-size: 0.92rem;
}

.hub-quicklink-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
}

/* ---------- Grid servicios ---------- */
.hub-services-section {
  padding: 56px 24px;
  background: #f8fafc;
}

.hub-section-head {
  max-width: var(--hub-max);
  margin: 0 auto 32px;
  text-align: left;
}

.hub-section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: #0f172a;
}

.hub-section-head p {
  margin: 0;
  color: #64748b;
  font-size: 1rem;
}

.hub-services-grid {
  max-width: var(--hub-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.hub-service-card {
  background: #fff;
  border-radius: var(--hub-radius);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: var(--hub-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hub-service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

.hub-card-media {
  height: 140px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.hub-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.hub-card-media--fallback .hub-card-media-placeholder {
  display: flex;
  font-size: 2.5rem;
}

.hub-card-media-placeholder {
  display: none;
}

.hub-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.hub-card-body h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.hub-card-body p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #64748b;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hub-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #64748b;
  padding: 32px;
}

/* ---------- Trámites compacto ---------- */
.hub-tramites-compact {
  padding: 32px 24px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.hub-tramites-inner {
  max-width: var(--hub-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 20px 24px;
  background: #f8fafc;
  border-radius: var(--hub-radius);
  border: 1px solid #e2e8f0;
}

.hub-tramites-inner h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.hub-tramites-inner p {
  margin: 0;
  flex: 1;
  min-width: 200px;
  font-size: 0.9rem;
  color: #64748b;
}

/* ---------- Carrusel logos ---------- */
.hub-brands-section {
  padding: 40px 0 48px;
  background: #fff;
}

.hub-brands-section .hub-section-head {
  text-align: center;
  padding: 0 24px;
}

.hub-brands-strip {
  position: relative;
  max-width: var(--hub-max);
  margin: 24px auto 0;
  padding: 20px 24px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid #e2e8f0;
  border-radius: var(--hub-radius);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
}

.hub-brands-strip--dragging {
  cursor: grabbing;
  touch-action: none;
  user-select: none;
}

.hub-brands-strip--dragging .hub-brand-item {
  pointer-events: none;
}

.hub-brands-strip--dragging .hub-brand-item:hover {
  transform: none;
  box-shadow: none;
}

.hub-brands-track {
  overflow: hidden;
}

.hub-brands-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  will-change: transform;
}

.hub-brand-item {
  flex-shrink: 0;
  width: 128px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.hub-brand-item:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.hub-brand-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.hub-brand-fallback {
  display: none;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  color: #475569;
  line-height: 1.2;
}

.hub-brand-item--text .hub-brand-fallback,
.hub-brand-item:not(:has(img)) .hub-brand-fallback,
.hub-brand-item.logo-load-failed .hub-brand-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.hub-brands-empty {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ---------- Teaser bonos (secundario) ---------- */
.hub-bonos-teaser {
  text-align: center;
  padding: 28px 24px 48px;
  background: #f8fafc;
}

.hub-bonos-teaser a {
  color: #1f4fd8;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.hub-bonos-teaser a:hover {
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hub-services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hub-hero {
    padding: clamp(28px, 4vh, 40px) 20px;
    min-height: clamp(360px, 52vh, 520px);
  }

  .hub-hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    justify-items: center;
    text-align: center;
  }

  .hub-hero-copy {
    align-items: center;
    width: 100%;
  }

  .hub-hero-desc {
    max-width: 100%;
  }

  .hub-hero-visual {
    order: -1;
    width: 100%;
  }

  .hub-hero-card {
    min-height: 180px;
    max-width: min(280px, 85vw);
    margin: 0 auto;
  }

  .hub-quicklinks {
    grid-template-columns: 1fr;
  }

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

  .hub-promo-banner {
    padding: 0 16px;
  }

  .hub-tramites-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Banner promo compartido (proyectos, bonos) — ratio 3:1 como hero ---------- */
.hub-promo-banner {
  max-width: var(--hub-max, 1200px);
  margin: 0 auto 8px;
  padding: 0 24px;
}

.hub-promo-banner-frame {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
  background: #0f172a;
  aspect-ratio: 3 / 1;
  max-height: min(42vw, 400px);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.28s ease;
}

a.hub-promo-banner-frame {
  text-decoration: none;
  color: inherit;
}

button.hub-promo-banner-frame {
  border: none;
  padding: 0;
  cursor: pointer;
  width: 100%;
  font: inherit;
  text-align: inherit;
}

.hub-promo-banner-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}

.hub-promo-banner-frame.is-fading {
  opacity: 0.2;
}

.hub-promo-banner-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  vertical-align: middle;
}

.hub-promo-banner-track {
  width: 100%;
  height: 100%;
  position: relative;
}

.hub-promo-banner-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hub-promo-banner-controls {
  margin-bottom: 8px;
}

.hub-promo-banner[hidden],
.hub-promo-banner-controls[hidden] {
  display: none !important;
}

a.hub-promo-banner-frame:focus-visible,
button.hub-promo-banner-frame:focus-visible {
  outline: 3px solid rgba(31, 79, 216, 0.5);
  outline-offset: 4px;
}
