/**
 * Catálogo — franja editorial de la single.
 */

body.catalogo-theme.single-product .catalogo-single-gallery-strip {
	grid-column: 1 / -1;
	width: 100vw;
	max-width: none;
	margin: clamp(48px, 6vw, 88px) calc(50% - 50vw) 0;
	overflow: hidden;
	background: var(--wtds-surface, #fff);
}

body.catalogo-theme.single-product .catalogo-single-gallery-strip__track {
	display: flex;
	gap: 0;
	overflow: hidden;
	width: 100%;
}

body.catalogo-theme.single-product .catalogo-single-gallery-strip__item {
	position: relative;
	min-width: 0;
	aspect-ratio: 1 / 1;
	flex: 0 0 calc(100% / var(--catalogo-single-gallery-visible, 4));
	margin: 0;
	overflow: hidden;
	background: var(--wtds-surface-2, #f8f6f2);
	width: calc(100% / var(--catalogo-single-gallery-visible, 4));
}

body.catalogo-theme.single-product .catalogo-single-gallery-strip__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
}

body.catalogo-theme.single-product .catalogo-single-gallery-strip--carousel .catalogo-single-gallery-strip__track {
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-inline: contain;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

body.catalogo-theme.single-product .catalogo-single-gallery-strip--carousel .catalogo-single-gallery-strip__track::-webkit-scrollbar {
	display: none;
}

body.catalogo-theme.single-product .catalogo-single-gallery-strip--carousel .catalogo-single-gallery-strip__item {
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

@media (max-width: 47.9375rem) {
	body.catalogo-theme.single-product .catalogo-single-gallery-strip {
		margin-top: 48px;
		order: 3;
		overflow: visible;
	}

	body.catalogo-theme.single-product .catalogo-single-gallery-strip__track {
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		overscroll-behavior-inline: contain;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	body.catalogo-theme.single-product .catalogo-single-gallery-strip__track::-webkit-scrollbar {
		display: none;
	}

	body.catalogo-theme.single-product .catalogo-single-gallery-strip__item {
		flex: 0 0 50vw;
		width: 50vw;
		scroll-snap-align: start;
		scroll-snap-stop: always;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.catalogo-theme.single-product .catalogo-single-gallery-strip__track {
		scroll-behavior: auto;
	}
}

/* Main gallery: editorial cells follow the photo count, not source dimensions.
   The canonical gallery remains available without JavaScript. */
body.catalogo-theme.single-product #wapu-single .wapu-single__gallery:has(.catalogo-mosaic-ready) {
	display: block !important;
	position: relative !important;
	top: auto !important;
	overflow: visible !important;
}

body.catalogo-theme.single-product #wapu-single .wapu-single__gallery .wapu-vg.catalogo-mosaic-ready > .wapu-vg__stage,
body.catalogo-theme.single-product #wapu-single .wapu-single__gallery .wapu-vg.catalogo-mosaic-ready > .wapu-vg__grid {
	display: none !important;
}

body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic {
	--mosaic-gap: 8px;
	container-type: inline-size;
	width: 100%;
	min-width: 0;
}

body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: calc((100cqw - var(--mosaic-gap)) / 4 - var(--mosaic-gap) / 2);
	gap: var(--mosaic-gap);
	width: 100%;
}

/* Five photos retain the stagger: short cells are 6:5, tall cells nearly 4:5. */
body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic[data-count="5"] .catalogo-single-mosaic__grid {
	grid-auto-rows: calc((100cqw - var(--mosaic-gap)) * 5 / 24 - var(--mosaic-gap) / 2);
}

body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic__tile {
	position: relative;
	grid-column: var(--mosaic-column) / span var(--mosaic-width);
	grid-row: var(--mosaic-row) / span var(--mosaic-height);
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border-radius: 6px;
	background: var(--wtds-surface-2, #f8f6f2);
}

body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic__open {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: inherit;
	background: transparent;
	color: inherit;
	cursor: zoom-in;
	box-shadow: none;
}

body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic__open:focus-visible {
	outline: 3px solid var(--wtds-ink, #111);
	outline-offset: -4px;
}

body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic__all {
	display: flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	max-width: 100%;
	min-height: 44px;
	margin: 12px auto 0;
	padding: 10px 18px;
	border: 1px solid var(--wtds-ink, #171717);
	border-radius: 4px;
	background: var(--wtds-surface, #fff);
	color: var(--wtds-ink, #171717);
	font: 500 14px/1.4 var(--wtds-font-text, Arial, sans-serif);
	cursor: pointer;
}
body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic__all:hover {
	background: var(--wtds-surface-2, #f5f3ee);
}
body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic__all:focus-visible {
	outline: 2px solid var(--wtds-ink, #171717);
	outline-offset: 3px;
}

body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic__media {
	display: block !important;
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0;
	border-radius: inherit;
	object-fit: cover !important;
	object-position: center !important;
}

/* One or two photos keep complete square stages; pairs stack vertically. */
body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic[data-count="1"] .catalogo-single-mosaic__grid {
	display: block;
}
body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic[data-count="2"] .catalogo-single-mosaic__grid {
	display: flex;
	flex-direction: column;
}
body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic[data-count="1"] .catalogo-single-mosaic__tile,
body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic[data-count="2"] .catalogo-single-mosaic__tile {
	aspect-ratio: 1 / 1;
}

@media (max-width: 47.9375rem) {
	body.catalogo-theme.single-product #wapu-single .catalogo-single-mosaic { --mosaic-gap: 4px; }
}

/* Compatibility with older parents using the child's single strip renderer. */
@media (min-width: 48rem) {
	body.catalogo-theme.single-product .catalogo-single-gallery-strip {
		display: none !important;
	}
}

/* Recommendation tabs follow the store's primary palette. */
body.catalogo-theme.single-product .wapu-product-related-below[data-wapu-related-tabs] .wapu-related-tabs__list {
	gap: .5rem;
}
body.catalogo-theme.single-product .wapu-product-related-below[data-wapu-related-tabs] .wapu-related-tabs__list > [role="tab"] {
	padding-inline: .875rem;
	border: 0;
	border-radius: 10px;
}
body.catalogo-theme.single-product .wapu-product-related-below[data-wapu-related-tabs] .wapu-related-tabs__list > [aria-selected="true"] {
	background-color: var(--wtds-primary-soft, color-mix(in srgb, var(--wtds-primary, var(--wtds-action)) 12%, transparent));
}
body.catalogo-theme.single-product .wapu-product-related-below[data-wapu-related-tabs] .wapu-related-tabs__track {
	display: none;
}

/* Seguir explorando inherits the former desktop strip's full-width squares. */
@media (min-width: 48rem) {
	body.catalogo-theme.single-product #wapu-single .wapu-product-related-below .wapu-single__related-carousel-stage {
		width: 100vw;
		max-width: none;
		margin-inline: calc(50% - 50vw);
	}
	body.catalogo-theme.single-product #wapu-single .wapu-product-related-below .wapu-single__related-carousel-viewport {
		scroll-snap-type: x mandatory;
	}
	body.catalogo-theme.single-product #wapu-single .wapu-product-related-below .wapu-single__related-carousel-track {
		display: flex;
		flex-flow: row nowrap;
		width: 100%;
		min-width: 0;
		gap: 0;
		justify-content: flex-start;
	}
	body.catalogo-theme.single-product #wapu-single .wapu-product-related-below .wapu-single__related-carousel-item {
		flex: 0 0 calc(100% / var(--catalogo-related-visible, 4));
		width: calc(100% / var(--catalogo-related-visible, 4));
		min-width: 0;
		scroll-snap-align: start;
		scroll-snap-stop: normal;
	}
	body.catalogo-theme.single-product #wapu-single .wapu-product-related-below .wapu-single__related-compact-card {
		gap: 0;
		height: 100%;
	}
	body.catalogo-theme.single-product #wapu-single .wapu-product-related-below .wapu-single__related-compact-media {
		aspect-ratio: 1 / 1;
		border-radius: 0;
	}
	body.catalogo-theme.single-product #wapu-single .wapu-product-related-below .wapu-single__related-compact-content {
		padding: 12px 16px 16px;
	}
	body.catalogo-theme.single-product #wapu-single .wapu-product-related-below .wapu-single__related-carousel-viewport.is-dragging {
		scroll-behavior: auto;
		scroll-snap-type: none;
		cursor: grabbing;
	}
}

@media (min-width: 48rem) and (prefers-reduced-motion: reduce) {
	body.catalogo-theme.single-product #wapu-single .wapu-product-related-below .wapu-single__related-carousel-viewport {
		scroll-behavior: auto;
	}
}

