﻿/* WooCommerce product loop overrides */

.woocommerce ul.products,
.woocommerce-page ul.products,
ul.products.columns-1,
ul.products.columns-2,
ul.products.columns-3,
ul.products.columns-4,
ul.products.columns-5,
ul.products.columns-6,
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px !important;
    padding: 20px !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    list-style: none !important;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    clear: none !important;
    text-align: left !important;
}

.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link,
.woocommerce ul.products li.product > a:not(.cpc-product-image a):not(.cpc-view-product-btn),
.woocommerce ul.products li.product > .button,
.woocommerce ul.products li.product > .price,
.woocommerce ul.products li.product > h2,
.woocommerce ul.products li.product > h3,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-category__title,
.woocommerce ul.products li.product .star-rating,
.woocommerce ul.products li.product .onsale,
.woocommerce ul.products li.product .price {
    display: none !important;
}

.woocommerce ul.products li.product .cpc-product-price .price {
    display: inline !important;
}

/* Home product section tabs */

.cpc-home-product-sections {
    max-width: 1400px;
    margin: 0 auto 36px;
}

.cpc-home-section-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 auto 22px;
    padding: 0 20px;
}

.cpc-home-section-tab {
    border: 1px solid #e8e2d4;
    background: #ffffff;
    color: #333333;
    min-width: 112px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cpc-home-section-tab:hover,
.cpc-home-section-tab.active {
    border-color: #FDB913;
    background: #FDB913;
    color: #000000;
    box-shadow: 0 5px 14px rgba(253, 185, 19, 0.3);
    transform: translateY(-1px);
}

.cpc-home-section-panel {
    display: none;
}

.cpc-home-section-panel.active {
    display: block;
}


.cpc-home-product-sections ul.products,
.woocommerce .cpc-home-product-sections ul.products,
.woocommerce-page .cpc-home-product-sections ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 30px !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.cpc-home-product-sections ul.products li.product,
.woocommerce .cpc-home-product-sections ul.products li.product,
.woocommerce-page .cpc-home-product-sections ul.products li.product {
    width: 100% !important;
    max-width: none !important;
    float: none !important;
    margin: 0 !important;
}
.cpc-home-section-empty {
    text-align: center;
    color: #777777;
    padding: 30px 20px;
    margin: 0;
}

/* Custom product card */

.cpc-product-card,
.woocommerce ul.products li.product.cpc-product-card,
.woocommerce-page ul.products li.product.cpc-product-card {
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100% !important;
}

.cpc-product-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

.cpc-product-card-inner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.cpc-product-badges {
    position: absolute;
    top: 10px;
    left: 0;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    padding-right: 8px;
}

.cpc-product-badge {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #000000;
    background-color: #FDB913;
    clip-path: polygon(0 0, 100% 0, 95% 50%, 100% 100%, 0 100%);
}

.cpc-badge-new-arrivals {
    background-color: #2F80ED;
    color: #ffffff;
}

.cpc-badge-back-in-stock {
    background-color: #FDB913;
    color: #000000;
}

.cpc-badge-popular {
    background-color: #1a1a4d;
    color: #ffffff;
}

.cpc-badge-on-sale {
    background-color: #dc3545;
    color: #ffffff;
}

.cpc-product-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.cpc-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cpc-product-code {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 15px;
    text-align: center;
}

.cpc-quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
}

.cpc-qty-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #333333;
    background: #ffffff;
    border-radius: 4px;
    font-size: 20px;
    font-weight: 700;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cpc-qty-btn:hover {
    background: #333333;
    color: #ffffff;
    border-color: #333333;
}

.cpc-qty-btn:active {
    transform: scale(0.95);
}

.cpc-qty-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    background: #ffffff;
}

.cpc-product-title {
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    margin: 0 0 15px 0;
    text-align: center;
    line-height: 1.4;
    min-height: 40px;
}

.cpc-product-title a {
    color: #666666;
    text-decoration: none;
}

.cpc-product-title a:hover {
    color: #333333;
}

.cpc-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 8px;
    text-align: center;
}

.cpc-stock-status-text {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.cpc-stock-status-text.in-stock-text {
    color: #28a745;
}

.cpc-stock-status-text.unavailable-text {
    color: #dc3545;
}

.cpc-stock-quantity {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #FFF9E6;
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    min-width: 80px;
}

.cpc-stock-number {
    font-size: 16px;
    font-weight: 700;
    color: #333333;
    line-height: 1.2;
}

.cpc-stock-icon {
    font-size: 20px;
    line-height: 1;
}

.cpc-product-actions {
    width: 100%;
    margin-bottom: 12px;
}

.cpc-add-to-cart-btn,
.cpc-out-of-stock-btn,
.cpc-view-product-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
}

