/* Catalogo sfogliabile riutilizzabile */

.sg-catalog-section {
    position: relative;
    padding: 70px 0 80px;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, .09), transparent 32%),
        radial-gradient(circle at bottom right, rgba(7, 87, 200, .08), transparent 35%),
        #f6f9fd;
}

.sg-catalog-heading {
    width: min(1180px, 100%);
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.sg-catalog-heading-icon {
    width: 74px;
    height: 74px;
    min-width: 74px;
    border-radius: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0757c8, #0ea5e9);
    color: #fff;
    font-size: 30px;
    box-shadow: 0 18px 42px rgba(7, 87, 200, .22);
}

.sg-catalog-mini-title {
    display: block;
    margin-bottom: 7px;
    color: #0757c8;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.4px;
}

.sg-catalog-heading h2 {
    margin: 0 0 8px;
    color: #07142b;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
    font-weight: 950;
    letter-spacing: -1.4px;
}

.sg-catalog-heading p {
    max-width: 720px;
    margin: 0;
    color: #667085;
    font-size: 16px;
    line-height: 1.7;
}

.sg-flipbook {
    width: min(1180px, 100%);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #dce5f0;
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .12);
}

.sg-catalog-toolbar {
    min-height: 76px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: linear-gradient(135deg, #071a3b, #0a2a58);
}

.sg-catalog-document-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
}

.sg-catalog-document-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .10);
    color: #7dd3fc;
    font-size: 21px;
}

.sg-catalog-document-title strong {
    display: block;
    overflow: hidden;
    margin-bottom: 3px;
    color: #fff;
    font-size: 15px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-catalog-document-title span {
    display: block;
    color: rgba(255, 255, 255, .66);
    font-size: 12px;
}

.sg-catalog-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.sg-catalog-toolbar-button {
    height: 42px;
    min-width: 42px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.sg-catalog-toolbar-button:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, .34);
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.sg-catalog-download-button {
    padding-inline: 15px;
    border-color: transparent;
    background: linear-gradient(135deg, #0875e1, #0ea5e9);
    font-size: 13px;
    font-weight: 850;
}

.sg-catalog-zoom-value {
    min-width: 48px;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.sg-catalog-viewport {
    position: relative;
    height: var(--sg-catalog-height-desktop, 570px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at center, rgba(14, 165, 233, .07), transparent 48%),
        linear-gradient(135deg, #e5ebf3, #f8fafc);
    touch-action: none;
}

.sg-catalog-viewport.is-zoomed {
    cursor: grab;
}

.sg-catalog-viewport.is-dragging {
    cursor: grabbing;
}

.sg-catalog-pan-layer,
.sg-catalog-book-layer {
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    will-change: transform;
}

.sg-catalog-pan-layer {
    transition: transform .06s linear;
}

.sg-catalog-book-layer {
    transition: transform .22s ease;
}

.sg-catalog-page {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.sg-catalog-page-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #fff;
}

.sg-catalog-page-number {
    position: absolute;
    right: 10px;
    bottom: 9px;
    z-index: 5;
    min-width: 27px;
    height: 23px;
    padding: 0 7px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 20, 43, .68);
    color: #fff;
    font-size: 10px;
    font-weight: 850;
    pointer-events: none;
}

.sg-catalog-loading {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #f8fafc;
    color: #07142b;
    transition: opacity .28s ease, visibility .28s ease;
}

.sg-catalog-loading.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.sg-catalog-loading strong {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 900;
}

.sg-catalog-loading span {
    color: #667085;
    font-size: 13px;
}

.sg-catalog-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid #dbe7f5;
    border-top-color: #0757c8;
    border-radius: 50%;
    animation: sgCatalogSpin .8s linear infinite;
}

@keyframes sgCatalogSpin {
    to { transform: rotate(360deg); }
}

.sg-catalog-footer {
    min-height: 74px;
    padding: 12px 18px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    border-top: 1px solid #e4eaf2;
    background: #fff;
}

.sg-catalog-navigation-button {
    min-height: 46px;
    padding: 0 17px;
    border: 1px solid #dce5f0;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: #07142b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.sg-catalog-navigation-button:first-child { justify-self: start; }
.sg-catalog-navigation-button:last-child { justify-self: end; }
.sg-catalog-navigation-button:disabled { opacity: .4; cursor: not-allowed; }

.sg-catalog-footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.sg-catalog-page-indicator {
    color: #0757c8;
    font-size: 13px;
    font-weight: 900;
}

.sg-catalog-help {
    color: #7a8496;
    font-size: 11px;
}

.sg-flipbook:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border: 0;
    border-radius: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: #dfe7f0;
}

.sg-flipbook:fullscreen .sg-catalog-viewport {
    width: 100%;
    height: 100%;
    min-height: 0;
}

@media (max-width: 991px) {
    .sg-catalog-section { padding: 55px 0 65px; }

    .sg-catalog-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .sg-catalog-toolbar-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .sg-catalog-viewport {
        height: var(--sg-catalog-height-tablet, 520px);
    }
}

@media (max-width: 767px) {
    .sg-catalog-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .sg-catalog-heading-icon {
        width: 64px;
        height: 64px;
        min-width: 64px;
        border-radius: 20px;
        font-size: 26px;
    }

    .sg-flipbook { border-radius: 22px; }

    .sg-catalog-viewport {
        height: var(--sg-catalog-height-mobile, 470px);
    }

    .sg-catalog-download-button span,
    .sg-catalog-help {
        display: none;
    }

    .sg-catalog-footer {
        grid-template-columns: 1fr 1fr;
    }

    .sg-catalog-footer-center {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .sg-catalog-navigation-button:first-child {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
    }

    .sg-catalog-navigation-button:last-child {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
    }
}
