/* ===== COLLECTION PAGE LAYOUT ===== */

.crumb-border {
    display: none;
}

.collection_banner img {
    border-radius: 8px;
    width: 100%;
    height: auto;
        max-height: 384px;
    object-fit: cover;
}

.mr_lr {
    margin: 0 5px;
}

.wrap_background {
    background: var(--body-background);
    padding-top: 20px;
    padding-bottom: 40px;
}

.bg_collection.section {
    padding: 0;
}

/* ===== SIDEBAR ===== */
.dqdt-sidebar {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding-left: 12px;
    padding-right: 12px;
}

.wrap_background_aside {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px 20px;
}

.aside-item {
    padding-top: 15px;
}

.aside-item + .aside-item {
    border-top: 1px solid #eee;
    margin-top: 15px;
}

.aside-title h2.title-head {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 12px;
    padding: 0;
    text-transform: uppercase;
}

.aside-title h2.title-head span {
    position: relative;
    padding-bottom: 5px;
}

.aside-title h2.title-head span:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: var(--secondary-color);
}

.aside-content.filter-group {
    max-height: none;
    overflow-y: visible;
}

.aside-content.filter-group ul {
    padding-left: 0;
    list-style: none;
    margin: 0;
}

.aside-content .filter-item {
    position: relative;
    font-size: 14px;
    padding: 0;
}

.aside-content .filter-item a {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
    padding: 6px 20px 6px 0;
    display: block;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
}

.aside-content .filter-item a:hover {
    color: var(--primary-color);
}

.aside-content .filter-item .fa {
    position: absolute;
    right: 0;
    top: 10px;
    color: #999;
    transition: transform 0.2s;
}

.aside-content .filter-item.active > a > .fa {
    transform: rotate(90deg);
}

.aside-content .filter-item .dropdown-menu {
    width: 100%;
    border: 0;
    padding-left: 15px;
    box-shadow: none;
    margin-top: 0;
    padding: 0;
    position: static;
    background: none;
    display: none;
}

.aside-content .filter-item.active > .dropdown-menu {
    display: block;
}

/* ===== FILTER CHECKBOXES ===== */
.filter-item--check-box span label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0 4px 0;
    gap: 6px;
}

.filter-item--check-box span label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    margin: 0;
    flex-shrink: 0;
    display: inline-block;
}

.filter-item--check-box span label .fa {
    display: none;
}

.filter-item--check-box.filter-item--green span label {
    font-weight: 400;
    color: var(--text-color);
}

.filter-item-toggle {
    padding: 8px 0;
    font-size: 14px;
    color: var(--primary-color);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-item-toggle .fas {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-item-toggle.show .fas {
    transform: rotate(180deg);
}

/* ===== SIDEBAR BORDER-RIGHT ON DESKTOP (match kitawa.vn) ===== */
@media (min-width: 1200px) {
    .sidebar .wrap_background_aside {
        border-right: 1px solid #eee;
    }
}

/* ===== MAIN CONTENT ===== */
.main_container.collection {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding-left: 12px;
    padding-right: 12px;
}

/* ===== GLOBAL CARD RESET (match kitawa.vn) ===== */
.card {
    border-radius: 0px;
    border: none;
}

.title_page.collection-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* ===== SORT BAR ===== */
.category-products .d-flex {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
}

.sortPagiBar {
    display: flex;
    align-items: center;
}

.sort-cate {
    display: flex;
    align-items: center;
}

#sort-by {
    display: flex !important;
    align-items: baseline;
}

#sort-by label.left span {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
    white-space: nowrap;
}

#sort-by .ul_col {
    padding-left: 0;
    list-style: none;
    margin: 0 0 0 10px;
}

#sort-by .ul_col > li {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

#sort-by .ul_col > li > span {
    font-size: 14px;
    color: var(--text-color);
}

#sort-by .fas.fa-chevron-down {
    margin-left: 8px;
    font-size: 12px;
    color: #999;
}

/* ===== MOBILE: Dropdown (< 1024px) ===== */
@media (max-width: 1023px) {
    #sort-by .ul_col > li .content_ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 9999;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
        min-width: 160px;
        padding: 5px 0;
        margin-top: 2px;
    }

    #sort-by .ul_col > li:hover .content_ul {
        display: block;
    }

    #sort-by .ul_col > li .content_ul li {
        display: block;
        padding: 0;
    }

    #sort-by .ul_col > li .content_ul li a {
        display: block;
        padding: 8px 15px;
        font-size: 14px;
        color: var(--text-color);
        text-decoration: none;
        transition: all 0.2s;
    }

    #sort-by .ul_col > li .content_ul li a:hover {
        color: var(--primary-color);
        background: var(--hover-bg);
    }
}

