﻿/* ==========================================================================
   SHARED GRID UTILITIES & HELPERS
   Source: Refactored from default.css + checkbox_js.css + HTML Fixes
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Bootstrap Grid Patches (Row Table / Flex)
   -------------------------------------------------------------------------- */
.row-table {
    width: 100%;
    display: table;
    margin: 0;
}

    .row-table > div {
        display: table-cell;
        float: none;
        vertical-align: middle;
    }

.row-flex {
    display: flex;
    flex-wrap: wrap;
}

    .row-flex > div {
        display: inline-flex;
        float: none;
    }

.row-table > div:not([class*="-push-"]):first-child {
    padding-left: 0;
}

.row-table > div:not([class*="-pull-"]):last-child {
    padding-right: 0;
}

.row-table > div[class*="-push-"]:first-child,
.row-flex > div[class*="-push-"]:first-child {
    padding-right: 0;
}

.row-table > div[class*="-pull-"]:last-child,
.row-flex > div[class*="-pull-"]:last-child {
    padding-left: 0;
}

.row-table.vertical-align-bottom > div,
.row-flex.vertical-align-bottom > div {
    vertical-align: bottom;
}

.row-table.vertical-align-top > div,
.row-flex.vertical-align-top > div {
    vertical-align: top;
}

/* --------------------------------------------------------------------------
   2. Grid Clearing (Fixes "Staircase" effect in float grids)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 991px) {
    .col-sm-2:nth-child(6n+1),
    .col-sm-1-5:nth-child(5n+1),
    .col-sm-3:nth-child(4n+1),
    .col-sm-4:nth-child(3n+1),
    .col-sm-6:nth-child(2n+1) {
        clear: left;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .col-md-2:nth-child(6n+1),
    .col-md-1-5:nth-child(5n+1),
    .col-md-3:nth-child(4n+1),
    .col-md-4:nth-child(3n+1),
    .col-md-6:nth-child(2n+1) {
        clear: left;
    }
}

@media (min-width: 1200px) {
    .col-md-6:not([class*="col-lg-"]):nth-child(2n+1),
    .col-lg-2:nth-child(6n+1),
    .col-lg-1-5:nth-child(5n+1),
    .col-lg-3:nth-child(4n+1),
    .col-lg-4:nth-child(3n+1),
    .col-lg-6:nth-child(2n+1) {
        clear: left;
    }
}

@media (max-width: 767px) {
    .col-xs-2:nth-child(6n+1),
    .col-xs-1-5:nth-child(5n+1),
    .col-xs-3:nth-child(4n+1),
    .col-xs-4:nth-child(3n+1),
    .col-xs-6:nth-child(2n+1) {
        clear: left;
    }
}

/* --------------------------------------------------------------------------
   3. Plugin Patches (Merged from checkbox_js.css)
   -------------------------------------------------------------------------- */
div#legend {
    text-align: center;
}

.legend_label {
    margin-right: 1em;
    margin-left: 0.3em;
}

/* --------------------------------------------------------------------------
   4. HTML Refactoring Utilities (New Helpers)
   -------------------------------------------------------------------------- */
.no-outline {
    outline: none !important;
    box-shadow: none !important;
}

.filter-row-tight {
    margin-left: -2px;
    margin-right: -2px;
}
