/*
 * Product card — shop, category and single-product loops.
 * Approved design ("Boutique Lifestyle"): borderless card, rounded 4:5
 * image, centered type, Playfair Display titles, Montserrat body,
 * always-visible matte-gold "Add to Cart" button.
 * Markup/data comes entirely from inc/product-card.php and native
 * WooCommerce/Kadence loop hooks — this file is presentation only.
 */

/* One card gap for every product grid: 32px desktop, 24px tablet, 16px phone. */
:root {
	--wpr-grid-gap: 32px;
}

@media (max-width: 1024px) {
	:root {
		--wpr-grid-gap: 24px;
	}
}

@media (max-width: 767px) {
	:root {
		--wpr-grid-gap: 16px;
	}
}

.wc-block-product-template {
	gap: var(--wpr-grid-gap);
}

/* WooCommerce sizes its columns for its own 1.25em gap, so the widths follow the gap above. */
.wc-block-product-template.is-flex-container.is-flex-container.columns-2 > li {
	width: calc((100% - var(--wpr-grid-gap)) / 2);
}

.wc-block-product-template.is-flex-container.is-flex-container.columns-3 > li {
	width: calc((100% - 2 * var(--wpr-grid-gap)) / 3);
}

.wc-block-product-template.is-flex-container.is-flex-container.columns-4 > li {
	width: calc((100% - 3 * var(--wpr-grid-gap)) / 4);
}

.wc-block-product-template__responsive.columns-2 {
	grid-template-columns: repeat(auto-fill, minmax(max(140px, calc((100% - var(--wpr-grid-gap)) / 2)), 1fr));
}

.wc-block-product-template__responsive.columns-3 {
	grid-template-columns: repeat(auto-fill, minmax(max(140px, calc((100% - 2 * var(--wpr-grid-gap)) / 3)), 1fr));
}

.wc-block-product-template__responsive.columns-4 {
	grid-template-columns: repeat(auto-fill, minmax(max(140px, calc((100% - 3 * var(--wpr-grid-gap)) / 4)), 1fr));
}

/*
 * Responsive grids keep two cards per row on 360px phones: WooCommerce's
 * 150px minimum card width needs 316px, which those screens don't have.
 */

/* Carousels: no list indent from the content styles, and on phones about one and a half cards, so the button text fits. */
.entry-content .wc-block-product-template.is-product-collection-layout-carousel {
	padding-left: 0;
}

@container carousel (max-width: 479px) {
	.wc-block-product-template.is-product-collection-layout-carousel .wc-block-product {
		min-width: 60%;
	}
}

/* A product grid that ends its section adds no margin; the section's own padding sets the gap. */
.entry-content .wp-block-woocommerce-product-collection:last-child {
	margin-bottom: 0;
}

/*
 * Same values as the block-grid rules further down this file, so
 * Shop/category cards and the Home page's block-based cards read as one
 * design, not two. box-shadow is explicitly zeroed (not just omitted):
 * Kadence's parent theme applies its own card shadow to
 * `.entry.loop-entry` — a class this element also carries — so leaving
 * the property out lets that default resurface.
 */
.woocommerce ul.products li.product {
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}

.woocommerce ul.products li.product .product-details {
	/* Kadence's parent theme also pads and side-margins this element
	   (`.entry-content-wrap`) on its own via a same-specificity selector
	   in woocommerce.min.css — !important needed to actually win the tie,
	   same reasoning as the shop-filter-tabs overrides in style.css. */
	padding: 16px 0 0 !important;
	margin: 0 !important;
	background: transparent;
	text-align: center;
}

.woocommerce ul.products li.product .product-details .woocommerce-loop-product__title {
	font-family: 'Playfair Display', serif;
	font-size: 18px;
	font-weight: 700;
	color: var(--global-palette3);
}

.woocommerce ul.products li.product .product-details .price {
	font-family: 'Montserrat', sans-serif;
	font-weight: 600;
	color: var(--global-palette3);
}

.woocommerce ul.products li.product .product-details .price del {
	color: var(--wpr-muted);
	font-weight: 400;
	opacity: 1;
}

.woocommerce div.product .summary .price del {
	color: var(--wpr-muted);
	opacity: 1;
}

.woocommerce ul.products li.product .product-details .price ins {
	text-decoration: none;
}

