﻿/* ============================================================
   METALMEC â€” Componenti: bottoni, frame dashboard, media
   ============================================================ */

/* --- Bottoni pillola (target: h 42px, pad 10px 24px, r 9999) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  padding: var(--btn-pad);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.375;
  letter-spacing: 0;
  white-space: nowrap;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.btn:hover {
  opacity: 0.85;
}

.btn:active {
  transform: scale(0.97);
}

.btn--dark {
  background: var(--ink);
  color: var(--white);
}

.btn--light {
  background: var(--white);
  color: var(--ink);
}

/* --- Link con freccia --- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 500;
  transition: opacity var(--dur-fast);
}

.link-arrow:hover {
  opacity: 0.7;
}

.link-arrow::after {
  content: "â†’";
  transition: transform var(--dur-fast) ease;
}

.link-arrow:hover::after {
  transform: translateX(3px);
}

/* --- Placeholder media (sostituisce i video del cliente) ---
   Per usare un video reale: sostituire il div con
   <video autoplay muted loop playsinline src="..."></video> */
.media-placeholder {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--steel-1), var(--steel-2) 55%, var(--steel-3));
}

/* Effetto "acciaio spazzolato" + grana */
.media-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(115deg,
      rgba(255, 255, 255, 0.045) 0 1px,
      transparent 1px 7px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.35;
  mix-blend-mode: screen;
}

/* Banda di luce diagonale animata (sheen metallico) */
.media-placeholder::after {
  content: "";
  position: absolute;
  inset: -60% -30%;
  background: linear-gradient(100deg,
    transparent 42%,
    rgba(255, 255, 255, 0.09) 50%,
    transparent 58%);
  transform: translateX(-55%);
  animation: sheen 12s var(--ease-out) infinite;
  pointer-events: none;
}

/* Varianti tonali */
.media-placeholder--hero {
  background:
    radial-gradient(120% 90% at 18% 0%, rgba(120, 160, 205, 0.35), transparent 55%),
    linear-gradient(160deg, var(--sky-1), var(--sky-2) 55%, var(--steel-3));
}

.media-placeholder--graphite {
  background: linear-gradient(160deg, var(--graphite-1), var(--graphite-2) 60%, var(--steel-3));
}

.media-placeholder--copper {
  background:
    radial-gradient(90% 70% at 75% 85%, rgba(255, 138, 61, 0.18), transparent 60%),
    linear-gradient(160deg, var(--copper-1), var(--copper-2) 60%, var(--steel-3));
}

/* Laser: fascio diagonale sottile su acciaio blu */
.media-placeholder--laser {
  background:
    linear-gradient(115deg, transparent 49.7%, rgba(190, 230, 255, 0.75) 50%, transparent 50.4%),
    radial-gradient(80% 60% at 50% 42%, rgba(120, 170, 220, 0.22), transparent 65%),
    linear-gradient(160deg, var(--sky-2), var(--steel-2) 55%, var(--steel-3));
}

/* Saldatura: bagliore arancio pulsante */
.media-placeholder--weld {
  background:
    radial-gradient(45% 38% at 62% 68%, rgba(255, 138, 61, 0.4), transparent 70%),
    linear-gradient(160deg, var(--graphite-1), var(--graphite-2) 55%, var(--steel-3));
}

/* Con video di sfondo: il gradiente resta solo come fallback, si spengono
   grana e sheen (il video copre tutto con object-fit: cover). */
.media-placeholder.has-video::before,
.media-placeholder.has-video::after {
  display: none;
}


/* --- Tabs a pillola --- */
.tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.tabs [role="tab"] {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  transition:
    background-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    opacity var(--dur-fast) ease;
}

/* Variante scura: pillole outline traslucide, attiva bianca */
.tabs--dark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 56px;
  z-index: 2;
}

.tabs--dark [role="tab"] {
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(4px);
}

.tabs--dark [role="tab"]:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.7);
}

.tabs--dark [role="tab"][aria-selected="true"] {
  background: var(--white);
  border-color: var(--white);
  color: var(--ink);
}

/* Variante chiara: pillole nel contenitore grigio */
.tabs--light {
  gap: 8px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--pill-grey);
  width: fit-content;
  margin-inline: auto;
}

.tabs--light [role="tab"] {
  color: var(--ink);
  opacity: 0.75;
}

.tabs--light [role="tab"][aria-selected="true"] {
  background: var(--white);
  opacity: 1;
}

/* --- Carosello dischi 3D (monete metalliche rotanti) ---
   Riutilizzabile: 6 dischi su un anello che ruota attorno all'asse Y.
   I dischi sul lato posteriore si nascondono (backface), come nel video. */
.disc-carousel {
  --disc-size: 230px;
  --disc-radius: 246px;
  --disc-spin: 26s;
  --disc-fs: 1.6rem;
  perspective: 1200px;
  perspective-origin: 50% 42%;
  width: 100%;
  height: calc(var(--disc-size) * 1.55);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.disc-carousel__ring {
  position: relative;
  width: var(--disc-size);
  height: var(--disc-size);
  transform-style: preserve-3d;
  animation: disc-spin var(--disc-spin) linear infinite;
}

.disc {
  position: absolute;
  inset: 0;
  transform: rotateY(calc(var(--i) * 60deg)) translateZ(var(--disc-radius));
  backface-visibility: hidden;
}

.disc__face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.62), transparent 44%),
    conic-gradient(from 215deg,
      #8b939d, #3d454e 20%, #b8bfc8 44%, #474f58 66%, #9ba3ac 86%, #8b939d);
  box-shadow:
    inset 0 4px 12px rgba(255, 255, 255, 0.35),
    inset 0 -14px 32px rgba(0, 0, 0, 0.55),
    0 34px 64px rgba(0, 0, 0, 0.55);
}

.disc__face::before {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.12);
}

.disc__label {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--disc-fs);
  letter-spacing: -0.01em;
  color: rgba(24, 28, 33, 0.6);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 0 -1px 1px rgba(0, 0, 0, 0.22);
}

/* Variante saldatura: metallo con riflesso ramato/caldo */
.disc-carousel--weld .disc__face {
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 235, 210, 0.6), transparent 44%),
    conic-gradient(from 215deg,
      #a98f7e, #4a3a30 20%, #d8c2ad 44%, #5a463a 66%, #b39a86 86%, #a98f7e);
}
