/*
 * Bridge: WooCommerce single-product markup -> the reference product design.
 *
 * The add-to-cart form is WooCommerce's own, because its variation script is what
 * keeps price, stock and availability honest as the shopper changes colour or
 * size. That form ships as a <table> with native <select> controls and a stock
 * blue button; this file maps that structure onto the design without altering it,
 * so nothing about cart correctness depends on styling.
 *
 * product.css already carries .opt-block, .variant, .size-btn, .qty-row, .buy-row,
 * .help-btn, .acc and .pdp-trust. Only the gaps are filled here.
 */

/* ---------------------------------------------------------------------------
 * 1. Gallery images
 *
 * .img-slot is a <span> so it can sit inside a <button> thumbnail. A span is
 * inline by default, so it ignored the height product.css gives it and the image
 * rendered at intrinsic size, overflowing the frame.
 * ------------------------------------------------------------------------- */
.gallery-thumb .img-slot,
.gallery-main .img-slot,
.variant__box .img-slot {
	display: block;
	height: 100%;
	width: 100%;
}

.gallery-thumb .img-slot img,
.gallery-main .img-slot img,
.variant__box .img-slot img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.gallery-main .img-slot img {
	padding: 6%;
}

/* ---------------------------------------------------------------------------
 * 2. The variations table
 *
 * hizjaab-product.js builds an .opt-block per attribute and hides the table row
 * it came from. The table is still in the DOM for WooCommerce; these rules stop
 * it contributing borders or spacing of its own.
 * ------------------------------------------------------------------------- */
.variations,
.variations tbody,
.variations tr,
.variations th,
.variations td {
	display: block;
	width: auto;
	border: 0;
	padding: 0;
	margin: 0;
	background: none;
}

/* Without JavaScript the native selects are the control, so they get the
   design's field treatment rather than being left unstyled. */
.variations select {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	max-width: 320px;
	font-family: var(--font-sans);
	font-size: 14px;
	color: var(--text-on-base);
	background: var(--pill-bg);
	border: 1px solid var(--surface-inverse-control-border);
	border-radius: var(--radius-sm);
	padding: 12px 14px;
	margin-bottom: 16px;
}

.variations select option {
	background: var(--surface-inverse-card);
	color: var(--text-on-base);
}

.variations th.label label {
	font-family: var(--font-sans);
	font-size: 11px;
	letter-spacing: var(--tracking-wider);
	text-transform: uppercase;
	color: var(--text-on-base-muted);
	margin-bottom: 10px;
	display: block;
	font-weight: 400;
}

/* ---------------------------------------------------------------------------
 * 3. Variant tiles and size pills
 * ------------------------------------------------------------------------- */
.variant.is-active .variant__check {
	display: flex;
}

.variant.is-unavailable,
.size-btn.is-unavailable {
	opacity: .35;
	cursor: not-allowed;
}

.size-btn.is-unavailable {
	text-decoration: line-through;
}

.size-btn--lg {
	min-width: 46px;
	height: 46px;
	padding: 0 14px;
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.size-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.opt-head .link {
	cursor: default;
}

/* ---------------------------------------------------------------------------
 * 4. Quantity stepper
 * ------------------------------------------------------------------------- */
.pdp-info .quantity.hz-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--surface-inverse-control-border);
	border-radius: var(--radius-pill);
	padding: 3px;
	float: none;
	margin: 0;
}

.pdp-info .hz-qty input.qty {
	width: 46px;
	height: 34px;
	text-align: center;
	font-family: var(--font-sans);
	font-size: 14px;
	color: var(--text-on-base);
	background: transparent;
	border: none;
	padding: 0;
	box-shadow: none;
	-moz-appearance: textfield;
}

