/*------------------------------------*/
/* Reset any theme or sidebar-specific floats
/*------------------------------------*/
.woocommerce .ign-filter-bar,
.woocommerce-page .ign-filter-bar {
    float: none;
    clear: both;
}

.ign-shop-layout {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.ign-shop-layout .content-area.primary {
    margin-top: 0 !important;
}

/*------------------------------------*/
/* Sort By Dropdown
/*------------------------------------*/
/* Hide Sort By form in default location */
.ast-woocommerce-container form {
    display: none;
}

/* Remove Margin from the Sort By Form */
.ign-sort .woocommerce-ordering {
    margin: 0;
}

.ign-sort {
    margin-left: auto;
}

.ign-sort .orderby {
    padding: 0 !important;
    text-size-adjust: 100%;
    font-family: "Open Sans", sans-serif;
    font-style: normal;
    font-weight: 600;
    line-height: 1.2;
    font-size: 1rem;
    vertical-align: middle !important;
}

/*------------------------------------*/
/* Results Number
/*------------------------------------*/

.woocommerce-result-count {
    padding-left: 2rem;
}

/*------------------------------------*/
/* Shop Astra Banner
/*------------------------------------*/
.ast-archive-entry-banner {
    border-bottom: solid 4px var(--ign-color-divider);
}

.ast-archive-entry-banner h1 {
    color: var(--ign-main-text);
    font-family: "EB Garamond";
    font-size: 5rem !important;
    margin-bottom: 3rem !important;
}

.ast-archive-entry-banner p {
    margin-bottom: 2rem !important;
    color: var(--ign-alt-text);
    font-size: 2rem;
    font-family: "Alpha 54";
}

/*------------------------------------*/
/* Filter Bar
/*------------------------------------*/
.ign-filter-bar {
    display: flex;
    position: relative;
    z-index: 20;
    width: 100%;
    margin: 0 auto 2rem auto;
    padding: 1rem 2rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0 !important;
    background: var(--ign-color-cream, #fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    max-width: 1200px;
}

/*------------------------------------*/
/* Filter Bar Facets
/*------------------------------------*/
.ign-facet {
    display: inline-block;
    position: relative;
    z-index: 10;
    margin-right: 1rem;
}

.ign-facet__summary {
    display: flex;
    padding: 0.25rem 0;
    font-weight: 600;
    line-height: 1.2;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

/* Hidden panel by default, with transition */
.ign-facet__panel {
    display: none;
    position: absolute;
    z-index: 1000;
    width: max-content;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-0.5rem);
    top: 100%;
    left: 0;
    background: var(--ign-color-cream, #fff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Show and animate panel when open */
.ign-facet[open] .ign-facet__panel {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Highlight summary when open */
.ign-facet[open] .ign-facet__summary {
    font-weight: 600;
    color: var(--ign-color-accent);
}

.ign-facet-button {
    margin-top: 16px;
}

.ign-facet__list {
    margin: 1em 1em .5em 1.75em;
}

/* Restore the default disclosure arrow */
.ign-facet__summary::-webkit-details-marker {
    display: inline-block;
    margin-left: 0.3rem;
}

/* Optional: if you want a custom arrow instead of the default one */
.ign-facet__summary::after {
    font-size: 0.8em;
    content: "▾";
    margin-left: 0.25rem;
    transition: transform 0.25s ease;
}

/* Rotate when open */
.ign-facet[open] .ign-facet__summary::after {
    transform: rotate(180deg);
}

/* Fix filter bar layout inside Astra container */
.ast-container>.ign-filter-bar {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
    /* Pull it visually into the main content area */
    order: -1;
    grid-column: 1 / -1;
}

/* If Astra is using grid or flex layouts, prevent sidebar nesting */

.ast-container {
    display: flex;
    flex-direction: column;
}

/*------------------------------------*/
/* Tablet and below: natural wrapping
/*------------------------------------*/

@media (max-width: 1024px) {
    .ign-filter-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        /* tighter row/column gap */
        gap: 0.75rem 1rem;
        margin-bottom: 1rem;
    }

    .ign-facet {
        /* allow facets to size naturally */
        flex: 0 1 auto;
        min-width: 160px;
    }
}

/*------------------------------------*/
/* Mobile: full-width stacked dropdowns
/*------------------------------------*/

@media (max-width: 640px) {
    .ign-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .ign-facet {
        width: 100%;
    }

    .ign-facet__summary {
        justify-content: space-between;
    }
}