/*
 * Product page (inc/product-page.php). Desktop: [thumbs | landscape photo stage] + sticky info column, centred;
 * SEO description under the photos; «Похожие» below (related-products.css). ≤1024px: stacked, swipe slider.
 */

.pcm-pp {
	--pcm-pp-text: #111;
	--pcm-pp-muted: #6b6b6b;
	--pcm-pp-line: #e6e6e6;
	--pcm-pp-panel: #f4f4f4;
	--pcm-pp-info: 400px;
}

/* ---------- frame ---------- */
.pcm-pp #content > .ast-container {
	max-width: 1500px;
	padding-left: 48px;
	padding-right: 48px;
}

.pcm-pp #primary {
	margin-top: 32px;
	margin-bottom: 0;
	padding: 0;
}

.pcm-pp .woocommerce-notices-wrapper:empty,
.pcm-pp #content div.product > .pcm-badges {
	display: none; /* badges are re-printed inside the photo stage */
}

.pcm-pp #content .ast-woocommerce-container {
	padding: 0;
	background: transparent;
}

/* one column at every width (owner liked the tablet card): photo → info → details → «Похожие» */
.pcm-pp #content div.product {
	display: block;
}

.pcm-pp #content div.product::before,
.pcm-pp #content div.product::after {
	display: none;
}

.pcm-pp #content div.product > .summary {
	width: auto !important;
	max-width: none;
	float: none !important; /* Astra floats the summary right */
	clear: both;
	margin: 0;
	padding: 24px 0 0;
}

.pcm-pp #content div.product > .pcm-pp-details {
	clear: both;
}

.pcm-pp-sticky {
	position: static;
}

/* ---------- gallery ---------- */
.pcm-pp-gallery {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
	min-width: 0;
}

/* thumbs are not shown any more (dots instead, like on the tablet); markup kept for the slider script */
.pcm-pp-gallery__thumbs {
	order: 2;
	display: none !important;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
}

.pcm-pp-gallery__stage {
	order: 1;
}

.pcm-pp-gallery__thumbs::-webkit-scrollbar {
	display: none;
}

.pcm-pp .pcm-pp-gallery__thumb {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	width: 96px;
	aspect-ratio: 3 / 2;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 0;
	background: #fff;
	color: var(--pcm-pp-text);
	font-size: 10px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	opacity: 0.55;
	transition: opacity 0.2s, border-color 0.2s;
}

.pcm-pp .pcm-pp-gallery__thumb:hover,
.pcm-pp .pcm-pp-gallery__thumb.is-active {
	opacity: 1;
	background: #fff;
	color: var(--pcm-pp-text);
}

.pcm-pp .pcm-pp-gallery__thumb.is-active {
	border-color: var(--pcm-pp-text);
}

.pcm-pp-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.pcm-pp-gallery__thumb--video {
	background: var(--pcm-pp-panel) !important;
}

.pcm-pp-gallery__stage {
	position: relative;
	min-width: 0;
}

/* gap: without it a 1px sliver of the neighbouring (grey) photo shows at fractional widths */
.pcm-pp-gallery__track {
	display: flex;
	gap: 8px;
	touch-action: pan-x pan-y;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.pcm-pp-gallery__track::-webkit-scrollbar {
	display: none;
}

.pcm-pp-gallery__slide {
	flex: 0 0 100%;
	margin: 0;
	aspect-ratio: 3 / 2;
	scroll-snap-align: start;
	background: #fff;
}

.pcm-pp-gallery__zoom {
	display: block;
	width: 100%;
	height: 100%;
	cursor: pointer;
}

.pcm-pp-gallery__slide img,
.pcm-pp-gallery__slide video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.pcm-pp-gallery__slide video {
	background: #fff;
}

.pcm-pp .pcm-pp-gallery__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	padding: 0;
	border: 1px solid #111; /* visible on white-background photos too */
	border-radius: 50%;
	background: #fff;
	color: var(--pcm-pp-text);
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

.pcm-pp .pcm-pp-gallery__arrow:not(:disabled):hover {
	background: #111;
	color: #fff;
}

.pcm-pp-gallery__arrow--prev {
	left: 12px;
}

.pcm-pp-gallery__arrow--next {
	right: 12px;
}

.pcm-pp-gallery__stage:hover .pcm-pp-gallery__arrow:not(:disabled),
.pcm-pp .pcm-pp-gallery__arrow:focus-visible {
	opacity: 1;
}

.pcm-pp .pcm-pp-gallery__arrow:disabled {
	cursor: default;
}

.pcm-pp-gallery__dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	padding: 12px 0 0;
}

