/*pubDark.css*/

:root {
    /*
     ⚠ Layout controlled by JS runtime.

     Il layout effettivo dei ProductBox è calcolato dinamicamente
     dal runtime JavaScript.

     NON modificare min-width, padding, margin o box-sizing
     senza verificare l'impatto sul calcolo layout.

     Questo valore NON controlla il layout runtime.
     È un fallback di sicurezza (dummy) per prevenire
     collassi visivi se il JS non viene eseguito.
    */
    /*--box-min-width: 250px;*/
	/*imposto altezza di partenza del row-container*/
	/*--row-container-height: 680px;*/
}

html, body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;      /* ✅ presente anche internamente in magicbox: scroll in scroll, permette di scrollare sia il magicbox che il body/reload*/
  overscroll-behavior-y: auto;  /* ✅ abilita pull-to-refresh */
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: #222;
	padding-top: calc(env(safe-area-inset-top) + 42px);
}

.top-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  z-index: 1000;
  align-items: center;
  justify-content: center;   /* centra orizzontalmente */
}
.debug-layout * {
   outline: 1px solid red;
}
/* Contenitore rosso principale full-width */
#product-row-container {
    position: relative; /* necessario per overlay pulsanti */
    width: 100%;       /* combacia con il browser */
    max-width: 100%;
    /*height: var(--row-container-height);*/
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid red; /* bordo rosso sottile */
    box-sizing: border-box;
    overflow: hidden;
	margin-top: 0;
}

/* Wrapper grigio chiaro full-width */
#products-row-wrapper {
    flex: 1;
    height: 100%; /*garantisce l’allineamento perfetto*/
    display: flex;
    justify-content: flex-start; /* productBox parte dal bordo sinistro */
    align-items: center;
    overflow: hidden;
    border: 1px solid yellow; /* bordo bianco sottile */
    border-radius: 0; /* rimuovo arrotondamento */
	/*background: rgba(0,0,0,0.0);*/
    /*background-color: slategray;*/
    box-sizing: border-box;
    position: relative;
    padding: 0; /* nessun padding */
    margin: 0;  /* nessun margine */
	touch-action: pan-y;
}

/* Riga interna dei ProductBox */
#products-row {
    display: flex;
    flex-direction: row;
    height: 100%;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* ProductBox */
.product-box {
    border: 2px solid purple;
    /*background-color: #333;*/
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 100%;
    font-size: 18px;
    font-weight: bold;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
	position: relative;
    /*overflow-y: auto;   *//*scroll verticale: disabilitato scroll dentro scroll */
    overflow-x: hidden; /* blocca scroll orizzontale */
    border: 0px; /* 1️⃣ ProductBox (bordo più interno) */
    flex-shrink: 0; /*SHOWALL: modalitá tutti i prodotti visibili*/
	transition: height .18s ease;
	contain: layout paint size;
}

/*se in futuro aggiungerai effetti hover/animazioni, il 0px potrebbe influenzare il “padding visivo”, quindi tienilo sotto controllo.*/
/* Sovrappongo il primo e ultimo box al bordo del wrapper */
#products-row .product-box:first-child {
    margin-left: 0px;  /* sovrappone il bordo sinistro del wrapper */
}

#products-row .product-box:last-child {
    margin-right: -2px; /* sovrappone il bordo destro del wrapper */
}

/* Pulsanti overlay senza bordo e sfondo */
#nav-left,
#nav-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 26px;
    color: white;
    border: none;
    cursor: pointer;

    /* sfondo visibile */
    background: rgba(0,0,0,0.35);

    z-index: 20;
	pointer-events:auto;
}
#nav-left {
    border-radius: 0 50px 50px 0;   /* arrotondato lato destro */
}

#nav-right {
    border-radius: 50px 0 0 50px;   /* arrotondato lato sinistro */
}
/* posizionamento pulsanti singoli (centrati verticalmente) */
#nav-left,
#nav-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

/* posizionamento pulsanti avanzati (sotto la riga) */
#nav-left-adv,
#nav-right-adv {
    position: absolute;
    bottom: 60px;   /* sposta sotto il wrapper */
}

/* allineamenti orizzontali */
#nav-left,
#nav-left-adv {
    left: 0;
}

