/* Classic Transfers responsive layout corrections — v1.0.9.
 * @desc Shared gutters, WooCommerce product grids and wrapping purchase controls.
 * This file is loaded after the original WPCode-derived styles.
 */
:root { --ct-page-gutter: 150px; }

/* Catalogue image: retain the original spacing-10 padding and round its visible image area. */
.ct-category-products .wp-block-woocommerce-product-image.catalogue-product-image,
.ct-category-products .wp-block-woocommerce-product-image.catalogue-product-image img {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.ct-category-products .wp-block-woocommerce-product-image.catalogue-product-image {
    box-sizing: border-box;
    overflow: hidden;
}

/* Product-card price and action must be able to wrap within the card. */
.ct-category-products .wp-block-post-template .wp-block-group.is-content-justification-space-between,
.ct-category-products .wp-block-post-template .wp-block-group.is-layout-flex {
    flex-wrap: wrap;
    min-width: 0;
}
.ct-category-products .wp-block-woocommerce-product-button {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: var(--wp--preset--spacing--10, 10px);
}
.ct-category-products .wp-block-woocommerce-product-button a,
.single-product .wp-block-woocommerce-related-products .wp-block-woocommerce-product-button a {
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Do not change the working header/mobile navigation breakpoints. */
@media (min-width: 601px) and (max-width: 1100px) {
    :root { --ct-page-gutter: 32px; }
    .ct-category-products .wp-block-post-template,
    .single-product .products-block-post-template {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .ct-category-products .wp-block-post-template > *,
    .single-product .products-block-post-template > * { min-width: 0; }
    .ct-single-product-main { padding-left: 32px !important; padding-right: 32px !important; }
    .ct-standard-page-content { padding-left: 32px !important; padding-right: 32px !important; }
}
@media (max-width: 600px) {
    :root { --ct-page-gutter: 16px; }
    .ct-category-products .wp-block-post-template,
    .single-product .products-block-post-template {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .ct-single-product-main { padding-left: 16px !important; padding-right: 16px !important; }
    .ct-standard-page-content { padding-left: 16px !important; padding-right: 16px !important; }
}
/* Apply the common gutters to template wrappers that use literal desktop padding.
 * Inline block styles require !important at responsive widths.
 */
@media (max-width: 1100px) {
    .wp-site-blocks > .wp-block-cover[style*="padding-left:150px"],
    .wp-site-blocks > .wp-block-group[style*="padding-left:150px"],
    .wp-site-blocks > main.wp-block-group[style*="padding-left:150px"],
    .wp-site-blocks > .wp-block-group .wp-block-group[style*="padding-left:150px"] {
        padding-left: var(--ct-page-gutter) !important;
        padding-right: var(--ct-page-gutter) !important;
    }
    .ct-category-products { min-width: 0; }
}

/* Template-specific blocks can be nested below the root wrapper. Scope to the
 * affected WooCommerce screens rather than changing arbitrary custom sections. */
@media (max-width: 1100px) {
    body.search .wp-site-blocks .wp-block-group[style*="padding-left:150px"],
    body.search .wp-site-blocks .wp-block-cover[style*="padding-left:150px"],
    body.tax-product_cat .wp-site-blocks .wp-block-group[style*="padding-left:150px"],
    body.tax-product_cat .wp-site-blocks .wp-block-cover[style*="padding-left:150px"],
    body.single-product .wp-site-blocks .wp-block-group[style*="padding-left:150px"],
    body.single-product .wp-site-blocks .wp-block-cover[style*="padding-left:150px"] {
        padding-left: var(--ct-page-gutter) !important;
        padding-right: var(--ct-page-gutter) !important;
    }
}

/* Preserve desktop gutters on landing-page content; never pad full-bleed hero covers. */
@media (min-width: 1101px) {
    .ct-standard-page-content { padding-left: 150px !important; padding-right: 150px !important; }
}
/* Make landing-page hero actions usable at narrow widths. */
@media (max-width: 1100px) {
    .ct-hobby-hero .wp-block-group.is-layout-flex { flex-wrap: wrap !important; }
    .ct-hobby-hero .wp-block-button__link { max-width: 100%; white-space: normal; }
}
