/* --- DESKTOP VIEW FIX --- */
@media screen and (min-width: 992px) {
    body.header-image-active .site-header,
    body.custom-background .site-header,
    .header-layout-1, .header-layout-2, .header-layout-3,
    .aft-custom-header, 
    div[style*="background-image"] {
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        aspect-ratio: 1900 / 600 !important; 
        background-size: 100% 100% !important; 
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }
}

/* --- MOBILE & TABLET VIEW FIX --- */
@media screen and (max-width: 991px) {
    body.header-image-active .site-header,
    body.custom-background .site-header,
    .header-layout-1, .header-layout-2, .header-layout-3,
    .aft-custom-header, 
    div[style*="background-image"] {
        /* Forces mobile to also lock into the correct image shape */
        aspect-ratio: 1900 / 600 !important;
        background-size: contain !important; /* Prevents top/bottom cropping */
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }
}

ss
@media (max-width: 768px) {
    .aft-post-share-wrap, 
    .social-share-links, 
    .entry-share {
        display: none !important;
    }
}


/* CFL Past Champions Banner Grid */

.wp-block-gallery.cfl-champions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px !important;
}

.wp-block-gallery.cfl-champions > .wp-block-image {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    min-width: 0;
}

.cfl-champions .wp-block-image img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Mobile layout */

@media (max-width: 767px) {
    .wp-block-gallery.cfl-champions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px !important;
    }
}

/* Hide Past Champions featured image only */
.page-id-1031 .post-thumbnail,
.page-id-1031 .entry-header .featured-image {
    display: none !important;
}


/* Hide product counts on team shop tiles */
.woocommerce ul.products li.product-category mark.count {
    display: none !important;
}

/* Center team names */
.woocommerce ul.products li.product-category h2 {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
}

/* Add consistent padding around team logos */
.woocommerce ul.products li.product-category img {
    box-sizing: border-box;
    padding: 20px;
}


/* Remove sidebar from WooCommerce pages */
body.woocommerce #secondary,
body.woocommerce-cart #secondary,
body.woocommerce-checkout #secondary {
    display: none !important;
}

/* Expand WooCommerce content to full width */
body.woocommerce #primary,
body.woocommerce-cart #primary,
body.woocommerce-checkout #primary {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none !important;
}


/* CFL Shop - Mobile Franchise Directory */
@media (max-width: 767px) {

    body.woocommerce-shop ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    body.woocommerce-shop ul.products li.product-category {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
        box-sizing: border-box !important;
    }

    body.woocommerce-shop ul.products li.product-category a {
        display: flex !important;
        flex-direction: column;
        height: 100%;
    }

    body.woocommerce-shop ul.products li.product-category img {
        width: 100% !important;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        padding: 15px !important;
        margin: 0 !important;
    }

    body.woocommerce-shop ul.products li.product-category h2 {
        font-size: 14px !important;
        line-height: 1.3 !important;
        min-height: 55px;
        margin: 0 !important;
        padding: 10px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        flex-grow: 1;
    }

    body.woocommerce-shop ul.products::before,
    body.woocommerce-shop ul.products::after {
        display: none !important;
    }
}


/* CFL Team Stores - Mobile Product Grid */
@media (max-width: 767px) {
    body.tax-product_cat ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    body.tax-product_cat ul.products::before,
    body.tax-product_cat ul.products::after {
        display: none !important;
    }

    body.tax-product_cat ul.products li.product {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        float: none !important;
        box-sizing: border-box !important;
    }
}
