/* Native Divi galleries remain editable and show their normal grid without JS. */
body #page-container .pp-product-gallery {
	min-width: 0;
}

body #page-container .pp-product-gallery-row > .et_pb_column {
	min-width: 0;
}

body #page-container .et_pb_row.pp-product-gallery-notes {
	margin-top: 24px !important;
}

body #page-container .pp-product-gallery-notes .et_pb_text_inner p {
	font-size: 14px !important;
}

body #page-container .pp-product-gallery .et_pb_gallery_image img {
	aspect-ratio: 1;
	background: var(--pp-surface);
	object-fit: contain;
}

body #page-container .pp-product-gallery .et_overlay {
	border-color: var(--pp-line) !important;
}

body #page-container .pp-product-gallery .et_overlay::before {
	color: var(--pp-orange-deep) !important;
}

body #page-container .pp-product-gallery.pp-product-gallery--ready .et_pb_gallery_items {
	display: block !important;
	margin: 0 !important;
	touch-action: pan-y pinch-zoom;
	width: 100% !important;
}

body #page-container .pp-product-gallery--ready .et_pb_gallery_items::before,
body #page-container .pp-product-gallery--ready .et_pb_gallery_items::after {
	display: none;
}

body #page-container .pp-product-gallery.pp-product-gallery--ready .et_pb_gallery_item {
	clear: none !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
	width: 100% !important;
}

body #page-container .pp-product-gallery.pp-product-gallery--ready .et_pb_gallery_item[hidden] {
	display: none !important;
}

body #page-container .pp-product-gallery.pp-product-gallery--ready .et_pb_gallery_item:not([hidden]) {
	display: block !important;
	opacity: 1 !important;
}

body #page-container .pp-product-gallery--ready .et_pb_gallery_image {
	aspect-ratio: 1;
	background: var(--pp-surface);
	border: 1px solid var(--pp-line);
	border-radius: 8px;
	margin: 0 auto !important;
	max-height: 480px;
	max-width: 480px;
	overflow: hidden;
	width: 100%;
}

body #page-container .pp-product-gallery--ready .et_pb_gallery_image a {
	align-items: center;
	display: flex;
	height: 100%;
	justify-content: center;
	width: 100%;
}

body #page-container .pp-product-gallery--ready .et_pb_gallery_image img {
	display: block;
	height: 100% !important;
	max-height: 480px;
	object-fit: contain;
	width: 100% !important;
}

body #page-container .pp-product-gallery--ready .et_pb_gallery_title {
	color: var(--pp-ink);
	font-family: var(--pp-font-ui);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	margin: 20px 0 8px !important;
	padding: 0 !important;
	text-align: center;
}

body #page-container .pp-product-gallery--ready .et_pb_gallery_caption {
	color: var(--pp-muted);
	font-family: var(--pp-font-ui);
	font-size: 15px;
	line-height: 1.6;
	margin: 0 auto !important;
	max-width: 640px;
	padding: 0 !important;
	text-align: center;
}

body #page-container .pp-product-gallery__controls {
	align-items: center;
	display: flex;
	gap: 18px;
	justify-content: center;
	margin: 20px 0 16px;
}

body #page-container .pp-product-gallery__counter {
	color: var(--pp-muted);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	min-width: 64px;
	text-align: center;
}

body #page-container .pp-product-gallery__arrow,
body #page-container .pp-product-gallery__thumb {
	appearance: none;
	background: var(--pp-surface);
	border: 2px solid var(--pp-line);
	border-radius: 8px;
	color: var(--pp-ink);
	cursor: pointer;
	font-family: var(--pp-font-ui);
	margin: 0;
	transition: background-color 160ms ease, border-color 160ms ease;
}

body #page-container .pp-product-gallery__arrow {
	align-items: center;
	display: inline-flex;
	height: 44px;
	justify-content: center;
	padding: 0;
	width: 44px;
}

body #page-container .pp-product-gallery__arrow::before {
	border-right: 2px solid currentColor;
	border-top: 2px solid currentColor;
	content: '';
	height: 9px;
	transform: rotate(45deg) translate(-1px, 1px);
	width: 9px;
}

body #page-container .pp-product-gallery__arrow--prev::before {
	transform: rotate(-135deg) translate(-1px, 1px);
}

body #page-container .pp-product-gallery__arrow:hover,
body #page-container .pp-product-gallery__thumb:hover {
	border-color: var(--pp-orange);
}

body #page-container .pp-product-gallery__arrow:focus-visible,
body #page-container .pp-product-gallery__thumb:focus-visible {
	outline: 2px solid var(--pp-orange);
	outline-offset: 3px;
}

body #page-container .pp-product-gallery__rail {
	display: flex;
	gap: 10px;
	margin: 0;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	padding: 5px 5px 12px;
	scroll-padding-inline: 5px;
	scroll-snap-type: x proximity;
	scrollbar-color: var(--pp-orange-deep) var(--pp-bg);
	scrollbar-width: thin;
}

