/**
 * Shop Recent Videos block styles.
 *
 * @package made-to-thrive-2026-base
 */

/* -------------------------------------------------------------------------
   Block wrapper
   ------------------------------------------------------------------------- */

.mtt-shop-recent-videos {
	background-color: var(--wp--preset--color--ivory, #FDF9F3);
	box-sizing: border-box;
	color: var(--wp--preset--color--espresso, #6B6647);
	margin-inline: auto;
	max-width: 1110px;
	padding-block: 70px 0;
	padding-inline: clamp(1rem, 3vw, 1.25rem);
	width: 100%;
}

@media (min-width: 768px) {
	.mtt-shop-recent-videos {
		padding-inline: 0;
	}
}

.mtt-shop-recent-videos *,
.mtt-shop-recent-videos *::before,
.mtt-shop-recent-videos *::after {
	box-sizing: border-box;
}

.mtt-srv__preview {
	margin: 0;
}

.mtt-srv__empty,
.mtt-srv__products-empty {
	margin: 0;
	padding: 1rem;
	text-align: center;
}

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */

.mtt-srv__header {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	justify-content: space-between;
	margin-bottom: clamp(1rem, 2.5vw, 1.75rem);
	width: 100%;
}

.mtt-srv__header .wp-block-heading {
	color: inherit;
	margin: 0;
}

.mtt-srv__header .wp-block-button {
	margin: 0;
}

.mtt-srv__header .wp-block-button__link {
	border-color: currentColor;
	color: inherit;
	padding: 15px 30px!important;
}

/* -------------------------------------------------------------------------
   Body layout
   ------------------------------------------------------------------------- */

.mtt-srv__body {
	align-items: start;
	display: grid;
	gap: 40px;
	grid-template-columns: 330px 340px 436px;
	margin-bottom:109px;
}

/* -------------------------------------------------------------------------
   Tab navigation
   ------------------------------------------------------------------------- */

.mtt-srv__tabs-trigger {
	display: none;
}

.mtt-srv__tabs {
	border: 1px solid #4D3700;
	display: flex;
	flex-direction: column;
	gap: 0;
	height: 488px;
	margin: 0;
	overflow-y: auto;
	padding: 0;
	width: 330px;
}

.mtt-srv__tab {
    appearance: none;
    background-color: transparent;
    border: 0;
    border-bottom: 1px solid #4D3700;
    color: inherit;
    cursor: pointer;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    font-weight: 400;
    gap: 36px;
    justify-content: flex-start;
    min-height: 83px;
    padding: 0.875rem 2.2rem;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
    width: 100%;
}

.mtt-srv__tab:last-child {
	border-bottom: 0;
}

.mtt-srv__tab.is-active,
.mtt-srv__tab[aria-selected="true"] {
	background-color: var(--mtt-srv-highlight, #E8DCCB);
}

.mtt-srv__tab:hover {
	background-color: var(--mtt-srv-highlight, #E8DCCB);
}

.mtt-srv__tab:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.mtt-srv__tab-number {
	flex-shrink: 0;
	font-family: var(--wp--preset--font-family--source-sans-3, "Source Sans 3", sans-serif);
	font-size: 15px;
	font-weight: 400;
	line-height: 22px;
}

.mtt-srv__tab-title {
	flex: 1 1 auto;
	font-family: var(--wp--preset--font-family--la-roue, "La Roue", serif);
	font-size: 22px;
	font-weight: 400;
	line-height: 22px;
	min-width: 0;
}

/* -------------------------------------------------------------------------
   Video column
   ------------------------------------------------------------------------- */

.mtt-srv__video-col {
	border: 1px solid #4D3700;
	height: 488px;
	min-width: 0;
	overflow: hidden;
	position: relative;
	width: 340px;
}

.mtt-srv__video-panel {
	height: 100%;
	min-height: 0;
	overflow: hidden;
}

.mtt-srv__video-panel .mtt-sv__video {
	height: 100%;
	position: relative;
	width: 100%;
}

.mtt-srv__video-panel .mtt-sv__video-cover,
.mtt-srv__video-panel .mtt-sv__video-player {
	height: 100%;
	width: 100%;
}

.mtt-srv__video-panel .mtt-sv__video-cover {
	position: relative;
}

.mtt-srv__video-panel .mtt-sv__cover-image {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.mtt-srv__video-panel .mtt-sv__play {
	align-items: center;
	background: transparent;
	border: 0;
	cursor: pointer;
	display: flex;
	height: 100%;
	justify-content: center;
	left: 0;
	padding: 0;
	position: absolute;
	top: 0;
	width: 100%;
}

.mtt-srv__video-panel .mtt-sv__play:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

.mtt-srv__video-panel .mtt-sv__play svg {
	display: block;
	flex-shrink: 0;
	height: 65.833px;
	width: 65.833px;
}

.mtt-srv__video-panel .mtt-sv__video-element,
.mtt-srv__video-panel .mtt-sv__video-embed,
.mtt-srv__video-panel .mtt-sv__video-embed iframe {
	display: block;
	height: 100%;
	width: 100%;
}

.mtt-srv__video-panel .mtt-sv__video-element {
	object-fit: cover;
}

.mtt-srv__video-panel .mtt-sv__video-embed--instagram {
	align-items: stretch;
	background: #fafafa;
	display: flex;
	height: 100%;
	justify-content: center;
	overflow: hidden;
	width: 100%;
}

.mtt-srv__video-panel .mtt-sv__video-embed--instagram .instagram-media {
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	margin: 0 !important;
	max-width: 100% !important;
	min-width: 0 !important;
	padding: 0 !important;
	width: 100% !important;
}

.mtt-srv__video-panel .mtt-sv__video-embed--instagram iframe {
	border: 0 !important;
	display: block !important;
	height: 100% !important;
	margin: 0 auto !important;
	max-width: 100% !important;
	min-width: 0 !important;
	width: 100% !important;
}

.mtt-srv__video-empty {
	align-items: center;
	display: flex;
	height: 100%;
	justify-content: center;
	margin: 0;
	min-height: 0;
	padding: 1rem;
	text-align: center;
}

/* -------------------------------------------------------------------------
   Products column
   ------------------------------------------------------------------------- */

.mtt-srv__products-col {
	height: 488px;
	min-width: 0;
	overflow: visible;
	position: relative;
	width: 436px;
}

.mtt-srv__products-panel {
	align-items: stretch;
	display: flex;
	gap: 16px;
	height: 100%;
	min-height: 0;
}

.mtt-srv__products-panel[hidden] {
	/* Keep layout width so LTK/ShopMy widgets can measure while inactive.
	   display:none collapses width to 0 and leaves the slider showing one image. */
	display: flex !important;
	height: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
	overflow: hidden !important;
	padding: 0 !important;
	pointer-events: none;
	visibility: hidden;
}

.mtt-srv__products-panel.is-active,
.mtt-srv__products-panel:not([hidden]) {
	height: 100% !important;
	min-height: 0;
	overflow: visible;
	pointer-events: auto;
	visibility: visible;
}

.mtt-srv__products-wrap {
	border: 1px solid #4D3700;
	flex: 0 0 384px;
	height: 488px;
	min-height: 0;
	padding: 0.75rem 30px 0;
	width: 384px;
}

.mtt-srv__grid-scroll {
	height: 100%;
	min-height: 0;
	min-width: 0;
	overflow-y: auto;
	scrollbar-width: none;
}

.mtt-srv__grid-scroll::-webkit-scrollbar {
	display: none;
}

.mtt-srv__grid-scroll:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.mtt-srv__grid {
	display: grid;
	gap: 0.625rem;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.mtt-srv__grid-item {
	margin: 0;
}

.mtt-srv__grid-link {
	display: block;
	height: 120px;
	overflow: hidden;
	text-decoration: none;
}

.mtt-srv__grid-image {
	display: block;
	height: 100%;
	object-fit: contain;
	object-position: center;
	transition: transform 0.3s ease;
	width: 100%;
}

.mtt-srv__grid-link:hover .mtt-srv__grid-image,
.mtt-srv__grid-link:focus-visible .mtt-srv__grid-image {
	transform: scale(1.06);
}

.mtt-srv__embed {
	flex: 1 1 auto;
	min-height: 0;
	min-width: 0;
	overflow-y: auto;
}

.mtt-srv__embed iframe {
	max-width: 100%;
}

/* -------------------------------------------------------------------------
   Custom vertical scrollbar
   ------------------------------------------------------------------------- */

.mtt-srv__scrollbar {
	align-self: center;
	flex: 0 0 36px;
	height: 281px;
	margin-left: 5px;
	position: relative;
	width: 36px;
}

.mtt-srv__scrollbar-track {
	background-color: #4D3700;
	bottom: 0;
	height: 100%;
	left: 12px;
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	width: 1px;
}

.mtt-srv__scrollbar-thumb {
	align-items: center;
	appearance: none;
	background: transparent;
	border: 0;
	cursor: grab;
	display: flex;
	gap: 10px;
	height: 24px;
	left: 0;
	margin: 0;
	padding: 0;
	position: absolute;
	top: 0;
	transform: translateY(0);
	width: auto;
}

.mtt-srv__scrollbar-thumb-circle {
	background-color: var(--mtt-srv-highlight, #E8DCCB);
	border: 1px solid #4D3700;
	border-radius: 50%;
	flex-shrink: 0;
	height: 24px;
	width: 24px;
}

.mtt-srv__scrollbar-thumb svg {
	display: block;
	flex-shrink: 0;
	height: 19.965px;
	width: 7.748px;
}

.mtt-srv__scrollbar-thumb:active {
	cursor: grabbing;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 1240px) {
	.mtt-shop-recent-videos {
		max-width: 950px;
	}

	.mtt-srv__body {
		gap: 10px;
		grid-template-columns:
			minmax(0, 330fr)
			minmax(0, 340fr)
			minmax(0, 436fr);
	}

	.mtt-srv__tabs,
	.mtt-srv__video-col,
	.mtt-srv__products-col {
		min-width: 0;
		width: 100%;
	}

	.mtt-srv__products-panel {
		min-width: 0;
		width: 100%;
	}

	.mtt-srv__products-wrap {
		flex: 1 1 auto;
		min-width: 0;
		width: auto;
	}
}

@media (min-width: 768px) and (max-width: 1240px) {
	.mtt-srv__header .wp-block-button {
		transform: translateX(-56px);
	}
}

@media (max-width: 880px) {
	.mtt-shop-recent-videos {
		max-width: 90%;
	}

	.mtt-srv__body {
		grid-template-columns: minmax(0, 324fr) minmax(0, 436fr);
	}

	.mtt-srv__tabs-trigger {
		align-items: center;
		background: transparent;
		border: 1px solid #4D3700;
		color: inherit;
		display: flex;
		font-family: var(--wp--preset--font-family--source-sans-3, "Source Sans 3", sans-serif);
		font-size: 15px;
		font-weight: 700;
		grid-column: 1 / -1;
		justify-content: space-between;
		padding: 1rem;
		text-transform: uppercase;
		width: calc(100% - 56px);
	}

	.mtt-srv__tabs-trigger::after {
		content: "+";
		font-size: 1.25rem;
		line-height: 1;
	}

	.mtt-srv__tabs-trigger[aria-expanded="true"]::after {
		content: "−";
	}

	.mtt-srv__tabs {
		display: none;
		flex-direction: column;
		grid-column: 1 / -1;
		height: auto;
		max-height: none;
		overflow: visible;
		width: calc(100% - 56px);
	}

	.mtt-srv__tabs.is-open {
		display: flex;
	}

	.mtt-srv__tab {
		border-bottom: 1px solid #4D3700;
		border-right: 0;
		flex: none;
		min-width: 0;
		width: 100%;
	}

	.mtt-srv__tab:last-child {
		border-bottom: 0;
	}
}

@media (max-width: 768px) {
	.mtt-srv__header .wp-block-button {
		display: none;
	}

	.mtt-srv__header .wp-block-heading {
		text-align: center;
		width: 100%;
	}

	.mtt-srv__body {
		grid-template-columns: minmax(0, 1fr);
		margin: 0 auto 50px;
		max-width: 500px;
	}

	.mtt-srv__tabs-trigger {
		width: 100%;
	}

	.mtt-srv__video-col,
	.mtt-srv__products-col {
		grid-column: 1;
		width: 100%;
	}

	.mtt-srv__products-col {
		height: auto;
	}

	.mtt-srv__products-panel,
	.mtt-srv__products-panel.is-active,
	.mtt-srv__products-panel:not([hidden]) {
		flex-direction: column;
		height: auto !important;
		width: 100%;
	}

	.mtt-srv__products-wrap {
		flex: none;
		height: auto;
		padding: 0.75rem 0;
		width: 100%;
	}

	.mtt-srv__grid-scroll {
		height: auto;
		overflow-x: auto;
		overflow-y: hidden;
	}

	.mtt-srv__grid {
		display: grid;
		grid-auto-columns: calc((100% - 1.875rem) / 3.5);
		grid-auto-flow: column;
		grid-template-columns: none;
		grid-template-rows: minmax(0, 1fr);
	}

	.mtt-srv__scrollbar {
		align-self: center;
		flex: none;
		height: 36px;
		margin: 5px 0 0;
		width: 281px;
	}

	.mtt-srv__scrollbar-track {
		bottom: auto;
		height: 1px;
		left: 0;
		right: 0;
		top: 12px;
		transform: translateY(-50%);
		width: 100%;
	}

	.mtt-srv__scrollbar-thumb {
		bottom: auto;
		left: 0;
		top: 0;
		transform: translateX(0);
	}

	.mtt-srv__scrollbar-thumb svg {
		display: none;
	}

	.mtt-srv__scrollbar-thumb::after {
		background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2219.965%22%20height%3D%227.748%22%20viewBox%3D%220%200%2019.965%207.748%22%3E%3Cg%20transform%3D%22translate%28-531.742%20-1272.126%29%22%3E%3Cg%20transform%3D%22translate%28521.399%201248.48%29%22%3E%3Cpath%20d%3D%22M44%2C31.04l3.52-3.52L44%2C24%22%20transform%3D%22translate%28-17.919%29%22%20fill%3D%22none%22%20stroke%3D%22%234d3700%22%20stroke-width%3D%221%22%2F%3E%3Cline%20x1%3D%2217.276%22%20transform%3D%22translate%2812%2027.585%29%22%20fill%3D%22none%22%20stroke%3D%22%234d3700%22%20stroke-width%3D%221%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate%28562.051%201303.52%29%20rotate%28180%29%22%3E%3Cpath%20d%3D%22M44%2C31.04l3.52-3.52L44%2C24%22%20transform%3D%22translate%28-17.919%29%22%20fill%3D%22none%22%20stroke%3D%22%234d3700%22%20stroke-width%3D%221%22%2F%3E%3Cline%20x1%3D%2217.276%22%20transform%3D%22translate%2812%2027.585%29%22%20fill%3D%22none%22%20stroke%3D%22%234d3700%22%20stroke-width%3D%221%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E");
		background-position: center;
		background-repeat: no-repeat;
		background-size: contain;
		content: "";
		height: 7.748px;
		left: 50%;
		pointer-events: none;
		position: absolute;
		top: calc(100% + 11px);
		transform: translateX(-50%);
		width: 19.965px;
	}
}

@media (max-width: 550px) {
	.mtt-srv__body {
		position: relative;
	}

	.mtt-srv__tabs.is-open {
		background-color: var(--wp--preset--color--ivory, #FDF9F3);
		left: 0;
		position: absolute;
		top: 62px;
		width: 100%;
		z-index: 5;
	}
}

/* -------------------------------------------------------------------------
   Editor
   ------------------------------------------------------------------------- */

.mtt-srv-editor__placeholder {
	margin-top: 1rem;
}

.mtt-srv-editor__limit-note {
	font-size: 0.8125rem;
	margin: 0.5rem 0 0;
}

.mtt-srv-editor__slide {
	border: 1px solid #ddd;
	margin-top: 1rem;
	padding: 0.75rem;
}

.mtt-srv-editor__slide-header {
	align-items: center;
	display: flex;
	gap: 0.5rem;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.mtt-srv-editor__product-list {
	list-style: none;
	margin: 0.75rem 0 0;
	padding: 0;
}

.mtt-srv-editor__product-item + .mtt-srv-editor__product-item {
	margin-top: 0.5rem;
}

.mtt-srv-editor__product-row {
	align-items: center;
	display: flex;
	gap: 0.5rem;
	justify-content: space-between;
}

.mtt-srv-editor__product-fields {
	border-top: 1px solid #eee;
	margin-top: 0.5rem;
	padding-top: 0.5rem;
}

.mtt-shop-recent-videos.is-editor .mtt-srv__header {
	border-bottom: 1px dashed #ccc;
	padding-bottom: 1rem;
}

@media (prefers-reduced-motion: reduce) {
	.mtt-srv__tab {
		transition: none;
	}
}