.pdp-info .hz-qty input.qty::-webkit-outer-spin-button,
.pdp-info .hz-qty input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.hz-qty__minus,
.hz-qty__plus {
	width: 30px;
	height: 30px;
	min-width: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: var(--text-on-base);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.hz-qty__minus:hover,
.hz-qty__plus:hover {
	background: var(--pill-bg);
}

.hz-qty__minus svg,
.hz-qty__plus svg {
	width: 14px;
	height: 14px;
}

/* ---------------------------------------------------------------------------
 * 5. Add to bag / Buy now
 *
 * product.css styles .btn-bag and .btn-buy; these rules undo the WooCommerce and
 * Astra button chrome that would otherwise sit on top of them.
 * ------------------------------------------------------------------------- */
.pdp-info .buy-row .btn-bag,
.pdp-info .buy-row .btn-buy {
	width: 100%;
	min-height: 52px;
	line-height: 1;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: var(--tracking-wide);
}

.pdp-info .buy-row .btn-bag {
	background: transparent;
	color: var(--text-on-base);
	border: 1px solid var(--surface-inverse-control-border);
}

.pdp-info .buy-row .btn-bag:hover {
	background: var(--pill-bg);
	border-color: var(--taupe-400);
	color: var(--text-on-base);
}

.pdp-info .buy-row .btn-buy {
	background: var(--taupe-400);
	color: var(--plum-950);
	border: 1px solid transparent;
}

.pdp-info .buy-row .btn-buy:hover {
	background: var(--taupe-600);
	color: #fff;
}

.pdp-info .buy-row button:disabled {
	opacity: .55;
	cursor: not-allowed;
}

/* WooCommerce marks the button disabled until a variation resolves. */
.pdp-info .buy-row .disabled {
	opacity: .55;
	cursor: not-allowed;
}

.pdp-info form.cart {
	margin: 0;
	display: block;
}

/* Simple products have no variation block, so quantity and buttons share a row. */
.pdp-info form.cart:not(.variations_form) .qty-row {
	margin-top: 20px;
}

/* ---------------------------------------------------------------------------
 * 6. Detail accordion
 *
 * product.css styles .acc-item / .acc-head / .acc-body for a scripted panel.
 * Using <details>/<summary> keeps every section openable, readable and findable
 * by browser search with no JavaScript, which only needs the marker suppressed
 * and the icon rotated.
 * ------------------------------------------------------------------------- */
.acc-item > summary.acc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 16px;
	cursor: pointer;
	list-style: none;
}

.acc-item > summary.acc-head::-webkit-details-marker {
	display: none;
}

.acc-item > summary.acc-head::marker {
	content: "";
}

.acc-item > summary.acc-head svg {
	transition: transform .2s ease;
	flex-shrink: 0;
}

.acc-item[open] > summary.acc-head svg {
	transform: rotate(45deg);
}

.acc-item .acc-body ul {
	margin: 12px 0 0;
	padding-left: 18px;
}

.acc-item .acc-body li {
	font-size: 14px;
	line-height: 1.7;
	color: var(--text-on-base-muted);
}

/* ---------------------------------------------------------------------------
 * 7. Related products
 * ------------------------------------------------------------------------- */
.related.products {
	margin: 72px 0 96px;
}

.related.products > h2 {
	font-family: var(--font-display);
	font-size: 28px;
	color: var(--text-on-base-heading);
	margin: 0 0 6px;
}

.related.products ul.products,
.related.products .products {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	padding: 0;
	margin: 24px 0 0;
}

@media (max-width: 1024px) {
	.related.products ul.products,
	.related.products .products {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 640px) {
	.related.products ul.products,
	.related.products .products {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ---------------------------------------------------------------------------
 * 8. Astra chrome the design has no place for
 * ------------------------------------------------------------------------- */
.single-product .woocommerce-product-rating,
.single-product .woocommerce-tabs,
.single-product #reviews,
.single-product .woocommerce-product-details__short-description,
.single-product .price:not(.pdp-price) {
	display: none;
}

/* The variation price block duplicates the heading price. */
.woocommerce-variation-price {
	display: none;
}

.woocommerce-variation-availability p {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--text-on-base-muted);
	margin: 10px 0 0;
}

.reset_variations {
	display: inline-block;
	margin-top: 10px;
	font-size: 12px;
	color: var(--taupe-400);
	text-decoration: underline;
	text-underline-offset: 3px;
}
