/* Single product page. Loaded only when is_product(). Tokens from tokens.css.
   Overrides the _s woocommerce.css floats, so selectors carry .single-product for specificity. */

/* Breadcrumb + notices sit on the same container as the product */
.single-product .woocommerce-breadcrumb {
	max-width: var(--nhi-container); margin: 0 auto; box-sizing: border-box;
	padding: var(--nhi-space-5) var(--nhi-gutter) var(--nhi-space-2);
	font-size: var(--nhi-step--1); color: var(--nhi-muted);
}
.single-product .woocommerce-breadcrumb a { color: inherit; text-decoration: none; transition: color var(--nhi-dur) ease; }
.single-product .woocommerce-breadcrumb a:hover { color: var(--nhi-gold-ink); text-decoration: underline; }
.nhi-product-wrap { padding-block: var(--nhi-space-2) var(--nhi-space-8); }
.nhi-product-wrap .woocommerce-message,
.nhi-product-wrap .woocommerce-error,
.nhi-product-wrap .woocommerce-info {
	margin: 0 0 var(--nhi-space-5); padding: var(--nhi-space-3) var(--nhi-space-4); list-style: none;
	background: var(--nhi-cream); border-left: var(--nhi-rule) solid var(--nhi-gold); border-radius: var(--nhi-radius-sm);
}

/* Top: media + summary */
.single-product div.nhi-product { float: none; width: 100%; }
.nhi-product__top { display: grid; gap: var(--nhi-space-6); }
@media (min-width: 48em) {
	.nhi-product__top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--nhi-space-7); align-items: start; }
	.nhi-product__media { position: sticky; top: calc(var(--nhi-header-h) + var(--nhi-space-4)); }
}

/* Gallery */
.single-product div.nhi-product .woocommerce-product-gallery {
	float: none; width: 100%; margin: 0; opacity: 1 !important; /* WC hides it until JS runs, which delays LCP */
}
.single-product div.nhi-product .woocommerce-product-gallery__wrapper { margin: 0; }
.single-product div.nhi-product .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child) { display: none; } /* until slider starts */
.single-product div.nhi-product .woocommerce-product-gallery__image {
	background: var(--nhi-cream); border-radius: var(--nhi-radius); overflow: hidden;
	aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
	border: 1px solid var(--nhi-line);
}
.single-product div.nhi-product .woocommerce-product-gallery__image img {
	display: block; width: 100%; height: 100%; object-fit: contain;
}
/* aspect-ratio: while the slider starts it shows every slide stacked for a moment (Q6: 5,300 px tall), which threw the
   title, price and buttons off screen and back (PSI mobile CLS 0.44). Slides are square, so the viewport is too. */
.single-product div.nhi-product .flex-viewport {
	border-radius: var(--nhi-radius); overflow: hidden; border: 1px solid var(--nhi-line); aspect-ratio: 1;
}
.single-product div.nhi-product .flex-viewport .woocommerce-product-gallery__image { border: 0; } /* the viewport has the border */
.single-product div.nhi-product .flex-control-thumbs {
	display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--nhi-space-3);
	margin: var(--nhi-space-3) 0 0; padding: 0; list-style: none;
}
@media (min-width: 64em) {
	.single-product div.nhi-product .flex-control-thumbs { grid-template-columns: repeat(5, 1fr); }
}
/* Phones: the gallery sits above the title, price and buttons. The slider adds the thumbnails after the page has
   painted, which pushed everything below down (CLS 0.27 on Q6). So the thumbnails are one swipeable row
   (4.5 visible), and that row's height is reserved until the slider has built it. */