/* The canonical Reviews block occupies the purchase column on desktop. */
body.catalogo-theme.single-product #wapu-single .catalogo-single-reviews {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	flex: 0 0 auto;
	order: 2;
}
body.catalogo-theme.single-product #wapu-single .catalogo-single-reviews > .wapu-reviews-section {
	width: 100%;
	max-width: none;
	min-width: 0;
	margin: 0;
	padding: 24px 0 0;
	flex: 0 0 auto;
	grid-column: auto;
}
body.catalogo-theme.single-product .catalogo-single-reviews .wapu-tab-hero,
body.catalogo-theme.single-product .catalogo-single-reviews .wapu-summary,
body.catalogo-theme.single-product .catalogo-single-reviews .wapu-photos-strip-wrap { min-width: 0; }
body.catalogo-theme.single-product .catalogo-single-reviews .wapu-filters,
body.catalogo-theme.single-product .catalogo-single-reviews .wapu-reviews-pagination { flex-wrap: wrap; gap: 6px; }
@container reviews-section (max-width: 40rem) {
	body.catalogo-theme.single-product .catalogo-single-reviews .wapu-tab-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 47.9375rem) {
	body.catalogo-theme.single-product #wapu-single > .catalogo-single-reviews { padding-inline: 24px; }
}

/* Reviews' photo panel shares a legacy class with the parent's modal shell. */
body.catalogo-theme.single-product #wapu-photo-modal > .wapu-modal {
	position: relative;
	inset: auto;
	padding: 0;
	align-items: stretch;
	justify-content: normal;
}
body.catalogo-theme.single-product #wapu-photo-modal.is-open > .wapu-modal {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