.cpc-add-to-cart-btn,
.cpc-view-product-btn {
    background-color: #FDB913;
    color: #000000;
}

.cpc-add-to-cart-btn:hover,
.cpc-view-product-btn:hover {
    background-color: #E5A711;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 185, 19, 0.4);
}

.cpc-out-of-stock-btn {
    background-color: #1a1a4d;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 0.9;
}

.cpc-add-to-favourites {
    width: 100%;
    margin-top: auto;
}

.cpc-favourite-btn {
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;
    border: 2px solid #333333;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cpc-favourite-btn:hover {
    background: #f8f8f8;
    border-color: #000000;
}

.cpc-favourite-btn.active {
    background: #ffe6e6;
    border-color: #dc3545;
}

.cpc-heart-icon {
    font-size: 16px;
    color: #333333;
}

.cpc-favourite-btn.active .cpc-heart-icon {
    color: #dc3545;
}

.cpc-favourite-text {
    font-size: 12px;
    font-weight: 600;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cpc-product-card-accent {
    height: 4px;
    background: linear-gradient(90deg, #FDB913 0%, #FFD700 100%);
    margin-top: 0;
    width: 100%;
}

.cpc-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333333;
    color: #ffffff;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.cpc-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive layout */

@media (max-width: 768px) {
    .woocommerce ul.products,
    ul.products,
    .cpc-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
        gap: 20px !important;
        padding: 15px !important;
    }

    .cpc-product-card-inner {
        padding: 15px;
    }

    .cpc-product-image {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .woocommerce ul.products,
    ul.products,
    .cpc-products-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* Homepage product section layout override */
.cpc-home-product-sections {
    width: min(1400px, calc(100vw - 40px)) !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.cpc-home-product-sections .cpc-home-section-panel.active ul.products,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 30px !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 20px !important;
}

.cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    float: none !important;
    margin: 0 !important;
}

@media (max-width: 1024px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px !important;
        padding: 15px !important;
    }
}

@media (max-width: 480px) {
    .cpc-home-product-sections {
        width: calc(100vw - 24px) !important;
    }

    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* Homepage product section compact flex layout override */
.cpc-home-product-sections .cpc-home-section-panel.active ul.products,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    gap: 28px !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px 0 !important;
}

.cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
    flex: 0 0 calc((100% - 84px) / 4) !important;
    width: calc((100% - 84px) / 4) !important;
    max-width: calc((100% - 84px) / 4) !important;
    min-width: 0 !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cpc-home-product-sections .cpc-product-card,
.woocommerce .cpc-home-product-sections ul.products li.product.cpc-product-card,
.woocommerce-page .cpc-home-product-sections ul.products li.product.cpc-product-card {
    height: 100% !important;
}

@media (max-width: 1024px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
        flex-basis: calc((100% - 56px) / 3) !important;
        width: calc((100% - 56px) / 3) !important;
        max-width: calc((100% - 56px) / 3) !important;
    }
}

@media (max-width: 768px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products {
        gap: 20px !important;
        padding: 15px 0 !important;
    }

    .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
        flex-basis: calc((100% - 20px) / 2) !important;
        width: calc((100% - 20px) / 2) !important;
        max-width: calc((100% - 20px) / 2) !important;
    }
}

@media (max-width: 480px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Homepage pagination and tighter spacing */
.cpc-home-products-page {
    display: none !important;
}

.cpc-home-products-page.active {
    display: block !important;
}

.cpc-home-product-sections .cpc-home-section-panel.active ul.products,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products {
    gap: 18px !important;
    max-width: 1180px !important;
    padding: 18px 0 !important;
}

.cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
    flex: 0 0 calc((100% - 54px) / 4) !important;
    width: calc((100% - 54px) / 4) !important;
    max-width: calc((100% - 54px) / 4) !important;
}

.cpc-home-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px auto 0;
    padding: 0 0 10px;
}

.cpc-home-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #e3dfd4;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cpc-home-page-btn:hover,
.cpc-home-page-btn.active {
    border-color: #FDB913;
    background: #FDB913;
    color: #000000;
}

.cpc-badge-popular {
    display: none !important;
}

@media (max-width: 1024px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
        flex-basis: calc((100% - 36px) / 3) !important;
        width: calc((100% - 36px) / 3) !important;
        max-width: calc((100% - 36px) / 3) !important;
    }
}