.pcm-pp-gallery__dots span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #cfcfcf;
	transition: background-color 0.2s;
}

.pcm-pp-gallery__dots span.is-active {
	background: #111;
}

.pcm-pp-gallery__stage .pcm-badges--single {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	margin: 0;
}

/* ---------- info column ---------- */
.pcm-pp .summary .woocommerce-breadcrumb {
	margin: 0 0 20px;
	padding: 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--pcm-pp-muted);
}

.pcm-pp .summary .woocommerce-breadcrumb a {
	color: var(--pcm-pp-muted);
}

.pcm-pp-head {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

.pcm-pp #content .pcm-pp-title {
	flex: 1 1 auto;
	margin: 0;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--pcm-pp-text);
}


.pcm-pp-price {
	margin: 12px 0 0;
	font-size: 22px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--pcm-pp-text);
}

.pcm-pp-price del {
	margin-right: 8px;
	font-size: 16px;
	color: var(--pcm-pp-muted);
	opacity: 1;
}

.pcm-pp-price ins {
	text-decoration: none;
}

.pcm-pp-stock {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--pcm-pp-muted);
}

.pcm-pp-stock::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #2e9b4f;
}

.pcm-pp-stock--outofstock::before {
	background: #b7b7b7;
}

.pcm-pp-stock--backorder::before {
	background: #d99a1e;
}

/* [ Добавить в корзину / Перейти в корзину ][ ♡ ] */
.pcm-pp-buy {
	display: flex;
	align-items: stretch;
	gap: 6px;
	margin: 24px 0 0;
}

.pcm-pp-buy > form.cart,
.pcm-pp-buy > .pcm-pp-to-cart {
	flex: 1 1 auto;
	min-width: 0;
}

.pcm-pp #content .pcm-pp-buy .pcm-fav-btn {
	flex: 0 0 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #111;
	color: #fff;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.2s;
}

.pcm-pp #content .pcm-pp-buy .pcm-fav-btn:hover,
.pcm-pp #content .pcm-pp-buy .pcm-fav-btn:focus-visible {
	background: #333;
	color: #fff;
}

.pcm-pp-buy .pcm-fav-btn .pcm-fav-btn__icon {
	width: 22px;
	height: 22px;
}

.pcm-pp-buy .stock,
.pcm-pp-buy .ast-stock-detail,
.pcm-pp-buy .quantity {
	display: none !important;
}

.pcm-pp #content .pcm-pp-buy form.cart {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
}

.pcm-pp #content .pcm-pp-buy .single_add_to_cart_button,
.pcm-pp #content .pcm-pp-buy .pcm-pp-to-cart {
	display: block;
	box-sizing: border-box;
	text-align: center;
	text-decoration: none;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 24px;
	border: 0;
	border-radius: 0;
	background: #111;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	line-height: 48px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: background-color 0.2s;
}

.pcm-pp #content .pcm-pp-buy .single_add_to_cart_button.is-busy {
	opacity: 0.7;
	cursor: progress;
}

.pcm-pp #content .pcm-pp-buy .single_add_to_cart_button:hover,
.pcm-pp #content .pcm-pp-buy .single_add_to_cart_button:focus-visible,
.pcm-pp #content .pcm-pp-buy .pcm-pp-to-cart:hover,
.pcm-pp #content .pcm-pp-buy .pcm-pp-to-cart:focus-visible {
	background: #333;
	color: #fff;
}

.pcm-pp-buy .added_to_cart {
	display: inline-block;
	margin-top: 10px;
	font-size: 13px;
	color: var(--pcm-pp-text);
	text-decoration: underline;
}

