/* ===============================
   RvN3 – Clients UI (Responsive)
   =============================== */

/* --------- Design tokens (opcional pero recomendado) --------- */
:root {
  --topbar-h: 72px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.14);

  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.06);

  --txt: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);

  --accent: rgba(55, 226, 213, 0.95);
  --accent-2: rgba(55, 226, 213, 0.55);

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);

  /* layout */
  --gutter: clamp(16px, 3vw, 28px);
}

/* Fallback container si no tenés uno */
.container {
  width: min(1120px, 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

/* Mejoras generales UX */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  color: var(--txt);
}
a {
  color: inherit;
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid rgba(55, 226, 213, 0.8);
  outline-offset: 3px;
}

/* Reduce motion (accesibilidad) */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  .chip,
  .topbar__link {
    transition: none !important;
  }
}

/* ========= TOPBAR (Responsive + usable) ========= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  height: 72px; /* altura fija para centrar todo */
  display: flex;
  align-items: center;
  backdrop-filter: blur(1px);
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar__inner {
  width: 100%;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  /* evita que en mobile quede todo pegado */
  padding-block: 10px;
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* target táctil */
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.92);
  user-select: none;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar__link {
  display: inline-flex;
  align-items: center;

  min-height: 44px; /* target táctil */
  padding-inline: 8px;

  line-height: 1;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  letter-spacing: 0.2px;

  transition:
    color 0.18s ease,
    opacity 0.18s ease;
}

.topbar__link:hover {
  color: rgba(255, 255, 255, 0.92);
}
.topbar__link.is-active {
  color: var(--accent);
}

/* CTA */

.btn {
  --btn-bg: transparent;
  --btn-border: #2b2f37;
  --btn-color: var(--ink);

  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  padding: 10px 18px;
  border-radius: 999px;

  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;

  background: var(--btn-bg);
  color: var(--btn-color);
  border: 1px solid var(--btn-border);

  text-decoration: none;
  cursor: pointer;

  backdrop-filter: blur(4px);

  transition:
    transform 0.2s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  --accent: #37e2d5;

  --btn-bg: rgba(55, 226, 213, 0.08);
  --btn-border: rgba(55, 226, 213, 0.25);
  --btn-color: var(--accent);
}

.btn.primary:hover {
  --btn-bg: rgba(55, 226, 213, 0.18);
  --btn-border: rgba(55, 226, 213, 0.5);

  box-shadow: 0 0 18px rgba(55, 226, 213, 0.18);
}

/* Mobile: oculto nav (ideal: reemplazar por menú hamburguesa en HTML/JS) */
@media (max-width: 720px) {
  .topbar__nav {
    display: none;
  }
}

/* ========= HERO / TYPO ========= */

.clients-hero {
  /* más aire en desktop, menos en mobile */
  padding: clamp(40px, 6vw, 72px) 0 clamp(18px, 3vw, 28px);
}

/* Si tu H1 está dentro de .clients-hero, esto lo mejora mucho */
.clients-hero h1 {
  font-size: clamp(34px, 5.2vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.clients-hero p {
  max-width: 62ch;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(14px, 1.7vw, 16px);
  line-height: 1.55;
  margin: 0;
}

/* ========= FILTERS / CHIPS ========= */

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* Mobile UX: chips scrolleables en una línea */
@media (max-width: 640px) {
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
  }
  .filters::-webkit-scrollbar {
    height: 6px;
  }
  .filters::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
  }
  .chip {
    scroll-snap-align: start;
  }
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;

  padding: 10px 14px;
  border-radius: 999px;

  cursor: pointer;
  user-select: none;

  min-height: 44px; /* target táctil */
  display: inline-flex;
  align-items: center;

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(55, 226, 213, 0.5);
}

.chip.is-active {
  background: rgba(55, 226, 213, 0.12);
  border-color: rgba(55, 226, 213, 0.55);
}

/* ========= GRID ========= */

.clients {
  padding: clamp(22px, 3vw, 30px) 0 clamp(54px, 7vw, 80px);
}

/* En vez de 12 columnas fijas, auto-fit para que fluya perfecto */
.clients-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  align-items: stretch;
}

/* Card */
.client-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);

  transform: translateZ(0);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.client-card:hover {
  background: var(--card-hover);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

/* ========= THUMB / IMAGE ========= */

.client-thumb {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

/* altura de imagen fluida por breakpoint */
.client-thumb img {
  width: 100%;
  height: clamp(190px, 24vw, 240px);
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transform: scale(1.001);
}

/* ========= BODY ========= */

.client-body {
  padding: 16px 16px 18px;
}

.client-body h3 {
  margin: 10px 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.client-body p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.client-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========= LIGHTBOX (mejor mobile + cierre seguro) ========= */

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;

  padding: clamp(14px, 2.2vw, 22px);
  background: rgba(0, 0, 0, 0.72);
  z-index: 1000;
}

.lightbox.is-open {
  display: flex;
}

.lightbox__img {
  max-width: min(1100px, 96vw);
  max-height: min(86vh, 760px);

  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox__close {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));

  width: 46px;
  height: 46px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 18px;
  cursor: pointer;

  display: grid;
  place-items: center;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.16);
}
