/*
 * NetSuite description styles (carried over from WPCode 41926 "Product Description Tab Styles" and 41977 "Table
 * Default Style"). NetSuite writes these classes and tables into product and category descriptions through In8Sync,
 * so the theme has to style them or every product with a download, video or spec table loses its look.
 * Same rules as the snippets; selectors moved from Avada's markup to the block theme's (product tabs, the category
 * description block and Shop components' [il_cat_more]); colours from theme.json.
 */

/* Download buttons */
.download-button {
	display: inline-block;
	padding: 10px 20px;
	background-color: var(--wp--preset--color--navy, #004385);
	color: #ffffff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 700;
}
.download-button:hover,
.download-button:focus {
	background-color: var(--wp--preset--color--action-hover, #004f7a);
	color: #ffffff;
}

/* Bare video embeds (WordPress oEmbed gives YouTube a fixed width="500"): keep them inside the screen at 16:9.
   Before the .video-container rule on purpose: same specificity, so that rule still wins inside its box.
   22 Nov audit: 2 pages scrolled sideways on phones (the-future-of-the-laboratory, product u-pette-dispenser). */
iframe[src*="youtube.com/embed"],
iframe[src*="youtube-nocookie.com/embed"],
iframe[src*="player.vimeo.com/video"] {
	max-width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}

/* Video container: 16:9, 4:3 on phones */
.video-container {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
}
.video-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
@media screen and (max-width: 768px) {
	.video-container {
		padding-bottom: 75%;
	}
}

/* Tables inside product and category descriptions (not the Specifications tab) */
.woocommerce-Tabs-panel--description table,
.wp-block-term-description table,
.il-cat-more table {
	width: auto;
	table-layout: auto;
	border-collapse: collapse;
	border-spacing: 0;
	border: 1px solid var(--wp--preset--color--hairline);
	margin: 0;
}
.woocommerce-Tabs-panel--description table th,
.woocommerce-Tabs-panel--description table td,
.wp-block-term-description table th,
.wp-block-term-description table td,
.il-cat-more table th,
.il-cat-more table td {
	padding: 3px;
	text-align: left;
	border: 1px solid var(--wp--preset--color--hairline);
}
.woocommerce-Tabs-panel--description table th,
.woocommerce-Tabs-panel--description table tr:nth-child(even),
.wp-block-term-description table th,
.wp-block-term-description table tr:nth-child(even),
.il-cat-more table th,
.il-cat-more table tr:nth-child(even) {
	background-color: #f2f2f2;
}
@media (min-width: 768px) {
	.woocommerce-Tabs-panel--description table,
	.wp-block-term-description table,
	.il-cat-more table {
		width: calc(100% - 20px);
	}
}
@media (max-width: 767px) {
	.woocommerce-Tabs-panel--description table,
	.wp-block-term-description table,
	.il-cat-more table {
		display: block;
		max-width: 100%;
		white-space: nowrap;
		overflow-x: auto;
	}
	/* NetSuite tables arrive wrapped in a <figure> that grows to the table's own width (681px+), pushing the whole
	   page sideways on phones. Keep the figure inside the column; the table scrolls inside it. */
	.woocommerce-Tabs-panel--description figure,
	.wp-block-term-description figure,
	.il-cat-more figure {
		max-width: 100%;
		margin-left: 0;
		margin-right: 0;
		overflow-x: auto;
	}
}
