/* ==========================================================================
   Ingrandimento delle schermate a tutto schermo
   AlbaSoftware, rev. 8.11 (comportamento in js/ingrandimento.js)

   Va caricato DOPO style.css, nelle pagine con schermate: home e schede
   prodotto.
   ========================================================================== */

/* --- Immagini ingrandibili ---------------------------------------------- */

[data-ingrandisci] img[data-ingrandibile] { cursor: zoom-in; }
[data-ingrandisci] img[data-ingrandibile]:focus-visible {
  outline: 2px solid var(--accent-light, #7dbeff);
  outline-offset: 3px;
}

/* Galleria: leggero sollevamento e lente al passaggio del mouse */
.shots figure { position: relative; }
.shots img[data-ingrandibile] {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.shots img[data-ingrandibile]:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(12, 36, 61, 0.16);
}
.shots figure::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
  background: rgba(6, 21, 36, 0.72) no-repeat center / 16px 16px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E");
}
.shots figure:hover::after { opacity: 1; }

@media (hover: none) {
  /* sugli schermi a tocco la lente resta sempre visibile, in piccolo */
  .shots figure::after { opacity: 0.85; width: 26px; height: 26px; background-size: 14px 14px; }
}

/* --- Finestra ------------------------------------------------------------ */

html.ingrandimento-aperto { overflow: hidden; }

.ingrandimento {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px 24px;
  opacity: 0;
  transition: opacity 220ms ease;
}
.ingrandimento[hidden] { display: none; }
.ingrandimento.is-aperta { opacity: 1; }

.ingrandimento__sfondo {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 19, 0.92);
}

.ingrandimento__figura {
  position: relative;
  z-index: 1;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 0;
}

/* la schermata non supera mai la sua misura reale (1366 x 768) */
.ingrandimento__visual {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: calc(100% - 40px);
  flex: 0 1 auto;
}
.ingrandimento__img {
  display: block;
  max-width: min(100%, 1366px);
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  transition: opacity 200ms ease;
}
.ingrandimento__watermark {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  width: max-content;
  max-width: 92%;
  color: rgba(255, 255, 255, 0.48);
  font: 600 clamp(0.65rem, 1.8vw, 1.15rem)/1.3 var(--font-head, sans-serif);
  letter-spacing: 0.035em;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.72);
  pointer-events: none;
  user-select: none;
}
.ingrandimento.is-carica .ingrandimento__img { opacity: 0.35; }

.ingrandimento__testo {
  display: flex;
  gap: var(--space-4, 16px);
  align-items: baseline;
  color: #fff;
  font-family: var(--font-head, sans-serif);
  font-size: var(--text-sm, 0.8125rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}
.ingrandimento__conteggio { color: rgba(255, 255, 255, 0.62); font-weight: 500; }

.ingrandimento__btn {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid rgba(125, 190, 255, 0.42);
  border-radius: 50%;
  background: rgba(12, 36, 61, 0.7);
  color: #fff;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.ingrandimento__btn[hidden] { display: none; }
.ingrandimento__btn:hover { background: rgba(125, 190, 255, 0.24); border-color: var(--accent-light, #7dbeff); }
.ingrandimento__btn:focus-visible { outline: 2px solid var(--accent-light, #7dbeff); outline-offset: 3px; }
.ingrandimento__btn svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.ingrandimento__chiudi { top: 10px; right: 14px; }
.ingrandimento__prec { left: 14px; top: 50%; transform: translateY(-50%); }
.ingrandimento__succ { right: 14px; top: 50%; transform: translateY(-50%); }

/* Schermi stretti: frecce in basso, la schermata usa tutta la larghezza */
@media (max-width: 700px) {
  .ingrandimento { padding: 56px 10px 76px; }
  .ingrandimento__prec, .ingrandimento__succ { top: auto; bottom: 16px; transform: none; }
  .ingrandimento__prec { left: calc(50% - 56px); }
  .ingrandimento__succ { right: calc(50% - 56px); }
  .ingrandimento__testo { flex-direction: column; gap: 2px; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ingrandimento, .ingrandimento__img, .shots img[data-ingrandibile] { transition: none; }
  .shots img[data-ingrandibile]:hover { transform: none; }
}