@media (max-width: 47.99em) {
	.single-product div.nhi-product .flex-control-thumbs {
		display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
	}
	.single-product div.nhi-product .flex-control-thumbs::-webkit-scrollbar { display: none; }
	.single-product div.nhi-product .flex-control-thumbs li {
		flex: 0 0 calc((100% - 4 * var(--nhi-space-3)) / 4.5); box-sizing: border-box; scroll-snap-align: start;
	}
	.single-product div.nhi-product .woocommerce-product-gallery:has(.woocommerce-product-gallery__image + .woocommerce-product-gallery__image):not(:has(.flex-control-thumbs)) {
		padding-bottom: calc(var(--nhi-space-3) + (100% - 4 * var(--nhi-space-3)) / 4.5);
	}
}
.single-product div.nhi-product .flex-control-thumbs li {
	float: none !important; width: auto !important; margin: 0 !important; clear: none !important;
	aspect-ratio: 1; background: var(--nhi-cream); border-radius: var(--nhi-radius-sm);
	overflow: hidden; border: 1.5px solid transparent; transition: border-color var(--nhi-dur) ease;
}
.single-product div.nhi-product .flex-control-thumbs img {
	display: block; width: 100%; height: 100%; object-fit: contain;
	border-radius: var(--nhi-radius-sm); opacity: 0.65; cursor: pointer;
	transition: opacity var(--nhi-dur) ease;
}
.single-product div.nhi-product .flex-control-thumbs li:hover,
.single-product div.nhi-product .flex-control-thumbs img.flex-active {
	border-color: var(--nhi-gold);
}
.single-product div.nhi-product .flex-control-thumbs img.flex-active,
.single-product div.nhi-product .flex-control-thumbs img:hover {
	opacity: 1;
}
.single-product div.nhi-product .woocommerce-product-gallery__trigger {
	top: var(--nhi-space-3); right: var(--nhi-space-3); z-index: 2;
	border-radius: 50%; background: var(--nhi-paper); box-shadow: var(--nhi-shadow);
}

/* Summary Details */
.nhi-product__summary .product_title {
	margin: 0 0 var(--nhi-space-3); font-size: var(--nhi-step-3);
	color: var(--nhi-ink); line-height: 1.2;
}
.nhi-product__summary .price {
	display: inline-flex; align-items: baseline; gap: var(--nhi-space-2);
	margin: 0 0 var(--nhi-space-4); font-size: var(--nhi-step-2);
	font-weight: var(--nhi-weight-head); color: var(--nhi-ink);
}
.nhi-product__summary .price del {
	color: var(--nhi-muted); font-weight: var(--nhi-weight-body); font-size: 0.75em;
}
.nhi-product__summary .price ins { text-decoration: none; color: var(--nhi-ink); }

.nhi-product__summary .woocommerce-product-details__short-description {
	margin: 0 0 var(--nhi-space-5); color: var(--nhi-ink-3); line-height: 1.6;
}
.nhi-product__summary .woocommerce-product-details__short-description p { margin: 0 0 var(--nhi-space-3); }
.nhi-product__summary .woocommerce-product-details__short-description ul {
	margin: 0 0 var(--nhi-space-3); padding: 0; list-style: none; display: grid; gap: var(--nhi-space-2);
}
.nhi-product__summary .woocommerce-product-details__short-description li {
	position: relative; padding-left: 1.5em; line-height: 1.5;
}
.nhi-product__summary .woocommerce-product-details__short-description li::before {
	content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px;
	background: var(--nhi-gold); border-radius: 50%;
}

