/* V3 shell and compatibility layout for the existing Mat Designer UI. */
body.td6-v3-gaming-mat-product {
	background: #f4f4f2;
	color: #333;
}

body.td6-v3-gaming-mat-product .td6-header,
body.td6-v3-gaming-mat-product .td6-footer {
	color: #fff;
}

body.td6-v3-gaming-mat-product .td6-breadcrumbs,
body.td6-v3-gaming-mat-product .td6-breadcrumbs a,
body.td6-v3-gaming-mat-product .td6-breadcrumbs [aria-current="page"] {
	color: #333;
}

.td6-gaming-mat-product .mat-designer-page-block p.po-quote-wrap {
	margin-block: 0;
	color: #222;
	font-size: 1.17em;
	font-weight: 600;
	letter-spacing: -.015em;
	text-wrap: balance;
}

.td6-gaming-mat-product {
	min-height: 70vh;
	padding: clamp(3rem, 6vw, 6rem) 0 clamp(4rem, 7vw, 7rem);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.65;
}

.td6-gaming-mat-product button,
.td6-gaming-mat-product input,
.td6-gaming-mat-product select,
.td6-gaming-mat-product textarea {
	font-family: inherit;
}

/* Keep the legacy control surface typographically coherent inside the V3
 * shell. Several old inline patches otherwise assign unrelated sizes. */
.td6-gaming-mat-product .mat-designer-page-block button,
.td6-gaming-mat-product .mat-designer-page-block input,
.td6-gaming-mat-product .mat-designer-page-block select,
.td6-gaming-mat-product .mat-designer-page-block textarea,
.td6-gaming-mat-product .mat-designer-page-block label,
.td6-gaming-mat-product .mat-designer-page-block .md-control-label {
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	letter-spacing: 0 !important;
	line-height: 1.35 !important;
}

.td6-gaming-mat-product .mat-designer-page-block .md-designer-tab,
.td6-gaming-mat-product .mat-designer-page-block .md-material-title,
.td6-gaming-mat-product .mat-designer-page-block .md-group-title,
.td6-gaming-mat-product .mat-designer-page-block .md-control-title {
	font-size: 14px !important;
	font-weight: 600 !important;
}

.td6-gaming-mat-product .mat-designer-page-block .md-row-count,
.td6-gaming-mat-product .mat-designer-page-block .md-col-count,
.td6-gaming-mat-product .mat-designer-page-block .md-dim-value,
.td6-gaming-mat-product .mat-designer-page-block .md-summary-add-btn,
.td6-gaming-mat-product .mat-designer-page-block .md-large-preview-btn {
	font-size: 14px !important;
	font-weight: 600 !important;
}

body.td6-v3-gaming-mat-product .td6-gaming-mat-product .mat-designer-page-block .mat-designer-tilesizes .md-map-layout-panel .md-controls .md-btn,
body.td6-v3-gaming-mat-product .td6-gaming-mat-product .mat-designer-page-block .mat-designer-tilesizes .md-map-layout-panel .md-controls .md-randomize,
body.td6-v3-gaming-mat-product .td6-gaming-mat-product .mat-designer-page-block .mat-designer-tilesizes .md-map-layout-panel .md-controls .md-undo {
	font-size: 14px !important;
	font-weight: 500 !important;
	line-height: 1.35 !important;
}

body.td6-v3-gaming-mat-product .td6-gaming-mat-product .mat-designer-page-block .mat-designer-tilesizes .md-map-layout-panel .md-size-readout .md-dim-value {
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
}

body.td6-v3-gaming-mat-product .td6-gaming-mat-product .mat-designer-page-block .mat-designer-tilesizes .md-size-option .md-material-label {
	font-size: 14px !important;
	font-weight: 500 !important;
	line-height: 1.35 !important;
}

body.td6-v3-gaming-mat-product .td6-gaming-mat-product .mat-designer-page-block .mat-designer-tilesizes .md-map-layout-panel .md-stepper > .md-btn,
body.td6-v3-gaming-mat-product .td6-gaming-mat-product .mat-designer-page-block .mat-designer-tilesizes .md-map-layout-panel .md-stepper > .md-count {
	display: grid !important;
	width: 52px !important;
	min-width: 52px !important;
	height: 40px !important;
	min-height: 40px !important;
	padding: 0 !important;
	line-height: 1 !important;
	place-items: center;
}