@media (max-width: 768px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products {
        gap: 16px !important;
    }

    .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
        flex-basis: calc((100% - 16px) / 2) !important;
        width: calc((100% - 16px) / 2) !important;
        max-width: calc((100% - 16px) / 2) !important;
    }
}

@media (max-width: 480px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Ensure only the current homepage page is visible */
.cpc-home-product-sections .cpc-home-section-panel.active ul.products.cpc-home-products-page:not(.active),
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products.cpc-home-products-page:not(.active),
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products.cpc-home-products-page:not(.active) {
    display: none !important;
}

.cpc-home-product-sections .cpc-home-section-panel.active ul.products.cpc-home-products-page.active,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products.cpc-home-products-page.active,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products.cpc-home-products-page.active {
    display: flex !important;
}

/* Product image zoom and adaptive right-side list layout */
.cpc-home-product-sections {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 36px 0 !important;
    padding: 0 !important;
}

.cpc-home-section-tabs {
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 0 18px 0 !important;
}

.cpc-home-product-sections .cpc-home-section-panel.active ul.products,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
.cpc-home-product-sections ul.products,
.woocommerce .cpc-home-product-sections ul.products,
.woocommerce-page .cpc-home-product-sections ul.products {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 10px 0 18px 0 !important;
    justify-content: flex-start !important;
}

.cpc-home-product-sections .cpc-home-section-panel.active ul.products.cpc-home-products-page.active,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products.cpc-home-products-page.active,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products.cpc-home-products-page.active {
    display: grid !important;
}

.cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
.woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product,
.woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product {
    width: 100% !important;
    max-width: none !important;
    flex: initial !important;
}

.cpc-product-card-inner {
    padding: 16px !important;
}

.cpc-product-image-zoom {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpc-product-title span {
    color: #666666;
    text-decoration: none;
}

.cpc-view-product-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none !important;
    box-shadow: none !important;
}

body.cpc-lightbox-open {
    overflow: hidden;
}

.cpc-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.74);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.cpc-image-lightbox.active {
    opacity: 1;
}

.cpc-image-lightbox-content {
    position: relative;
    max-width: min(920px, 94vw);
    max-height: 92vh;
    padding: 22px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.cpc-image-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 76vh;
    object-fit: contain;
    margin: 0 auto;
}

.cpc-image-lightbox-title {
    margin-top: 12px;
    color: #333333;
    font-size: 14px;
    font-weight: 600;
}

.cpc-image-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #FDB913;
    color: #000000;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1200px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .cpc-home-product-sections ul.products,
    .woocommerce .cpc-home-product-sections ul.products,
    .woocommerce-page .cpc-home-product-sections ul.products {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 1024px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .cpc-home-product-sections ul.products,
    .woocommerce .cpc-home-product-sections ul.products,
    .woocommerce-page .cpc-home-product-sections ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .cpc-home-section-tabs {
        justify-content: center !important;
    }

    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .cpc-home-product-sections ul.products,
    .woocommerce .cpc-home-product-sections ul.products,
    .woocommerce-page .cpc-home-product-sections ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (max-width: 480px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .cpc-home-product-sections ul.products,
    .woocommerce .cpc-home-product-sections ul.products,
    .woocommerce-page .cpc-home-product-sections ul.products {
        grid-template-columns: 1fr !important;
    }

    .cpc-image-lightbox-content {
        padding: 14px;
    }
}
/* Fix image hover background and lightbox close button */
.cpc-product-image-zoom,
.cpc-product-image-zoom:hover,
.cpc-product-image-zoom:focus,
.cpc-product-image-zoom:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    color: inherit !important;
    transform: none !important;
}

.cpc-product-image-zoom img {
    pointer-events: none;
}

.cpc-product-image-zoom:focus-visible {
    outline: 2px solid #FDB913 !important;
    outline-offset: 3px !important;
}

.cpc-image-lightbox-close,
.cpc-image-lightbox-close:hover,
.cpc-image-lightbox-close:focus,
.cpc-image-lightbox-close:active {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 2 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #FDB913 !important;
    color: #000000 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 34px !important;
    text-align: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
    transform: none !important;
}

.cpc-image-lightbox-close:hover {
    background: #e5a711 !important;
}

