/* ==========================================
   Collection Grid Base
========================================== */
.collection-main-body.grid-uniform {
    margin-left: 0;
}

.collection_grid .pagination {
    margin-top: 30px;
    text-align: center;
}

.collection_grid .btn--underlined {
    color: var(--primary-btn-bg-color);
}

.mobile-facets__open {
    margin: 0 0 15px 0;
}

.facets__form-inner {
    gap: 30px;
}

@media screen and (min-width: 768px) {
    .facets__form-inner {
        column-gap: var(--grid-spacing);
    }
}

/* ==========================================
   Desktop Grid Layout
========================================== */
@media screen and (min-width: 768px) {
    .grid-area--filtering { grid-area: filtering; }
    .grid-area--collection { grid-area: collection; }

    .collection_grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas: "collection";
    }

    .collection_grid.filtering_enabled--topbar {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, auto);
        grid-template-areas: "filtering" "collection";
    }

    .collection_grid.filtering_enabled--topbar .collection-info__description {
        text-align: center;
    }

    .collection_grid.filtering_enabled--sidebar {
        grid-template-columns: 250px 1fr;
        grid-template-rows: auto;
        grid-template-areas: "filtering collection";
        column-gap: 30px;
    }

    .collection_grid.filtering_enabled--sidebar .collection-info {
        margin-bottom: 30px;
    }

    .collection_grid.filtering_enabled--sidebar .collection-info .page--title {
        text-align: left;
    }
}

/* ==========================================
   Sticky Filter Bar — DESKTOP ONLY
========================================== */
@media screen and (min-width: 768px) {
    #smart-filter-bar {
        position: sticky;
        top: 0;
        z-index: 999;
        background: #fff;
        transition: transform 0.35s ease;
        will-change: transform;
    }

    #smart-filter-bar.filter--hidden {
        transform: translateY(-100%);
    }

    #smart-filter-bar.filter--visible {
        transform: translateY(0);
    }
}

/* ==========================================
   MOBILE — TOP sticky bar
========================================== */
/* ==========================================
   MOBILE — Button sits naturally in page flow
========================================== */
@media screen and (max-width: 767px) {

    /* NOT fixed — sits naturally in page between header and products */
     /* NOT fixed — sits naturally in page between header and products */
    #smart-filter-bar {
        position: sticky !important;
        top: 0 !important;
        bottom: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 900 !important;
        background: #fff !important;
        transition: none !important;
        padding: 10px 15px !important;
        will-change: auto !important;
        transform: none !important;
    }

    #smart-filter-bar.filter--hidden {
        transform: none !important;
    }

    #smart-filter-bar.filter--visible {
        transform: none !important;
    }

    /* No placeholder needed for sticky */
    #smart-filter-bar-placeholder {
        display: none !important;
    }

    .mobile-facets__open {
        margin: 0 !important;
        width: 100% !important;
    }

    .grid-area--filtering {
        margin: 0 !important;
        padding: 0 !important;
    }

    .grid-area--collection {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* Remove left white space */
@media screen and (max-width: 767px) {
    

    /* Hide drawer by default — already handled by translateX(-100%) */
    /* Make sure overlay is hidden too */
    .filtering-drawer-overlay {
        display: none;
    }

    .js-drawer-open-filter .filtering-drawer-overlay {
        display: block;
    }
}