body #page-container .pp-product-gallery__thumb {
	align-items: stretch;
	display: flex;
	flex: 0 0 116px;
	flex-direction: column;
	gap: 8px;
	padding: 6px;
	scroll-snap-align: start;
	text-align: center;
}

body #page-container .pp-product-gallery__thumb[aria-pressed='true'] {
	background: var(--pp-orange-soft);
	border-color: var(--pp-orange);
}

body #page-container .pp-product-gallery__thumb img {
	aspect-ratio: 1;
	background: var(--pp-surface);
	border-radius: 4px;
	display: block;
	height: auto;
	object-fit: contain;
	width: 100%;
}

body #page-container .pp-product-gallery__thumb span {
	font-size: 12px;
	font-weight: 700;
	line-height: 1.35;
	overflow-wrap: anywhere;
	padding: 0 2px 4px;
}

body #page-container .pp-product-gallery__status {
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

@media (max-width: 640px) {
	body #page-container .pp-product-gallery__thumb { flex-basis: 96px; }
	body #page-container .pp-product-gallery--ready .et_pb_gallery_title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	body #page-container .pp-product-gallery__arrow,
	body #page-container .pp-product-gallery__thumb { transition: none; }
}

/* Room layouts use native rows and galleries; enhancement is scoped to this section. */
body #page-container .pp-lighting-layouts .pp-lighting-layout-group,
body #page-container .pp-lighting-layouts .pp-lighting-layout-group > .et_pb_column {
	min-width: 0;
}

body #page-container .pp-lighting-layouts .et_pb_row.pp-lighting-layout-group {
	display: grid !important;
	gap: 48px;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

body #page-container .pp-lighting-layouts .pp-lighting-layout-group::after {
	display: none;
}

body #page-container .pp-lighting-layouts .pp-lighting-layout-group > .et_pb_column {
	margin: 0 !important;
	width: 100% !important;
}

body #page-container .pp-lighting-layouts--ready .pp-lighting-layout-group[hidden] {
	display: none !important;
}

body #page-container .pp-lighting-layouts .et_pb_row.pp-layout-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 32px !important;
}

body #page-container .pp-layout-tabs::after {
	display: none;
}

body #page-container .pp-layout-tabs__tab {
	appearance: none;
	background: var(--pp-surface);
	border: 2px solid var(--pp-line);
	border-radius: 8px;
	color: var(--pp-ink);
	cursor: pointer;
	font-family: var(--pp-font-ui);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0;
	min-height: 48px;
	padding: 12px 20px;
	text-align: center;
	transition: background-color 160ms ease, border-color 160ms ease;
}

body #page-container .pp-layout-tabs__tab:hover {
	border-color: var(--pp-orange);
}

body #page-container .pp-layout-tabs__tab[aria-selected='true'] {
	background: var(--pp-orange-soft);
	border-color: var(--pp-orange);
}

body #page-container .pp-layout-tabs__tab:focus-visible,
body #page-container .pp-lighting-layouts .pp-lighting-layout-group:focus-visible {
	outline: 2px solid var(--pp-orange);
	outline-offset: 3px;
}

body #page-container .pp-lighting-layouts .pp-layout-gallery .et_pb_gallery_image img {
	aspect-ratio: 3 / 2;
}

body #page-container .pp-lighting-layouts .pp-layout-gallery.pp-product-gallery--ready .et_pb_gallery_image {
	aspect-ratio: 3 / 2;
	max-height: none;
	max-width: 640px;
}

body #page-container .pp-lighting-layouts .pp-layout-gallery.pp-product-gallery--ready .et_pb_gallery_image img {
	max-height: none;
}

body #page-container .pp-lighting-layouts .pp-layout-gallery .pp-product-gallery__rail {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	max-height: none;
	overflow: visible;
	scroll-snap-type: none;
}

body #page-container .pp-lighting-layouts .pp-layout-gallery .pp-product-gallery__thumb {
	gap: 6px;
	min-width: 0;
	padding: 5px;
}

body #page-container .pp-lighting-layouts .pp-layout-gallery .pp-product-gallery__thumb img {
	aspect-ratio: 3 / 2;
}

body #page-container .pp-lighting-layouts .pp-layout-gallery .pp-product-gallery__thumb span {
	font-size: 11px;
	line-height: 1.35;
}

@media (max-width: 980px) {
	body #page-container .pp-lighting-layouts .et_pb_row.pp-lighting-layout-group {
		gap: 24px;
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 640px) {
	body #page-container .pp-layout-tabs__tab {
		flex: 1 1 calc(50% - 10px);
		font-size: 14px;
		padding: 10px 12px;
	}

	body #page-container .pp-lighting-layouts .pp-layout-gallery .pp-product-gallery__rail {
		display: flex;
		max-height: none;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x proximity;
	}

	body #page-container .pp-lighting-layouts .pp-layout-gallery .pp-product-gallery__thumb {
		flex-basis: 112px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body #page-container .pp-layout-tabs__tab { transition: none; }
}
