/**
 * Live Related selects — identical to PS Plus `.ps-plus-dd*` (copied 1:1 from ps_plus.css).
 * Flags: image/catalog/flags/{iso}.svg via AppRouteCountryHelper RU→iso2 map in twig.
 * Also: playonly-delivery-badge (replaces stock «На складе» green dot on product.twig).
 * Geometry matches Prostore .ui-badge «Новинка» (radius 4px, font/line/pad); full-width bar.
 * v=20261112a — DTU/options above price+Купить on mobile (real WebKit)
 */

/* --- Soft delivery badge (unused until re-enabled in product.twig) ---
 * Geometry = .ui-badge «Новинка»; muted green. Kept for later.
.playonly-delivery-badge {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	float: none;
	margin: 1.2rem 0 1.6rem;
	padding: 0 0.8rem;
	border: 0;
	border-radius: 4px;
	background: #eef6f0;
	color: #3d6b4f;
	font-size: 1.4rem;
	line-height: 2.6rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	white-space: normal;
	box-shadow: none;
}
*/

/* --- Buy column order ---
 * wishlist → Live Related → DTU/options → price+Купить
 * (was buy before options; !important also overrode PS Plus card on real phones)
 * :has() selectors stay in their own rules: one unsupported selector drops the whole list.
 */
#product.sku__desc,
.sku__desc#product {
	display: flex !important;
	flex-direction: column !important;
}
.sku__desc > .playonly-addto-top { order: 1 !important; }
.sku__desc > .sku__group--options,
.sku__desc > .playonly-options-group { order: 3 !important; }
.sku__desc > .playonly-buy-group { order: 4 !important; }
#product.sku__desc > .sku__group:has(.sku__addto) { order: 1 !important; }
#product.sku__desc > #live-related-products-slot,
#product.sku__desc > .live-related-products {
	order: 2 !important;
	width: 100%;
}
#product.sku__desc > .sku__group--options {
	order: 3 !important;
}
#product.sku__desc > .sku__group:has(.sku__settings) {
	order: 3 !important;
}
#product.sku__desc > .playonly-buy-group {
	order: 4 !important;
}
#product.sku__desc > .sku__group:has(.sku__price),
#product.sku__desc > .sku__group:has(#button-cart),
#product.sku__desc > .sku__group:has(.ui-add-to-cart) {
	order: 4 !important;
}
/* PS Plus card: keep fields (3) above pay (4) even if this sheet loads on the same page */
.ps-plus-card .sku__desc > .ps-plus-options,
.ps-plus-card #product.sku__desc > .ps-plus-options:not(#po-0) {
	order: 3 !important;
}
.ps-plus-card .sku__desc > .ps-plus-pay-group,
.ps-plus-card #product.sku__desc > #ps-plus-pay.ps-plus-pay-group {
	order: 4 !important;
}
.sku__desc > .playonly-addto-top .sku__addto,
#product.sku__desc > .sku__group:has(.sku__addto) .sku__addto {
	display: flex !important;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0 2rem;
	margin: 0 0 1.2rem;
	padding: 0;
	list-style: none;
}
.sku__desc > .playonly-addto-top .sku__addto > li,
#product.sku__desc > .sku__group:has(.sku__addto) .sku__addto > li {
	margin: 0;
	padding: 0;
	float: none;
}

/* --- LRP block spacing (like .ps-plus-selector__block) --- */
.live-related-products {
	margin: 0 0 1.6rem;
}
.live-related-products__axis.ps-plus-selector__block,
.live-related-products .ps-plus-selector__block {
	margin: 0 0 1.8rem;
}
.live-related-products .ps-plus-selector__block:last-child {
	margin-bottom: 0;
}

/* No red asterisks on Страна / Номинал */
.live-related-products .form-group.required > .ps-plus-selector__label::before,
.live-related-products .form-group.required > .control-label::before,
.live-related-products .form-group.required > .live-related-products__label::before,
.live-related-products .ps-plus-selector__label::before,
.live-related-products .control-label::before {
	content: none !important;
	display: none !important;
}
.live-related-products .form-group.required > .ps-plus-selector__label::after,
.live-related-products .form-group.required > .control-label::after,
.live-related-products .control-label::after {
	content: none !important;
	display: none !important;
}

