/* ══════════════════════════════════════════════════════════════════
   BSCare – huellas.css  (Página "Huellas BS-Care": historia + galerías)
   ══════════════════════════════════════════════════════════════════ */

/* ── HISTORIA ───────────────────────────────────────────────────── */
.huellas-story {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: 4rem; align-items: center;
}
.huellas-story-text p {
  color: var(--gray-500); line-height: 1.85; font-size: 1rem;
  margin-bottom: 1.1rem;
}
.huellas-story-text p strong { color: var(--blue-primary); }
.huellas-story-text .huellas-lead {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 800; font-style: italic;
  color: var(--gray-900); line-height: 1.5;
  border-left: 4px solid var(--red-primary);
  padding-left: 1rem; margin-top: 1.5rem;
}

.huellas-evo {
  position: relative;
  display: grid; gap: 1rem;
}
.huellas-evo-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  display: flex; align-items: center; gap: 1.1rem;
  box-shadow: var(--shadow-md);
}
.huellas-evo-card img { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.huellas-evo-card img.huellas-evo-logo-bs {
  width: 96px; height: 64px; object-fit: cover;
  border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.huellas-evo-card small {
  display: block; font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.25rem;
}
.huellas-evo-card strong { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 900; line-height: 1.2; }
.huellas-evo-card span { display: block; font-size: 0.82rem; margin-top: 0.3rem; line-height: 1.5; }
.huellas-evo-before { background: var(--blue-bg); border: 1px solid var(--gray-100); color: var(--gray-700); }
.huellas-evo-before small { color: var(--gray-500); }
.huellas-evo-after { background: var(--grad-blue); color: #fff; }
.huellas-evo-after small { color: rgba(255,255,255,0.7); }
.huellas-evo-after span { color: rgba(255,255,255,0.85); }
.huellas-evo-arrow {
  justify-self: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: #fff; color: var(--red-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 900;
  box-shadow: var(--shadow-md);
  animation: huellasBounce 2.2s ease-in-out infinite;
}
@keyframes huellasBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}
.huellas-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 0.5rem;
}
.huellas-stat {
  background: #fff; border: 1px solid var(--gray-100);
  border-radius: var(--radius-md); padding: 0.9rem 0.5rem; text-align: center;
}
.huellas-stat b {
  display: block; font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 900; color: var(--blue-primary); line-height: 1;
}
.huellas-stat em {
  font-style: normal; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-500);
}

/* ── NAVEGACIÓN DE GALERÍAS (chips fijos) ───────────────────────── */
.huellas-nav {
  position: sticky; top: calc(var(--nav-h) + 0.75rem); z-index: 20;
  display: flex; gap: 0.6rem; justify-content: safe center; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: none;
  width: fit-content; max-width: min(var(--max-w), 100%); margin: 0 auto 3rem;
  padding: 0.6rem;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 30px rgba(0,58,140,0.08);
}
.huellas-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 1rem;
  border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--gray-700);
  font-family: var(--font-main); font-size: 0.82rem; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.huellas-chip:hover { background: var(--blue-pale); color: var(--blue-primary); }
.huellas-chip.active { background: var(--blue-primary); color: #fff; }
.huellas-chip i {
  font-style: normal; font-size: 0.68rem; font-weight: 800;
  background: rgba(0,58,140,0.1); color: inherit;
  padding: 1px 7px; border-radius: var(--radius-full);
}
.huellas-chip.active i { background: rgba(255,255,255,0.22); }
.huellas-nav::-webkit-scrollbar { display: none; }

/* ── BLOQUE DE CADA GALERÍA ─────────────────────────────────────── */
.huellas-gallery {
  max-width: var(--max-w); margin: 0 auto 1rem;
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 16px rgba(0, 58, 140, 0.05);
  scroll-margin-top: calc(var(--nav-h) + 6rem);
  transition: box-shadow var(--t-med), border-color var(--t-med);
}
.huellas-gallery:hover, .huellas-gallery.open {
  border-color: var(--blue-pale);
  box-shadow: 0 14px 40px rgba(0, 58, 140, 0.12);
}
.huellas-gallery-head {
  width: 100%;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.1rem 1.5rem;
  background: none; border: 0; cursor: pointer;
  text-align: left; font-family: inherit;
}
.huellas-gallery-num {
  font-family: var(--font-display);
  font-size: 2.6rem; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, var(--blue-primary), var(--red-primary));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  min-width: 3.2rem;
}
.huellas-gallery-info { flex: 1; min-width: 0; }
.huellas-gallery-head h3 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 900;
  color: var(--gray-900); line-height: 1.2;
}
.huellas-gallery-head p { font-size: 0.82rem; color: var(--gray-500); font-weight: 600; margin-top: 0.15rem; }
.huellas-gallery-peek { display: flex; flex-shrink: 0; transition: opacity var(--t-med), transform var(--t-med); }
.huellas-gallery-peek img {
  width: 54px; height: 54px; object-fit: cover;
  border-radius: 14px; border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 58, 140, 0.18);
  margin-left: -18px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.huellas-gallery-peek img:nth-child(1) { transform: rotate(-6deg); }