/* short description: Moonswoon-like text */
.pcm-pp-short {
	margin: 28px 0 0;
	font-size: 15px;
	line-height: 1.65;
	color: var(--pcm-pp-text);
}

.pcm-pp-short p {
	margin: 0 0 0.8em;
}

.pcm-pp-short p:last-child {
	margin-bottom: 0;
}

/* collection · SKU */
.pcm-pp-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin: 24px 0 0;
	font-size: 11px;
	line-height: 1.4;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pcm-pp-text);
}

.pcm-pp-meta__sku {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--pcm-pp-muted);
}

.pcm-pp .pcm-pp-copy {
	display: inline-flex;
	padding: 2px;
	border: 0;
	background: transparent;
	color: var(--pcm-pp-muted);
	cursor: pointer;
}

.pcm-pp .pcm-pp-copy:hover,
.pcm-pp .pcm-pp-copy.is-copied {
	background: transparent;
	color: var(--pcm-pp-text);
}

/* accordions: grey panels with a thin plus (Moonswoon) */
.pcm-pp-acc {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 32px 0 0;
}

.pcm-pp-acc__item {
	background: var(--pcm-pp-panel);
}

.pcm-pp-acc__title {
	position: relative;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 58px;
	padding: 16px 56px 16px 20px;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--pcm-pp-text);
	cursor: pointer;
	list-style: none;
}

.pcm-pp-acc__title::-webkit-details-marker {
	display: none;
}

.pcm-pp-acc__icon {
	position: absolute;
	top: 50%;
	right: 20px;
	width: 18px;
	height: 18px;
	margin-top: -9px;
}

.pcm-pp-acc__icon::before,
.pcm-pp-acc__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 18px;
	height: 1px;
	background: currentColor;
	transition: transform 0.25s;
}

.pcm-pp-acc__icon::after {
	transform: rotate(90deg);
}

.pcm-pp-acc__item[open] .pcm-pp-acc__icon::after {
	transform: rotate(0deg);
}

.pcm-pp-acc__body {
	padding: 0 20px 20px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--pcm-pp-text);
}

.pcm-pp-acc__body p {
	margin: 0 0 0.7em;
}

.pcm-pp-acc__body p:last-child {
	margin-bottom: 0;
}

.pcm-pp-acc__body a {
	color: var(--pcm-pp-text);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pcm-pp-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
}

.pcm-pp-specs {
	margin: 0;
}

.pcm-pp-specs__row {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	gap: 16px;
	padding: 9px 0;
	border-bottom: 1px solid #e2e2e2;
}

.pcm-pp-specs__row:last-child {
	border-bottom: 0;
}

.pcm-pp-specs dt {
	font-weight: 400;
	color: var(--pcm-pp-muted);
}

.pcm-pp-specs dd {
	margin: 0;
}

.pcm-pp-list {
	margin: 0;
	padding-left: 18px;
}

/* ---------- SEO description under the photos ---------- */
.pcm-pp-desc {
	max-width: 760px;
	margin: 56px 0 0;
	padding: 0;
}

.pcm-pp #content .pcm-pp-desc__title {
	margin: 0 0 18px;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pcm-pp-text);
}

.pcm-pp-desc__text {
	font-size: 15px;
	line-height: 1.7;
	color: #222;
}

.pcm-pp-desc__text p,
.pcm-pp-desc__text ul,
.pcm-pp-desc__text ol {
	margin: 0 0 1em;
}

.pcm-pp-desc__text h2,
.pcm-pp-desc__text h3 {
	margin: 1.6em 0 0.6em;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.pcm-pp-desc__text a {
	color: #4a7fb5;
}

/* related band: a bit of air after the main block */
.pcm-pp #content div.product > section.related {
	margin-top: 40px;
}

/* ---------- full-screen viewer ---------- */
.pcm-pp-viewer {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}

.pcm-pp-viewer[hidden] {
	display: none;
}

.pcm-pp-viewer-open,
.pcm-pp-viewer-open body {
	overflow: hidden;
}