/* Label — same as .ps-plus-selector__label */
.live-related-products .ps-plus-selector__label {
	display: block;
	margin: 0 0 0.8rem;
	font: 500 1.2rem/1.6rem "Roboto", Arial, Helvetica, sans-serif;
	color: #8a93a3;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	float: none;
	width: auto;
	padding: 0;
}

/* Hidden native select for LRP JS */
.live-related-products__select-native {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* ===== ps-plus-dd* copied 1:1 from ps_plus.css ===== */
.live-related-products .ps-plus-dd {
	position: relative;
}

.live-related-products .ps-plus-dd__toggle {
	appearance: none;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #e1e5ee;
	border-radius: 8px;
	background: #f3f5f9;
	cursor: pointer;
	text-align: left;
	box-sizing: border-box;
	overflow: hidden;
}

.live-related-products .ps-plus-dd.is-open .ps-plus-dd__toggle {
	border-color: #cfd6e4;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	background: #eef1f6;
}

.live-related-products .ps-plus-dd__toggle-main {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1 1 auto;
	overflow: hidden;
}

.live-related-products .ps-plus-dd__toggle-side {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

/* Flag 22×16 — same lock as .ps-plus-card (theme img{width:100%}) */
.live-related-products .ps-plus-dd img.ps-plus-dd__flag,
.live-related-products .ps-plus-dd__flag {
	display: block !important;
	width: 22px !important;
	height: 16px !important;
	max-width: 22px !important;
	max-height: 16px !important;
	min-width: 22px !important;
	min-height: 16px !important;
	object-fit: cover !important;
	object-position: center !important;
	border-radius: 2px;
	flex: 0 0 22px !important;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.live-related-products .ps-plus-dd__label {
	font: 400 15px/20px "Roboto", Arial, Helvetica, sans-serif;
	color: #222;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1 1 auto;
	min-width: 0;
}

.live-related-products .ps-plus-dd__label--muted {
	color: #6b7280;
}

.live-related-products .ps-plus-dd__price {
	font: 700 15px/20px "Roboto", Arial, Helvetica, sans-serif;
	color: #111;
	white-space: nowrap;
}

.live-related-products .ps-plus-dd__caret {
	display: block;
	width: 10px;
	height: 10px;
	flex: 0 0 10px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23222' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.15s ease;
}

.live-related-products .ps-plus-dd.is-open .ps-plus-dd__caret {
	transform: rotate(180deg);
}

.live-related-products .ps-plus-dd__list {
	list-style: none;
	margin: 0;
	padding: 0;
	position: absolute;
	left: 0;
	right: 0;
	z-index: 30;
	background: #fff;
	border: 1px solid #e1e5ee;
	border-top: 0;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 8px 16px rgba(22, 28, 45, 0.08);
	overflow: hidden;
	max-height: 280px;
	overflow-y: auto;
}

.live-related-products .ps-plus-dd__list[hidden] {
	display: none !important;
}

.live-related-products .ps-plus-dd__list > li + li {
	border-top: 1px solid #eef1f6;
}

.live-related-products .ps-plus-dd__option {
	appearance: none;
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 0;
	background: #fff;
	cursor: pointer;
	text-align: left;
	box-sizing: border-box;
}

.live-related-products .ps-plus-dd__option:hover,
.live-related-products .ps-plus-dd__option.is-active {
	background: #f7f8fb;
}

.live-related-products .ps-plus-dd__option:disabled,
.live-related-products .ps-plus-dd__option.is-unavailable {
	color: #999;
	cursor: not-allowed;
}

.live-related-products .ps-plus-dd__option .ps-plus-dd__label {
	flex: 1 1 auto;
	min-width: 0;
}

.live-related-products .ps-plus-dd__option .ps-plus-dd__price {
	flex: 0 0 auto;
	margin-left: auto;
}