/* ===== DESKTOP: Inline (≥ 1024px) ===== */
@media (min-width: 1024px) {
    .sort-cate .fas {
        display: none;
    }

    #sort-by .ul_col > li > span {
        display: none !important;
    }

    .sort-cate .content_ul li {
        display: inline-block;
    }

    .sort-cate .content_ul li a {
        font-weight: 400;
        color: #898989;
        padding: 9px 10px 11px;
        display: inline-block;
    }

    .sort-cate .content_ul li:hover,
    .sort-cate .content_ul li.active {
        border-bottom: 2px solid var(--primary-color);
        margin-bottom: -2px;
    }

    .sort-cate .content_ul li:hover a,
    .sort-cate .content_ul li.active a {
        color: var(--primary-color);
    }
}

/* ===== OPEN FILTERS BUTTON ===== */
#open-filters {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

#open-filters .fa {
    font-size: 16px;
}

/* ===== PRODUCT GRID ===== */
.products-view-grid .product-list {
    margin: 0 -12px;
}

.product-col {
    padding: 12px;
}

/* Product card in collection page - 4 columns */
@media (min-width: 992px) {
    .product-col {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .product-col {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
}

@media (max-width: 767px) {
    .product-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ===== PAGINATION ===== */
.section.pagenav {
    padding: 20px 0;
    margin-top: 10px;
}

.nav_pagi {
    width: 100%;
}

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
    margin: 0;
    float: right;
}

.pagination li {
    margin: 0 3px;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 14px;
    color: var(--text-color);
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.pagination li a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination li.active span,
.pagination li.active a {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination li.disabled span {
    color: #ccc;
    background: #f9f9f9;
    cursor: not-allowed;
}

/* ===== COLLECTION DESCRIPTION ===== */
.collection-desc {
    background: var(--body-background);
}

.collection-desc .heading-bar__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.rte.product_getcontent {
    max-height: var(--maxHeightContent);
    overflow: hidden;
    position: relative;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    padding: 20px;
    transition: max-height 0.4s ease;
}

.rte.product_getcontent.show {
    max-height: none !important;
}

.rte.product_getcontent .js-content:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 100%);
    pointer-events: none;
}

.rte.product_getcontent.show .js-content:after {
    content: none;
}

.rte.product_getcontent .toggle-btn {
    display: inline-flex !important;
    align-items: center;
    text-decoration: none;
    margin-top: 10px;
    cursor: pointer;
}

/* ===== MOBILE SIDEBAR OVERLAY (match kitawa.vn) ===== */
@media (max-width: 1199px) {
    .dqdt-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        height: 100%;
        z-index: 9999;
        background: #fff !important;
        overflow-y: auto;
        transition: all 0.3s ease;
        box-shadow: 0 0 20px rgba(0,0,0,0.2);
        visibility: hidden;
        opacity: 0;
        transform: translateX(100%);
    }

    .sidebar.openf {
        top: 0 !important;
        right: 0;
        height: 100%;
        overflow: auto;
        z-index: 9999;
        visibility: visible;
        opacity: 1;
        width: 300px;
        transform: translateX(0);
    }

    .open-filters.d-xl-none {
        display: flex !important;
    }
}

@media (min-width: 1200px) {
    .open-filters.d-xl-none {
        display: none !important;
    }
}

/* ===== SELECTED FILTERS ===== */
.filter-container__selected-filter {
    margin-bottom: 10px;
}

.filter-container__selected-filter-header {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.filter-container__selected-filter-header-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.filter-container__clear-all {
    float: right;
    color: var(--primary-color, #bd1e2b);
    font-size: 13px;
    text-decoration: none;
}

.filter-container__clear-all:hover {
    text-decoration: underline;
}

.filter-container__selected-filter-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

.filter-container__selected-filter-item {
    background: transparent;
    padding: 6px 8px;
    margin-right: 4px;
    margin-top: 4px;
    border: 1px solid var(--primary-color);
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.filter-container__selected-filter-item:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    background: var(--primary-color);
    opacity: 0.1;
}

.filter-container__selected-filter-item a {
    color: var(--buynow-bg);
    z-index: 1;
    position: relative;
    font-weight: 400;
    text-decoration: none;
    font-size: 13px;
}

.filter-container__selected-filter-item a:hover {
    text-decoration: none;
}

.filter-container__selected-filter-item a .fa {
    margin-left: 5px;
}