.pcm-pp-viewer__img {
	max-width: calc(100vw - 160px);
	max-height: calc(100vh - 80px);
	object-fit: contain;
}

.pcm-pp-viewer button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #111;
	cursor: pointer;
}

.pcm-pp-viewer button:hover,
.pcm-pp-viewer button:focus {
	background: transparent;
	color: #111;
}

.pcm-pp-viewer__close {
	top: 16px;
	right: 16px;
}

.pcm-pp-viewer__nav--prev {
	left: 16px;
	top: 50%;
	margin-top: -26px;
}

.pcm-pp-viewer__nav--next {
	right: 16px;
	top: 50%;
	margin-top: -26px;
}

.pcm-pp-viewer__count {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 12px;
	letter-spacing: 0.08em;
	color: var(--pcm-pp-muted);
}

/* ---------- desktop: first screen = photo + info (like the tablet), details below ---------- */
@media (min-width: 1025px) {
	.pcm-pp #primary {
		margin-top: 24px;
	}

	/* photo height: product-page.js fits photo + info into the window; fallback below */
	.pcm-pp-gallery {
		display: block;
	}

	.pcm-pp-gallery__track {
		height: var(--pcm-pp-stage-h, max(360px, calc(100vh - 420px)));
	}

	.pcm-pp-gallery__slide {
		aspect-ratio: auto;
		height: 100%;
	}

	/* not on the first screen: shown in the details block below instead */
	.pcm-pp-short,
	.pcm-pp-meta,
	.pcm-pp-acc {
		display: none;
	}

	.pcm-pp #content .pcm-pp-title,
	.pcm-pp-price {
		font-size: 24px;
	}

	/* [ breadcrumbs + title | price · availability / buttons ] */
	.pcm-pp-info {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
		column-gap: 64px;
		align-items: end;
	}

	.pcm-pp-info__main .woocommerce-breadcrumb {
		margin-bottom: 14px;
	}

	.pcm-pp-sku-top {
		display: flex;
		align-items: center;
		gap: 6px;
		margin: 8px 0 0;
		font-size: 12px;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--pcm-pp-muted);
	}

	.pcm-pp-pricerow {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 16px;
	}

	.pcm-pp-pricerow .pcm-pp-price,
	.pcm-pp-pricerow .pcm-pp-stock {
		margin: 0;
	}

	.pcm-pp-info__side .pcm-pp-buy {
		margin-top: 16px;
	}

	/* details: vertical tab list on the left | content */
	.pcm-pp-details {
		margin: 96px 0 0;
	}

	.pcm-pp-tabs {
		display: grid;
		grid-template-columns: 260px minmax(0, 1fr);
		column-gap: 64px;
		align-items: start;
	}

	.pcm-pp-tabs__nav {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		position: sticky;
		top: 104px;
		border-left: 1px solid var(--pcm-pp-line);
	}

	.pcm-pp .pcm-pp-tabs__tab {
		margin: 0 0 0 -1px;
		padding: 10px 0 10px 20px;
		border: 0;
		border-left: 2px solid transparent;
		border-radius: 0;
		background: transparent;
		color: var(--pcm-pp-muted);
		font-size: 12px;
		font-weight: 600;
		line-height: 1.4;
		letter-spacing: 0.12em;
		text-align: left;
		text-transform: uppercase;
		cursor: pointer;
	}

	.pcm-pp .pcm-pp-tabs__tab:hover,
	.pcm-pp .pcm-pp-tabs__tab:focus {
		background: transparent;
		color: var(--pcm-pp-text);
	}

	.pcm-pp .pcm-pp-tabs__tab.is-active {
		border-left-color: #111;
		color: var(--pcm-pp-text);
	}

	.pcm-pp-tabs__panel {
		display: none;
		max-width: 760px;
		font-size: 15px;
		line-height: 1.7;
		color: #222;
	}

	.pcm-pp-tabs__panel.is-active {
		display: block;
	}

	.pcm-pp-tabs__panel p {
		margin: 0 0 1em;
	}

	.pcm-pp-tabs__panel a {
		color: var(--pcm-pp-text);
		text-decoration: underline;
		text-underline-offset: 3px;
	}

	.pcm-pp-desc {
		margin: 0;
	}

	.pcm-pp #content .pcm-pp-desc__title {
		display: none; /* the tab says it */
	}

	.pcm-pp .pcm-pp-details__name {
		margin: 0 0 12px;
		font-size: 16px;
		font-weight: 600;
		letter-spacing: 0.02em;
		text-transform: uppercase;
		color: var(--pcm-pp-text);
	}

	.pcm-pp .pcm-pp-details__sku {
		margin: 0 0 20px;
		font-size: 14px;
		color: var(--pcm-pp-muted);
	}

	.pcm-pp #content .pcm-pp-details__subtitle {
		margin: 36px 0 16px;
		font-size: 15px;
		font-weight: 600;
		text-transform: none;
		letter-spacing: 0;
		color: var(--pcm-pp-text);
	}

	/* characteristics with dotted leaders */
	.pcm-pp-dots {
		margin: 0;
		font-size: 14px;
		line-height: 1.5;
	}

	.pcm-pp-dots__row {
		display: grid;
		grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
		padding: 3px 0;
	}

	.pcm-pp-dots dt {
		display: flex;
		align-items: baseline;
		gap: 4px;
		overflow: hidden;
		font-weight: 400;
		color: var(--pcm-pp-muted);
	}

	.pcm-pp-dots dt::after {
		content: "";
		flex: 1 1 auto;
		border-bottom: 1px dotted #b5b5b5;
		margin-right: 8px;
	}

	.pcm-pp-dots dd {
		margin: 0;
		color: var(--pcm-pp-text);
	}

	.pcm-pp-tabs__panel--extra ul {
		margin: 0 0 1em;
		padding-left: 18px;
	}
}