#nav-right,
#nav-right-adv {
    right: 0;
}

/* effetti hover */
#nav-left:hover,
#nav-right:hover,
#nav-left-adv:hover,
#nav-right-adv:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* effetti active */
#nav-left:active,
#nav-right:active,
#nav-left-adv:active,
#nav-right-adv:active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* stato disabled */
#nav-left:disabled,
#nav-right:disabled,
#nav-left-adv:disabled,
#nav-right-adv:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/*** MAGIC BOX ***/

.magic-box {
    width: 100%;
    min-height: 100%;
    position: relative;
    z-index: 20;
    overflow-x: hidden;
    overflow-y: visible;
}

.magic-box-root {
	width: 100%;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	position: relative;
	overflow: visible;
	align-self: stretch;
	height: 100%;
	overflow-y: auto; /*scroll in scroll: permette di scrollare sia il magicbox che il body/reload*/
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/* media container */

.media-container {
    width: 100%;
    padding-top: 5px;
	min-height: 0;
	/*indica freccia giu, significa: usa lo scroller*/
	/* il contenitore media diventa riferimento */
    position: relative;
}

/* blocco media */

.media-block {
    width: 100%;
}

.media-block:not(.image) + .media-block:not(.image) {
    margin-top: 6px;
}

/* =========================
   IMMAGINI (layout naturale)
   ========================= */

/* lo stage per immagini NON forza ratio */
.media-block.image .media-stage {
    aspect-ratio: auto;
    position: static;
}

/* immagine sempre larga quanto il container */
.media-block.image .media-main {
    display: block;
    width: 100%;
    height: auto;      /* altezza naturale */
    object-fit: contain;
}

.media-block.image + .media-block.image {
    margin-top: 4px;
}
/* =========================
   IMAGE GALLERY VISIBILITY
   ========================= */

.image-gallery,
.media-gallery {
    display: none;
}

.image-gallery.open,
.media-gallery.open {
    display: block;
}

/* =========================
   VIDEO GALLERY VISIBILITY
   ========================= */
.video-gallery {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.video-gallery.open {
    visibility: visible;
    height: auto;
    pointer-events: auto;
}
/*evitare frame bianco durante cambio src video*/
.media-stage video {
    background: #000;
}

/* =========================
   VIDEO & STL (layout uniforme)
   ========================= */

.media-wrapper.uniform {
    width: 100%;
}

/* stage stabile e indipendente dal contenuto */
.media-wrapper.uniform .media-stage {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* dimensione stabile prima del load ed estetica colori bordi*/
.media-stage {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(70,170,255,0.40);
    border-radius: 10px;
    box-sizing: border-box;
    contain: layout paint;
}

/* video e STL non influenzano layout */
.media-stage video,
.media-stage .stl-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* menu */

.media-menu button {
    margin-right: 4px;
    font-size: 0.75em;
    cursor: pointer;
}

/* solo uniform media devono clip */
.media-wrapper.uniform .media-stage {
    overflow: hidden;
}

/* indicatore scroll */
.media-container::after {
    content: "▼";
    position: absolute;
    top: 6px;
    left: 6px;

    font-size: 22px;
    line-height: 1;

    color: white;
    background: rgba(0,0,0,0.25);

    padding: 2px 6px;
    border-radius: 6px;

    z-index: 50;
    pointer-events: none;

    opacity: 0;
    transition: opacity .18s ease;
}

/* appare al passaggio mouse */
.product-box:hover .media-container::after {
    opacity: 1;
}

/* su mobile sempre visibile */
@media (hover: none) {
  .media-container::after {
      opacity: 1;
  }
}

/* base contenuto */
#products-row {
    position: relative;
    z-index: 1;
}

/* MagicBox layers */
.magic-box-root {
    position: relative;
    z-index: 2;
}

/* overlay navigazione interna */
#nav-left-adv,
#nav-right-adv {
    position: absolute;
    z-index: 30;
}

/* overlay navigazione esterna */
#nav-left,
#nav-right {
    position: absolute;
    z-index: 40;
	pointer-events: auto;
}

/* =========================
   PRODUCT HEADER
   ========================= */

.product-header {
    width: 100%;
    padding: 6px 8px 4px;
    box-sizing: border-box;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2px;
    color: #fff;
}

