/* =========================================================
   PRODUCTS GROUPED BY SUBCATEGORY
   ========================================================= */

.serp-category-product-list {
    width: 100%;
    margin: 35px 0;
}

.serp-category-product-section {
    margin-bottom: 55px;
}

.serp-category-product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.serp-category-heading-wrap {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.serp-category-product-heading {
    margin: 0;
    padding: 0;
    color: #171717;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
    text-transform: uppercase;
    word-break: break-word;
}

.serp-category-product-count {
    flex-shrink: 0;
    color: #777777;
    font-size: 14px;
    font-weight: 600;
}

.serp-category-header-link {
    flex-shrink: 0;
    color: #d7532f !important;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-decoration: none !important;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.25s ease;
}

.serp-category-header-link:hover {
    color: #b33e20 !important;
}

/* Product grid */

.serp-category-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 26px;
    align-items: stretch;
}

.serp-category-products-grid.columns-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.serp-category-products-grid.columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.serp-category-products-grid.columns-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.serp-category-products-grid.columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.serp-category-products-grid.columns-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.serp-category-products-grid.columns-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* Product card */

.serp-category-product-card {
    min-width: 0;
    height: 100%;
    margin: 0;
}

.serp-category-product-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 14px;
    overflow: hidden;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 22px;
    color: inherit;
    text-decoration: none !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.serp-category-product-link:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
}

/*
 * This is the clickable image/title/price wrapper.
 * The Add to Cart button remains outside this anchor.
 */
.serp-category-product-main-link {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    color: inherit !important;
    text-decoration: none !important;
}

.serp-category-product-main-link:hover {
    color: inherit !important;
    text-decoration: none !important;
}

/* Product image */

.serp-category-product-image-wrap {
    position: relative;
    width: 100%;
    height: 215px;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 16px;
    background: #111111;
}

.serp-category-product-image,
.serp-category-product-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.serp-category-product-link:hover .serp-category-product-image,
.serp-category-product-link:hover .serp-category-product-image-wrap img {
    transform: scale(1.06);
}

/* Main image badge */

.serp-category-product-badge {
    position: absolute;
    top: 13px;
    left: 13px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - 26px);
    padding: 7px 12px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 999px;
    background: #d7532f;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.3px;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Sale badge */

.serp-category-sale-badge {
    position: absolute;
    right: 13px;
    bottom: 13px;
    z-index: 3;
    padding: 7px 11px;
    border-radius: 999px;
    background: #ffffff;
    color: #d7532f;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
}

/* Product card content */

.serp-category-product-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px 2px 10px;
    text-align: center;
}

.serp-category-product-title {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin: 0;
    padding: 0;
    color: #171717;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 800;
    text-transform: uppercase;
    word-break: break-word;
}

.serp-category-product-price {
    min-height: 25px;
    margin-top: 8px;
    color: #171717;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
}

.serp-category-product-price del {
    margin-right: 5px;
    color: #999999;
    font-size: 13px;
    opacity: 1;
}

.serp-category-product-price ins {
    color: #d7532f;
    text-decoration: none;
}

/* Add to Cart area */

.serp-category-product-cart {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    padding: 0 2px 2px;
}

/*
 * Supports:
 * Add to cart
 * Select options
 * Read more
 * Buy product
 */
.serp-category-product-cart .button,
.serp-category-product-cart .serp-category-product-button {
    display: flex !important;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 34px;
    margin: 0 !important;
    padding: 7px 14px !important;
    box-sizing: border-box;

    border: 2px solid #111111 !important;
    border-radius: 999px !important;

    background: #ffffff !important;
    color: #111111 !important;

    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0.7px;
    text-align: center;
    text-decoration: none !important;
    text-transform: uppercase;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease;
}

.serp-category-product-cart .button:hover,
.serp-category-product-cart .button:focus,
.serp-category-product-cart .serp-category-product-button:hover,
.serp-category-product-cart .serp-category-product-button:focus {
    border-color: #111111 !important;
    background: #111111 !important;
    color: #ffffff !important;
}



/* WooCommerce AJAX loading state */

.serp-category-product-cart .button.loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.serp-category-product-cart .button.loading::after {
    position: static;
    margin-left: 8px;
}

/* WooCommerce added-to-cart link */

.serp-category-product-cart .added_to_cart {
    display: block;
    margin-top: 9px;
    color: #d7532f !important;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    text-decoration: none !important;
    text-transform: uppercase;
}

.serp-category-product-cart .added_to_cart:hover {
    color: #b33e20 !important;
}

/* Side-cart plugin compatibility */

.serp-category-product-cart .xoo-wsc-btn,
.serp-category-product-cart .xoo-wsc-ft-btn {
    width: 100%;
}

/* Empty category message */

