/* StratoLab: progressive immersion over the live storefront. */
.image-viewer .viewer-stage.is-loading::before{content:'Caricamento foto…';position:absolute;inset:50% 20px auto;color:#a9c8e5;text-align:center;font:14px/1.6 'DM Sans',Arial,sans-serif;pointer-events:none}
.image-viewer .viewer-stage.is-loading .viewer-image{opacity:0}
:root {
  --experience-cyan: #57d9ff;
  --experience-blue: #1676fa;
  --experience-ease: cubic-bezier(.22,.7,.2,1);
}

body.experience-ready .hero {
  background: radial-gradient(ellipse at 18% 76%, #103958 0, transparent 58%), #071322;
}
body.experience-ready .hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 58% 18%, #1471aa1c, transparent 49%),
    radial-gradient(ellipse at 92% 85%, #36569d17, transparent 44%);
}
body.experience-ready .hero-copy,
body.experience-ready .hero-art,
body.experience-ready .hero-index { z-index: 1; }
body.experience-ready .hero-copy > .eyebrow { animation: studio-enter .8s var(--experience-ease) both; }
body.experience-ready .hero-copy > h1 { animation: studio-enter 1s .09s var(--experience-ease) both; }
body.experience-ready .hero-copy > p { animation: studio-enter 1s .18s var(--experience-ease) both; }
body.experience-ready .hero-copy > .primary,
body.experience-ready .hero-copy > .hero-secondary,
body.experience-ready .hero-copy > .hero-note { animation: studio-enter .9s .25s var(--experience-ease) both; }
body.experience-ready .hero h1 em {
  background: linear-gradient(120deg, #78d8ff 15%, #49b7ff 58%, #8baaff);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 44px #47b9ff0d;
}
body.experience-ready .hero-art {
  box-shadow: 0 30px 90px #0005, 0 0 0 1px #69bfff0e;
}
body.experience-ready .hero-art .art-label,
body.experience-ready .hero-art .art-bottom { z-index: 4; }

/* Observer classes are never added when progressive motion is unavailable. */
body.experience-ready .reveal-ready {
  transition: opacity .72s var(--experience-ease), transform .72s var(--experience-ease);
}
body.experience-ready .reveal-ready:not(.is-revealed) {
  opacity: 0;
  transform: translateY(24px);
}
body.experience-ready .reveal-ready.is-revealed { opacity: 1; transform: none; }
body.experience-ready .products > article { transform-origin: center top; }
body.experience-ready .product-image .quick {
  transition: color .2s, background .2s, transform .3s var(--experience-ease);
}
body.experience-ready .product-image:hover .quick {
  color: white;
  background: #1676fa;
  transform: rotate(7deg);
}
body.experience-ready .filters button,
body.experience-ready .primary {
  transition: background .2s, color .2s, box-shadow .25s, transform .25s var(--experience-ease);
}
body.experience-ready .primary:hover { box-shadow: 0 10px 28px #1676fa25; }
body.experience-ready .primary:active { transform: translateY(1px); }
body.experience-ready .filters button.active { box-shadow: 0 5px 15px #10213d16; }
body.experience-scrolled > header { border-bottom-color: #5894cc4a; }

#experienceProgress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 3px;
  pointer-events: none;
  overflow: hidden;
  background: transparent;
}
.experience-progress-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(var(--reading-progress, 0));
  transform-origin: left;
  background: linear-gradient(90deg, #1676fa, #60e1ff 65%, #9b91ff);
  box-shadow: 0 0 10px #4cc7ff66;
}
.cart-feedback { animation: cart-feedback .5s var(--experience-ease); }

/* Explicit image inspection controls keep the original purchase buttons intact. */
.photo-art { position: relative; }
.image-expand {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #d8eaff57;
  border-radius: 24px;
  background: #07182bc9;
  backdrop-filter: blur(12px);
  color: #eef8ff;
  font: 500 11px/1.3 'DM Sans', Arial, sans-serif;
  letter-spacing: .05px;
  cursor: pointer;
  box-shadow: 0 4px 20px #0002;
  transition: background .2s, border-color .2s;
}
.image-expand svg { width: 17px; height: 17px; flex-shrink: 0; }
.image-expand:hover { background: #0b4d85ed; border-color: #75d8ffb3; }
.image-expand:focus-visible { outline: 3px solid #8aeaff; outline-offset: 4px; }
#heroArt > .image-expand { top: 88px; right: 22px; }
body.product-page .seo-product-photo > .image-expand { left: 18px; right: auto; top: 18px; }

@keyframes studio-enter {
  from { opacity: 0; transform: translateY(17px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cart-feedback {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.12); }
}

@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  body.experience-ready .has-spotlight {
    --pointer-x: 50%;
    --pointer-y: 50%;
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    transform: perspective(1000px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transition: transform .35s var(--experience-ease), box-shadow .35s;
    backface-visibility: hidden;
  }
  body.experience-ready .has-spotlight.is-tilting {
    transition: transform .12s linear, box-shadow .25s;
    will-change: transform;
  }
  body.experience-ready .hero-art.has-spotlight::before,
  body.experience-ready .product-image.has-spotlight::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(circle at var(--pointer-x) var(--pointer-y), #bdefff3d, transparent 47%);
    transition: opacity .3s;
    mix-blend-mode: screen;
  }
  body.experience-ready .has-spotlight.is-tilting::before,
  body.experience-ready .product-image.has-spotlight.is-tilting::after { opacity: .65; }
  body.experience-ready .product-image .quick { z-index: 4; }
  body.experience-ready .hero-art.is-tilting {
    box-shadow: 0 35px 95px #0006, 0 0 35px #359dff18;
  }
}

/* The photo is the focus. These styles apply only to this native dialog. */
dialog.image-viewer {
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  color: #eef6ff;
  background: radial-gradient(ellipse at 50% 40%, #122a44, #040c17 74%);
  box-shadow: none;
  font-family: 'DM Sans', Arial, sans-serif;
  overscroll-behavior: contain;
}
dialog.image-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
}
.image-viewer::backdrop { background: #02060cef; backdrop-filter: blur(12px); }
.image-viewer [hidden] { display: none !important; }
.image-viewer .viewer-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-width: 0;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 76px;
  padding: 20px max(24px,4vw);
  margin: 0;
  border-bottom: 1px solid #b4d5ef15;
  background: #050e1bc9;
}
.image-viewer .viewer-title {
  min-width: 0;
  max-width: 900px;
  margin: 0;
  color: #eef6ff;
  font: 600 17px/1.45 Manrope, Arial, sans-serif;
  letter-spacing: -.3px;
  overflow-wrap: anywhere;
}
.image-viewer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid #b7d1ef47;
  border-radius: 9px;
  background: #c6e5ff0a;
  color: #e9f5ff;
  font: 500 13px/1.35 'DM Sans', Arial, sans-serif;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.image-viewer button:hover { background: #1676fa32; border-color: #73d6ff9c; }
.image-viewer button:focus-visible { outline: 3px solid #79dbff; outline-offset: 4px; }
.image-viewer button:disabled { opacity: .35; cursor: default; }
.image-viewer button svg { width: 20px; height: 20px; }
.image-viewer .viewer-close { font-size: 23px; line-height: 1; padding: 7px 12px; }
.image-viewer .viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: clamp(18px,3.5vh,45px) clamp(62px,6vw,100px);
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-color: #52779d #091423;
}
.image-viewer .viewer-image {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 5px;
  object-fit: contain;
  object-position: center;
  box-shadow: 0 18px 80px #0004;
}
.image-viewer .viewer-error {
  position: absolute;
  inset: 0;
  width: min(390px,80%);
  height: max-content;
  margin: auto;
  color: #bad1e7;
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
}
.image-viewer .viewer-nav {
  position: absolute;
  inset: 50% 22px auto;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: none;
}
.image-viewer .viewer-nav button {
  width: 48px;
  height: 56px;
  border-radius: 12px;
  font-size: 27px;
  line-height: 1;
  background: #061323d9;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}
.image-viewer .viewer-footer {
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  width: 100%;
  max-width: none;
  height: auto;
  padding: 14px max(24px,4vw) max(14px,env(safe-area-inset-bottom));
  margin: 0;
  border-top: 1px solid #b4d5ef15;
  background: #050e1be6;
  color: #99b4cf;
  font-size: 12px;
  line-height: 1.5;
}
.image-viewer .viewer-caption { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.image-viewer .viewer-count { white-space: nowrap; color: #d7ebff; font-variant-numeric: tabular-nums; }
.image-viewer .viewer-zoom { min-width: 100px; }
.image-viewer.is-zoomed .viewer-stage { display: block; overflow: auto; padding: 0; }
.image-viewer.is-zoomed .viewer-image { width: 200%; height: 200%; max-width: none; max-height: none; border-radius: 0; }
.image-viewer.is-zoomed .viewer-zoom { background: #1676fa4d; border-color: #7bc3ff8c; }

/* Depth stays subtle around text and purchase controls. */
body.experience-ready .hero-secondary span {
  display: inline-block;
  transition: transform .25s var(--experience-ease);
}
body.experience-ready .hero-secondary:hover span { transform: translateY(3px); }
body.experience-ready .story-art {
  box-shadow: 0 24px 65px #10274612;
}
body.experience-ready .promo {
  box-shadow: 0 20px 55px #18385108;
}
body.experience-ready .closing {
  background: radial-gradient(ellipse at 50% 45%, #123c64 0, #0a1b32 68%);
}

@media (max-width:760px) {
  #heroArt > .image-expand { top: 78px; right: 18px; }
  .image-viewer .viewer-header {
    padding: max(14px,env(safe-area-inset-top)) 18px 14px;
    gap: 14px;
  }
  .image-viewer .viewer-title { font-size: 15px; line-height: 1.5; }
  .image-viewer .viewer-stage { padding: 18px 16px 64px; }
  .image-viewer .viewer-nav {
    inset: auto 18px 89px;
    transform: none;
  }
  .image-viewer .viewer-nav button { width: 45px; height: 46px; border-radius: 10px; }
  .image-viewer .viewer-footer {
    padding: 12px 18px max(12px,env(safe-area-inset-bottom));
    gap: 10px 14px;
    font-size: 11px;
  }
  .image-viewer .viewer-caption { line-height: 1.5; }
  .image-viewer .viewer-count { font-size: 11px; }
  .image-viewer .viewer-zoom { min-width: 83px; font-size: 12px; padding: 9px 12px; }
  .image-viewer .viewer-close { min-width: 44px; min-height: 44px; }
  .image-expand { font-size: 11px; padding: 10px 12px; }
  .image-viewer.is-zoomed .viewer-stage { padding: 0; }
}
@media (max-width:450px) {
  #heroArt > .image-expand { top: 74px; right: 16px; }
  .image-viewer .viewer-footer { flex-wrap: wrap; }
  .image-viewer .viewer-caption { flex-basis: calc(100% - 76px); }
  .image-viewer .viewer-count { margin-left: auto; }
  .image-viewer .viewer-zoom { min-width: 0; width: 100%; min-height: 44px; }
  .image-viewer .viewer-nav { bottom: 138px; }
  .image-viewer .viewer-stage { padding-bottom: 64px; }
}
@media (pointer:coarse), (hover:none) {
  body.experience-ready .has-spotlight,
  body.experience-ready .has-spotlight.is-tilting { transform: none; will-change: auto; }
  body.experience-ready .has-spotlight::before,
  body.experience-ready .product-image.has-spotlight::after { display: none; }
}
@media (prefers-reduced-motion:reduce) {
  body.experience-ready .hero-copy > *,
  body.experience-ready .reveal-ready,
  body.experience-ready .has-spotlight,
  body.experience-ready .has-spotlight.is-tilting,
  .cart-feedback {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    will-change: auto !important;
  }
  body.experience-ready .has-spotlight::before,
  body.experience-ready .product-image.has-spotlight::after { display: none; }
  body.experience-ready .hero-secondary span,
  .image-viewer button,
  .image-expand { transition: none; }
}