.cpc-image-lightbox-content {
    padding-top: 56px !important;
}
/* Mobile catalogue layout: categories on top, products in two columns */
@media (max-width: 768px) {
    body.woocommerce-page #primary,
    body.woocommerce-page #main,
    body.woocommerce-page .site-main,
    body.woocommerce-page .content-area,
    body.woocommerce-page .site-content,
    body.woocommerce-page .container,
    body.woocommerce-page .row,
    body.woocommerce-page .elementor-container,
    body.woocommerce-page .elementor-row {
        max-width: 100% !important;
    }

    body.woocommerce-page .site-content,
    body.woocommerce-page .row,
    body.woocommerce-page .elementor-container,
    body.woocommerce-page .elementor-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    body.woocommerce-page #secondary,
    body.woocommerce-page .secondary,
    body.woocommerce-page .sidebar,
    body.woocommerce-page .widget-area,
    body.woocommerce-page aside,
    body.woocommerce-page .elementor-widget-sidebar,
    body.woocommerce-page .product-categories,
    body.woocommerce-page .widget_product_categories {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
        float: none !important;
        clear: both !important;
        margin: 0 0 12px 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }

    body.woocommerce-page #primary,
    body.woocommerce-page .primary,
    body.woocommerce-page .content-area,
    body.woocommerce-page .site-main,
    body.woocommerce-page .elementor-widget-shortcode,
    body.woocommerce-page .elementor-widget-woocommerce-products,
    body.woocommerce-page .woocommerce {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
        float: none !important;
        clear: both !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.woocommerce-page .widget_product_categories,
    body.woocommerce-page .elementor-widget-sidebar,
    body.woocommerce-page #secondary,
    body.woocommerce-page .sidebar,
    body.woocommerce-page .widget-area {
        overflow-x: hidden !important;
    }

    body.woocommerce-page .widget_product_categories ul,
    body.woocommerce-page .product-categories {
        max-height: 245px !important;
        overflow-y: auto !important;
    }

    .cpc-home-product-sections {
        width: 100% !important;
        margin-top: 0 !important;
    }

    .cpc-home-section-tabs {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        justify-content: stretch !important;
        align-items: stretch !important;
        margin: 8px 0 12px 0 !important;
        padding: 0 !important;
    }

    .cpc-home-section-tab {
        min-width: 0 !important;
        width: 100% !important;
        padding: 7px 5px !important;
        border-radius: 4px !important;
        font-size: 10px !important;
        white-space: nowrap !important;
    }

    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .cpc-home-product-sections ul.products,
    .woocommerce .cpc-home-product-sections ul.products,
    .woocommerce-page .cpc-home-product-sections ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .cpc-product-card,
    .woocommerce ul.products li.product.cpc-product-card,
    .woocommerce-page ul.products li.product.cpc-product-card {
        border-radius: 5px !important;
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08) !important;
    }

    .cpc-product-card-inner {
        padding: 10px 8px !important;
    }

    .cpc-product-badges {
        top: 6px !important;
        right: 6px !important;
        padding-right: 0 !important;
    }

    .cpc-product-badge {
        padding: 4px 8px !important;
        font-size: 8px !important;
        letter-spacing: 0.2px !important;
    }

    .cpc-product-image {
        height: 112px !important;
        margin-bottom: 8px !important;
    }

    .cpc-product-code {
        font-size: 10px !important;
        margin-bottom: 8px !important;
        word-break: break-word !important;
    }

    .cpc-quantity-controls {
        gap: 6px !important;
        margin-bottom: 8px !important;
    }

    .cpc-qty-btn {
        width: 26px !important;
        height: 24px !important;
        font-size: 14px !important;
        border-width: 1px !important;
    }

    .cpc-qty-input {
        width: 40px !important;
        height: 24px !important;
        font-size: 12px !important;
    }

    .cpc-product-title {
        font-size: 10px !important;
        min-height: 32px !important;
        margin-bottom: 8px !important;
        line-height: 1.35 !important;
    }

    .cpc-product-price {
        font-size: 12px !important;
        margin-bottom: 5px !important;
    }

    .cpc-stock-status-text {
        font-size: 9px !important;
        margin-bottom: 6px !important;
    }

    .cpc-stock-quantity {
        padding: 6px 8px !important;
        margin-bottom: 8px !important;
        min-width: 52px !important;
    }

    .cpc-stock-number {
        font-size: 10px !important;
    }

    .cpc-stock-icon {
        font-size: 13px !important;
    }

    .cpc-product-actions {
        margin-bottom: 8px !important;
    }

    .cpc-add-to-cart-btn,
    .cpc-out-of-stock-btn,
    .cpc-view-product-btn,
    .cpc-favourite-btn {
        min-height: 30px !important;
        padding: 7px 6px !important;
        font-size: 9px !important;
        letter-spacing: 0 !important;
        border-radius: 3px !important;
    }

    .cpc-favourite-btn {
        flex-direction: column !important;
        gap: 2px !important;
    }

    .cpc-heart-icon {
        font-size: 13px !important;
    }

    .cpc-favourite-text {
        font-size: 8px !important;
        line-height: 1.2 !important;
    }
}

