/* =============================================
   POPUP OVERLAY - Main Structure
   ============================================= */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.overlay-bg {
    background-color: #ffffff;
    font-size: 20px;
}

.overlay-content {
    position: absolute;
    top: 45%;
    left: 50%;
    max-width: 590px;
    width: 100%;
    text-align: center;
    line-height: 1;
    overflow: hidden;
    transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
}

/* Image inside popup */
.overlay-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =============================================
   TYPOGRAPHY & LINKS
   ============================================= */
.overlay-span {
    color: #266740;
    font-size: 23px;
}

.overlay-text {
    text-align: justify;
}

.overlay-box a,
.overlay-box a:visited,
.row a,
.row a:visited {
    color: #006600;
    text-decoration: none;
}

/* =============================================
   LAYOUT HELPERS
   ============================================= */
.overlay-table {
    width: 100%;
}

.overlay-margin {
    margin-left: 2em;
}

.overlay-box {
    margin: 50px 50px 25px;
    line-height: 28px;
}

.row-btn {
    display: flow-root;
}

/* =============================================
   CLOSE BUTTON - Base style
   ============================================= */
.close-btn {
    text-align: center;
    padding: 10px;
}

.close-btn a {
    color: inherit;
    font-weight: bold;
    text-decoration: none;
}

/* Large screens (≥992px) - white background + right-aligned */
@media (min-width: 992px) {
    .close-btn {
        float: right;
        background-color: #ffffff;           /* White background */
        padding: 12px 20px;
        border-radius: 4px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .close-btn a {
        color: #006600;
    }
}

/* =============================================
   SMALL SCREENS - Tablet & Mobile
   ============================================= */
@media (max-width: 991px) {
    .overlay-content {
        position: fixed;
        top: 45%;
        left: 50%;
        width: calc(100% - 20px);
        max-width: 530px;
        height: auto;
        max-height: 90vh;
        overflow: hidden;
        transform: translate(-50%, -50%);
        -ms-transform: translate(-50%, -50%);
    }

    .overlay-box {
        margin: 0 20px;
        text-align: left;
    }

    .close-btn {
        float: none;               /* Full width, centered */
        background: none;          /* Transparent on small screens */
        padding: 15px 10px;
    }

    .close-btn a {
        color: #006600;
        font-size: 18px;
    }

    .float-td {
        float: none;
        text-align: center;
        padding: 10px;
        border: 1px solid #000;
    }

    .sec-td {
        padding: 20px 0;
    }

    .tittle-td:after {
        display: contents;
        content: ":";
    }
}

@media (max-width: 767px) {
    .tittle-td {
        text-align: left;
    }
}

/* =============================================
   LEGACY / UNUSED (kept for compatibility)
   ============================================= */
.button-close {
    display: block;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    text-align: left;
    cursor: pointer;
}

.float-td {
    float: right;
}

.tittle-td:after {
    content: ":";
    display: inline-block;
    float: right;
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
    .overlay-content {
        position: fixed;
        top: 45%;
        left: 50%;
        width: calc(100% - 20px);
        max-width: 500px;
        height: auto;
        overflow-y: hidden;
        transform: translate(-50%, -50%);
        -ms-transform: translate(-50%, -50%);
    }
}

.overlay.hidden {
    display: none;
}