/* =========================================================
   RENTA DE FOOD TRUCK — Galería por servicios (shortcode [rft_galeria])
   v3.1: formato CARRUSEL — las fotos van pasando solas, con flechas
   circulares a los lados y puntos abajo (el activo es una pastilla
   del color principal). Conserva el selector de servicios y el lightbox.
   Todos los colores traen fallback; si el diseño está activo, hereda
   la paleta elegida en Ajustes.
   ========================================================= */

.rft-galeria {
  max-width: 1180px;
  margin-inline: auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Filtros (selector de servicios) ---------- */
.rft-galeria-filtros {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin: 0 0 26px;
  padding: 0;
}
.rft-filtro {
  appearance: none;
  border: 1.5px solid var(--rft-border, #e7ebf4);
  background: #fff;
  color: var(--rft-navy, #1d2954);
  font: 600 14px/1 'Inter', sans-serif;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  width: auto;
  transition: background .25s ease, color .25s ease,
              border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.rft-filtro:hover {
  border-color: var(--rft-blue, #1f4cff);
  color: var(--rft-blue, #1f4cff);
  transform: translateY(-1px);
}
.rft-filtro.is-active {
  background: var(--rft-grad-primary, linear-gradient(90deg, #ff4f87, #ff6b5a));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(255,79,135,.26);
}
.rft-filtro:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--rft-focus-ring, rgba(31,76,255,.16));
}

/* ---------- Carrusel ---------- */
.rft-carrusel-wrap { position: relative; }

.rft-carrusel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 2px 14px;           /* aire para la sombra de las tarjetas */
  scrollbar-width: none;            /* Firefox */
  -webkit-overflow-scrolling: touch;
}
.rft-carrusel::-webkit-scrollbar { display: none; }
.rft-carrusel:focus-visible {
  outline: none;
  border-radius: 16px;
  box-shadow: 0 0 0 3px var(--rft-focus-ring, rgba(31,76,255,.16));
}

.rft-galeria-item {
  margin: 0;
  position: relative;
  flex: 0 0 calc((100% - 32px) / 3);   /* 3 tarjetas a la vista */
  scroll-snap-align: start;
  border-radius: 18px;
  overflow: hidden;
  background: var(--rft-bg-soft, #f6f8fc);
  height: 250px;                       /* tarjeta apaisada, sin deformar la foto */
  cursor: zoom-in;
  box-shadow: 0 10px 26px rgba(16,26,51,.10), 0 2px 6px rgba(16,26,51,.05);
}
.rft-galeria-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .55s cubic-bezier(.16,1,.3,1);
}
.rft-galeria-item:hover img { transform: scale(1.05); }
.rft-galeria-item::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(16,26,51,.38), transparent 45%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.rft-galeria-item:hover::after { opacity: 1; }
.rft-galeria-item .rft-galeria-tag {
  position: absolute; left: 12px; bottom: 12px;
  z-index: 1;
  width: auto;
  background: rgba(255,255,255,.92);
  color: var(--rft-navy, #1d2954);
  font: 600 12px/1 'Inter', sans-serif;
  padding: 7px 12px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
.rft-galeria-item:hover .rft-galeria-tag { opacity: 1; transform: translateY(0); }
.rft-galeria-item.rft-oculto { display: none; }

/* ---------- Flechas ---------- */
.rft-carrusel-btn {
  appearance: none; border: none; cursor: pointer;
  position: absolute; top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  padding: 0;
  width: 48px; height: 48px;
  border-radius: 999px;
  background: #fff;
  color: var(--rft-navy, #1d2954);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(16,26,51,.16), 0 2px 6px rgba(16,26,51,.08);
  transition: background .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.rft-carrusel-prev { left: 6px; }
.rft-carrusel-next { right: 6px; }
.rft-carrusel-btn:hover {
  background: var(--rft-grad-primary, linear-gradient(90deg, #ff4f87, #ff6b5a));
  color: #fff;
  transform: translateY(-50%) scale(1.07);
  box-shadow: 0 12px 26px rgba(255,79,135,.26);
}
.rft-carrusel-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--rft-focus-ring, rgba(31,76,255,.16));
}
.rft-carrusel-btn[disabled] { opacity: .35; cursor: default; }
.rft-carrusel-btn[disabled]:hover {
  background: #fff; color: var(--rft-navy, #1d2954);
  transform: translateY(-50%);
  box-shadow: 0 10px 24px rgba(16,26,51,.16), 0 2px 6px rgba(16,26,51,.08);
}

/* ---------- Puntos ---------- */
.rft-carrusel-dots {
  display: flex; flex-wrap: wrap; gap: 9px;
  justify-content: center;
  margin-top: 16px;
  min-height: 8px;
}
.rft-dot {
  appearance: none; border: none; cursor: pointer; padding: 0;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--rft-border, #e7ebf4);
  transition: background .3s ease, width .3s ease;
}
.rft-dot:hover { background: var(--rft-blue-light, #b9c8ff); }
.rft-dot.is-active {
  width: 26px;
  background: var(--rft-pink, #ff4f87);
}
.rft-dot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--rft-focus-ring, rgba(31,76,255,.16));
}

/* Con pocas fotos no hacen falta controles */
.rft-galeria.rft-sin-controles .rft-carrusel-btn,
.rft-galeria.rft-sin-controles .rft-carrusel-dots { display: none; }

.rft-galeria-vacia {
  text-align: center;
  color: var(--rft-muted, #6c7285);
  padding: 30px 0;
}

/* ---------- Lightbox ---------- */
.rft-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(8,12,24,.92);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .25s ease;
}
.rft-lightbox.is-open { opacity: 1; }
.rft-lightbox img {
  max-width: min(92vw, 1200px);
  max-height: 84vh;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  user-select: none;
}
.rft-lightbox-caption {
  position: absolute; left: 50%; bottom: 26px;
  transform: translateX(-50%);
  color: #fff; font: 500 14px/1.4 'Inter', sans-serif;
  background: rgba(255,255,255,.1);
  padding: 8px 16px; border-radius: 999px;
  max-width: 90vw; text-align: center;
}
.rft-lightbox-btn {
  appearance: none; border: none; cursor: pointer; padding: 0;
  position: absolute;
  width: 46px; height: 46px; border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s ease, transform .25s ease;
}
.rft-lightbox-btn:hover {
  background: var(--rft-pink, #ff4f87);
  transform: scale(1.06);
}
.rft-lightbox-btn:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px;
}
.rft-lightbox-close { top: 20px; right: 20px; }
.rft-lightbox-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.rft-lightbox-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.rft-lightbox-prev:hover { transform: translateY(-50%) scale(1.06); }
.rft-lightbox-next:hover { transform: translateY(-50%) scale(1.06); }

body.rft-lightbox-abierto { overflow: hidden; }

/* ---------- Responsive / accesibilidad ---------- */
@media (max-width: 900px) {
  .rft-galeria-item { flex-basis: calc((100% - 16px) / 2); height: 230px; }  /* 2 a la vista */
}
@media (max-width: 720px) {
  .rft-filtro { padding: 10px 16px; font-size: 13px; }
  .rft-carrusel-btn { width: 42px; height: 42px; }
  .rft-carrusel-prev { left: 2px; }
  .rft-carrusel-next { right: 2px; }
  .rft-lightbox-prev { left: 8px; }
  .rft-lightbox-next { right: 8px; }
}
@media (max-width: 560px) {
  .rft-galeria-item { flex-basis: 86%; height: 220px; }  /* 1 a la vista con asomo de la siguiente */
}
@media (prefers-reduced-motion: reduce) {
  .rft-carrusel { scroll-behavior: auto; }
  .rft-galeria-item img,
  .rft-filtro, .rft-dot,
  .rft-carrusel-btn,
  .rft-lightbox { transition: none !important; }
}
