/**
 * Single artwork — reference layout: two columns on wide screens (image | details), stacked on small.
 * Art Galleria: product-image.php (.col-md-6) + summary → .ag-artworkdetails (JS); modal lives between them in DOM.
 */

body.single-product #primary.content-area,
body.single-product #main.site-main {
	width: 100%;
	max-width: none;
}

body.single-product .woocommerce {
	box-sizing: border-box;
	max-width: none;
}

body.single-product div.product {
	position: relative;
	width: 100%;
	max-width: 100%;
}

/* Sale badge over the product block (WC outputs before gallery column) */
body.single-product div.product > span.onsale {
	position: absolute;
	z-index: 3;
	top: 1rem;
	left: 1rem;
	margin: 0;
}

/* ----- Mobile: single column, rule between blocks ----- */
body.single-product div.product {
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

body.single-product div.product > .col-md-6,
body.single-product div.product > .summary,
body.single-product div.product > .ag-artworkdetails {
	float: none !important;
	width: 100% !important;
	max-width: 58rem !important;
	margin-left: auto !important;
	margin-right: auto !important;
	clear: both;
}

body.single-product div.product #main-img img,
body.single-product div.product .a-artworks img.img-responsive {
	display: block;
	width: 100%;
	height: auto;
}

body.single-product div.product #main-img img.ag-artwork-placeholder {
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: linear-gradient(145deg, #f3f3f1, #e8e8e4);
	max-height: min(90vh, 72rem);
	margin-inline: auto;
}

body.single-product div.product > .summary,
body.single-product div.product > .ag-artworkdetails {
	border-top: 1px solid rgba(0, 0, 0, 0.14);
	padding-top: clamp(1.25rem, 3vw, 2rem);
	margin-top: clamp(1.25rem, 3vw, 2rem);
}

/* ----- Desktop: two equal columns ----- */
@media (min-width: 992px) {
	body.single-product div.product {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: clamp(1.5rem, 3vw, 2.75rem);
		row-gap: clamp(1.25rem, 2vw, 2rem);
		align-items: start;
		max-width: min(120rem, 100%);
		margin-inline: auto;
		padding-inline: clamp(1rem, 2vw, 2rem);
		box-sizing: border-box;
	}

	/*
	 * Gallery column: first .col-md-6 only (AG JS adds .col-md-6 to the summary column too).
	 * Details: .summary before JS runs; .ag-artworkdetails after JS renames the summary box.
	 */
	body.single-product div.product > .col-md-6:not(.ag-artworkdetails) {
		grid-column: 1;
		grid-row: 1;
		width: 100% !important;
		max-width: none !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	body.single-product div.product > .summary.entry-summary,
	body.single-product div.product > .ag-artworkdetails {
		grid-column: 2;
		grid-row: 1;
		width: 100% !important;
		max-width: none !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		border-top: none !important;
		padding-top: 0 !important;
		margin-top: 0 !important;
	}

	/*
	 * Modal, scripts, hidden inputs, etc. sit between the two columns in the DOM — span full width
	 * so they don’t occupy a phantom grid column. Do not hide <link rel="stylesheet"> (AG loads artwork CSS).
	 */
	body.single-product div.product > *:not(.col-md-6):not(.summary):not(.ag-artworkdetails):not(span.onsale) {
		grid-column: 1 / -1;
	}

	body.single-product div.product > #ag-enquiry .modal-dialog {
		position: relative;
		width: auto;
		max-width: 560px;
		margin: 0;
	}
}

/*
 * Enquiry modal: Bootstrap JS/CSS are not bundled with Twenty Twenty — keep overlay out of flow.
 * Open state uses .in (Bootstrap 3) or .show (Bootstrap 4+); toggled from small script in functions.php.
 */
body.single-product #ag-enquiry.modal {
	position: fixed !important;
	inset: 0;
	z-index: 100050;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.45);
	overflow-y: auto;
	margin: 0 !important;
}

body.single-product #ag-enquiry.modal.in,
body.single-product #ag-enquiry.modal.show {
	display: flex !important;
}

body.single-product #ag-enquiry .modal-content {
	background: #fff;
	max-height: 90vh;
	overflow-y: auto;
}

/* Inner spacing: AG / animated-gallery modal resets can zero Bootstrap padding */
/* body.single-product #ag-enquiry .modal-header {
	padding: 1.25rem 1.5rem 1rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
} */

.modal-header .modal-title {
	padding: 0 3rem;
}


body.single-product #ag-enquiry .modal-body {
	padding: 3rem;
}

body.single-product #ag-enquiry .modal-header .close {
	margin-top: -0.25rem;
	padding: 2rem;
}

body.single-product #ag-enquiry .modal-body .wpcf7 {
	margin: 0;
}

/* Typography & meta */
body.single-product .product_meta {
	text-align: left;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}

body.single-product .product_meta .cat-name {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: clamp(1.4rem, 2.2vw, 1.75rem);
	line-height: 1.25;
	margin: 0 0 0.35em;
	border: 0;
	padding: 0;
}

body.single-product .product_meta .a-title {
	font-style: italic;
	font-weight: 400;
	font-size: clamp(1.35rem, 2vw, 1.65rem);
	line-height: 1.35;
	margin: 0 0 0.85em;
	border: 0;
	padding: 0;
}

body.single-product .product_meta .ag-field-ag_dimensions,
body.single-product .product_meta .ag-field-ag_framed_dimensions,
body.single-product .product_meta .ag-field-ag_medium_text {
	display: block;
	font-size: 1em;
	line-height: 1.45;
	margin: 0 0 0.35em;
	font-weight: 400;
}

body.single-product .product_meta .ag-field-description {
	display: block;
	margin-top: 1.25rem;
	font-size: 1em;
	line-height: 1.6;
	max-width: none;
}

body.single-product .product_meta .ag-field-description p {
	margin: 0 0 1em;
}

body.single-product .product_meta .price-span,
body.single-product .product_meta .price {
	margin-top: 0.75rem;
	margin-bottom: 0.35rem;
}

body.single-product .product_meta .financing-text,
body.single-product .product_meta .financing-price {
	display: block;
	font-size: 0.95em;
	margin-top: 0.35rem;
}

/* View more artworks — no bullets */
body.single-product .ag-bottomnav ul {
	list-style: none !important;
	margin: 0.5rem 0 0;
	padding-left: 0 !important;
}

body.single-product .ag-bottomnav li {
	display: inline-block;
	margin: 0.35rem 1.25rem 0 0;
	padding-left: 0;
}

body.single-product .product_meta .glyph {
	display: none;
}

/* Cart + enquire */
body.single-product .product_meta .cart {
	margin-top: 1.25rem;
}

body.single-product .product_meta .ag-btn-enquire,
body.single-product .product_meta .btn.ag-btn {
	display: inline-block;
	margin-top: 0.75rem;
	padding: 0.65em 1.25em;
	border: 1px solid rgba(0, 0, 0, 0.35);
	background: transparent;
	font-family: inherit;
	font-size: 1em;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

body.single-product .product_meta .ag-btn-enquire:hover,
body.single-product .product_meta .btn.ag-btn:hover {
	border-color: rgba(0, 0, 0, 0.65);
}

/* Prev / next */
body.single-product .product_meta .row.m-t-50 {
	margin-top: clamp(2rem, 4vw, 3rem) !important;
	clear: both;
}

body.single-product .product_meta .ag-previous img,
body.single-product .product_meta .ag-next img {
	max-height: 2.5rem;
	width: auto;
}