.product-descr {
    font-size: 0.8rem;
    line-height: 1.25;
    color: #ccc;
}

/* link [more] */
.show-more {
    color: #aaa;
    cursor: pointer;
    user-select: none;
}

.show-more:hover {
    color: #fff;
}

/* link contact */
.contact-link {
    color: #9ad;
    text-decoration: none;
    margin-left: 4px;
    white-space: nowrap;
}

.contact-link:hover {
    text-decoration: underline;
}
/* descrizione troncata a righe */
.product-descr.trunk {
  display: -webkit-box;
  -webkit-line-clamp: 3;   /* numero righe visibili */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* link more */
.show-more {
  color: #6fdc6f;          /* verde moderno leggibile su dark */
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  margin-left: 4px;
  white-space: nowrap;
}

.show-more:hover {
  text-decoration: underline;
}

.media-footer {
    font-size: 0.72rem;
    line-height: 1.2;

    color: #aaa;

    display: flex;
    align-items: center;
    justify-content: flex-start;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    margin-top: 6px;
    padding-bottom: 6px;
}

.media-block + .media-block {
    margin-top: 4px;
	margin-bottom: 2px;
}

/*distaccato ombreggiato: non buttare
.media-stage {
    border-radius: 8px;
    overflow: hidden;

    border: 1px solid rgba(255,255,255,0.08);
	border-color: white;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.05),
        0 4px 12px rgba(0,0,0,0.45);
}

*/
/* ===============================
   FAKE GRADIENT BORDERS (TEST)
   =============================== */

/* 2️⃣ Wrapper (viewport della riga) */
#products-row-wrapper {
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow:
        0 0 0 1px rgba(210,180,140,0.25),
        0 0 0 2px rgba(120,120,120,0.25);
	border-radius: 8px;
}

/* 3️⃣ Container esterno */
#product-row-container {
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow:
        0 0 0 1px rgba(210,180,140,0.10),
        0 0 0 3px rgba(120,120,120,0.15);
	border-radius: 8px;
}

/*SHOWALL: modalitá tutti i prodotti visibili*/
/* ===== FLEX BEHAVIOR ===== */

.product-box.shrinkable {
    flex-shrink: 1;
}

.product-title-row {
    display: flex;
    align-items: center;
    gap: 8px;          /* spazio tra indice e nome */
}

.product-index {
    font-weight: 600;
    opacity: 0.6;
}

.product-name {
    font-weight: 600;
}

/*progress bar per fullscreen*/
.media-progress {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.15);
    margin-top: 4px;
    overflow: hidden;
}

.media-progress-bar {
    height: 100%;
    width: 0%;
    background: white;
    transition: width 0.2s ease;
}

.media-overlay-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
}

.media-full-btn {
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
}

.media-full-btn:hover {
    background: rgba(0,0,0,0.85);
}

/********************/
/* LIST MODE LAYOUT */
/********************/

/* la riga smette di essere flex */
#products-row.list-mode {
	display: block;
	width: 480px;
    max-width: 480px;
}

/* ogni product-box diventa una riga */
#products-row.list-mode .product-box {
	display: block;
	width: 100%;
}

/* rimuove altezze forzate interne */
#products-row.list-mode .magic-box,
#products-row.list-mode .magic-box-root {
	min-height: unset;
}

/* il container deve poter crescere */
#product-row-container.list-mode {
	overflow: visible;
}

/* il body non deve centrare verticalmente */
body.list-mode-active {
	align-items: flex-start;
}

/* overlay titolo */
.product-list-overlay {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: flex-start;
	padding-left: 14px;
	background: #222;
	cursor: pointer;
	z-index: 60;
}

.product-list-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: #fff;
}

#products-row.list-mode .media-container {
	display: none;
}

#products-row.list-mode .product-descr,
#products-row.list-mode .media-menu {
	display: none;
}

#products-row.list-mode .product-box {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.product-list-overlay:active {
    background: #444;
}
.product-list-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-index {
    font-weight: 600;
    opacity: 0.55;
}
.product-thumb {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}
.product-list-overlay.visited {
    background: #2a2a40;
    border-left: 3px solid #5aa2ff;
}
/********************/

