/* Mobile: grade e modal responsivos das galerias Phoca */
@media (max-width: 767px) {
    #pg-msnr-container {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
    #pg-msnr-container .pg-cv-box.item {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        float: none !important;
        width: auto !important;
        margin: 0 !important;
        padding: 8px !important;
        box-sizing: border-box !important;
        background: #fff;
        border-radius: 6px;
    }
    #pg-msnr-container .pg-cv-box-img,
    #pg-msnr-container .pg-box1,
    #pg-msnr-container .pg-box2,
    #pg-msnr-container .pg-box3,
    #pg-msnr-container .pg-modal-button {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
    }
    #pg-msnr-container .pg-image {
        display: block !important;
        width: 100% !important;
        height: 120px !important;
        object-fit: cover;
        border-radius: 4px;
    }
    #pg-msnr-container .pg-cv-name {
        overflow: hidden;
        margin-top: 8px;
        font-size: 11px;
        line-height: 1.35;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    #pg-msnr-container .pg-icon-detail {
        display: none !important;
    }

    #sbox-overlay {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
    }
    #sbox-window {
        position: fixed !important;
        top: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        left: 8px !important;
        width: auto !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
    #sbox-content,
    #sbox-content iframe {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
    }
    #sbox-btn-close {
        top: -4px !important;
        right: -4px !important;
    }

    body.contentpane {
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: #111 !important;
    }
    body.contentpane #pg-multibox-table,
    body.contentpane #pg-multibox-table tbody,
    body.contentpane #pg-multibox-table tr {
        display: block !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body.contentpane .pg-multibox-righttd {
        display: none !important;
    }
    body.contentpane .pg-multibox-lefttd,
    body.contentpane .pg-multibox-left {
        display: block !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #111 !important;
    }
    body.contentpane .pg-multibox-left > a {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        height: 100% !important;
    }
    body.contentpane .pg-detail-image {
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        object-fit: contain;
    }
    body.contentpane .pg-imgbd-multibox-prev,
    body.contentpane .pg-imgbd-multibox-next {
        display: block !important;
        top: 50% !important;
        opacity: .85;
        transform: translateY(-50%);
    }
}

@media (max-width: 767px) {
    #sbox-overlay { z-index: 200000 !important; }
    #sbox-window { z-index: 200001 !important; }
}

/* Celular na horizontal: aproveita toda a altura sem cortar a foto */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
    #sbox-overlay {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 2000000 !important;
    }
    #sbox-window {
        position: fixed !important;
        top: 4px !important;
        right: 4px !important;
        bottom: 4px !important;
        left: 4px !important;
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        box-sizing: border-box !important;
        z-index: 2000001 !important;
    }
    #sbox-content,
    #sbox-content iframe {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
    }
    #sbox-btn-close {
        top: -2px !important;
        right: -2px !important;
    }

    body.contentpane {
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: #111 !important;
    }
    body.contentpane #pg-multibox-table,
    body.contentpane #pg-multibox-table tbody,
    body.contentpane #pg-multibox-table tr {
        display: block !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body.contentpane .pg-multibox-righttd {
        display: none !important;
    }
    body.contentpane .pg-multibox-lefttd,
    body.contentpane .pg-multibox-left {
        display: block !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #111 !important;
    }
    body.contentpane .pg-multibox-left > a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
    }
    body.contentpane .pg-detail-image {
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        object-fit: contain !important;
    }
    body.contentpane .pg-imgbd-multibox-prev,
    body.contentpane .pg-imgbd-multibox-next {
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
}
