/* ═══════════════════════════════════════════════════
   f-gallery.css — Galería premium macOS / liquid glass
═══════════════════════════════════════════════════ */

body.fg-lock { overflow: hidden; }

#f-gallery {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
#f-gallery.fg-open {
  opacity: 1;
  pointer-events: auto;
}

.fg-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(255,255,255,0.08), transparent 60%),
    rgba(10, 10, 14, 0.55);
  backdrop-filter: blur(36px) saturate(160%);
  -webkit-backdrop-filter: blur(36px) saturate(160%);
}

.fg-window {
  position: relative;
  width: min(1080px, 96vw);
  height: min(780px, 92vh);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(246, 246, 248, 0.82);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow:
    0 40px 100px rgba(0,0,0,0.45),
    0 0 0 1px rgba(0,0,0,0.06),
    inset 0 1px 0 rgba(255,255,255,0.7);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
#f-gallery.fg-open .fg-window {
  transform: translateY(0) scale(1);
}

.fg-chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.18));
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.fg-traffic {
  display: flex;
  gap: 8px;
  padding-left: 4px;
}
.fg-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.12);
}
.fg-dot--close { background: #FF5F57; cursor: pointer; }
.fg-dot--min { background: #FEBC2E; }
.fg-dot--max { background: #28C840; }
.fg-dot--close:hover { filter: brightness(0.92); }

.fg-chrome-title {
  flex: 1;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: rgba(0,0,0,0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fg-chrome-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 110px;
  justify-content: flex-end;
}
.fg-counter {
  font-size: 12px;
  font-weight: 600;
  color: rgba(0,0,0,0.45);
  font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,0.05);
  padding: 4px 9px;
  border-radius: 999px;
}
.fg-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.55);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}
.fg-icon-btn:hover {
  background: rgba(0,0,0,0.1);
  color: rgba(0,0,0,0.85);
}

.fg-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 0;
}

.fg-frame {
  position: relative;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.55), transparent 45%),
    linear-gradient(160deg, #e8e8ed 0%, #d1d1d6 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fg-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,0.18));
}
.fg-img.is-in {
  opacity: 1;
  transform: scale(1);
}

.fg-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(0,0,0,0.4);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
}
.fg-empty-ico { font-size: 42px; opacity: 0.7; }

.fg-loader {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(0,0,0,0.1);
  border-top-color: #007AFF;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.fg-loader.is-on {
  opacity: 1;
  animation: fg-spin 0.7s linear infinite;
}
@keyframes fg-spin { to { transform: rotate(360deg); } }

.fg-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.72);
  color: rgba(0,0,0,0.7);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(255,255,255,0.8);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.18s, background 0.18s, opacity 0.18s;
  justify-self: center;
}
.fg-nav:hover:not(:disabled) {
  background: #fff;
  transform: scale(1.06);
}
.fg-nav:active:not(:disabled) { transform: scale(0.96); }
.fg-nav:disabled { opacity: 0.28; cursor: default; }

.fg-caption {
  text-align: center;
  min-height: 22px;
  padding: 8px 20px 2px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(0,0,0,0.45);
  flex-shrink: 0;
}

.fg-strip-wrap {
  flex-shrink: 0;
  padding: 10px 18px 16px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.03));
}
.fg-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scroll-snap-type: x mandatory;
  justify-content: safe center;
}
.fg-strip::-webkit-scrollbar { height: 0; }

.fg-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: rgba(0,0,0,0.06);
  scroll-snap-align: center;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.fg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fg-thumb:hover { transform: translateY(-2px); }
.fg-thumb.is-active {
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0,122,255,0.22), 0 8px 18px rgba(0,122,255,0.2);
  transform: translateY(-2px) scale(1.04);
}

@media (max-width: 720px) {
  #f-gallery { padding: 10px; }
  .fg-window {
    width: 100%;
    height: 94vh;
    border-radius: 16px;
  }
  .fg-stage { grid-template-columns: 40px 1fr 40px; }
  .fg-nav { width: 36px; height: 36px; }
  .fg-thumb { width: 60px; height: 46px; }
  .fg-traffic { display: none; }
}
