/* Website - Popup — stile neutro, personalizzabile via variabili --wpopup-* (Popup → Aspetto) */
.wpopup { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; font-family: var(--wpopup-font, inherit); }
.wpopup[hidden] { display: none; }
.wpopup__overlay { position: absolute; inset: 0; background: var(--wpopup-overlay, rgba(0,0,0,.6)); animation: wpopup-fade .25s ease-out; }
.wpopup__dialog { position: relative; width: 100%; max-width: var(--wpopup-max-width, 560px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: hidden; background: var(--wpopup-bg, #fff); color: var(--wpopup-text, #111); border-radius: var(--wpopup-radius, 16px); box-shadow: 0 24px 64px rgba(0,0,0,.35); animation: wpopup-pop .3s cubic-bezier(.2,.9,.3,1.2); outline: none; }
.wpopup__scroll { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; -webkit-overflow-scrolling: touch; border-radius: inherit; }
.wpopup__close { position: absolute; top: 10px; right: 10px; z-index: 2; box-sizing: border-box; width: 40px; height: 40px; min-width: 0; min-height: 0; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; line-height: 0; font-size: 0; border: 0; border-radius: 50%; background: var(--wpopup-close-bg, #fff); color: var(--wpopup-close-text, #111); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); transition: transform .15s; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
.wpopup__close svg { display: block; width: 22px; height: 22px; flex: 0 0 auto; margin: 0; pointer-events: none; }
.wpopup__close:hover, .wpopup__close:focus-visible { transform: scale(1.08); outline: 2px solid var(--wpopup-accent, #1d4ed8); outline-offset: 2px; }
.wpopup__media { position: relative; line-height: 0; aspect-ratio: 16 / 9; max-height: 60vh; overflow: hidden; background: #e9e9e9; border-radius: var(--wpopup-radius, 16px) var(--wpopup-radius, 16px) 0 0; }
.wpopup__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wpopup__media--contain { background: transparent; }
.wpopup__media--contain .wpopup__img { object-fit: contain; }
.wpopup__slides { position: absolute; inset: 0; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.wpopup__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.wpopup__slide.is-active { opacity: 1; }
.wpopup__dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.wpopup__dot { box-sizing: border-box; width: 12px; height: 12px; padding: 0; margin: 0; border: 2px solid #fff; border-radius: 50%; background: transparent; box-shadow: 0 0 2px rgba(0,0,0,.4); cursor: pointer; transition: background .2s, transform .2s; -webkit-appearance: none; appearance: none; }
.wpopup__dot.is-active { background: #fff; transform: scale(1.1); }
.wpopup__body { padding: 28px 32px 32px; }
.wpopup__title { margin: 0 0 12px; font-size: clamp(1.3rem, 2.5vw, 1.75rem); line-height: 1.2; color: inherit; }
.wpopup__title[hidden] { display: none; }
.wpopup__content { font-size: 1rem; line-height: 1.55; }
.wpopup__content > :first-child { margin-top: 0; }
.wpopup__content > :last-child { margin-bottom: 0; }
.wpopup__content a { color: var(--wpopup-accent, #1d4ed8); }
.wpopup__actions { margin: 24px 0 0; }
.wpopup__actions--center { text-align: center; }
.wpopup__actions--full .wpopup__button { display: block; text-align: center; }
.wpopup__button { display: inline-block; box-sizing: border-box; padding: 12px 26px; border-radius: var(--wpopup-button-radius, 999px); background: var(--wpopup-button-bg, var(--wpopup-accent, #1d4ed8)); color: var(--wpopup-button-text, #fff) !important; font-weight: 600; text-decoration: none !important; transition: filter .15s, transform .15s; }
.wpopup__button:hover, .wpopup__button:focus-visible { filter: brightness(1.1); transform: translateY(-1px); }
@media (max-width: 480px) { .wpopup__body { padding: 22px 20px 24px; } }
@keyframes wpopup-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wpopup-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wpopup__overlay, .wpopup__dialog { animation: none; } }
body.wpopup-open { overflow: hidden; }

/* Sfumatura + indicatore di scorrimento (visibili solo se c'è altro contenuto sotto) */
.wpopup__fade { position: absolute; left: 0; right: 0; bottom: 0; height: 72px; pointer-events: none; opacity: 0; transition: opacity .25s; background: linear-gradient(to bottom, transparent, var(--wpopup-bg, #fff) 70%); background: linear-gradient(to bottom, color-mix(in srgb, var(--wpopup-bg, #fff) 0%, transparent), var(--wpopup-bg, #fff) 70%); border-radius: 0 0 var(--wpopup-radius, 16px) var(--wpopup-radius, 16px); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; }
.wpopup__dialog.is-scrollable .wpopup__fade { opacity: 1; }
.wpopup__scroll-hint { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; background: var(--wpopup-accent, #1d4ed8); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25); animation: wpopup-bounce 1.6s ease-in-out infinite; }
@keyframes wpopup-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .wpopup__scroll-hint { animation: none; } }
