/* ══════════════════════════════════════════════════════════════
   FIVETECH — VETRINA 3D (showcase3d)
   Tutti i selettori sono prefissati .ftv3- per non toccare il resto
   Creato con il cuore da Rosario Cinque
══════════════════════════════════════════════════════════════ */

#ftv3 {
  --ftv3-blue: #1a6fd4;
  --ftv3-blue2: #2a85f5;
  --ftv3-blue3: #5ba8ff;
  --ftv3-orange: #f97316;
  --ftv3-orange2: #fb923c;
  --ftv3-ink: #050c1c;
  position: relative;
  overflow: hidden;
  background: linear-gradient(175deg, #050c1c 0%, #0a1733 42%, #061225 100%);
  padding: 62px 0 0;
  isolation: isolate;
  contain: layout paint;
}

/* alone luminoso di fondo */
#ftv3::before {
  content: '';
  position: absolute;
  inset: -10% -20% auto -20%;
  height: 70%;
  background:
    radial-gradient(ellipse 46% 60% at 30% 40%, rgba(26, 111, 212, .22), transparent 68%),
    radial-gradient(ellipse 40% 55% at 74% 56%, rgba(249, 115, 22, .13), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* linea di separazione superiore */
#ftv3::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 168, 255, .45), rgba(251, 146, 60, .3), transparent);
  pointer-events: none;
  z-index: 3;
}

/* ── HUD TESTATA ─────────────────────────────────────────── */
.ftv3-hud {
  position: relative;
  z-index: 4;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5% 26px;
  text-align: center;
}

.ftv3-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(42, 133, 245, .14);
  border: 1px solid rgba(42, 133, 245, .32);
  color: var(--ftv3-blue3);
  padding: 5px 15px;
  border-radius: 50px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.ftv3-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
  font-weight: 800;
  line-height: 1.08;
  color: #fff;
  margin: 0 0 12px;
  letter-spacing: -.02em;
}

.ftv3-title span {
  background: linear-gradient(135deg, var(--ftv3-blue3), var(--ftv3-orange2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ftv3-sub {
  color: rgba(255, 255, 255, .56);
  font-size: clamp(.9rem, 1.6vw, 1rem);
  line-height: 1.7;
  max-width: 640px;
  margin: 0 auto;
}

/* ── FILTRI CATEGORIA ────────────────────────────────────── */
.ftv3-filters {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 5% 8px;
  max-width: 1200px;
  margin: 0 auto;
}

.ftv3-filter {
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 50px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .22s, border-color .22s, color .22s, transform .22s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.ftv3-filter:hover {
  color: #fff;
  background: rgba(42, 133, 245, .2);
  border-color: rgba(91, 168, 255, .45);
}

.ftv3-filter[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--ftv3-blue2), var(--ftv3-blue));
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(42, 133, 245, .38);
}

.ftv3-filter:focus-visible {
  outline: 2px solid var(--ftv3-blue3);
  outline-offset: 3px;
}

/* ── PALCO / CANVAS ──────────────────────────────────────── */
.ftv3-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 85vh;
  min-height: 460px;
  max-height: 820px;
  touch-action: pan-y;
  cursor: grab;
}

.ftv3-stage.is-dragging { cursor: grabbing; }

.ftv3-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.ftv3-stage:focus-visible {
  outline: 2px solid var(--ftv3-blue3);
  outline-offset: -4px;
  border-radius: 12px;
}

/* ── LOADING ─────────────────────────────────────────────── */
.ftv3-loader {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(5, 12, 28, .82);
  backdrop-filter: blur(6px);
  transition: opacity .6s ease, visibility .6s;
}

.ftv3-loader[hidden] {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ftv3-loader-ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(91, 168, 255, .18);
  border-top-color: var(--ftv3-blue3);
  border-right-color: var(--ftv3-orange2);
  animation: ftv3-spin .9s linear infinite;
}

@keyframes ftv3-spin { to { transform: rotate(360deg); } }

.ftv3-loader-bar {
  width: min(210px, 50vw);
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.ftv3-loader-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ftv3-blue3), var(--ftv3-orange2));
  transition: width .3s ease;
}

.ftv3-loader-txt {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
}

