/*
 * Single product tabs, review form and related products. Loaded after
 * woocommerce-product.css on product pages only.
 */

/* Tabs: a quiet underline row instead of boxed tabs. */
.woocommerce div.product .woocommerce-tabs ul.tabs {
	padding: 0;
	margin: 0 0 1.5rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before {
	border: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
	background: transparent;
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
	display: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 0.5rem 0.875rem;
	margin-bottom: -1px;
	border-bottom: 2px solid transparent;
	color: var(--wp--preset--color--muted);
	font-weight: 600;
	text-decoration: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover,
.woocommerce div.product .woocommerce-tabs ul.tabs li a:focus-visible {
	color: var(--wp--preset--color--primary);
	border-bottom-color: var(--wp--preset--color--primary);
}

/* Review form: the review inputs don't use the .form-row markup the
   other WooCommerce fields do, so they need their own rules to read like
   the on-site forms — boxed fields, bold labels, tidy spacing. */
.woocommerce #review_form #respond p.comment-form-author,
.woocommerce #review_form #respond p.comment-form-email,
.woocommerce #review_form #respond .comment-form-rating,
.woocommerce #review_form #respond p.comment-form-comment {
	margin: 0 0 1rem;
}

.woocommerce #review_form #respond label {
	font-weight: 600;
}

.woocommerce #review_form #respond input[type="text"],
.woocommerce #review_form #respond input[type="email"],
.woocommerce #review_form #respond textarea {
	box-sizing: border-box;
	width: 100%;
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--sm);
	padding: 0.625rem 0.75rem;
	font: inherit;
}

.woocommerce #review_form #respond select#rating {
	width: 100%;
	height: auto;
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--sm);
	padding: 0.625rem 0.75rem;
	font: inherit;
}

/* The review submit carries only the "submit" class, so the shared
   .button hover rule never reaches it. */
.woocommerce #respond input#submit:hover,
.woocommerce #respond input#submit:focus-visible {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--background);
}

/* Name and Email share a row on desktop; rating, review text and the
   submit button span across both columns. */
@media (min-width: 782px) {
	.woocommerce #review_form #respond form.comment-form {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: 1rem;
		align-items: start;
	}

	.woocommerce #review_form #respond .comment-form-rating,
	.woocommerce #review_form #respond p.comment-form-comment,
	.woocommerce #review_form #respond p.form-submit,
	.woocommerce #review_form #respond p.must-log-in {
		grid-column: 1 / -1;
	}
}

.woocommerce #reviews #respond .comment-reply-title {
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.25rem;
	margin: 0 0 1rem;
}

/* Related products heading: a step below the (reduced) product title, so
   the title keeps its place at the top of the hierarchy. */
.woocommerce .related.products > h2,
.woocommerce .upsells.products > h2 {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.25rem;
	margin-bottom: 1.25rem;
}

/* Related products keep the proportions they have in the shop grid.
   The blockified template renders no .related wrapper, so it is matched
   by the collection name in its Interactivity data context. */
.woocommerce .wp-block-woocommerce-product-collection[data-wp-context*="related"] ul.wc-block-product-template > li.wc-block-product,
.woocommerce .wp-block-woocommerce-product-collection[data-wp-context*="upsells"] ul.wc-block-product-template > li.wc-block-product {
	width: calc(50% - 0.625em);
	box-sizing: border-box;
}

/* Four columns on desktop, two on phones. The 0.9375em offset is
   WooCommerce's own columns-4 formula against its 1.25em column gap. */
@media (min-width: 782px) {
	.woocommerce .wp-block-woocommerce-product-collection[data-wp-context*="related"] ul.wc-block-product-template > li.wc-block-product,
	.woocommerce .wp-block-woocommerce-product-collection[data-wp-context*="upsells"] ul.wc-block-product-template > li.wc-block-product {
		width: calc(25% - 0.9375em);
	}
}

/* The related pattern stacks a title margin on the card gap, leaving a
   pocket of air the shop cards don't have. The gap alone spaces it. */
.woocommerce .wp-block-woocommerce-product-collection[data-wp-context*="related"] ul.wc-block-product-template .wp-block-post-title,
.woocommerce .wp-block-woocommerce-product-collection[data-wp-context*="upsells"] ul.wc-block-product-template .wp-block-post-title {
	margin-bottom: 0;
}