/* Allow detailed labels to wrap without changing the native mobile columns. */
.mhm-detailed-rooms > tbody > tr > .mhm-room-label {
    white-space: normal !important;
    overflow-wrap: break-word;
}
.mhm-detailed-rooms tr[data-dt-column="4"] > td:nth-child(2) {
    white-space: normal !important;
    overflow-wrap: break-word;
}
#rentalsTable.mhm-detailed-rooms:not(.mhm-detailed-savings) th,
#rentalsTable.mhm-detailed-rooms:not(.mhm-detailed-savings) td,
.mhm-detailed-rooms.criteria-table th,
.mhm-detailed-rooms.criteria-table td {
    min-width: 0;
    box-sizing: border-box;
}
.mhm-detailed-rooms:not(.mhm-detailed-savings) th:nth-child(4) { min-width: 75px; }
.mhm-detailed-rooms:not(.mhm-detailed-savings) .mhm-room-label {
    width: 13ch;
    max-width: 15ch;
}
.mhm-detailed-rooms .wrap-two-lines,
.mhm-detailed-rooms.criteria-table > tbody > tr > td:nth-child(4) {
    white-space: normal;
    overflow-wrap: anywhere;
}
#roomTypeFilter + .select2-container,
#roomTypeFilter + .select2-container .select2-selection__rendered,
#roomTypeFilter + .select2-container .select2-selection__choice,
#roomTypeFilter + .select2-container .select2-search__field {
    max-width: 100% !important;
}
#roomTypeFilter + .select2-container .select2-selection__rendered,
#roomTypeFilter + .select2-container .select2-selection__choice,
#select2-roomTypeFilter-results .select2-results__option {
    white-space: normal !important;
    overflow-wrap: anywhere;
}

@media (min-width: 576px) and (max-width: 1199px) {
    .mhm-detailed-rooms:not(.mhm-detailed-savings) > thead > tr > th,
    .mhm-detailed-rooms:not(.mhm-detailed-savings) > tbody > tr.clickable-row > td {
        padding-inline: 8px;
    }
    .mhm-detailed-rooms:not(.mhm-detailed-savings).dtr-inline > tbody > tr.clickable-row > td.dtr-control {
        padding-left: 30px;
    }
}
@media (max-width: 374px) {
    table.criteria-table.mhm-detailed-rooms > thead > tr > th { padding-inline: 5px 18px !important; }
    table.criteria-table.mhm-detailed-rooms > tbody > tr.clickable-row > td { padding-right: 4px !important; }
    .mhm-detailed-rooms:not(.mhm-detailed-savings) > thead > tr > th { padding: 8px 16px 8px 4px; }
    .mhm-detailed-rooms:not(.mhm-detailed-savings) > tbody > tr.clickable-row > td { padding-inline: 4px; }
    .mhm-detailed-rooms:not(.mhm-detailed-savings).dtr-inline > tbody > tr.clickable-row > td.dtr-control { padding-left: 30px; }
    #rentalsTableContainer.mhm-detailed-table-wrap,
    .criteria-matches.mhm-detailed-match-list .table-responsive { padding-inline: 4px; }
    .mhm-detailed-rooms ~ .dataTables_paginate {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        white-space: normal;
    }
    .mhm-detailed-rooms ~ .dataTables_paginate > span {
        display: inline-flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .mhm-detailed-table-wrap .dataTables_filter input,
    .mhm-detailed-match-list .dataTables_filter input { max-width: 65%; }
}

/* Savings has different primary columns and its own desktop column widths. */
@media (max-width: 1024px) {
    #rentalsTable.mhm-detailed-savings { table-layout: auto !important; }
    #rentalsTable.mhm-detailed-savings > thead > tr > th {
        padding-inline: 5px 22px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    #rentalsTable.mhm-detailed-savings > tbody > tr.clickable-row > td {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    #rentalsTable.mhm-detailed-savings > tbody > tr.clickable-row > td:first-child {
        white-space: nowrap !important;
        word-break: normal !important;
    }
    #rentalsTable.mhm-detailed-savings > tbody > tr.clickable-row > td.dtr-control {
        padding-left: 30px !important;
    }
    .mhm-detailed-savings-wrap .dataTables_filter input { max-width: 70%; }
}
@media (min-width: 1025px) and (max-width: 1199px) {
    #rentalsTable.mhm-detailed-savings > thead > tr > th { padding-inline: 4px 19px !important; }
    #rentalsTable.mhm-detailed-savings > :is(thead, tbody) > tr > :is(th, td):nth-child(1),
    #rentalsTable.mhm-detailed-savings > :is(thead, tbody) > tr > :is(th, td):nth-child(2) {
        width: 11% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    #rentalsTable.mhm-detailed-savings > :is(thead, tbody) > tr > :is(th, td):nth-child(4) {
        width: 15% !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    #rentalsTable.mhm-detailed-savings > thead > tr > th:nth-child(5),
    #rentalsTable.mhm-detailed-savings > thead > tr > th:nth-child(7) { white-space: normal !important; }
}
@media (max-width: 350px) {
    #rentalsTableContainer.mhm-detailed-savings-wrap > .container { padding-inline: 5px; }
}
@media (min-width: 992px) and (max-width: 1099px) {
    .mhm-detailed-savings-filters #savingsFilter .btn-group { flex-wrap: wrap; }
}

/* Let the native Responsive plugin measure actual column content on saved matches. */
table.criteria-table.mhm-detailed-rooms { table-layout: auto !important; }
table.criteria-table.mhm-detailed-rooms > :is(thead, tbody) > tr > :is(th, td) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}
table.criteria-table.mhm-detailed-rooms > tbody > tr.clickable-row > td:first-child {
    white-space: nowrap !important;
    word-break: normal !important;
}
