/* =============================================================================
   Element: Drawer
   Pannello laterale che scivola da destra con overlay
   ============================================================================= */

/* Base — nascosto di default */
.s4w-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    pointer-events: none;
}

.s4w-drawer.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Overlay scuro */
.s4w-drawer__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

/* Pannello bianco da destra */
.s4w-drawer__panel {
    position: relative;
    z-index: 1;
    width: 40%;
    max-width: 600px;
    height: 100%;
    background-color: var(--bg-white-0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.s4w-drawer.is-open .s4w-drawer__panel {
    transform: translateX(0);
}

/* Header: area con bottone close */
.s4w-drawer__header {
    flex-shrink: 0;
    height: 82px;
    display: flex;
    align-items: center;
    padding-left: 15px;
}

/* Bottone chiudi (X circolare, top-left del pannello) */
.s4w-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    flex-shrink: 0;
    background: var(--bg-weak-100);
    border: 1px solid var(--stroke-soft-200);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-main-900);
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.s4w-drawer__close:hover {
    background-color: var(--bg-soft-200);
}

/* Linea separatrice */
.s4w-drawer__separator {
    flex-shrink: 0;
    height: 1px;
    background-color: var(--stroke-soft-200);
}

/* Body scorrevole */
.s4w-drawer__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 40px 40px;
}

/* Immagine quadrata */
.s4w-drawer__image {
    width: 100%;
    margin-bottom: var(--spacing-xl);
}

.s4w-drawer__image img {
    width: 100%;
    display: block;
    height: auto;
}

/* Contenuto testuale */
.s4w-drawer__content {
    display: flex;
    flex-direction: column;

}

.s4w-drawer__title {
    font-family: var(--font-secondary);
    font-size: 32px;
    font-weight: var(--weight-regular);
    line-height: 1.2;
    letter-spacing: -2px;
    color: var(--text-main-900);
    text-transform: capitalize;
    padding: 0;
    margin: 10px 0;
}

/* Widget Spotify - full width sotto al titolo */
.s4w-drawer__spotify-widget {
    width: 100%;
}

.s4w-drawer__spotify-widget iframe {
    width: 100% !important;
    max-width: 100%;
    display: block;
}

.s4w-drawer__text {
    font-family: var(--font-secondary);
    font-size: var(--paragraph-medium);
    font-weight: var(--weight-regular);
    line-height: 1.6;
    letter-spacing: -0.176px;
    color: var(--text-sub-500);
}

/* Tablet */
@media (max-width: 1024px) {
    .s4w-drawer__panel {
        width: 55%;
    }
}

/* Mobile: lascia uno sliver di pagina a sinistra */
@media (max-width: 768px) {
    .s4w-drawer__panel {
        width: calc(100% - 36px);
        height: 100vh;
        height: 100dvh; /* Dynamic Viewport Height - si adatta alla barra indirizzi */
    }

    .s4w-drawer__body {
        padding: 16px 20px 32px;
    }
}

/* Riduzione movimento */
@media (prefers-reduced-motion: reduce) {
    .s4w-drawer,
    .s4w-drawer__panel {
        transition: none;
    }
}
