/* =========================================================
   PRODUCT CATALOGUE
========================================================= */

.cpc-product-catalogue {
    width: 100%;
    padding: 40px 20px 70px;
    background: #fff;
    box-sizing: border-box;
}

.cpc-product-catalogue *,
.cpc-product-catalogue *::before,
.cpc-product-catalogue *::after {
    box-sizing: border-box;
}

.cpc-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}


/* =========================================================
   LAYOUT
========================================================= */

.cpc-catalogue-layout {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 35px;
    align-items: start;
}


/* =========================================================
   SIDEBAR
========================================================= */

.cpc-sidebar {
    width: 100%;
}

.cpc-filter-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 25px;
    border-bottom: 1px solid #ddd;
}

.cpc-filter-heading h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    color: #111;
}

.cpc-filter-heading button {
    border: 0;
    padding: 0;
    background: transparent;
    color: #777;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
}


.cpc-filter-section {
    /*padding: 25px 0;*/
    border-bottom: 1px solid #ddd;
}

.cpc-filter-section-2 {
    padding: 25px 0;
}

.cpc-filter-section h3 {
    margin: 0 0 18px;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 600;
    color: #111;
}

.cpc-filter-section-2 h3 {
    margin: 0 0 18px;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 600;
    color: #111;
}


/* =========================================================
   CHECKBOXES
========================================================= */

.cpc-checkbox-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
    cursor: pointer;
    font-size: 15px;
    color: #444;
    line-height: 1.4;
}

.cpc-checkbox-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cpc-custom-checkbox {
    position: relative;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1px solid #d2d2d2;
    border-radius: 4px;
    background: #fff;
}

.cpc-checkbox-label input:checked + .cpc-custom-checkbox {
    background: #f69320;
    border-color: #f69320;
}

.cpc-checkbox-label input:checked + .cpc-custom-checkbox::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 9px;
    left: 6px;
    top: 2px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


/* =========================================================
   COLLECTION BUTTONS
========================================================= */

.cpc-collection-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cpc-collection-filter {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid #d7d7d7;
    border-radius: 30px;
    background: #fff;
    color: #444;
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cpc-collection-filter:hover,
.cpc-collection-filter.active {
    background: #f69320;
    border-color: #f69320;
    color: #fff;
}


/* =========================================================
   PRODUCTS AREA
========================================================= */

.cpc-products-area {
    position: relative;
    min-width: 0;
}

.cpc-products-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    margin-bottom: 12px;
}

.cpc-product-count {
    color: #777;
    font-size: 13px;
}


/* =========================================================
   PRODUCT GRID
========================================================= */

.cpc-products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 20px;
}


/* =========================================================
   PRODUCT CARD
========================================================= */

.cpc-product-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dedede;
    border-radius: 15px;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cpc-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

.cpc-product-image-link {
    display: block;
    width: 100%;
    aspect-ratio: 1.35 / 1;
    overflow: hidden;
    padding: 10px;
}

.cpc-product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 11px;
}

.cpc-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #f4f4f4;
    color: #777;
}

.cpc-product-content {
    padding: 0 10px 15px;
}

.cpc-product-title {
    margin: 8px 0 8px;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 500;
}

.cpc-product-title a {
    color: #111;
    text-decoration: none;
}

.cpc-product-description {
    min-height: 64px;
    margin-bottom: 10px;
    color: #808080;
    font-size: 13px;
    line-height: 1.45;
    overflow: hidden;
}

.cpc-product-description p {
    margin: 0;
}

.cpc-know-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0068c9;
    text-decoration: none;
    font-size: 16px;
}

.cpc-know-more-text {
    font-weight: 400;
}

.cpc-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    min-width: 19px;
    color: #0068c9;
    background: none !important;
    transition: color 0.15s ease, transform 0.15s ease;
}

.cpc-arrow svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cpc-know-more:hover .cpc-arrow {
    transform: translate(1px, -1px);
    color: #f69320;
}


/* =========================================================
   PAGINATION
========================================================= */

#cpc-pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 34px;
}

.cpc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cpc-page-btn {
    width: 36px;
    height: 36px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;

    border: 1px solid #e0e0e0;
    border-radius: 4px;

    background: #fff;
    color: #333;

    font-size: 13px;
    cursor: pointer;

    transition: all 0.2s ease;
}