/* Form, Cart, Variations */
.nhi-product__summary form.cart { margin: 0 0 var(--nhi-space-5); }
.nhi-product__summary table.variations { width: 100%; margin: 0 0 var(--nhi-space-4); border: 0; border-collapse: collapse; }
.nhi-product__summary table.variations th,
.nhi-product__summary table.variations td { display: block; padding: 0; border: 0; text-align: left; }
.nhi-product__summary table.variations th.label {
	padding: var(--nhi-space-2) 0 var(--nhi-space-1); font-size: var(--nhi-step--1);
	font-weight: var(--nhi-weight-strong); text-transform: uppercase; letter-spacing: .06em;
}
.nhi-product__summary table.variations select {
	width: 100%; min-height: 48px; padding: .6em 2.2em .6em .9em; border: 1px solid var(--nhi-line);
	border-radius: var(--nhi-radius-sm); background: var(--nhi-paper); color: var(--nhi-ink);
	font: inherit; cursor: pointer; transition: border-color var(--nhi-dur) ease;
}
.nhi-product__summary table.variations select:focus { border-color: var(--nhi-gold); outline: none; }
.nhi-product__summary .reset_variations {
	display: inline-block; margin-top: var(--nhi-space-2); font-size: var(--nhi-step--1);
	color: var(--nhi-muted); text-decoration: underline;
}
.nhi-product__summary .woocommerce-variation-price .price { font-size: var(--nhi-step-1); margin-bottom: var(--nhi-space-3); }
.nhi-product__summary .woocommerce-variation-add-to-cart,
.nhi-product__summary form.cart:not(.variations_form) {
	display: flex; flex-wrap: wrap; gap: var(--nhi-space-3); align-items: stretch;
}
.nhi-product__summary .quantity .qty {
	width: 5em; min-height: 52px; padding: 0 .5em; border: 1.5px solid var(--nhi-line);
	border-radius: var(--nhi-radius-pill); text-align: center; font: inherit; font-weight: var(--nhi-weight-strong);
	color: var(--nhi-ink); background: var(--nhi-paper); transition: border-color var(--nhi-dur) ease;
}
.nhi-product__summary .quantity .qty:focus { border-color: var(--nhi-gold); outline: none; }
.nhi-product__summary .single_add_to_cart_button {
	flex: 1 1 12rem; min-height: 52px; padding: 0 1.75em; border: 0; border-radius: var(--nhi-radius-pill);
	background: var(--nhi-gold); color: var(--nhi-ink); font: inherit; font-weight: var(--nhi-weight-head);
	cursor: pointer; transition: background-color var(--nhi-dur) ease, transform var(--nhi-dur) ease, box-shadow var(--nhi-dur) ease;
}
.nhi-product__summary .single_add_to_cart_button:hover,
.nhi-product__summary .single_add_to_cart_button:focus {
	background: var(--nhi-gold-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(212, 175, 58, 0.35);
}
.nhi-product__summary .single_add_to_cart_button.disabled,
.nhi-product__summary .single_add_to_cart_button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Contact actions and assurance */
.nhi-product__actions-wrap { margin-top: var(--nhi-space-4); }
.nhi-product__contact {
	display: flex; flex-wrap: wrap; gap: var(--nhi-space-3);
	padding-top: var(--nhi-space-4); border-top: 1px solid var(--nhi-line);
}
.nhi-product__contact .nhi-btn { flex: 1 1 10rem; justify-content: center; min-height: 48px; }

.nhi-product__assurance {
	margin-top: var(--nhi-space-5); padding: var(--nhi-space-4);
	background: var(--nhi-cream); border: 1px solid var(--nhi-line);
	border-radius: var(--nhi-radius); display: grid; gap: var(--nhi-space-3);
}
.nhi-product__assurance-item { display: flex; align-items: flex-start; gap: var(--nhi-space-3); }
.nhi-product__assurance-icon {
	color: var(--nhi-gold); flex: none; width: 20px; height: 20px;
	display: inline-flex; align-items: center; justify-content: center; margin-top: 2px;
}
.nhi-product__assurance-copy { display: flex; flex-direction: column; font-size: var(--nhi-step--1); line-height: 1.35; }
.nhi-product__assurance-copy strong { color: var(--nhi-ink); font-weight: var(--nhi-weight-strong); }
.nhi-product__assurance-copy span { color: var(--nhi-muted); font-size: 0.85em; }

/* Full Description Section */
.nhi-product__more { margin-top: var(--nhi-space-8); }
.nhi-product-description {
	margin-bottom: var(--nhi-space-7); max-width: 60rem;
	background: var(--nhi-paper); border: 1px solid var(--nhi-line);
	border-radius: var(--nhi-radius); padding: var(--nhi-space-6);
	box-shadow: var(--nhi-shadow);
}
.nhi-product-description h3 {
	margin: var(--nhi-space-4) 0 var(--nhi-space-2); font-size: var(--nhi-step-1);
	color: var(--nhi-ink); position: relative; padding-bottom: var(--nhi-space-2);
}
.nhi-product-description h3::after {
	content: ""; display: block; width: 2.5rem; height: 2px; background: var(--nhi-gold); margin-top: 6px;
}
.nhi-product-description blockquote {
	margin: var(--nhi-space-3) 0 var(--nhi-space-4); padding: var(--nhi-space-3) var(--nhi-space-4);
	background: var(--nhi-cream); border-left: var(--nhi-rule) solid var(--nhi-gold);
	border-radius: var(--nhi-radius-sm); font-style: normal;
}
.nhi-product-description blockquote p { margin: 0; }
.nhi-product-description p { margin: 0 0 var(--nhi-space-4); line-height: 1.7; }
.nhi-product-description ul, .nhi-product-description ol { margin: 0 0 var(--nhi-space-4); padding-left: 1.25em; line-height: 1.6; }

/* Tabs */
.single-product .woocommerce-tabs { max-width: 60rem; }
.single-product .woocommerce-tabs ul.tabs {
	display: flex; gap: var(--nhi-space-2); margin: 0 0 var(--nhi-space-4);
	padding: 0; list-style: none; border-bottom: 1px solid var(--nhi-line); overflow-x: auto;
}
.single-product .woocommerce-tabs ul.tabs li { margin: 0; padding: 0; border: 0; background: none; }
.single-product .woocommerce-tabs ul.tabs li a {
	display: block; padding: var(--nhi-space-3) var(--nhi-space-4);
	font-weight: var(--nhi-weight-strong); text-decoration: none; color: var(--nhi-muted);
	white-space: nowrap; transition: color var(--nhi-dur) ease;
}
.single-product .woocommerce-tabs ul.tabs li.active a {
	color: var(--nhi-ink); box-shadow: inset 0 -3px 0 var(--nhi-gold);
}
.single-product .woocommerce-tabs .panel h2 { font-size: var(--nhi-step-1); margin: 0 0 var(--nhi-space-3); }
.single-product table.shop_attributes {
	width: 100%; border-collapse: collapse; border: 1px solid var(--nhi-line);
	border-radius: var(--nhi-radius); overflow: hidden;
}
.single-product table.shop_attributes th,
.single-product table.shop_attributes td {
	padding: var(--nhi-space-3) var(--nhi-space-4); border-bottom: 1px solid var(--nhi-line);
	text-align: left; font-style: normal; font-size: var(--nhi-step--1);
}
.single-product table.shop_attributes tr:last-child th,
.single-product table.shop_attributes tr:last-child td { border-bottom: 0; }
.single-product table.shop_attributes th { width: 35%; font-weight: var(--nhi-weight-strong); background: var(--nhi-cream); }
.single-product table.shop_attributes p { margin: 0; }

/* Related Products */
.single-product section.related { margin-top: var(--nhi-space-8); }
.single-product section.related > h2 {
	margin: 0 0 var(--nhi-space-5); font-size: var(--nhi-step-2); color: var(--nhi-ink);
}
.single-product section.related ul.products {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--nhi-space-4);
	margin: 0; padding: 0; list-style: none;
}
@media (min-width: 64em) {
	.single-product section.related ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--nhi-space-5); }
}
.single-product section.related ul.products li.product {
	float: none; width: auto; margin: 0; padding: 0 0 var(--nhi-space-4); display: flex; flex-direction: column;
	border: 1px solid var(--nhi-line); border-radius: var(--nhi-radius); overflow: hidden; background: var(--nhi-paper);
	transition: border-color var(--nhi-dur) ease, transform var(--nhi-dur) ease, box-shadow var(--nhi-dur) ease;
}
.single-product section.related ul.products li.product:hover {
	border-color: var(--nhi-gold); transform: translateY(-3px); box-shadow: var(--nhi-shadow);
}
.single-product section.related ul.products li.product a { text-decoration: none; color: inherit; }
.single-product section.related ul.products li.product img {
	display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain;
	background: var(--nhi-cream); margin: 0 0 var(--nhi-space-3);
}
.single-product section.related .woocommerce-loop-product__title {
	margin: 0; padding: 0 var(--nhi-space-3); font-size: var(--nhi-step--1); font-weight: var(--nhi-weight-strong); line-height: 1.35;
}
.single-product section.related .price {
	padding: var(--nhi-space-2) var(--nhi-space-3) 0; font-weight: var(--nhi-weight-head); color: var(--nhi-ink);
}
.single-product section.related .star-rating { margin: var(--nhi-space-2) var(--nhi-space-3) 0; }
.single-product section.related ul.products li.product .button {
	margin: var(--nhi-space-3) var(--nhi-space-3) 0; padding: .7em 1em; border-radius: var(--nhi-radius-pill);
	background: var(--nhi-ink); color: var(--nhi-paper); text-align: center;
	font-size: var(--nhi-step--1); font-weight: var(--nhi-weight-strong); transition: background-color var(--nhi-dur) ease;
}
.single-product section.related ul.products li.product .button:hover {
	background: var(--nhi-ink-3); color: var(--nhi-gold);
}