/* =========================
   HIDE NAV BUTTONS ON TOUCH DEVICES
   ========================= */

/* dispositivi touch primari */
@media (pointer: coarse) {
    #nav-left,
    #nav-right,
    #nav-left-adv,
    #nav-right-adv {
        display: none !important;
    }
}
/*
@media (hover:none){
  #nav-left, #nav-right {
     width: 36px;
     opacity: .6;
  }
}*/
.touch-device #nav-left,
.touch-device #nav-right,
.touch-device #nav-left-adv,
.touch-device #nav-right-adv {
    display: none;
}
/* =========================================================
model_stl.css
   STL VIEWER COMPONENT
========================================================= */

.stl-viewer {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Canvas */
.stl-viewer__canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  touch-action:none;
}

/* Gradient background */
.media-stage.stl-stage-bg {
  background: linear-gradient(
    180deg,
    #000033 0%,
    #ffffff 48%,
    #2b1a1a 49%,
    #5a5add 51%,
    #1a1a2a 52%,
    #111155 97%,
    #3a2a00 100%
  );
}

/* Swipe hint */
.stl-viewer__hint {
  position: absolute;
  top: 10px;
  right: 60px;
  width: 40px;
  height: 40px;
  opacity: 0.5;
  z-index: 3;
}

/* High / Full button */
.stl-viewer__btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 14px;
  cursor: pointer;
  background-color: #208637;
  opacity: 0.8;
}

.stl-viewer--fullscreen .stl-viewer__btn {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: green;
}

/* STL label */
.stl-viewer__label {
  position: absolute;
  bottom: 4px;
  left: 8px;
  color: #fff;
  font-size: 13px;
  z-index: 4;
  text-decoration: underline;
  cursor: pointer;
}

.stl-viewer__label:hover {
  color: #0078d4;
}

/* Footer */
.stl-viewer__footer {
  position: absolute;
  bottom: -16px;
  left: 0;
  width: 100%;
  box-sizing: border-box;

  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;

  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;

  z-index: 2;
  pointer-events: none;
}
/* =========================================================
   FULLSCREEN MODE
========================================================= */

.stl-viewer--fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: linear-gradient(
    180deg,
    #000033 0%,
    #ffffff 48%,
    #2b1a1a 49%,
    #5a5add 51%,
    #1a1a2a 52%,
    #111155 97%,
    #3a2a00 100%
  );
}
/* =========================
   STL GALLERY
   ========================= */

.stl-gallery {
    display: none;              /* chiusa di default */
    width: 100%;
}

.stl-gallery.open {
    display: block;             /* apertura controllata via JS */
}

/* Spaziatura tra i blocchi STL nella gallery */
.stl-gallery .media-block + .media-block {
    margin-top: 6px;
}

/* Assicura coerenza con layout uniforme */
.stl-gallery .media-wrapper {
    width: 100%;
}

/* opzionale: leggera separazione visiva */
.stl-gallery {
    margin-top: 6px;
}
.media-stage.stl-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #1f1f1f;
}
.stl-canvas {
   width: 100%;
   height: 100%;
   display: block;
}
.stl-global-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: black;
  z-index: 99999;
}

/* =========================================================
   MEDIA MENU
   Toolbar full-width
========================================================= */

.media-menu {

    display:flex;
    width:100%;

    background:#000;

    border:1px solid #333;
    padding:2px;

    box-sizing:border-box;
}

/* =========================================================
   SLOT
========================================================= */

.media-slot {

    flex:1;                    /* slot distribuiti uniformemente */

    height:30px;

    display:flex;
    align-items:center;
    justify-content:center;

    gap:4px;

    border:1px solid #333;
    border-radius:2px;

    background:#111;

    font-size:16px;

    cursor:pointer;

    box-sizing:border-box;
}
.media-slot span:first-child{
    font-size:15px;
}
/* media attivo */

.media-active{
    filter:brightness(1.3);
}

/* media inesistente */

.media-none{

    opacity:0.35;
    filter:grayscale(100%);

    cursor:default;
}

/* =========================================================
   DOT INDICATOR
========================================================= */

.dot{

    width:7px;
    height:7px;

    border-radius:50%;
}