.cpc-page-btn:hover:not(:disabled),
.cpc-page-btn.active {
    background-color: #f69320 !important;
    border: 1px solid #f69320 !important;
    color: #fff !important;
}

.cpc-page-btn.disabled,
.cpc-page-btn:disabled {
    background: #eee;
    color: #aaa;
    cursor: not-allowed;
}

.cpc-page-dots {
    width: 25px;
    text-align: center;
    color: #555;
}


/* =========================================================
   LOADER
========================================================= */

.cpc-loader {
    position: absolute;
    inset: 50px 0 0;
    z-index: 10;

    display: none;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.7);
}

.cpc-loader.loading {
    display: flex;
}

.cpc-spinner {
    width: 35px;
    height: 35px;

    border: 3px solid #ddd;
    border-top-color: #f69320;

    border-radius: 50%;

    animation: cpc-spin 0.7s linear infinite;
}

@keyframes cpc-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   NO PRODUCTS
========================================================= */

.cpc-no-products {
    grid-column: 1 / -1;
    padding: 70px 20px;
    text-align: center;
}

.cpc-no-products h3 {
    margin: 0 0 8px;
    color: #222;
    font-size: 22px;
}

.cpc-no-products p {
    margin: 0;
    color: #777;
}


/* =========================================================
   MOBILE FILTER BUTTON (hidden on desktop)
========================================================= */

.cpc-mobile-filter-btn {
    display: none !important;
}


/* Mobile Header inside Sidebar (hidden on desktop) */

.cpc-mobile-filter-header {
    display: none;
}


/* Mobile Footer (hidden on desktop) */

.cpc-mobile-filter-footer {
    display: none;
}


/* =========================================================
   TABLET
   768px - 1024px
========================================================= */

@media (max-width: 1024px) {

    .cpc-product-catalogue {
        padding-left: 25px;
        padding-right: 25px;
    }

    .cpc-catalogue-layout {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 25px;
    }

    .cpc-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .cpc-product-title {
        font-size: 18px;
    }

}


/* =========================================================
   MOBILE
   <= 767px
========================================================= */

@media (max-width: 767px) {

    .cpc-product-catalogue {
        padding: 25px 15px 50px;
    }


    /* Mobile Filter Button */

    .cpc-mobile-filter-btn {
        width: 100%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;

        margin-bottom: 20px;
        padding: 12px 20px;

        border: 1px solid #f69320;
        border-radius: 8px;

        background: #f69320;
        color: #fff;

        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
    }


    /* Layout */

    .cpc-catalogue-layout {
        display: block;
    }


    /* =========================================================
       SIDEBAR — OFF-CANVAS SLIDE-IN
    ========================================================= */

    .cpc-sidebar {
        position: fixed !important;

        top: 0 !important;
        left: -100% !important;
        right: auto !important;
        bottom: auto !important;

        z-index: 99999 !important;

        width: min(330px, 88vw) !important;
        min-width: 0 !important;
        max-width: min(330px, 88vw) !important;

        height: 100dvh !important;
        max-height: 100dvh !important;

        display: flex !important;
        flex-direction: column !important;

        overflow: hidden !important;

        margin: 0 !important;
        padding: 0 !important;

        background: #fff !important;

        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.15);

        transition: left 0.3s ease !important;
    }

    .cpc-sidebar.open {
        left: 0 !important;
    }

    .cpc-sidebar-scroll {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 20px !important;
        -webkit-overflow-scrolling: touch;
    }


    /* Overlay */

    .cpc-filter-overlay {
        position: fixed;
        inset: 0;

        z-index: 99998;

        display: none;

        background: rgba(0, 0, 0, 0.45);
    }

    .cpc-filter-overlay.open {
        display: block;
    }


    /* Mobile Sidebar Header */

    .cpc-mobile-filter-header {
        display: flex;
        align-items: center;
        justify-content: space-between;

        padding-bottom: 20px;
        margin-bottom: 20px;

        border-bottom: 1px solid #ddd;
    }

    .cpc-mobile-filter-header h2 {
        margin: 0;
        font-size: 24px;
    }

    .cpc-close-filter {
        width: 30px;
        height: 30px !important;

        border: 0 !important;
        border-radius: 0;

        background: transparent !important;
        color: #222 !important;

        font-size: 22px !important;
        line-height: 1;

        cursor: pointer;
    }


    /* Hide duplicate desktop filter heading on mobile */

    .cpc-filter-heading {
        display: none !important;
    }


    /* Products */

    .cpc-products-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .cpc-product-image-link {
        aspect-ratio: 1.5 / 1;
    }

    .cpc-product-content {
        padding: 0 14px 16px;
    }

    .cpc-product-title {
        font-size: 19px;
    }

    .cpc-product-description {
        min-height: auto;
        font-size: 14px;
    }

    .cpc-products-top {
        margin-bottom: 15px;
    }

    .cpc-product-count {
        font-size: 12px;
    }


    /* Pagination */

    .cpc-pagination {
        gap: 5px;
    }

    .cpc-page-btn {
        width: 34px;
        height: 34px;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        line-height: 1 !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }


    /* Slightly taller collection pills on mobile */

    .cpc-collection-filter {
        padding: 12px 16px;
    }


    /* =========================================================
       MOBILE STICKY FILTER FOOTER
    ========================================================= */

    .cpc-mobile-filter-footer {
        display: flex !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;

        align-items: center;
        justify-content: space-between;
        gap: 12px;

        padding: 16px 20px;

        border-top: 1px solid #ddd;
        background: #fff;

        position: relative;
        z-index: 5;
    }

    /* Mobile "Clear all filters" — orange pill */
    .cpc-mobile-clear-link {
        border: 1px solid #f69320 !important;
        padding: 10px 16px !important;
        border-radius: 30px !important;
        background: #f69320 !important;
        color: #fff !important;
        font-size: 14px;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease;
    }

    .cpc-mobile-clear-link:hover {
        background: #d97b0e !important;
        border-color: #d97b0e !important;
        color: #fff !important;
    }

    .cpc-show-results-btn {
        flex: 1 1 auto;

        border: 0;
        padding: 13px 20px;
        border-radius: 30px;

        background: #f69320;
        color: #fff;

        font-size: 15px;
        font-weight: 600;
        text-align: center;

        cursor: pointer;
        transition: background 0.2s ease;
    }

    .cpc-show-results-btn:hover {
        background: #d97b0e;
    }

}