/* Classic cards (related products) keep the block cards' rhythm: 16px from price to button. Matches Kadence's selectors so it wins. */
.woocommerce ul.products.woo-archive-btn-button li.product .product-details .price {
	margin-bottom: 16px;
}

.woocommerce ul.products.align-buttons-bottom li.product .product-action-wrap {
	padding-top: 0;
}

.woocommerce ul.products li.product span.onsale {
	background: var(--global-palette3);
	color: var(--global-palette2);
	border: 1px solid var(--global-palette2);
	border-radius: 0;
	min-width: 0;
	min-height: 0;
	width: auto;
	line-height: 1;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 6px 12px;
	top: 14px;
	left: 14px;
	right: auto;
}

.wpr-card-eyebrow {
	font-family: 'Montserrat', sans-serif;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wpr-gold-text);
	margin: 0 0 4px;
}

.woocommerce ul.products li.product .product-action-wrap .button {
	display: block;
	width: 100%;
	box-sizing: border-box;
	background: var(--global-palette-btn-bg);
	color: var(--global-palette-btn);
	border-radius: var(--wpr-btn-radius);
	text-align: center;
	transition: background 200ms ease, color 200ms ease;
}

.woocommerce ul.products li.product .product-action-wrap .button:hover {
	background: var(--global-palette-btn-bg-hover);
	color: var(--global-palette-btn-hover);
}

.woocommerce ul.products li.product .woocommerce-loop-image-link {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	border-radius: 18px;
	background: var(--global-palette7);
}

.woocommerce ul.products li.product .woocommerce-loop-image-link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.woocommerce ul.products li.product:hover .woocommerce-loop-image-link img {
	transform: scale(1.035);
}

/*
 * Block-based product grids (Product Collection, On Sale Products,
 * Hand-picked Products, Featured Category) render through WooCommerce's
 * own block markup, not the classic loop template above — different
 * classes, same brand system. These cards don't carry the eyebrow line,
 * because WooCommerce's block renderer has no hook point for it.
 *
 * Card shape: a deliberate, scoped exception to the site's sharp-corner
 * language (hero imagery, header elements all stay 0-radius). The
 * rounded image and button are one shared pattern reused everywhere a
 * WooCommerce grid renders — Shop, category archives, Home — so there's
 * one card design to maintain, not a per-page one-off. Flat and static
 * — no shadow, no lift on hover; only the product image zooms slightly.
 */

.wc-block-product-template .wc-block-product,
.wc-block-grid__product {
	/* Same Kadence `.entry.loop-entry` collision as the classic loop
	   card above — these blocks carry that class too. Its inline style
	   loads after this stylesheet at equal selector specificity, so
	   box-shadow needs !important to actually win (same reasoning as
	   the shop-filter-tabs overrides in style.css). */
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	box-shadow: none !important;
}

.wc-block-product-template .wc-block-components-product-image,
.wc-block-grid .wc-block-grid__product-link {
	overflow: hidden;
	aspect-ratio: 4 / 5;
	border-radius: 18px;
	background: var(--global-palette7);
}

.wc-block-product-template .wc-block-components-product-image > a {
	display: block;
	height: 100%;
}