.dot-active{
    background:#28c840;
}

.dot-enabled{
    background:#ffffff;
}

.dot-none{
    background:#444;
}

/* =========================================================
   GALLERY STATE
========================================================= */

.gallery-open{
    color:#ff4040;
}

.gallery-closed{
    color:#28c840;
}

.gallery-disabled{
    color:#444;
    cursor:default;
}
.media-slot + .media-slot {
    border-left-color:#444;
	gap:4px;
}
.gallery-open,
.gallery-closed{
    font-weight:bold;
}


/************************/
.product-list-title{

    display:flex;
    align-items:center;

    gap:10px;
}

.product-index{
    width:36px;
    text-align:right;
}

.product-thumb{
    width:40px;
    flex:0 0 40px;
}

.product-name{
    flex:1;
}

.product-media-grid{

    display:grid;

    grid-template-columns:repeat(2,16px);
    grid-template-rows:repeat(2,16px);

    gap:2px;

    width:36px;
}

/**/
.tech-btn {

	padding: 6px 18px;

	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.15em;
	font-family: system-ui, sans-serif;

	color: #bdbdbd;

	background:
		linear-gradient(#0e0e0e,#000);

	border: 1px solid #7a2cff;
	border-radius: 10px;

	cursor: pointer;
	user-select: none;

	position: relative;

	text-shadow:
		0 1px 0 #000,
		0 -1px 0 #444;

	box-shadow:

		/* inner plate */
		inset 0 0 6px rgba(255,255,255,0.05),

		/* inner border */
		inset 0 0 0 1px rgba(255,255,255,0.04),

		/* outer glow */
		0 0 8px rgba(123,44,255,0.25);

	transition:
		all .25s ease;
}
.tech-btn:active {

	transform: translateY(1px);

	box-shadow:

		inset 0 0 14px rgba(0,0,0,0.9),

		inset 0 0 4px rgba(255,255,255,0.05),

		0 0 6px rgba(123,44,255,0.25);
}
.tech-btn:focus-visible {

	outline: none;

	box-shadow:

		0 0 0 2px rgba(123,44,255,0.35),

		0 0 18px rgba(123,44,255,0.6);
}
.tech-btn:disabled {

	opacity: .45;
	cursor: default;

	box-shadow:
		inset 0 0 6px rgba(0,0,0,0.8);
}
.tech-btn {
	transform: translateY(-5px);
}
.tech-btn.active {

	color: #fff;

	border-color: #b070ff;

	box-shadow:
		inset 0 0 10px rgba(255,255,255,0.08),
		0 0 14px rgba(123,44,255,0.55),
		0 0 28px rgba(123,44,255,0.35);
}
.tech-btn {

	box-shadow:
		inset 0 0 6px rgba(255,255,255,0.05),
		0 2px 0 rgba(0,0,0,0.8),
		0 0 8px rgba(123,44,255,0.25);

	transition: all 0.12s ease;
}
.tech-btn.active {

	transform: translateY(2px);

	box-shadow:
		inset 0 3px 8px rgba(0,0,0,0.9),
		inset 0 0 10px rgba(123,44,255,0.45),
		0 0 6px rgba(123,44,255,0.35);

	color: #fff;
}
.tech-btn.active {

	transform: translateY(2px);

	box-shadow:
		inset 0 3px 8px rgba(0,0,0,0.9),
		inset 0 0 10px rgba(123,44,255,0.45),
		0 0 6px rgba(123,44,255,0.35);

	color: #fff;
}
.tech-btn.active::after {

	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;

	box-shadow:
		inset 0 0 12px rgba(160,96,255,0.6);

	pointer-events: none;
}
@keyframes buttonBounce {

	0%   { transform: translateY(0); }
	60%  { transform: translateY(3px); }
	80%  { transform: translateY(1px); }
	100% { transform: translateY(2px); }

}
.tech-btn.active {

	animation: buttonBounce 0.18s ease;

	transform: translateY(2px);

	box-shadow:
		inset 0 3px 8px rgba(0,0,0,0.9),
		inset 0 0 10px rgba(123,44,255,0.45),
		0 0 6px rgba(123,44,255,0.35);

	color: #fff;
}
.tech-btn {

	will-change: transform;
}