/*
 * The product page.
 *
 * Measured off the reference: two equal columns, a 43px quantity box beside a
 * charcoal button that fills the rest of the row, and a tab strip whose active
 * tab carries a dark underline over a hairline that runs the full width.
 */

.product-page__layout {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 30px;
	align-items: start;
	margin-block-end: var(--section-gap);
}

/* ─── Gallery ────────────────────────────────────────────────────────────── */

.product-gallery {
	position: relative;
}

/*
 * Both axes declared. A lone overflow-x makes the browser compute overflow-y
 * as `auto` too, which turns the gallery into a vertical scroller and the page
 * into something draggable sideways.
 */
.product-gallery__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	background: var(--product-card-bg);
}

.product-gallery__viewport::-webkit-scrollbar {
	display: none;
}

.product-gallery__track {
	display: flex;
}

.product-gallery__slide {
	flex: 0 0 100%;
	min-width: 0;
	margin: 0;
	scroll-snap-align: start;
}

.product-gallery__image,
.product-gallery__empty {
	display: block;
	width: 100%;
	height: auto;
	/* The catalogue's photography is square; the slot follows it rather than
	   cropping to a shape of its own. */
	aspect-ratio: 1;
	object-fit: cover;
}

.product-gallery__empty {
	background: var(--product-card-bg);
}

.product-gallery__badge {
	inset-block-start: 12px;
	inset-inline-start: 0;
	z-index: 2;
}

.product-gallery__save {
	inset-block-start: 12px;
	inset-inline-end: 12px;
}

.product-gallery__arrow {
	position: absolute;
	inset-block-start: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.86);
	color: var(--color-ink);
	cursor: pointer;
	transform: translateY(-50%);
	transition: background-color 0.18s ease, opacity 0.2s ease;
}

.product-gallery__arrow:hover {
	background: var(--color-white);
}

/* An arrow at the end of the gallery has nothing to do; it goes rather than
   sitting there inert. */
.product-gallery__arrow[disabled] {
	opacity: 0;
	pointer-events: none;
}

.product-gallery__arrow--prev {
	inset-inline-start: 16px;
}

.product-gallery__arrow--next {
	inset-inline-end: 16px;
}

.product-gallery__arrow .icon {
	width: 22px;
	height: 22px;
}

.product-gallery__arrow--prev .icon {
	transform: rotate(90deg);
}

.product-gallery__arrow--next .icon {
	transform: rotate(-90deg);
}

.product-gallery__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.product-gallery__thumb {
	display: block;
	width: 90px;
	padding: 0 0 6px;
	border: 0;
	border-block-end: 2px solid transparent;
	background: none;
	cursor: pointer;
}

.product-gallery__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	background: var(--product-card-bg);
}

.product-gallery__thumb[aria-current="true"] {
	border-block-end-color: var(--color-ink);
}

/* ─── Buy column ─────────────────────────────────────────────────────────── */

.product-summary__title {
	margin: 0 0 10px;
	font-family: var(--font-heading);
	font-size: var(--fs-product-title);
	font-weight: 400;
	letter-spacing: 0.02em;
	line-height: 1.18;
}

.product-summary__price {
	margin-block-end: 26px;
	font-size: 24px;
	line-height: 1.3;
}

.product-summary__price del {
	color: var(--color-text-muted);
	text-decoration: none;
}

.product-summary__price ins {
	margin-inline-start: 8px;
	background: none;
	color: var(--color-ink);
	text-decoration: none;
}

.product-summary__attribute {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 0 0 16px;
	font-size: 14px;
}