/* =========================================================
   SMALL MOBILE
   <= 480px
========================================================= */

@media (max-width: 480px) {

    .cpc-product-catalogue {
        padding-left: 12px;
        padding-right: 12px;
    }

    .cpc-product-title {
        font-size: 18px;
    }

    .cpc-product-description {
        font-size: 13px;
    }

    .cpc-page-btn {
        width: 32px;
        height: 32px;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        line-height: 1 !important;
        text-align: center !important;
        box-sizing: border-box !important;
        font-size: 12px;
    }

    /* Footer buttons — compact on very small screens */
    .cpc-mobile-clear-link {
        padding: 9px 12px !important;
        font-size: 13px !important;
    }

    .cpc-show-results-btn {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }

}


/* =========================================================
   DESKTOP PRODUCT CATALOGUE FIX
   (Guarded with explicit resets so it never leaks into mobile)
========================================================= */

@media (min-width: 768px) {

    .cpc-product-catalogue .cpc-container {
        width: 100% !important;
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .cpc-product-catalogue .cpc-catalogue-layout {
        display: grid !important;
        grid-template-columns: 245px minmax(0, 1fr) !important;
        column-gap: 35px !important;
        width: 100% !important;
        align-items: start !important;
    }

    .cpc-product-catalogue .cpc-sidebar {
        display: block !important;
        width: 245px !important;
        min-width: 245px !important;
        max-width: 245px !important;
        grid-column: 1 !important;

        /* Explicit resets — protects against mobile rule leaks */
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        box-shadow: none !important;
        transition: none !important;
        z-index: auto !important;
    }

    .cpc-product-catalogue .cpc-products-area {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        grid-column: 2 !important;
    }

    .cpc-product-catalogue .cpc-products-grid {
        display: grid !important;
        width: 100% !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 22px 20px !important;
    }

    .cpc-product-catalogue .cpc-product-card {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    /* Explicitly hide mobile-only elements on desktop */
    .cpc-mobile-filter-footer,
    .cpc-mobile-filter-btn,
    .cpc-mobile-filter-header {
        display: none !important;
    }

}


/* =========================================================
   FILTER OVERLAY
========================================================= */

/* Desktop + Tablet */
.cpc-filter-overlay {
    display: none !important;
}


/* Mobile only */
@media (max-width: 767px) {

    .cpc-filter-overlay {
        position: fixed !important;

        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;

        z-index: 99998 !important;

        display: none !important;

        width: 100vw !important;
        height: 100vh !important;

        margin: 0 !important;
        padding: 0 !important;

        background: rgba(0, 0, 0, 0.45) !important;
    }

    .cpc-filter-overlay.open {
        display: block !important;
    }

}


/* =========================================================
   PAGINATION ALIGNMENT FIX
========================================================= */

.cpc-page-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
    vertical-align: middle !important;
}

@media (max-width: 767px) {
    .cpc-page-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        line-height: 1 !important;
        text-align: center !important;
    }
}


