body.modal-open {
    overflow: hidden;
}

/* Modal */

.pds-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.pds-modal.active {
    display: flex !important;
}

/* Desktop View */

.pds-desktop {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pds-modal-box {
    width: 70%;
    height: 90vh;
    max-width: 1200px;
    background: white;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    position: relative; /*Added 23/09*/
}

/* Desktop Confirmation Overlay */

#desktop-confirmation {
    display: none;
    position: absolute;
    width: 70%;
    height: 90vh;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.50);
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Confirmation text */
#desktop-confirmation .pds-modal-box-header-confirmation {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0;
}

#desktop-confirmation .pds-modal-box-header-confirmation h2 {
    margin: 0;
    max-width: 750px;
    color: #1B1464 !important;
    font-size: 30px;
    line-height: 1.35;
    font-weight: 700;
    padding: 0;
}

/* Confirmation buttons */
#desktop-confirmation .pds-modal-box-footer {
    flex: 0 0 auto;
    background: transparent;
    border-top: none;
    justify-content: center;
    padding: 30px 40px 0;
    gap: 60px;
}

/* Header */

.pds-modal-box-header {
    background: #1B1464;
    color: white;
    padding: 15px 30px;
    border-bottom: 1px solid white;
}

.pds-modal-box-header h2 {
    margin: 0;
    color: white !important;
    font-size: 28px;
}

.pds-modal-box-header p {
    margin: 5px 0 0;
    font-size: 15px;
    line-height: 1.6;
}

.pds-modal-box-header-confirmation {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}

.pds-modal-box-header-confirmation h2 {
    margin: 0;
    max-width: 750px;

    color: #1B1464 !important;
    font-size: 30px;
    line-height: 1.35;
    font-weight: 700;

    background: transparent;
    padding: 25px 35px;
}

/* Tabs */

.pds-tabs {
    display: flex;
    width: 100%;
    background: #FFF0F2;
}

.pds-tab {
    flex: 1;
    padding: 14px;
    border: none;
    border-right: 1px solid #fff;
    color: black;
    background: #FFF0F2;
    cursor: pointer;
    transition: 0.2s;
    white-space: pre-line;
}

.pds-tab:last-child {
    border-right: none;
}

.pds-tab:hover {
    color: white;
    background: #E11F27;
}

.pds-tab.active {
    background: #E11F27;
    color: white;
}

.pds-error {
    display: none;
}

.pds-error.active {
    display: flex;
}

/* PDS Viewer */

.pds-viewer {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.pds-modal-box-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: white;
    display: block;
    padding: 10px 0;
}

.pdf-container {
    display: none;
}

.pdf-container.active {
    display: block;
}

.pdf-page {
    width: 80%;
    display: block;
    margin: 15px auto;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Footer */

.pds-modal-box-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid white;
    gap: 15px;
    flex-shrink:0;
}

.pds-modal-box-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    height: 48px;
    border-radius: 8px !important;
    font-size: 18px;
    font-weight: bold;
    font-family: "PT Sans", Tahoma, Geneva, sans-serif;
    text-decoration: none;
}

#desktop-confirmation .pds-modal-box-footer {
    background: transparent;
    border-top: none;
    justify-content: center;
    padding: 25px 40px 40px;
    gap: 60px;
}

/* Buttons */

#pds-back,
#desktop-confirmation-back,
#mobile-intro-back,
#mobile-pds-back,
#mobile-confirmation-back {
    background: transparent;
    color: #E11F27;
    border: 2px solid #E11F27;
}

#pds-back:hover,
#desktop-confirmation-back:hover,
#mobile-intro-back:active,
#mobile-pds-back:active,
#mobile-confirmation-back:active {
    background: #C01A21;
    color: white;
    border-color: #B5181F;
}

#pds-agree,
#desktop-confirmation-proceed,
#mobile-read-pds,
#mobile-pds-agree,
#mobile-confirmation-proceed {
    background: #e31b23;
    color: white;
    border: 2px solid #e31b23;
}

#pds-agree:hover,
#desktop-confirmation-proceed:hover,
#mobile-read-pds:active,
#mobile-pds-agree:active,
#mobile-confirmation-proceed:active {
    color: white;
    background: #C01A21;
    border-color: #B5181F;
}

#desktop-confirmation .pds-modal-box-footer a {
    /* min-width: 145px; */
    height: 48px;
}