.td6-gaming-mat-product__inner {
	width: min(100% - 40px, 1500px);
	margin-inline: auto;
}

.td6-gaming-mat-product__header {
	max-width: 1100px;
	margin: 0 auto clamp(2rem, 4vw, 4rem);
	text-align: center;
}

.td6-gaming-mat-product__header h1 {
	margin: .35rem 0 0;
	font-size: clamp(2.5rem, 5.5vw, 5rem);
	line-height: 1;
	letter-spacing: -.035em;
	text-transform: uppercase;
}

.td6-gaming-mat-product__intro {
	max-width: 760px;
	margin: 1.35rem auto 0;
	text-align: left;
}

.td6-gaming-mat-product__spec {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .3rem 1rem;
	margin: 0 0 .85rem;
	color: #555;
	font-size: .9rem;
	font-weight: 600;
	letter-spacing: .015em;
}

.td6-gaming-mat-product__spec span::before {
	content: '·';
	margin-right: 1rem;
	color: #999;
}

.td6-gaming-mat-product__description,
.td6-gaming-mat-product__purchase-note {
	margin: 0 0 .8rem;
	color: #444;
	font-size: 1rem;
	line-height: 1.6;
}

.td6-gaming-mat-product__description p {
	margin: 0;
}

.td6-gaming-mat-product__purchase-note {
	margin-bottom: 0;
}

.td6-gaming-mat-product__error {
	padding: 2rem;
	background: #fff;
	text-align: center;
}

.td6-gaming-mat-product .woocommerce-notices-wrapper,
.td6-gaming-mat-product .woocommerce-message,
.td6-gaming-mat-product .woocommerce-error,
.td6-gaming-mat-product .woocommerce-info {
	max-width: 1100px;
	margin: 0 auto 1.5rem;
}

.td6-gaming-mat-product .mat-designer-page-block {
	width: 100%;
	min-width: 0;
	color: #333;
}

.td6-gaming-mat-product .mat-designer-page-block h2,
.td6-gaming-mat-product .mat-designer-page-block h3,
.td6-gaming-mat-product .mat-designer-page-block h4 {
	color: #222;
	font-weight: 600;
	letter-spacing: -.015em;
}

.td6-gaming-mat-product .mat-designer-tilesizes,
.td6-gaming-mat-product .mat-designer-tilesizes .md-designer-tab-panels,
.td6-gaming-mat-product .mat-designer-tilesizes .md-group-panel,
.td6-gaming-mat-product .mat-designer-tilesizes .md-instructions {
	color: #222;
}

.td6-gaming-mat-product .mat-designer-flavour-description,
.td6-gaming-mat-product .mat-designer-tilesizes,
.td6-gaming-mat-product .mat-designer {
	width: min(100%, 1280px);
	margin-inline: auto;
}

.td6-gaming-mat-product .mat-designer-flavour-description,
.td6-gaming-mat-product .mat-designer-basic-description {
	font-size: 15px;
	font-weight: 400;
	line-height: 1.65;
}

.td6-gaming-mat-product .mat-designer-flavour-description img,
.td6-gaming-mat-product .mat-designer-basic-description img {
	max-width: 100%;
	height: auto;
}

.td6-gaming-mat-product .md-code-text {
	display: block;
	width: 100%;
	margin-inline: auto;
	text-align: center;
}

/* The live map and generated preview always own a complete row. */
.td6-gaming-mat-product .mat-designer > .md-grid,
.td6-gaming-mat-product .mat-designer > .md-preview,
.td6-gaming-mat-product .mat-designer > .md-preview-wrap,
.td6-gaming-mat-product .mat-designer > .md-inline-preview,
.td6-gaming-mat-product .mat-designer > .mat-designer-material,
.td6-gaming-mat-product .mat-designer > .md-summary,
.td6-gaming-mat-product .mat-designer > .md-sample-strip {
	flex: 0 0 100%;
	width: 100%;
	min-width: 0;
	clear: both;
}

.td6-gaming-mat-product .mat-designer .md-grid,
.td6-gaming-mat-product .mat-designer .md-preview,
.td6-gaming-mat-product .mat-designer .md-preview-wrap,
.td6-gaming-mat-product .mat-designer .md-preview-crop {
	max-width: 100%;
	box-sizing: border-box;
}