/* =========================================================
   ALL BUTTON COLORS — UNIFIED ORANGE #f69320
========================================================= */

/* ---------- Desktop "Clear all filters" button ---------- */
#cpc-clear-filters,
.cpc-filter-heading #cpc-clear-filters,
.cpc-product-catalogue .cpc-filter-heading button#cpc-clear-filters,
.cpc-product-catalogue .cpc-filter-heading button {
    background: #f69320 !important;
    background-color: #f69320 !important;
    border: 1px solid #f69320 !important;
    color: #ffffff !important;
    padding: 8px 14px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

#cpc-clear-filters:hover,
.cpc-filter-heading #cpc-clear-filters:hover,
.cpc-product-catalogue .cpc-filter-heading button#cpc-clear-filters:hover,
.cpc-product-catalogue .cpc-filter-heading button:hover {
    background: #d97b0e !important;
    background-color: #d97b0e !important;
    border-color: #d97b0e !important;
    color: #ffffff !important;
}


/* ---------- Mobile "Clear all filters" button (footer) ---------- */
#cpc-clear-filters-mobile,
.cpc-mobile-filter-footer #cpc-clear-filters-mobile,
.cpc-product-catalogue .cpc-mobile-clear-link,
.cpc-product-catalogue .cpc-mobile-filter-footer button.cpc-mobile-clear-link {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #ffffff !important;
    color: #747474 !important;
    padding: 10px 16px !important;
    border-radius: 30px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

#cpc-clear-filters-mobile:hover,
.cpc-mobile-filter-footer #cpc-clear-filters-mobile:hover,
.cpc-product-catalogue .cpc-mobile-clear-link:hover,
.cpc-product-catalogue .cpc-mobile-filter-footer button.cpc-mobile-clear-link:hover {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: #fff !important;
    color: #747474 !important;
}


/* ---------- Collection buttons ---------- */
.cpc-collection-filter {
    background: #FFFFFF !important;
    border: 1px solid #d6d6d6 !important;
    color: #423f3d !important;
    border-radius: 30px !important;
}

.cpc-collection-filter:hover,
.cpc-collection-filter.active {
    background: #f69320 !important;
    border-color: #f69320 !important;
    color: #fff !important;
}


/* ---------- Mobile Filter button ---------- */
.cpc-mobile-filter-btn {
    background: #f69320 !important;
    border-color: #f69320 !important;
    color: #fff !important;
}

.cpc-mobile-filter-btn:hover {
    background: #d97b0e !important;
    border-color: #d97b0e !important;
    color: #fff !important;
}


/* ---------- Show Results button (mobile footer) ---------- */
.cpc-show-results-btn {
        background: #105CAA !important;
    background-color: #105CAA !important;
    border: 1px solid #105CAA !important;
    color: #ffffff !important;
    padding: 10px 16px !important;
    border-radius: 30px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, border-color 0.2s
}

.cpc-show-results-btn:hover {
    background: #d97b0e !important;
    border-color: #d97b0e !important;
    color: #fff !important;
}


/* ---------- Pagination buttons — default state ---------- */
.cpc-page-btn {
    background-color: #fff !important;
    border: 1px solid #dfe3e8 !important;
    color: #000 !important;
    width: 60px!important;
}

/* Pagination — active + hover state */
.cpc-page-btn:hover:not(:disabled),
.cpc-page-btn.active {
    background-color: #f69320 !important;
    border: 1px solid #f69320 !important;
    color: #fff !important;
    width:60px!important;
}

/* Pagination — disabled */
.cpc-page-btn.disabled,
.cpc-page-btn:disabled {
    background: #eee !important;
    border-color: #e0e0e0 !important;
    color: #aaa !important;
    width: 60px!important;
}