.pds-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: white;
    font-size: 28px;
    line-height: 28px;
    font-weight: 400;
    cursor: pointer;
}

#mobile-confirmation .pds-close-btn {
    color: black;
}

/* Loading */

.pds-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 15px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 769px) {

    .pds-desktop {
        display: flex;
    }

    .pds-mobile {
        display: none;
    }

    .pds-tab:hover {
        background: #E11F27;
    }

}

/* Mobile View */
@media (max-width: 768px) {

    .pds-desktop {
        display: none;
    }

    #desktop-confirmation {
        display: none !important;
    }

    /* =========================
       MODAL
       ========================= */

    .pds-modal {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
        display: none;
        padding: 0;
        margin: 0;
        align-items: stretch;
        justify-content: stretch;
        overflow: hidden;
    }

    .pds-modal.active {
        display: flex !important;
    }

    /* =========================
       MOBILE CONTAINER
       ========================= */
    
    .pds-mobile {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100dvh;
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    /* =========================
       MOBILE SCREENS
       ========================= */
    
    .pds-modal-box-mobile {
        display: none;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        background: #fff;
        flex-direction: column;
        overflow: hidden;
        position: relative; /*Added 23/09*/
    }

    .pds-modal-box-mobile.active {
        display: flex !important;
        flex-direction: column !important;
    }

    /* =========================
       INTRO / CONFIRMATION
       ========================= */
    
    #mobile-intro,
    #mobile-confirmation {
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* =========================
       CONTENT
       ========================= */

    .pds-modal-box-header-intro-mobile,
    .pds-modal-box-header-confirmation-mobile {

        /*
         * THIS gets whatever space remains
         * after the footer.
         */
        flex: 1 1 0;
        width: 100%;
        min-width: 0;
        min-height: 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 20px;
        /*
         * If content is too tall, content scrolls.
         * Footer remains visible.
         */
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* =========================
       INTRO TEXT
       ========================= */

    .pds-modal-box-header-intro-mobile h2,
    .pds-modal-box-header-confirmation-mobile h2 {
        margin: 15px;
        color: #1B1464 !important;
        font-size: clamp(28px, 8vw, 40px);
        line-height: 1.2;
    }

    .pds-modal-box-header-intro-mobile p {
        margin: 10px;
        font-size: clamp(16px, 4.5vw, 22px);
        line-height: 1.4;
    }

    .pds-modal-box-header-viewer-mobile h2 {
        background: #1B1464;
        margin: 10px;
        padding: 25px;
        color: white;
        font-size: clamp(24px, 6vw, 40px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }    
    
    .pdf-page {
        width: 98%;
        display: block;
        margin: 10px auto;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    }

    .pds-tabs-mobile {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        gap: 4px;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .pds-tabs-mobile .pds-tab {
        width: 100%;
        min-height: 60px;
        padding: 10px;
        border: none;
        white-space: pre-line;
    }

    .pds-tabs-mobile .pds-tab:nth-child(2n) {
        border-right: none;
    }

    .pds-tabs-mobile .pds-tab:nth-last-child(-n + 2) {
        border-bottom: none;
    }

    .pds-tabs-mobile .pds-tab.active {
        background: #E11F27;
    }

    /* =========================
       FOOTER
       ========================= */

    .pds-modal-box-footer {
        /*
         * EXACTLY 78px.
         * Never grows.
         * Never shrinks.
         */
        flex: 0 0 78px !important;
        width: 100%;
        height: 78px;
        min-height: 78px;
        max-height: 78px;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        gap: 15px;
        margin: 0;
        flex-shrink: 0 !important;
    }

    .pds-modal-box-footer a {
        display: inline-flex;
        flex: 1 1 0;
        width: 0;
        min-width: 0;
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border-radius: 8px !important;
        font-size: 18px;
        font-weight: bold;
        font-family: "PT Sans", Tahoma, Geneva, sans-serif;
        text-decoration: none;
        text-align: center;
    }

    /* =========================
       PDS VIEWER
       ========================= */

    #mobile-pds-viewer {
        flex: 1 1 0;
        width: 100%;
        height: auto;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
    }

    .pds-modal-box-header-viewer-mobile {
        flex: 0 0 auto;
    }

    .pds-modal-box-body-mobile {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        background: white;
        padding: 10px 0;
        box-sizing: border-box;
    }

}