.serp-category-products-message {
    margin: 15px 0;
    padding: 14px 18px;
    border-left: 4px solid #d7532f;
    background: #f8f8f8;
    color: #444444;
    font-size: 15px;
}

/* Product title */

.serp-category-product-title {
    display: block;
    min-height: 0;
    margin: 0 0 4px;
    color: #111111;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 800;
    text-align: left;
    text-transform: none;
}

/* Brand */

.serp-category-product-brand {
    margin-bottom: 15px;
    color: #252525;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 400;
    text-align: left;
}

/* Race/type */

.serp-category-product-races {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 5px;
    color: #252525;
    font-size: 12px;
    line-height: 1.3;
    text-align: left;
}

.serp-category-product-race {
    display: inline-block;
}

/* Cannabinoids */

.serp-category-product-cannabinoids {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
    min-height: 17px;
    margin-bottom: 5px;
    color: #252525;
    font-size: 10px;
    line-height: 1.35;
    text-align: left;
}

.serp-cannabinoid {
    display: inline-block;
}

.serp-cannabinoid-primary {
    font-weight: 800;
}

/* Price */

.serp-category-product-price {
    min-height: 21px;
    margin-top: 0;
    margin-bottom: 8px;
    color: #666666;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 400;
    text-align: left;
}

/* Keep all cards aligned */

.serp-category-product-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 10px 0 8px;
    text-align: left;
}

/* Add button remains at card bottom */

.serp-category-product-cart {
    margin-top: auto;
}

/* Tablet */

@media (max-width: 991px) {
    .serp-category-products-grid,
    .serp-category-products-grid.columns-3,
    .serp-category-products-grid.columns-4,
    .serp-category-products-grid.columns-5,
    .serp-category-products-grid.columns-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px;
    }

    .serp-category-product-heading {
        font-size: 25px;
    }

    .serp-category-product-image-wrap {
        height: 210px;
    }
}

/* Mobile */

@media (max-width: 575px) {
    .serp-category-product-list {
        margin: 25px 0;
    }

    .serp-category-product-section {
        margin-bottom: 38px;
    }

    .serp-category-product-header {
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .serp-category-heading-wrap {
        flex: 1;
        min-width: 0;
    }

    .serp-category-product-heading {
        font-size: 18px;
        line-height: 1.25;
    }

    /*
     * Keep View All Products visible on mobile.
     */
    .serp-category-header-link {
        display: inline-block;
        max-width: 95px;
        padding-top: 3px;
        font-size: 10px;
        line-height: 1.25;
        letter-spacing: 0.4px;
        text-align: right;
        white-space: normal;
    }

    .serp-category-product-count {
        display: none;
    }

    .serp-category-products-grid,
    .serp-category-products-grid.columns-2,
    .serp-category-products-grid.columns-3,
    .serp-category-products-grid.columns-4,
    .serp-category-products-grid.columns-5,
    .serp-category-products-grid.columns-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 13px;
    }

    .serp-category-product-link {
        padding: 9px;
        border-radius: 16px;
    }

    .serp-category-product-image-wrap {
        height: 145px;
        border-radius: 12px;
    }

    .serp-category-product-badge {
        top: 9px;
        left: 9px;
        max-width: calc(100% - 18px);
        padding: 6px 9px;
        font-size: 8px;
    }

    .serp-category-sale-badge {
        right: 8px;
        bottom: 8px;
        padding: 5px 8px;
        font-size: 8px;
    }

    .serp-category-product-body {
        padding: 13px 1px 8px;
    }

    .serp-category-product-title {
        min-height: 38px;
        font-size: 12px;
        line-height: 1.3;
    }

    .serp-category-product-price {
        min-height: 20px;
        margin-top: 6px;
        font-size: 12px;
    }

    .serp-category-product-price del {
        display: block;
        margin-right: 0;
        font-size: 10px;
    }

    .serp-category-product-cart {
        padding: 0;
    }

    .serp-category-product-cart .button,
    .serp-category-product-cart .serp-category-product-button {
        min-height: 30px;
        padding: 6px 8px !important;
        font-size: 9px !important;
        line-height: 1 !important;
        letter-spacing: 0.4px;
    }

    .serp-category-product-cart .added_to_cart {
        margin-top: 6px;
        font-size: 9px;
    }
}

/* Very small screens */

@media (max-width: 380px) {
    .serp-category-products-grid,
    .serp-category-products-grid.columns-2,
    .serp-category-products-grid.columns-3,
    .serp-category-products-grid.columns-4,
    .serp-category-products-grid.columns-5,
    .serp-category-products-grid.columns-6 {
        grid-template-columns: 1fr !important;
    }

    .serp-category-product-image-wrap {
        height: 210px;
    }

    .serp-category-product-title {
        font-size: 14px;
    }

    .serp-category-product-cart .button,
    .serp-category-product-cart .serp-category-product-button {
        font-size: 11px !important;
    }
}