.huellas-gallery-peek img:nth-child(3) { transform: rotate(6deg); }
.huellas-gallery-head:hover .huellas-gallery-peek img:nth-child(1) { transform: rotate(-12deg) translateX(-8px); }
.huellas-gallery-head:hover .huellas-gallery-peek img:nth-child(2) { transform: translateY(-4px); }
.huellas-gallery-head:hover .huellas-gallery-peek img:nth-child(3) { transform: rotate(12deg) translateX(8px); }
.huellas-gallery.open .huellas-gallery-peek { opacity: 0; transform: scale(0.8); }
.huellas-gallery-chevron {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  background: var(--blue-pale); color: var(--blue-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800;
  transition: transform var(--t-med), background var(--t-med), color var(--t-med);
}
.huellas-gallery.open .huellas-gallery-chevron { transform: rotate(90deg); background: var(--blue-primary); color: #fff; }
.huellas-gallery-head:focus-visible { outline: 3px solid var(--blue-primary); outline-offset: -3px; border-radius: var(--radius-xl); }
.huellas-gallery-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.huellas-gallery.open .huellas-gallery-body { grid-template-rows: 1fr; }
.huellas-gallery-body > div { overflow: hidden; min-height: 0; padding: 0 1.5rem; }
.huellas-gallery.open .huellas-gallery-body > div { padding-bottom: 1.5rem; }

/* Mosaico tipo "bento" */
.huellas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 190px;
  grid-auto-flow: dense;
  gap: 0.85rem;
}
.huellas-tile {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--blue-pale);
  cursor: zoom-in;
  border: 0; padding: 0;
  opacity: 0; transform: translateY(24px) scale(0.97);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.huellas-tile.in { opacity: 1; transform: none; }
.huellas-tile:nth-child(8n+1) { grid-column: span 2; grid-row: span 2; }
.huellas-tile:nth-child(8n+4) { grid-row: span 2; }
.huellas-tile:nth-child(8n+7) { grid-column: span 2; }
.huellas-tile img, .huellas-tile video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}
.huellas-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 24, 68, 0.75));
  opacity: 0; transition: opacity 0.35s ease;
}
.huellas-tile-zoom {
  position: absolute; z-index: 1; right: 14px; bottom: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: var(--blue-primary);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.huellas-tile:hover { box-shadow: 0 18px 40px rgba(0, 58, 140, 0.25); }
.huellas-tile:hover img, .huellas-tile:hover video { transform: scale(1.08); }
.huellas-tile:hover::after, .huellas-tile:focus-visible::after { opacity: 1; }
.huellas-tile:hover .huellas-tile-zoom, .huellas-tile:focus-visible .huellas-tile-zoom { opacity: 1; transform: scale(1); }
.huellas-tile:focus-visible { outline: 3px solid var(--blue-primary); outline-offset: 3px; }
.huellas-tile-play {
  position: absolute; z-index: 1; inset: 0; margin: auto;
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: var(--red-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.huellas-tile-hidden { display: none; }

.huellas-more {
  display: flex; justify-content: center; margin-top: 1.25rem;
}

/* ── LIGHTBOX ───────────────────────────────────────────────────── */
.huellas-lightbox {
  position: fixed; inset: 0; z-index: 10000; /* encima de los botones flotantes (9999) */
  background: rgba(0, 14, 40, 0.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; grid-template-rows: auto 1fr auto;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.huellas-lightbox.open { opacity: 1; visibility: visible; }
.hlb-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; color: #fff;
}
.hlb-title { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.hlb-count { font-size: 0.8rem; color: rgba(255,255,255,0.65); margin-left: 0.75rem; font-weight: 600; }
.hlb-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08); color: #fff;
  font-size: 1.4rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}
.hlb-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.06); }
.hlb-stage {
  position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5.5rem;
}
.hlb-media {
  max-width: 100%; max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  opacity: 0; transform: scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.hlb-media.ready { opacity: 1; transform: none; }
.hlb-prev, .hlb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.hlb-prev:hover, .hlb-next:hover { transform: translateY(-50%) scale(1.06); }
.hlb-prev { left: 1.25rem; }
.hlb-next { right: 1.25rem; }
.hlb-strip {
  display: flex; gap: 0.5rem; overflow-x: auto;
  padding: 1rem 1.5rem 1.25rem;
  scrollbar-width: thin;
}
.hlb-thumb {
  flex: 0 0 auto; width: 72px; height: 52px;
  border-radius: 8px; overflow: hidden; padding: 0;
  border: 2px solid transparent; background: rgba(255,255,255,0.1);
  opacity: 0.5; cursor: pointer;
  transition: opacity var(--t-fast), border-color var(--t-fast);
}
.hlb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hlb-thumb span { color: #fff; font-size: 1.1rem; }
.hlb-thumb:hover { opacity: 0.85; }
.hlb-thumb.active { opacity: 1; border-color: #fff; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .huellas-story { grid-template-columns: 1fr; gap: 2.5rem; }
  .huellas-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 170px; }
}
@media (max-width: 768px) {
  .huellas-nav { top: calc(var(--nav-h) + 0.5rem); }
  .huellas-chip { font-size: 0.74rem; padding: 0.4rem 0.75rem; }
  .huellas-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; gap: 0.6rem; }
  .huellas-tile:nth-child(8n+7) { grid-column: span 1; }
  .huellas-gallery-head { gap: 0.75rem; padding: 0.9rem 1rem; }
  .huellas-gallery-num { font-size: 1.9rem; min-width: 2.4rem; }
  .huellas-gallery-peek { display: none; }
  .huellas-gallery-body > div { padding: 0 0.75rem; }
  .hlb-stage { padding: 0 0.75rem; }
  .hlb-prev, .hlb-next { width: 40px; height: 40px; font-size: 1.1rem; background: rgba(0,0,0,0.45); }
  .hlb-prev { left: 0.5rem; }
  .hlb-next { right: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .huellas-tile { opacity: 1; transform: none; transition: none; }
  .huellas-evo-arrow { animation: none; }
}