.product-summary__attribute-label {
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.product-summary__attribute-value {
	color: var(--color-text-muted);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.product-summary__stock {
	margin: 0 0 12px;
	color: var(--color-text-muted);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.product-summary__stock--out {
	color: var(--color-accent);
}

/* ─── WooCommerce's add-to-cart form ─────────────────────────────────────── */

/*
 * The form is WooCommerce's own markup, so these selectors carry `.woocommerce`
 * to outrank its stylesheet — its `.woocommerce div.product form.cart .button`
 * is (0,3,2) and a shorter rule silently loses.
 */
.woocommerce div.product form.cart,
.woocommerce div.product form.cart.variations_form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 0;
}

.woocommerce div.product form.cart .quantity {
	flex: none;
	margin: 0;
	float: none;
}

.woocommerce div.product form.cart .quantity .qty {
	width: 56px;
	height: 45px;
	padding: 0 4px;
	border: 1px solid var(--account-field-border);
	border-radius: 0;
	background: var(--color-white);
	color: var(--color-ink);
	font-family: var(--font-body);
	font-size: 15px;
	text-align: center;
}

.woocommerce div.product form.cart .button {
	flex: 1 1 200px;
	min-height: 45px;
	padding: 12px 24px;
	border: 0;
	border-radius: 0;
	background: var(--color-charcoal);
	color: var(--color-white);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.11em;
	line-height: 1.2;
	text-transform: uppercase;
}

.woocommerce div.product form.cart .button:hover {
	background: var(--color-ink);
	color: var(--color-white);
}

.woocommerce div.product form.cart .button:disabled {
	background: var(--color-border);
	color: var(--color-text-muted);
	cursor: not-allowed;
	opacity: 1;
}

/* Variation selects take the whole row above the buy line. */
.woocommerce div.product form.cart .variations {
	flex: 1 1 100%;
	margin: 0;
	border: 0;
}

.woocommerce div.product form.cart .variations tr {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-block-end: 14px;
}

.woocommerce div.product form.cart .variations th,
.woocommerce div.product form.cart .variations td {
	display: block;
	padding: 0;
	border: 0;
	text-align: start;
}

.woocommerce div.product form.cart .variations label {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.woocommerce div.product form.cart .variations select {
	width: 100%;
	height: 45px;
	padding: 0 14px;
	border: 1px solid var(--account-field-border);
	border-radius: 0;
	background: var(--color-white);
	font-family: var(--font-body);
	font-size: 15px;
	/* WooCommerce adds margin-right: 1em; on a full-width select that pushed
	   the page 3px sideways at 320-375px on every variable product. */
	margin-inline-end: 0;
}

.woocommerce div.product form.cart .woocommerce-variation-price {
	flex: 1 1 100%;
	font-size: 20px;
}

.woocommerce div.product form.cart .reset_variations {
	font-size: 13px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.product-summary__store {
	width: 100%;
	margin-block-start: 12px;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */

.product-tabs {
	margin-block-start: 34px;
}

.product-tabs__strip {
	display: flex;
	gap: 34px;
	border-block-end: 1px solid var(--color-border);
}

.product-tabs__tab {
	padding: 0 0 12px;
	border: 0;
	border-block-end: 2px solid transparent;
	margin-block-end: -1px;
	background: none;
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.product-tabs__tab[aria-selected="true"] {
	border-block-end-color: var(--color-ink);
	color: var(--color-ink);
}

.product-tabs__panel {
	padding-block: 18px;
	font-size: 15px;
	line-height: 1.6;
}

.product-tabs__panel p {
	margin: 0 0 12px;
}

.product-tabs__panel table {
	width: 100%;
	border-collapse: collapse;
}

.product-tabs__panel th,
.product-tabs__panel td {
	padding: 9px 0;
	border-block-end: 1px solid var(--color-border-light);
	font-size: 14px;
	text-align: start;
	vertical-align: top;
}

.product-tabs__panel th {
	width: 38%;
	font-weight: 600;
}

.product-tabs__panel p:last-child,
.product-tabs__panel table {
	margin-block-end: 0;
}

@media (max-width: 899px) {
	.product-page__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}

	.product-gallery__thumb {
		width: 66px;
	}

	.product-tabs__strip {
		gap: 20px;
		/* Three tabs at 14px do not fit at 320px; let the strip scroll rather
		   than wrap into two lines under a hairline. */
		overflow-x: auto;
		overflow-y: hidden;
		scrollbar-width: none;
	}

	.product-tabs__strip::-webkit-scrollbar {
		display: none;
	}

	.product-tabs__tab {
		flex: none;
		white-space: nowrap;
	}

	.woocommerce div.product form.cart .button {
		flex: 1 1 140px;
	}
}