/* ── ETICHETTA CARD ATTIVA (overlay HTML) ────────────────── */
.ftv3-label {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(520px, 86vw);
  text-align: center;
  pointer-events: none;
  transition: opacity .32s ease, transform .32s ease;
}

.ftv3-label.is-swapping {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}

.ftv3-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 10px;
  background: var(--ftv3-badge-bg, var(--ftv3-blue));
  box-shadow: 0 5px 18px var(--ftv3-badge-glow, rgba(26, 111, 212, .5));
}

.ftv3-label-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(1.05rem, 2.5vw, 1.55rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.22;
  margin: 0 0 6px;
  text-shadow: 0 2px 22px rgba(0, 0, 0, .6);
}

.ftv3-label-meta {
  font-size: .82rem;
  color: rgba(255, 255, 255, .58);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ftv3-label-meta b {
  color: var(--ftv3-orange2);
  font-weight: 700;
}

.ftv3-label-hint {
  margin-top: 9px;
  font-size: .7rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .3);
}

/* ── CONTROLLI ───────────────────────────────────────────── */
.ftv3-nav {
  position: absolute;
  top: 46%;
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(8, 18, 38, .58);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .22s, transform .22s, border-color .22s;
  -webkit-tap-highlight-color: transparent;
}

.ftv3-nav:hover {
  background: rgba(42, 133, 245, .62);
  border-color: rgba(91, 168, 255, .6);
  transform: scale(1.09);
}

.ftv3-nav:focus-visible {
  outline: 2px solid var(--ftv3-blue3);
  outline-offset: 3px;
}

.ftv3-nav-prev { left: 3%; }
.ftv3-nav-next { right: 3%; }

.ftv3-bar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px 5% 58px;
  max-width: 1200px;
  margin: 0 auto;
}

.ftv3-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 70vw;
}

.ftv3-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  cursor: pointer;
  transition: all .3s cubic-bezier(.22, 1, .36, 1);
  -webkit-tap-highlight-color: transparent;
}

.ftv3-dot:hover { background: rgba(255, 255, 255, .5); }

.ftv3-dot[aria-current="true"] {
  width: 26px;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--ftv3-blue3), var(--ftv3-orange2));
}

.ftv3-dot:focus-visible {
  outline: 2px solid var(--ftv3-blue3);
  outline-offset: 3px;
}

.ftv3-counter {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: .86rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .48);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  min-width: 62px;
  text-align: center;
}

.ftv3-counter b { color: #fff; }

.ftv3-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--ftv3-blue2), var(--ftv3-blue));
  box-shadow: 0 8px 28px rgba(42, 133, 245, .4);
  transition: transform .28s ease, box-shadow .28s ease;
}

.ftv3-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 38px rgba(42, 133, 245, .52);
}

.ftv3-cta:focus-visible {
  outline: 2px solid var(--ftv3-blue3);
  outline-offset: 3px;
}

/* ── MODALE DETTAGLIO ────────────────────────────────────── */
.ftv3-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(3, 8, 20, .78);
  backdrop-filter: blur(9px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}

.ftv3-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.ftv3-modal-box {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(165deg, #0b1932, #071226);
  border: 1px solid rgba(91, 168, 255, .2);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  transform: translateY(22px) scale(.97);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
}

.ftv3-modal.is-open .ftv3-modal-box { transform: none; }

.ftv3-modal-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 22px 22px 0 0;
  display: block;
  background: #0a1733;
}

.ftv3-modal-body { padding: 22px 24px 26px; }

.ftv3-modal-body h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.32rem;
  font-weight: 800;
  color: #fff;
  margin: 12px 0 6px;
  line-height: 1.22;
}

.ftv3-modal-loc {
  font-size: .84rem;
  color: rgba(255, 255, 255, .5);
  margin-bottom: 14px;
}

.ftv3-modal-desc {
  font-size: .92rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, .72);
  margin-bottom: 18px;
}

.ftv3-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.ftv3-modal-tags span {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .7);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .73rem;
  font-weight: 600;
}

.ftv3-modal-acts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ftv3-modal-acts a {
  flex: 1 1 auto;
  text-align: center;
  padding: 12px 18px;
  border-radius: 11px;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .25s ease;
}

.ftv3-modal-acts a:hover { transform: translateY(-2px); }

