/* POPSTER 3.11.18 — override circoscritti, nessuna modifica ai prodotti. */
/* Mobile: due righe di categorie minimal, 1 card e mezza visibile, senza margini laterali. */
@media (max-width: 767px) {
  body.home .popster-v315-categories .popster-v320-explore-desktop {display:none !important;}
  body.home .popster-v315-categories .popster-v320-explore-mobile.popster-v315-categories-grid {
    display:grid !important;
    grid-auto-flow:column !important;
    grid-template-columns:none !important;
    grid-auto-columns:calc((100vw - 12px) / 1.5) !important;
    grid-template-rows:repeat(2,minmax(0,auto)) !important;
    gap:16px 12px !important;
    overflow-x:auto !important;
    scroll-snap-type:x proximity !important;
    width:100vw !important;
    max-width:100vw !important;
    padding-left:0 !important;
    padding-right:0 !important;
    scroll-padding-left:0 !important;
  }
  body.home .popster-v315-categories .popster-v320-explore-mobile .popster-v315-category-card {min-width:0 !important;}
}
/* Categorie: mockup ambientato iniziale (Immagine 2), minimal al hover/tocco. */
.popster-v315-categories-page .popster-v315-categories-grid {
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:24px 18px !important;
}
.popster-v315-categories-page .popster-v318-category-image {
  position:relative;display:block;width:100%;aspect-ratio:3/4 !important;
  overflow:hidden !important; background:#eae5df !important; border-radius:13px;
}
.popster-v315-categories-page .popster-v318-category-image > img {
  position:absolute;inset:0;width:100% !important;height:100% !important;
  display:block;transition:opacity .28s ease,transform .35s ease;
}
.popster-v315-categories-page .popster-v318-category-main {object-fit:cover !important;}
.popster-v315-categories-page .popster-v318-category-alt {
  object-fit:contain !important;opacity:0;background:#f0ede5 !important;
}
@media (hover:hover) and (pointer:fine) {
  .popster-v315-categories-page .has-minimal-hover:hover .popster-v318-category-alt {opacity:1;}
  .popster-v315-categories-page .has-minimal-hover:hover .popster-v318-category-main {opacity:0;}
}
.popster-v315-categories-page .has-minimal-hover.is-flipped .popster-v318-category-alt,
.popster-v315-categories-page .has-minimal-hover:focus-visible .popster-v318-category-alt {opacity:1;}
.popster-v315-categories-page .has-minimal-hover.is-flipped .popster-v318-category-main,
.popster-v315-categories-page .has-minimal-hover:focus-visible .popster-v318-category-main {opacity:0;}
.popster-v315-categories-page .popster-v318-category-card .popster-v315-category-name {font-size:16px;}
.popster-v315-categories-page .popster-v318-category-card .popster-v315-category-count {font-size:12px;}
@media(max-width:767px) {
  .popster-v315-categories-page .popster-v315-categories-grid {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:20px 12px !important;
  }
  .popster-v315-categories-page .popster-v318-category-image{border-radius:11px;}
}
/* Hero compatta: si attiva soltanto quando entrambe le foto esistono. */
body.home .popster-before-after {
  position:absolute;inset:0;z-index:0;pointer-events:none;
}
body.home .popster-before-after[hidden]{display:none !important;}
body.home .popster-before-after img {
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 38%;
}
/* v3.11.22: passaggio Prima -> Dopo in 200 ms, una sola volta.
   Nessuno zoom: l'effetto non trattiene CPU/GPU oltre la dissolvenza. */
body.home .popster-before-after__after {
  opacity:0;
  transform:none;
  transition:opacity .2s ease-out;
  will-change:opacity;
}
body.home .popster-before-after.is-after .popster-before-after__after {
  opacity:1;
}
/* Guida ai formati */
.popster-v318-size-guide{padding-top:32px;padding-bottom:75px;}
.popster-v318-size-guide h1{font-size:clamp(29px,4vw,48px);line-height:1.2;margin:18px 0;}
.popster-v318-size-guide h2{font-size:clamp(21px,2.8vw,30px);margin:34px 0 10px;}
.popster-v318-size-guide p{color:#595652;max-width:790px;line-height:1.6;}
.popster-v318-breadcrumb{color:#666;font-size:14px;}
.popster-v318-formats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-top:27px;}
.popster-v318-format{display:flex;flex-direction:column;gap:6px;padding:18px 15px;background:rgba(255,255,255,.45);border:1px solid #e0dad1;border-radius:14px;}
.popster-v318-format strong{font-size:29px;line-height:1.2;}
.popster-v318-format span{font-size:15px;font-weight:650;}
.popster-v318-format p{margin:0;font-size:13px;}
.popster-v318-guide-photos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:24px 0;}
.popster-v318-guide-photo[hidden]{display:none !important;}
.popster-v318-guide-photo{display:block;text-decoration:none;}
.popster-v318-guide-photo img{width:100%;height:auto;border-radius:12px;}
.popster-v318-guide-photo span{display:block;font-weight:600;font-size:14px;margin-top:7px;}
.popster-v318-note{font-size:13px;margin:25px 0;}
.popster-v318-lightbox[hidden]{display:none !important;}
.popster-v318-lightbox{position:fixed;inset:0;background:rgba(18,18,18,.94);display:flex;justify-content:center;align-items:center;z-index:99999;padding:60px 15px 15px;}
.popster-v318-lightbox img{object-fit:contain;max-height:90vh;max-width:100%;width:auto;height:auto;}
.popster-v318-lightbox button{position:absolute;top:12px;right:16px;padding:9px 13px;color:#111;background:white;border:0;border-radius:50%;font-size:19px;}
@media(max-width:900px){.popster-v318-formats{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:600px){
  .popster-v318-formats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;}
  .popster-v318-format{padding:13px;}
  .popster-v318-format strong{font-size:23px;}
  .popster-v318-guide-photos{grid-template-columns:1fr;}
}
@media(prefers-reduced-motion:reduce){.popster-v315-categories-page .popster-v318-category-image img,body.home .popster-before-after__after{transition:none !important;}}