.td6-gaming-mat-product .mat-designer .md-grid {
	justify-self: center;
	width: max-content !important;
	max-width: 100%;
	margin-inline: auto !important;
}

/* Product photography follows the established reference layout: one centred
 * main image with a centred row of square thumbnails beneath it. */
.td6-gaming-mat-product .mat-designer-flavour-main,
.td6-gaming-mat-product .mat-designer-backdrop-main,
.td6-gaming-mat-product .mat-designer-backdrop-featured-main {
	display: flex;
	justify-content: center;
	width: min(100%, 1000px);
	margin: 0 auto 1.5rem;
	overflow: hidden;
}

.td6-gaming-mat-product .mat-designer-flavour-main {
	aspect-ratio: 3 / 2;
}

.td6-gaming-mat-product .mat-designer-backdrop-main {
	aspect-ratio: 4 / 3;
}

.td6-gaming-mat-product .mat-designer-backdrop-featured-main {
	aspect-ratio: 4 / 5;
}

.td6-gaming-mat-product .mat-designer-flavour-main img,
.td6-gaming-mat-product .mat-designer-backdrop-main img,
.td6-gaming-mat-product .mat-designer-backdrop-featured-main img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	object-fit: contain;
}

.td6-gaming-mat-product .mat-designer-flavour-gallery,
.td6-gaming-mat-product .mat-designer-backdrop-gallery,
.td6-gaming-mat-product .mat-designer-backdrop-featured-gallery {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .5rem;
	margin: 6px auto 1.5rem;
}

.td6-gaming-mat-product .flavour-gallery-thumb,
.td6-gaming-mat-product .backdrop-gallery-thumb,
.td6-gaming-mat-product .backdrop-featured-thumb {
	display: block;
	width: 240px;
	height: 240px;
	border: 2px solid #ddd;
	border-radius: 4px;
	object-fit: cover;
	cursor: pointer;
	transition: border-color .15s ease, transform .15s ease;
}

.td6-gaming-mat-product .backdrop-featured-thumb {
	height: auto;
}

.td6-gaming-mat-product .flavour-gallery-thumb.active,
.td6-gaming-mat-product .backdrop-gallery-thumb.active,
.td6-gaming-mat-product .backdrop-featured-thumb.active {
	border-color: #222;
}

.td6-gaming-mat-product .flavour-gallery-thumb:hover,
.td6-gaming-mat-product .backdrop-gallery-thumb:hover,
.td6-gaming-mat-product .backdrop-featured-thumb:hover {
	border-color: #777;
	transform: translateY(-2px);
}

/* These card rules formerly lived in the Drile header. They are part of the
 * Mat Designer control UI, so the V3 page owns the small compatibility layer. */
.td6-gaming-mat-product .mat-designer-tilesizes {
	margin-bottom: 1rem;
}

.td6-gaming-mat-product .mat-designer-tilesizes .md-material-title {
	margin-bottom: .5rem;
	color: #222;
	font-size: 1rem;
	font-weight: 600;
	text-align: center;
}

.td6-gaming-mat-product .mat-designer-material .md-material-container {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	width: 100%;
	padding: .75rem 1rem;
	border-radius: .5rem;
	background: #f9f9f9;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
	box-sizing: border-box;
}

.td6-gaming-mat-product .mat-designer-material .md-material-option {
	display: flex;
	flex: 1 1 calc(50% - 1rem);
	flex-direction: column;
	align-items: center;
	max-width: 200px;
}

.td6-gaming-mat-product .mat-designer-material .md-material-button {
	display: block;
	width: 100%;
	max-width: 200px;
	aspect-ratio: 1;
	padding: 0;
	border: 0;
	border-radius: .5rem;
	background-color: #fff;
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	cursor: pointer;
}