/* ---------- tablet / phone ---------- */
@media (max-width: 1024px) {
	/* below the info only the description, as before (perks / tabs / name / specs are desktop-only) */
	.pcm-pp-details.no-desc,
	.pcm-pp-sku-top,
	.pcm-pp-tabs__nav,
	.pcm-pp-details__name,
	.pcm-pp-details__sku,
	.pcm-pp-details__specs,
	.pcm-pp-tabs__panel--extra {
		display: none;
	}

	.pcm-pp #content > .ast-container {
		padding-left: 0;
		padding-right: 0;
	}

	.pcm-pp #primary {
		margin-top: 0;
	}

	.pcm-pp #content div.product {
		display: block;
	}

	.pcm-pp #content div.product > .summary {
		padding: 24px 32px 0;
	}

	.pcm-pp-sticky {
		position: static;
	}

	.pcm-pp-gallery,
	.pcm-pp-gallery.has-thumbs {
		display: block;
	}

	.pcm-pp-gallery__thumbs,
	.pcm-pp .pcm-pp-gallery__arrow {
		display: none;
	}

	.pcm-pp-gallery__dots {
		display: flex;
		justify-content: center;
		gap: 6px;
		padding: 12px 0 0;
	}

	.pcm-pp-gallery__dots span {
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: #cfcfcf;
		transition: background-color 0.2s;
	}

	.pcm-pp-gallery__dots span.is-active {
		background: #111;
	}

	.pcm-pp-desc {
		max-width: none;
		margin: 40px 0 0;
		padding: 0 32px;
	}

	.pcm-pp-viewer__img {
		max-width: 100vw;
		max-height: calc(100vh - 120px);
	}

	.pcm-pp-viewer__nav {
		display: none !important;
	}
}

@media (max-width: 767px) {
	.pcm-pp #content div.product > .summary {
		padding: 20px 20px 0;
	}

	.pcm-pp #content .pcm-pp-title,
	.pcm-pp-price {
		font-size: 18px;
	}

	.pcm-pp-acc__title {
		min-height: 54px;
		padding-left: 16px;
		font-size: 13px;
	}

	.pcm-pp-acc__body {
		padding: 0 16px 16px;
	}

	.pcm-pp-desc {
		padding: 0 20px;
	}
}
