/*
 * Public-facing minimal styles for the Shop/Archive "Customise" button.
 */

/* 1. Loop Button Layout (Standard) */
.scf-loop-buttons-wrapper--blocks {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.5rem;
	align-items: stretch;
	justify-content: flex-start;
	margin: 0.35rem 0 0 0;
}

.scf-loop-buttons-wrapper--blocks > .wp-block-button,
.scf-loop-buttons-wrapper--blocks > .scf-loop-customise-wrap {
	align-self: stretch;
	margin: 0 !important;
	flex: 1 1 0;
	min-width: 0;
	width: auto !important;
}

.scf-loop-buttons-wrapper--blocks .scf-loop-customise-form {
	margin: 0;
	display: none;
}

.scf-loop-buttons-wrapper--blocks .wc-block-components-product-button__button,
.scf-loop-buttons-wrapper--blocks .scf-loop-customise-btn {
	margin-bottom: 0 !important;
	width: 100% !important;
	box-sizing: border-box;
}

@media (max-width: 480px) {
	.scf-loop-buttons-wrapper--blocks {
		flex-wrap: wrap;
		justify-content: center;
	}
	.scf-loop-buttons-wrapper--blocks > .wp-block-button,
	.scf-loop-buttons-wrapper--blocks > .scf-loop-customise-wrap {
		flex: 1 1 100%;
	}
}

.scf-loop-buttons-wrapper--classic {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: center;
	margin: 0.35rem 0 1rem 0;
}

.scf-loop-buttons-wrapper--classic .scf-loop-customise-btn {
	margin: 0;
}

.scf-loop-customise-btn[disabled],
.scf-loop-customise-btn.disabled,
.scf-loop-customise-btn[aria-disabled="true"] {
	opacity: 0.55;
	cursor: not-allowed;
	pointer-events: none;
}

/* * 2. Uniform Product Card Layout 
 * These rules only apply if the "Enforce uniform layout" setting is enabled 
 */
body.scf-card-layout-active.woocommerce-shop .wc-block-components-product-loop__item,
body.scf-card-layout-active.post-type-archive-product .wc-block-components-product-loop__item,
body.scf-card-layout-active.tax-product_cat .wc-block-components-product-loop__item,
body.scf-card-layout-active.tax-product_tag .wc-block-components-product-loop__item,
body.scf-card-layout-active.woocommerce-shop .wc-block-components-product-grid__item,
body.scf-card-layout-active.post-type-archive-product .wc-block-components-product-grid__item,
body.scf-card-layout-active.tax-product_cat .wc-block-components-product-grid__item,
body.scf-card-layout-active.tax-product_tag .wc-block-components-product-grid__item {
	display: flex;
	flex-direction: column;
	height: 100%;
}

body.scf-card-layout-active.woocommerce-shop .wp-block-woocommerce-product-price,
body.scf-card-layout-active.post-type-archive-product .wp-block-woocommerce-product-price,
body.scf-card-layout-active.tax-product_cat .wp-block-woocommerce-product-price,
body.scf-card-layout-active.tax-product_tag .wp-block-woocommerce-product-price,
body.scf-card-layout-active.woocommerce-shop .wc-block-components-product-price,
body.scf-card-layout-active.post-type-archive-product .wc-block-components-product-price,
body.scf-card-layout-active.tax-product_cat .wc-block-components-product-price,
body.scf-card-layout-active.tax-product_tag .wc-block-components-product-price {
	margin-top: 0.25rem !important;
	margin-bottom: 0 !important;
}

body.scf-card-layout-active.woocommerce-shop .wp-block-woocommerce-product-button,
body.scf-card-layout-active.post-type-archive-product .wp-block-woocommerce-product-button,
body.scf-card-layout-active.tax-product_cat .wp-block-woocommerce-product-button,
body.scf-card-layout-active.tax-product_tag .wp-block-woocommerce-product-button,
body.scf-card-layout-active.woocommerce-shop .wc-block-components-product-button,
body.scf-card-layout-active.post-type-archive-product .wc-block-components-product-button,
body.scf-card-layout-active.tax-product_cat .wc-block-components-product-button,
body.scf-card-layout-active.tax-product_tag .wc-block-components-product-button {
	margin-top: 0.35rem !important;
	margin-bottom: 0 !important;
}

/* Clamp titles to 3 lines and reserve the same space on every card. */
body.scf-card-layout-active.woocommerce-shop .wc-block-components-product-title__link,
body.scf-card-layout-active.post-type-archive-product .wc-block-components-product-title__link,
body.scf-card-layout-active.tax-product_cat .wc-block-components-product-title__link,
body.scf-card-layout-active.tax-product_tag .wc-block-components-product-title__link,
body.scf-card-layout-active.woocommerce-shop .wp-block-post-title a,
body.scf-card-layout-active.post-type-archive-product .wp-block-post-title a,
body.scf-card-layout-active.tax-product_cat .wp-block-post-title a,
body.scf-card-layout-active.tax-product_tag .wp-block-post-title a {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	line-height: 1.25;
	max-height: 3.75em;
}

body.scf-card-layout-active.woocommerce-shop .wc-block-components-product-title,
body.scf-card-layout-active.post-type-archive-product .wc-block-components-product-title,
body.scf-card-layout-active.tax-product_cat .wc-block-components-product-title,
body.scf-card-layout-active.tax-product_tag .wc-block-components-product-title,
body.scf-card-layout-active.woocommerce-shop .wp-block-post-title,
body.scf-card-layout-active.post-type-archive-product .wp-block-post-title,
body.scf-card-layout-active.tax-product_cat .wp-block-post-title,
body.scf-card-layout-active.tax-product_tag .wp-block-post-title {
	margin-bottom: 0.15rem !important;
	min-height: 3.75em;
}
/* =========================================================
   2. Uniform Images (Block Themes & Classic)
   Forces images to a square (1:1) aspect ratio so the grid aligns.
   ========================================================= */

/* Block Themes (WooCommerce Blocks) */
body.scf-card-layout-active .wc-block-grid__product-image img,
body.scf-card-layout-active .wc-block-components-product-image img,
/* Classic Themes */
body.scf-card-layout-active ul.products li.product a img,
body.scf-card-layout-active .woocommerce-loop-product__link img {
    aspect-ratio: 1 / 1;  /* Forces a perfect square */
    width: 100%;
    height: auto;
    object-fit: cover;    /* Crops the image so it fills the square without squashing */
}

/* =========================================================
   COLOR FAMILY — CUSTOMISE BUTTON
   ========================================================= */
.scf-loop-buttons-wrapper--blocks .scf-loop-customise-btn,
.scf-loop-buttons-wrapper--classic .scf-loop-customise-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 12px 18px;
	border: 1px solid #5BC2B3 !important;
	border-radius: 6px;
	background: #5BC2B3 !important;
	color: #000 !important;
	font-family: Poppins, Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.scf-loop-buttons-wrapper--blocks .scf-loop-customise-btn:hover,
.scf-loop-buttons-wrapper--classic .scf-loop-customise-btn:hover {
	border-color: #C0EBDC !important;
	background: #C0EBDC !important;
	color: #000 !important;
	transform: translateY(-1px);
}

.scf-loop-customise-btn:focus-visible {
	outline: 2px solid #5BC2B3;
	outline-offset: 2px;
}

/* Optional: If you prefer Portrait (tall) images, change 1 / 1 to 3 / 4 */
