/* Listing "View Details" popup (components/partials/_listing_details_modal.html), shared by
   the county pages' "Businesses for Sale" table and the Florida listing search results. */

html.cl-modal-open,
html.cl-modal-open body {
    overflow: hidden;
}

.cl-modal {
    --cl-green: #0f4d2a;
    --cl-orange: #00461C;
    --cl-line: #e8f5ee;
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cl-modal[hidden] {
    display: none;
}

.cl-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.cl-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1000px;
    max-height: calc(100dvh - 48px);
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}

.cl-modal__dialog:focus {
    outline: none;
}

.cl-modal__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-top: 5px solid var(--cl-green);
    border-bottom: 1px solid var(--cl-line);
}

.cl-modal__heading {
    min-width: 0;
}

/* !important: typography.css forces `body h3` to the 28px h3 size. */
.cl-modal .cl-modal__title {
    margin: 0;
    color: var(--cl-green);
    font-size: 22px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.cl-modal__listnum {
    margin: 2px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.cl-modal__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cl-btn {
    padding: 10px 18px;
    color: var(--cl-green);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    background: #fff;
    border: 1px solid var(--cl-green);
    border-radius: 6px;
    cursor: pointer;
}

.cl-btn--primary {
    color: #fff;
    background: var(--cl-orange);
    border-color: var(--cl-orange);
}

.cl-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.cl-btn[hidden] {
    display: none;
}

.cl-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 4px;
    color: #374151;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.cl-modal__close:hover {
    background: #f3f4f6;
}

.cl-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cl-modal__loading {
    margin: 0;
    padding: 28px 20px;
    color: #4b5563;
    text-align: center;
}

.cl-modal__loading[hidden] {
    display: none;
}

.cl-modal__frame {
    display: block;
    width: 100%;
    height: 70vh;
    border: 0;
}

.cl-btn:focus-visible,
.cl-modal__close:focus-visible {
    outline: 3px solid rgba(0, 70, 28, 0.45);
    outline-offset: 2px;
}

@media (max-width: 720px) {
    .cl-modal {
        padding: 0;
    }

    .cl-modal__dialog {
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
    }

    .cl-modal__actions {
        width: 100%;
    }

    .cl-modal__actions .cl-btn {
        flex: 1 1 auto;
    }

    .cl-modal__frame {
        height: 80vh;
    }
}

@media print {
    .cl-modal {
        display: none !important;
    }
}
