/**
 * Wine-only card and single-product presentation.
 *
 * @package Annexe_Customizations
 */

/*
 * Wine cards show only the stored grape varieties, so the text stays secondary
 * to the name and price. No clamp is applied: a blend must never be truncated.
 */
ul.products li.product.aco-wine-card .ast-woo-shop-product-description {
	margin: 0.45rem 0 0;
	font-size: 0.88em;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

ul.products li.product.aco-wine-card .ast-woo-shop-product-description p {
	margin: 0;
}

body.single-product.aco-wine-product .aco-wine-details {
	clear: both;
	width: 100%;
	max-width: 1000px;
	box-sizing: border-box;
	margin: 0 auto;
	padding: 0;
	border-top: 0;
}

body.single-product.aco-wine-product .aco-wine-details__title {
	display: none;
}

body.single-product.aco-wine-product .aco-wine-details__group--main > .aco-wine-details__group-title {
	display: none;
}

body.single-product.aco-wine-product .aco-wine-details__groups {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem 2rem;
}

body.single-product.aco-wine-product .aco-wine-details__group--main {
	grid-column: 1 / -1;
}

body.single-product.aco-wine-product .aco-wine-details__group-title {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
	line-height: 1.3;
}

body.single-product.aco-wine-product .aco-wine-details__list {
	margin: 0;
}

body.single-product.aco-wine-product .aco-wine-details__row {
	display: grid;
	grid-template-columns: minmax(9rem, 0.35fr) minmax(0, 1fr);
	gap: 0.75rem;
	margin: 0;
	padding: 0.65rem 0;
	border-top: 0;
}

body.single-product.aco-wine-product .aco-wine-details__row dt,
body.single-product.aco-wine-product .aco-wine-details__row dd {
	margin: 0;
	overflow-wrap: anywhere;
}

body.single-product.aco-wine-product .aco-wine-details__row dt {
	font-weight: 600;
}

body.single-product.aco-wine-product .aco-wine-details__row dd {
	min-width: 0;
}

/*
 * Elementor's WooCommerce Product Content widget is the active product
 * description renderer on this site. Keep a fallback for descriptions
 * persisted before the wrapper markup was available.
 */
body.single-product.aco-wine-product .elementor-widget-woocommerce-product-content {
	clear: both;
	width: 100%;
	max-width: 1000px;
	box-sizing: border-box;
	margin: 1.5rem auto 0;
	padding: 0;
	border-top: 0;
}

body.single-product.aco-wine-product .elementor-widget-woocommerce-product-content .elementor-widget-container > h3:first-child {
	display: none;
}

body.single-product.aco-wine-product .elementor-widget-woocommerce-product-content .elementor-widget-container > h4 {
	margin: 1.5rem 0 0.75rem;
	font-size: 1.1rem;
	line-height: 1.3;
}

body.single-product.aco-wine-product .elementor-widget-woocommerce-product-content .elementor-widget-container > p {
	display: grid;
	grid-template-columns: minmax(9rem, 0.35fr) minmax(0, 1fr);
	gap: 0.75rem;
	margin: 0;
	padding: 0.65rem 0;
	border-top: 1px solid rgba(173, 182, 190, 0.45);
}

body.single-product.aco-wine-product .elementor-widget-woocommerce-product-content .elementor-widget-container > p strong {
	font-weight: 600;
}

body.single-product.aco-wine-product {
	overflow-x: hidden;
}

/*
 * Keep the complete bottle visible in the existing Elementor gallery.
 * The source images are tall bottle portraits; width: 100% makes them
 * several viewport heights tall on the single-product template.
 */
body.single-product.aco-wine-product .woocommerce-product-gallery__wrapper,
body.single-product.aco-wine-product .woocommerce-product-gallery__image,
body.single-product.aco-wine-product .woocommerce-product-gallery__image > a {
	display: flex;
	justify-content: center;
	width: 100%;
	height: auto;
}

body.single-product.aco-wine-product .woocommerce-product-gallery__image > a {
	align-items: flex-start;
}

body.single-product.aco-wine-product .woocommerce-product-gallery__image img {
	display: block;
	flex: 0 0 auto;
	align-self: center;
	width: auto !important;
	max-width: 100%;
	height: auto !important;
	max-height: min(70vh, 720px);
	object-fit: contain;
}

/*
 * On mobile, put the existing gallery before the existing purchase column,
 * then place the existing wine information after the purchase widgets.
 */
@media (max-width: 767px) {
	body.single-product.aco-wine-product .elementor-element-77e0a13b {
		order: -1;
	}

	body.single-product.aco-wine-product .elementor-element-513c6a9 > .elementor-element-5570bac2 {
		order: 1;
	}

	body.single-product.aco-wine-product .elementor-element-513c6a9 > .elementor-element-38219c65 {
		order: 2;
	}

	body.single-product.aco-wine-product .elementor-element-513c6a9 > .elementor-element-31d2331c {
		order: 3;
	}

	body.single-product.aco-wine-product .elementor-element-513c6a9 > .elementor-element-2c005afe {
		order: 4;
	}

	body.single-product.aco-wine-product .woocommerce-product-gallery__image img {
		max-height: 420px;
	}
}

@media (max-width: 921px) {
	body.single-product.aco-wine-product .aco-wine-details {
		margin-top: 0;
	}

	body.single-product.aco-wine-product .aco-wine-details__groups {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}

	body.single-product.aco-wine-product .aco-wine-details__group--main {
		grid-column: auto;
	}

	body.single-product.aco-wine-product .elementor-widget-woocommerce-product-content {
		margin-top: 1.5rem;
	}
}

@media (max-width: 544px) {
	body.single-product.aco-wine-product .aco-wine-details {
		padding-top: 0;
	}

	body.single-product.aco-wine-product .aco-wine-details__row {
		display: block;
	}

	body.single-product.aco-wine-product .aco-wine-details__row dt {
		margin-bottom: 0.25rem;
	}

	body.single-product.aco-wine-product .elementor-widget-woocommerce-product-content {
		padding-top: 0;
	}

	body.single-product.aco-wine-product .elementor-widget-woocommerce-product-content .elementor-widget-container > p {
		display: block;
	}

	body.single-product.aco-wine-product .elementor-widget-woocommerce-product-content .elementor-widget-container > p strong {
		display: block;
		margin-bottom: 0.25rem;
	}
}
