/**
 * Вирівнювання кнопок у сітці товарів (Astra + WooCommerce).
 */

.woocommerce ul.products li.product {
	display: flex;
	flex-direction: column;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
}

/* Зона під фото: кнопки на одній лінії з сусідніми картками */
.superlady-shop-thumb-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 0.75rem;
	width: 100%;
	margin-top: 0.5rem;
	padding-top: 0;
	box-sizing: border-box;
	position: relative;
	z-index: 6;
}

.superlady-shop-thumb-actions__buy {
	width: 100%;
}

.superlady-shop-thumb-actions .button,
.superlady-shop-thumb-actions .added_to_cart,
.superlady-shop-thumb-actions .sl-one-click-trigger {
	margin: 0 !important;
	vertical-align: middle;
}

.superlady-shop-thumb-actions__buy .button,
.superlady-shop-thumb-actions__buy .added_to_cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	text-align: center;
}

/* Кнопка з батьківського superlady-one-click.php (.sl-one-click-trigger) */
.superlady-shop-thumb-actions .sl-one-click-wrap--archive {
	margin: 0;
	width: 100%;
}

.superlady-shop-thumb-actions .sl-one-click-wrap--archive .sl-one-click-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* "Купити в 1 клік" — ніжний фіолетовий */
.sl-one-click-trigger.button {
	background-color: #c4a8f0 !important;
	color: #3b1d82 !important;
	border-color: #c4a8f0 !important;
}
.sl-one-click-trigger.button:hover,
.sl-one-click-trigger.button:focus {
	background-color: #b091e8 !important;
	border-color: #b091e8 !important;
	color: #3b1d82 !important;
}

/* Квадратні мініатюри товарів — однакова висота у всіх картках */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap > a {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap > a img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

/* Текстова частина картки займає решту висоти рядка */
.woocommerce ul.products li.product .astra-shop-summary-wrap {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding-top: 0.75rem;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap .ast-on-card-button:not(.ast-onsale-card) {
	display: none !important;
}


@media (max-width: 544px) {
	.woocommerce ul.products li.product .astra-shop-summary-wrap {
		padding-top: 0.5rem;
	}
}

/* Hide Astra "& Free Shipping" text on product pages and product cards */
.ast-shipping-text { display: none !important; }

/* Constrain product images in WooCommerce Blocks (homepage, Elementor, Gutenberg)
   to prevent oversized images from breaking grid layouts */
.wc-block-grid__product-image,
.wc-block-product-image,
.wp-block-woocommerce-product-collection .wc-block-product-image,
.woocommerce ul.products li.product > a:first-child {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.wc-block-grid__product-image img,
.wc-block-product-image img,
.wp-block-woocommerce-product-collection .wc-block-product-image img,
.woocommerce ul.products li.product > a:first-child img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
}

/* Sidebar: subcategory links — purple (depth-1 and deeper) */
.wc-block-product-categories-list--depth-1 a,
.wc-block-product-categories-list--depth-2 a,
.widget_product_categories .product-categories .children a {
    color: #7c3aed !important;
}
.wc-block-product-categories-list--depth-1 a:hover,
.wc-block-product-categories-list--depth-2 a:hover,
.widget_product_categories .product-categories .children a:hover {
    color: #6e42c1 !important;
}

/* Super Lady: sale price color */
.woocommerce-js .price ins,
.woocommerce-js .price ins .woocommerce-Price-amount,
.woocommerce-js .price ins .woocommerce-Price-amount bdi,
.woocommerce-js .price ins .woocommerce-Price-currencySymbol,
.woocommerce .wc-block-components-product-price ins,
.woocommerce .wc-block-components-product-price ins .woocommerce-Price-amount,
.woocommerce .wc-block-components-product-price ins .woocommerce-Price-amount bdi,
.woocommerce .wc-block-components-product-price ins .woocommerce-Price-currencySymbol {
    color: #aa0856 !important;
}