@media (max-width: 480px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .cpc-home-product-sections ul.products,
    .woocommerce .cpc-home-product-sections ul.products,
    .woocommerce-page .cpc-home-product-sections ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
/* Mobile collapsible category list */
.cpc-mobile-category-toggle {
    display: none;
}

@media (max-width: 768px) {
    .cpc-mobile-category-ready {
        border: 1px solid #FDB913 !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        background: #ffffff !important;
        margin-bottom: 12px !important;
    }

    .cpc-mobile-category-ready > .widget-title,
    .cpc-mobile-category-ready > h2,
    .cpc-mobile-category-ready > h3,
    .cpc-mobile-category-ready > h4,
    .cpc-mobile-category-ready .elementor-heading-title {
        display: none !important;
    }

    .cpc-mobile-category-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        min-height: 42px !important;
        padding: 0 14px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #FDB913 !important;
        color: #000000 !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        text-align: left !important;
        cursor: pointer !important;
        box-shadow: none !important;
    }

    .cpc-mobile-category-toggle:hover,
    .cpc-mobile-category-toggle:focus,
    .cpc-mobile-category-toggle:active {
        background: #FDB913 !important;
        color: #000000 !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .cpc-mobile-category-arrow {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 22px !important;
        height: 22px !important;
        font-size: 18px !important;
        line-height: 1 !important;
        transition: transform 0.2s ease !important;
    }

    .cpc-mobile-category-ready:not(.cpc-mobile-category-collapsed) .cpc-mobile-category-arrow {
        transform: rotate(180deg) !important;
    }

    .cpc-mobile-category-ready.cpc-mobile-category-collapsed .product-categories,
    .cpc-mobile-category-ready.cpc-mobile-category-collapsed ul.product-categories,
    .cpc-mobile-category-ready.cpc-mobile-category-collapsed > ul,
    .cpc-mobile-category-ready.cpc-mobile-category-collapsed .widget_product_categories > ul {
        display: none !important;
    }

    .cpc-mobile-category-ready:not(.cpc-mobile-category-collapsed) .product-categories,
    .cpc-mobile-category-ready:not(.cpc-mobile-category-collapsed) ul.product-categories {
        display: block !important;
        max-height: 260px !important;
        overflow-y: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}
@media (max-width: 768px) {
    .cpc-mobile-category-original-title {
        display: none !important;
    }
}
/* Mobile product grid footer and pagination polish */
@media (max-width: 768px) {
    .cpc-home-product-sections {
        margin-bottom: 28px !important;
        padding-bottom: 18px !important;
    }

    .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products,
    .cpc-home-product-sections ul.products,
    .woocommerce .cpc-home-product-sections ul.products,
    .woocommerce-page .cpc-home-product-sections ul.products {
        align-items: stretch !important;
        padding-bottom: 12px !important;
    }

    .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product:last-child:nth-child(odd),
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product:last-child:nth-child(odd),
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product:last-child:nth-child(odd) {
        grid-column: 1 / -1 !important;
        width: calc(50% - 5px) !important;
        max-width: 178px !important;
        justify-self: center !important;
    }

    .cpc-home-pagination {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 7px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 14px 0 22px 0 !important;
        padding: 2px 2px 8px 2px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
        white-space: nowrap !important;
    }

    .cpc-home-pagination::-webkit-scrollbar {
        height: 4px !important;
    }

    .cpc-home-pagination::-webkit-scrollbar-thumb {
        background: #FDB913 !important;
        border-radius: 999px !important;
    }

    .cpc-home-page-btn {
        flex: 0 0 34px !important;
        min-width: 34px !important;
        width: 34px !important;
        height: 34px !important;
        padding: 0 !important;
        border-radius: 6px !important;
        font-size: 13px !important;
        line-height: 34px !important;
        text-align: center !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .cpc-home-page-btn.active {
        box-shadow: 0 3px 8px rgba(253, 185, 19, 0.35) !important;
    }
}

@media (max-width: 420px) {
    .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product:last-child:nth-child(odd),
    .woocommerce .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product:last-child:nth-child(odd),
    .woocommerce-page .cpc-home-product-sections .cpc-home-section-panel.active ul.products li.product:last-child:nth-child(odd) {
        max-width: calc((100vw - 30px) / 2) !important;
    }
}