.floating-gallery {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  font-family: var(--font-sans);
}

.floating-gallery.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  touch-action: none;
}

.floating-gallery__hint {
  position: absolute;
  top: 24px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-cream);
  box-shadow: var(--shadow-soft);
  pointer-events: none;
}

.floating-gallery__hint i {
  font-size: 16px;
  color: var(--color-sage-300);
}

.floating-gallery__close {
  position: absolute;
  top: 20px;
  right: 80px;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--color-cream);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: background 0.22s, transform 0.15s, border-color 0.22s;
}

.floating-gallery__close:hover {
  background: rgba(61, 90, 62, 0.72);
  border-color: var(--glass-border-hover);
}

.floating-gallery__close:active {
  transform: scale(0.94);
}

.floating-gallery__track {
  display: flex;
  align-items: flex-start;
  gap: clamp(2.5rem, 6vw, 5rem);
  width: 100%;
  height: 100%;
  padding: 14vh max(12vw, 50%) 10vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  touch-action: pan-x;
}

.floating-gallery__track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
  user-select: none;
}

.floating-gallery__track::-webkit-scrollbar {
  display: none;
}

.floating-gallery__card {
  flex: 0 0 auto;
  position: relative;
  width: clamp(220px, 28vw, 340px);
  margin-top: var(--offset-y, 0);
  transform: rotate(var(--rotate, 0deg));
  transition: transform 0.32s var(--ease-out);
  scroll-snap-align: center;
}

.floating-gallery__card:hover {
  transform: rotate(var(--rotate, 0deg)) translateY(-8px) scale(1.02);
}

.floating-gallery__photo {
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  background: var(--color-forest-900);
  cursor: pointer;
  touch-action: manipulation;
}

.floating-gallery__photo img {
  display: block;
  width: 100%;
  height: clamp(200px, 32vh, 360px);
  object-fit: cover;
  user-select: none;
  transition: transform 0.4s var(--ease-out);
}

.floating-gallery__card:hover .floating-gallery__photo img {
  transform: scale(1.04);
}

.floating-gallery__label {
  position: absolute;
  left: 16px;
  bottom: 54px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-cream);
}

.floating-gallery__expand {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  color: var(--color-cream);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: background 0.22s, transform 0.15s, border-color 0.22s, color 0.22s;
}

.floating-gallery__expand:hover {
  background: rgba(61, 90, 62, 0.75);
  border-color: var(--glass-border-hover);
  color: var(--color-gold-400);
}

.floating-gallery__expand:active {
  transform: scale(0.92);
}

@media (max-width: 640px) {
  .floating-gallery__hint {
    top: 72px;
    left: 16px;
    font-size: 10px;
  }

  .floating-gallery__close {
    top: 20px;
    left: 20px;
    right: auto;
  }

  .floating-gallery__track {
    padding: 18vh max(10vw, 42%) 8vh;
    gap: 2rem;
  }

  .floating-gallery__card {
    width: min(72vw, 280px);
  }
}