.wc-block-product-template .wc-block-components-product-image img,
.wc-block-grid .wc-block-grid__product-link img {
	/* !important: the Product Image block writes its own square
	   aspect-ratio and object-fit onto this <img> as an inline style. */
	width: 100%;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: cover !important;
	transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.wc-block-product-template .wc-block-product:hover .wc-block-components-product-image img,
.wc-block-grid .wc-block-grid__product:hover .wc-block-grid__product-link img {
	transform: scale(1.035);
}

.wc-block-product-template .wp-block-post-title,
.wc-block-grid__product-title {
	font-family: 'Playfair Display', serif;
	font-size: 18px;
	font-weight: 700;
	color: var(--global-palette3);
	text-align: center;
	margin: 16px 0 8px;
}

/* Card rhythm: image, 16px, title, 8px, price, 16px, button. The image sets the first step, so cards without a title keep it. */
.wc-block-product-template .wc-block-components-product-image {
	margin-bottom: 16px;
}

.wc-block-product-template .wp-block-post-title {
	margin-top: 0;
}

.wc-block-product-template .wp-block-woocommerce-product-price .wc-block-components-product-price {
	margin-bottom: 0;
}

.wc-block-product-template .wp-block-woocommerce-product-price,
.wc-block-grid__product-price {
	font-family: 'Montserrat', sans-serif;
	font-weight: 600;
	color: var(--global-palette3);
	text-align: center;
}

.wc-block-product-template .wp-block-woocommerce-product-price del,
.wc-block-grid__product-price del {
	color: var(--wpr-muted);
	font-weight: 400;
	opacity: 1;
}

/* A short carousel row centres under its centred heading. "safe" keeps a
   row that scrolls reachable from its first card. */
.wc-block-product-template.is-product-collection-layout-carousel {
	justify-content: safe center;
}

/* The button sits at the card's foot, so a row of cards lines up. */
.wc-block-product-template .wc-block-product,
.wc-block-grid__product {
	display: flex;
	flex-direction: column;
}

.wc-block-product-template .wp-block-woocommerce-product-price,
.wc-block-grid__product-price {
	margin-bottom: 16px;
}

/* Kadence's page-content margins outrank a two-class selector on normal pages. */
.wc-block-product-template .wc-block-product .wc-block-components-product-button,
.wc-block-grid__product-add-to-cart {
	margin-top: auto;
}

.wc-block-product-template .wc-block-components-product-button .wp-block-button__link,
.wc-block-grid .wc-block-grid__product .wc-block-grid__product-add-to-cart .wp-block-button__link {
	background: var(--global-palette-btn-bg);
	color: var(--global-palette-btn);
	border-radius: var(--wpr-btn-radius);
	width: 100%;
	display: block;
	box-sizing: border-box;
	text-align: center;
	transition: background 200ms ease, color 200ms ease;
}

.wc-block-product-template .wc-block-components-product-button .wp-block-button__link:hover,
.wc-block-grid .wc-block-grid__product .wc-block-grid__product-add-to-cart .wp-block-button__link:hover {
	background: var(--global-palette-btn-bg-hover);
	color: var(--global-palette-btn-hover);
}

.wc-block-grid .wc-block-grid__product .wc-block-grid__product-onsale,
.wc-block-components-product-image .wc-block-components-product-sale-badge {
	position: absolute;
	z-index: 1;
	background: var(--global-palette3);
	color: var(--global-palette2);
	border: 1px solid var(--global-palette2);
	border-radius: 0;
	min-width: 0;
	min-height: 0;
	width: auto;
	line-height: 1;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 6px 12px;
	top: 14px;
	left: 14px;
	right: auto;
}

/*
 * Empty Cart block grid. Kadence styles this grid with long selectors, one
 * with an id, so these match their length and padding needs !important.
 */
.wc-block-grid .wc-block-grid__products {
	align-items: stretch;
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product {
	position: relative;
	text-align: center;
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product-link {
	display: block;
	position: relative;
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product .entry-content-wrap {
	display: flex;
	flex: 1;
	flex-direction: column;
	margin: 0 !important;
	padding: 0 !important;
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-title {
	margin: 16px 0 8px;
	font-size: 18px;
}

/* The same card gap as the other grids; Kadence sets 8px on phones and 40px above. */
.wp-site-blocks .wc-block-grid.wc-block-grid:not(.has-1-columns) .wc-block-grid__products.wc-block-grid__products {
	gap: var(--wpr-grid-gap);
	margin-bottom: 0;
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-price {
	font-size: 16px;
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-price del {
	color: var(--wpr-muted);
	opacity: 1;
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-onsale {
	padding: 6px 12px;
	border: 1px solid var(--global-palette2);
	border-radius: 0;
	background: var(--global-palette3);
	color: var(--global-palette2);
	font-size: 11px;
	font-weight: 600;
	top: 14px;
	left: 14px;
	right: auto;
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-add-to-cart {
	width: 100%;
	margin: auto 0 0;
	padding: 0;
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product.woo-archive-btn-button .wc-block-grid__product-add-to-cart .wp-block-button__link {
	padding: 10px 16px;
	color: var(--global-palette-btn);
}

.wc-block-grid .wc-block-grid__products .wc-block-grid__product.woo-archive-btn-button .wc-block-grid__product-add-to-cart .wp-block-button__link:hover {
	color: var(--global-palette-btn-hover);
}