.td6-gaming-mat-product .mat-designer-material .md-material-button.selected,
.td6-gaming-mat-product .mat-designer-material .md-material-button[aria-pressed="true"] {
	outline: 3px solid var(--md-cta, #ffc107);
	box-shadow: 0 0 0 4px rgba(255, 193, 7, .35), 0 4px 10px rgba(0, 0, 0, .15);
}

.td6-gaming-mat-product .mat-designer-material .md-material-label {
	margin-top: .5rem;
	color: #333;
	font-size: .9rem;
	text-align: center;
}

.td6-gaming-mat-product .mat-designer-tilesizes .md-material-container {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	width: 100%;
}

.td6-gaming-mat-product .mat-designer-tilesizes .md-size-option,
.td6-gaming-mat-product .mat-designer-tilesizes .md-preset-option {
	display: flex;
	flex: 1 1 calc(25% - 1rem);
	flex-direction: column;
	align-items: center;
	min-width: 140px;
	max-width: 200px;
}

.td6-gaming-mat-product .mat-designer-tilesizes .md-size-button,
.td6-gaming-mat-product .mat-designer-tilesizes .md-preset-button {
	position: relative;
	width: 100%;
	max-width: 200px;
	aspect-ratio: 1;
	padding: 0;
	border: 0;
	border-radius: .5rem;
	background-color: #fff;
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	cursor: pointer;
	transition: box-shadow .2s, transform .1s;
}

.td6-gaming-mat-product .mat-designer-tilesizes .md-size-button:hover,
.td6-gaming-mat-product .mat-designer-tilesizes .md-preset-button:hover {
	box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
	transform: translateY(-1px);
}

.td6-gaming-mat-product .mat-designer-tilesizes .md-size-button.selected,
.td6-gaming-mat-product .mat-designer-tilesizes .md-size-button[aria-pressed="true"],
.td6-gaming-mat-product .mat-designer-tilesizes .md-preset-button.selected,
.td6-gaming-mat-product .mat-designer-tilesizes .md-preset-button[aria-pressed="true"] {
	outline: 3px solid var(--md-cta, #ffc107);
	box-shadow: 0 0 0 4px rgba(255, 193, 7, .35), 0 4px 10px rgba(0, 0, 0, .15);
	transform: translateY(-1px);
}

.td6-gaming-mat-product .mat-designer-tilesizes .md-material-label {
	margin-top: .5rem;
	color: #333;
	font-size: .9rem;
	text-align: center;
}

.td6-gaming-mat-product .mat-designer-tilesizes .md-size-button.selected + .md-material-label,
.td6-gaming-mat-product .mat-designer-tilesizes .md-size-button[aria-pressed="true"] + .md-material-label,
.td6-gaming-mat-product .mat-designer-tilesizes .md-preset-button.selected + .md-material-label,
.td6-gaming-mat-product .mat-designer-tilesizes .md-preset-button[aria-pressed="true"] + .md-material-label {
	color: #111;
	font-weight: 700;
}

.td6-gaming-mat-product .mat-designer .md-inline-preview {
	display: flex;
	justify-content: center;
}

.td6-gaming-mat-product .mat-designer .md-large-preview-btn {
	min-height: 44px;
	padding: .7rem 1.35rem;
	border: 0;
	border-radius: 4px;
	background: #2f2f2f;
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

.td6-gaming-mat-product .mat-designer .md-preview-img,
.td6-gaming-mat-product .mat-designer .md-cell-img {
	max-width: 100%;
}

.td6-gaming-mat-product .mat-designer .md-preview {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 2px;
	width: 100%;
}

.td6-gaming-mat-product .mat-designer .md-preview-img {
	display: block;
	width: 100%;
	height: auto;
}

.td6-gaming-mat-product .mat-designer .md-summary {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .5rem;
	width: 100%;
	margin-bottom: 1rem;
	padding: .75rem 1rem;
	border-radius: .5rem;
	background: #f9f9f9;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
	box-sizing: border-box;
}

.td6-gaming-mat-product .mat-designer .md-summary-add-btn {
	min-height: 44px;
	padding: .7rem 1.35rem;
	border: 0;
	border-radius: 4px;
	background: #2f2f2f;
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

.td6-gaming-mat-product .td6-mat-cart-feedback {
	margin: .65rem 0 0;
	color: #333;
	font-size: 14px;
	font-weight: 500;
	text-align: center;
}

.td6-gaming-mat-product .td6-mat-cart-feedback a {
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Full-resolution preview viewer. Its compositor remains in the existing
 * Mat Designer bundle; these small V3 rules replace the old Drile shell CSS. */
.td6-v3-gaming-mat-product .md-zoom-layer {
	position: fixed;
	z-index: 10000;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, .88);
	color: #fff;
}

.td6-v3-gaming-mat-product .md-zoom-stage {
	max-width: 95vw;
	max-height: 90vh;
	overflow: auto;
	background: #fff;
}

.td6-v3-gaming-mat-product .md-zoom-stage canvas {
	display: block;
	max-width: none;
}

.td6-v3-gaming-mat-product .md-zoom-close {
	position: fixed;
	top: 16px;
	right: 18px;
	z-index: 2;
	display: grid;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .7);
	border-radius: 50%;
	background: #171717;
	color: #fff;
	font: 500 28px/1 Arial, sans-serif;
	cursor: pointer;
	place-items: center;
}

.td6-v3-gaming-mat-product .md-zoom-controls {
	position: fixed;
	top: 50%;
	right: 18px;
	display: grid;
	gap: 6px;
	transform: translateY(-50%);
	place-items: center;
}

.td6-v3-gaming-mat-product .md-zoom-controls button,
.td6-v3-gaming-mat-product .md-zoom-percent {
	display: grid;
	width: 42px;
	min-height: 38px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 4px;
	background: #252525;
	color: #fff;
	font: 600 14px/1 Arial, sans-serif;
	place-items: center;
}

.td6-gaming-mat-product .md-backdrops {
	clear: both;
	width: min(100%, 1280px);
	margin: clamp(4rem, 7vw, 7rem) auto 0;
	padding-top: clamp(.75rem, 1.5vw, 1rem);
	border-top: 1px solid #d8d8d5;
}

.td6-gaming-mat-product .md-backdrops .md-section-title,
.td6-gaming-mat-product .md-backdrops .md-section-subtitle {
	margin-inline: auto;
	text-align: center;
}

.td6-gaming-mat-product .md-backdrops .md-section-title {
	margin-bottom: .4rem;
	font-size: clamp(1.5rem, 2vw, 1.75rem);
	font-weight: 600;
	letter-spacing: -.015em;
}

.td6-gaming-mat-product .md-backdrops .md-section-subtitle {
	width: min(100%, 900px);
	margin-bottom: 1.25rem;
	color: #555;
}

.td6-gaming-mat-product .md-backdrops .md-backdrops-instructions {
	width: min(100%, 900px);
	margin: .75rem auto 1.5rem;
}

.td6-gaming-mat-product .md-backdrops .md-howto-title {
	margin-bottom: .4rem;
	text-align: center;
}

.td6-gaming-mat-product .md-backdrops .md-howto-list {
	color: #444;
	line-height: 1.55;
}

.td6-gaming-mat-product .md-backdrops-cta {
	margin: .75rem 0 1.5rem !important;
	text-align: center;
}

.td6-gaming-mat-product .md-backdrops-cta .md-summary-add-btn {
	min-height: 44px;
	padding: .7rem 1.35rem;
	border: 0;
	border-radius: 4px;
	background: var(--md-cta, #ffc107);
	color: #111;
	font-weight: 700;
	cursor: pointer;
}

@media (min-width: 1200px) {
	.td6-gaming-mat-product .mat-designer-backdrop-gallery {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		max-width: 1000px;
	}

	.td6-gaming-mat-product .mat-designer-backdrop-gallery .backdrop-gallery-thumb {
		width: 100%;
		height: auto;
		aspect-ratio: 1;
	}
}

@media (max-width: 1199px) {
	.td6-gaming-mat-product .mat-designer-flavour-gallery,
	.td6-gaming-mat-product .mat-designer-backdrop-gallery,
	.td6-gaming-mat-product .mat-designer-backdrop-featured-gallery {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		padding-block: 6px;
		scrollbar-width: thin;
	}

	.td6-gaming-mat-product .flavour-gallery-thumb,
	.td6-gaming-mat-product .backdrop-gallery-thumb,
	.td6-gaming-mat-product .backdrop-featured-thumb {
		flex: 0 0 80px;
		width: 80px;
		height: 80px;
		border-radius: 6px;
		object-fit: cover;
	}
}

@media (max-width: 767px) {
	.td6-gaming-mat-product {
		padding-top: 2.5rem;
	}

	.td6-gaming-mat-product__inner {
		width: min(100% - 24px, 1500px);
	}

	.td6-gaming-mat-product__header h1 {
		max-width: 100%;
		font-size: clamp(1.55rem, 7vw, 1.65rem);
		overflow-wrap: anywhere;
	}

}
