/*
    New, isolated, and specific styles for the catalog page.
*/

/* By chaining the original class with the new one, we increase specificity */
.catalog_wrapper.catalog-page-grid {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
}
.breadcrumbs_wrapper{
    margin-left: 68px;
    margin-top: 10px;
    margin-bottom: 22px;
}

/* DESKTOP: This is the default state for the filter panel */
.catalog_content.catalog-page-filters {
    display: flex; /* Ensures it is visible by default on desktop */
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 16px;
    /*width: 100%;*/
    max-width: 320px;
    margin: 0;
    background-color: #ffffff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    margin-right:10px;
    max-height: 80vh;
    overflow-y:auto;
}

.catalog_items.catalog-page-products {
    align-items: normal;
    width: 100%;
}

.catalog_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.catalog_header h1 {
    text-transform: uppercase;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-count-badge {
    background-color: #00AFF2;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
}

.catalog_sort {
    display: flex;
    /*align-items: center;*/
    /*gap: 10px;*/
    flex-direction: column;
    align-items: flex-start;
}

.catalog_sort label {
    font-weight: 600;
    font-size: 14px;
    color: #6c757d;
}

.catalog_sort select {
    border: 1px solid #ced4da;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background-color: #fff;
}

/* Hide all mobile-only elements on desktop */
.mobile-filter-trigger,
.mobile-filter-header,
.mobile-filter-footer {
    display: none;
}


/* Responsive Styles for Mobile */
@media (max-width: 992px) {

    .breadcrumbs_wrapper{
        margin-left: 0;
        margin-top: 38px;
        margin-bottom: 18px;
    }

    .breadcrumbs_wrapper.catalog{
        margin-left: 10px;
        margin-top: 16px;
        margin-bottom: 30px;
    }

    .catalog_wrapper.catalog-page-grid {
        flex-direction: column;
    }

    /* MOBILE: Hide the entire filter panel wrapper by default */
    .mobile-filter-panel {
        display: none;
    }
    
    /* MOBILE: When the panel is open, make it a slide-in */
    .mobile-filter-panel.is-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 320px;
        height: 100%;
        background-color: #fff;
        z-index: 1050;
        box-shadow: 0 0 20px rgba(0,0,0,0.2);
    }

    /* MOBILE: Show the trigger button */
    .mobile-filter-trigger {
        display: block;
        width: 100%;
        padding: 12px;
        background-color: #00AFF2;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 20px;
    }

    /* MOBILE: Style the panel's header */
    .mobile-filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        border-bottom: 1px solid #e9ecef;
        flex-shrink: 0;
    }
    
    .mobile-filter-header h3 {
        margin: 0;
        font-size: 1.2rem;
    }

    .mobile-filter-close {
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        padding: 0 10px;
    }

    /* MOBILE: Make the original filter list scrollable inside the panel */
    .mobile-filter-panel .catalog_content.catalog-page-filters {
        display: flex;
        overflow-y: auto; /* Allow scrolling */
        padding: 20px;
        box-shadow: none;
        border: none;
        border-radius: 0;
        max-width: 100%;
        height: 100%;
        padding-bottom: 100px;
    }

    /* MOBILE: Style the panel's footer */
    .mobile-filter-footer {
        display: block;
        padding: 15px 20px;
        border-top: 1px solid #e9ecef;
        flex-shrink: 0;
        background-color: #fff;
    }

    .mobile-filter-apply {
        width: 100%;
        padding: 12px;
        background-color: #28a745;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
    }
}