.ftv3-modal-acts .ftv3-m-primary {
  background: linear-gradient(135deg, var(--ftv3-blue2, #2a85f5), var(--ftv3-blue, #1a6fd4));
  color: #fff;
  box-shadow: 0 8px 24px rgba(42, 133, 245, .38);
}

.ftv3-modal-acts .ftv3-m-ghost {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .15);
  color: rgba(255, 255, 255, .84);
}

.ftv3-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(5, 12, 28, .7);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background .22s, transform .22s;
}

.ftv3-modal-close:hover {
  background: rgba(249, 115, 22, .8);
  transform: rotate(90deg);
}

/* ── FALLBACK CSS 3D (niente WebGL / reduced motion) ─────── */
.ftv3-fallback {
  position: relative;
  z-index: 2;
  padding: 10px 5% 0;
  max-width: 1200px;
  margin: 0 auto;
}

.ftv3-fb-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(300px, 76vw);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 26px 4px 34px;
  perspective: 1400px;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 168, 255, .4) transparent;
  -webkit-overflow-scrolling: touch;
}

.ftv3-fb-track::-webkit-scrollbar { height: 6px; }
.ftv3-fb-track::-webkit-scrollbar-track { background: rgba(255, 255, 255, .05); border-radius: 6px; }
.ftv3-fb-track::-webkit-scrollbar-thumb { background: rgba(91, 168, 255, .4); border-radius: 6px; }

.ftv3-fb-card {
  scroll-snap-align: center;
  background: linear-gradient(165deg, #0c1c38, #081428);
  border: 1px solid rgba(91, 168, 255, .16);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transform: rotateY(-7deg);
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), box-shadow .5s, border-color .5s;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .4);
}

.ftv3-fb-card:nth-child(even) { transform: rotateY(7deg); }

.ftv3-fb-card:hover,
.ftv3-fb-card:focus-visible {
  transform: rotateY(0) translateY(-8px) scale(1.03);
  border-color: rgba(91, 168, 255, .55);
  box-shadow: 0 26px 64px rgba(26, 111, 212, .38);
  outline: none;
}

.ftv3-fb-card img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  display: block;
  background: #0a1733;
}

.ftv3-fb-body { padding: 15px 16px 18px; }

.ftv3-fb-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 9px;
}

.ftv3-fb-body h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: .98rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 5px;
  line-height: 1.28;
}

.ftv3-fb-body p {
  font-size: .8rem;
  color: rgba(255, 255, 255, .5);
  line-height: 1.6;
  margin: 0;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  #ftv3 { padding-top: 48px; }
  .ftv3-stage { height: 70vh; min-height: 420px; }
  .ftv3-label { bottom: 10%; }
  .ftv3-nav { display: none; }              /* su mobile comanda lo swipe */
  .ftv3-bar { gap: 14px; padding-bottom: 46px; }
  .ftv3-dots { max-width: 100%; }
}

@media (max-width: 560px) {
  .ftv3-stage { height: 64vh; min-height: 380px; }
  .ftv3-label { width: 92vw; bottom: 8%; }
  .ftv3-label-hint { display: none; }
  .ftv3-filters { gap: 6px; }
  .ftv3-filter { font-size: .72rem; padding: 6px 13px; }
  .ftv3-modal-img { height: 168px; }
}

/* ── MOTION RIDOTTO ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ftv3-loader-ring { animation: none; }
  .ftv3-fb-card,
  .ftv3-cta,
  .ftv3-nav,
  .ftv3-dot,
  .ftv3-modal-box,
  .ftv3-label { transition: none !important; }
  .ftv3-fb-card,
  .ftv3-fb-card:nth-child(even) { transform: none; }
  .ftv3-fb-track { scroll-behavior: auto; }
}

/* ── MODALITÀ VIDEO (?videomode=1) ───────────────────────── */
#ftv3.ftv3-videomode {
  padding: 0;
  background: #050c1c;
}

#ftv3.ftv3-videomode .ftv3-hud,
#ftv3.ftv3-videomode .ftv3-filters,
#ftv3.ftv3-videomode .ftv3-bar,
#ftv3.ftv3-videomode .ftv3-nav,
#ftv3.ftv3-videomode .ftv3-loader { display: none !important; }

#ftv3.ftv3-videomode .ftv3-stage {
  height: 100vh;
  max-height: none;
  min-height: 0;
}
