/* ============================================================
   fc-lightbox — visione a piena risoluzione della galleria PDP
   Caricato da templates/catalog/product.tpl (non fa parte del
   bundle theme.min.css: resta isolato e sopravvive al rebuild).
   Usa i token --fc-* già definiti nel :root del tema.
   ============================================================ */

/* --- immagine principale cliccabile (era un div, ora è un button) --- */
.fc-gallery-main.is-zoomable {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  width: 100%;
  cursor: zoom-in;
  position: relative;
  display: block;
}
.fc-gallery-main.is-zoomable:focus-visible {
  outline: 2px solid var(--fc-blue, #1456f0);
  outline-offset: 4px;
  border-radius: 8px;
}

.fc-gallery-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--fc-border, #e5e7eb);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
  display: grid;
  place-items: center;
  color: var(--fc-ink-700, #2b3340);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms, transform 160ms, color 160ms;
  pointer-events: none;
  z-index: 3;
}
.fc-gallery-main.is-zoomable:hover .fc-gallery-zoom-hint,
.fc-gallery-main.is-zoomable:focus-visible .fc-gallery-zoom-hint {
  opacity: 1;
  transform: translateY(0);
  color: var(--fc-blue, #1456f0);
}
/* su touch non esiste hover: l'hint resta sempre visibile */
@media (hover: none) {
  .fc-gallery-zoom-hint { opacity: 1; transform: none; }
}

/* --- overlay --- */
.fc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fc-lightbox[hidden] { display: none; }

.fc-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 24, .88);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fcLbFade 180ms ease-out;
}

.fc-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(1180px, 100%);
  max-height: 100%;
  animation: fcLbIn 200ms cubic-bezier(.2, .7, .3, 1);
}

@keyframes fcLbFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes fcLbIn {
  from { opacity: 0; transform: scale(.97) }
  to   { opacity: 1; transform: none }
}
@media (prefers-reduced-motion: reduce) {
  .fc-lightbox__backdrop, .fc-lightbox__dialog { animation: none; }
  .fc-lightbox__img { transition: none !important; }
}

/* --- barra superiore --- */
.fc-lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}
.fc-lightbox__counter {
  color: rgba(255, 255, 255, .72);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.fc-lightbox__counter b { color: #fff; font-weight: 700; }

.fc-lightbox__close {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .10);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 160ms;
}
.fc-lightbox__close:hover {
  background: #fff;
  color: var(--fc-ink-800, #181e25);
  transform: rotate(90deg);
}

/* --- palcoscenico immagine --- */
.fc-lightbox__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  touch-action: pan-y;
}

.fc-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  opacity: 1;
  transition: opacity 160ms;
}
.fc-lightbox.is-loading .fc-lightbox__img { opacity: .25; }

.fc-lightbox__spinner {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  animation: fcLbSpin 700ms linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms;
}
.fc-lightbox.is-loading .fc-lightbox__spinner { opacity: 1; }
@keyframes fcLbSpin { to { transform: rotate(360deg) } }

/* --- frecce --- */
.fc-lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 160ms;
  z-index: 2;
}
.fc-lightbox__arrow:hover {
  background: #fff;
  color: var(--fc-blue, #1456f0);
  transform: translateY(-50%) scale(1.06);
}
.fc-lightbox__arrow.prev { left: 0; }
.fc-lightbox__arrow.next { right: 0; }

/* --- miniature --- */
.fc-lightbox__thumbs {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 2px;
}
.fc-lightbox__thumbs.is-single { display: none; }

.fc-lightbox__thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .25);
  background: #fff;
  cursor: pointer;
  opacity: .55;
  transition: 160ms;
}
.fc-lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-lightbox__thumb:hover { opacity: .85; }
.fc-lightbox__thumb.active {
  opacity: 1;
  border-color: var(--fc-blue, #1456f0);
  box-shadow: 0 0 0 2px rgba(20, 86, 240, .35);
}

.fc-lightbox :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* --- mobile --- */
@media (max-width: 640px) {
  .fc-lightbox { padding: 10px; }
  .fc-lightbox__arrow { width: 38px; height: 38px; }
  .fc-lightbox__arrow.prev { left: -2px; }
  .fc-lightbox__arrow.next { right: -2px; }
  .fc-lightbox__thumb { width: 46px; height: 46px; }
}
