/* 前台加购弹窗 */

body.sig-po-lock { overflow: hidden; }

.sig-po-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba( 0, 0, 0, .5 );
}
.sig-po-overlay[hidden] { display: none; }

.sig-po-modal {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 18px 50px rgba( 0, 0, 0, .3 );
	overflow: hidden;
}

.sig-po-x {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 2;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, .85 );
	box-shadow: 0 1px 4px rgba( 0, 0, 0, .2 );
	font-size: 22px;
	line-height: 1;
	color: #444;
	cursor: pointer;
}
.sig-po-x:hover { color: #000; }

.sig-po-hero {
	display: block;
	width: 100%;
	height: 170px;
	object-fit: cover;
	border-radius: 12px 12px 0 0;
}
.sig-po-hero[hidden] { display: none; }

.sig-po-title {
	margin: 0;
	padding: 18px 44px 12px 20px;
	font-size: 18px;
	border-bottom: 1px solid #eee;
}

.sig-po-body {
	padding: 4px 20px 8px;
	overflow-x: hidden; /* 1.5.1:弹窗里永远不该出现横向滚动条 */
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.sig-po-loading {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	height: 60px;
	margin: 20px auto;
}
.sig-po-loading span {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #c9c9c9;
	animation: sig-po-bounce 1s infinite ease-in-out both;
}
.sig-po-loading span:nth-child(1) { animation-delay: -.32s; }
.sig-po-loading span:nth-child(2) { animation-delay: -.16s; }
@keyframes sig-po-bounce {
	0%, 80%, 100% { transform: scale( .4 ); opacity: .4; }
	40% { transform: scale( 1 ); opacity: 1; }
}

/* ---------------------------------------------------------------------------
 * 选项组 + 选项行(1.5.1 重排)
 *
 * ⚠ po.css 在 flatsome.css 之前加载,而主题对 label / legend / input[type=number]
 *   有全局样式(输入框 width:100% + 下外边距、label 加粗缩字号、legend 上下大外边距……),
 *   同优先级甚至更高 → 会盖掉这里。所以下面凡是要压主题的规则都挂在 .sig-po-overlay 下,
 *   把优先级拉到主题之上。改这一段时别把前缀去掉。
 *
 * 一行的布局:[勾选框] [配图] [名称 —— 占满剩余宽度] [+价格 右对齐] [份数框 固定窄宽]
 *   名称吃掉中间所有空间 → 价格、份数框永远贴右,逐行竖向对齐成一条线;
 *   名称只有在一行真放不下时才折行。
 * ------------------------------------------------------------------------ */

.sig-po-overlay .sig-po-group {
	min-width: 0; /* fieldset 默认 min-width: min-content,会被内容撑得比弹窗还宽 */
	margin: 0;
	padding: 0 0 10px;
	border: 0;
}
.sig-po-overlay .sig-po-group + .sig-po-group { margin-top: 6px; }

.sig-po-overlay .sig-po-group legend {
	display: block;
	width: 100%;
	margin: 0 0 6px;
	padding: 14px 0 8px;
	border: 0;
	border-bottom: 1px solid #eee;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: #333;
}
.sig-po-overlay .sig-po-hint {
	margin-left: 6px;
	font-size: 12px;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
	color: #888;
}
.sig-po-overlay .sig-po-group.sig-po-invalid legend,
.sig-po-overlay .sig-po-group.sig-po-invalid legend .sig-po-hint { color: #c0392b; }

.sig-po-overlay .sig-po-row {
	display: flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box; /* Flatsome 全局就是 border-box;写明是为了换主题也一样:行高 = 44px */
	min-height: 44px;
	margin: 0 -8px; /* 行的内边距往外借:勾选框与组标题左对齐,悬停底色两侧留一点余量 */
	padding: 5px 8px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.35;
	color: #222;
	cursor: pointer;
}
@media ( hover: hover ) { /* 触屏上不要残留的"悬停"灰底 */
	.sig-po-overlay .sig-po-row:hover { background: #f6f6f6; }
}
.sig-po-overlay .sig-po-row input[type=radio],
.sig-po-overlay .sig-po-row input[type=checkbox] {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: #333; /* 想要品牌色就改这一处 */
	cursor: pointer;
}

.sig-po-opt-img {
	width: 40px;
	height: 40px;
	flex: none;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #eee;
}

.sig-po-overlay .sig-po-lbl {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: break-word; /* 超长单词兜底,不撑破行 */
}
.sig-po-overlay .sig-po-price {
	flex: none;
	margin-left: auto;
	font-size: 14px;
	font-weight: 400;
	color: #777;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* 份数框:所有行同宽、贴右 → 竖成一条线;宽度刚好放两位数 */
.sig-po-overlay .sig-po-row input.sig-po-qty {
	flex: none;
	box-sizing: border-box;
	width: 44px;
	min-width: 0;
	max-width: none;
	height: 34px;
	margin: 0;
	padding: 0 2px;
	border: 1px solid #bdbdbd;
	border-radius: 6px;
	background: #fff;
	box-shadow: none;
	color: #222;
	font-family: inherit;
	font-size: 16px; /* ≥16px:iPhone 点进去时不会把整页放大 */
	font-weight: 700;
	line-height: normal;
	text-align: center;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
	appearance: textfield; /* 去掉上下小箭头:桌面浏览器悬停时箭头会挤占窄框 */
	transition: border-color .15s, box-shadow .15s, background-color .15s, color .15s;
}
.sig-po-overlay .sig-po-row input.sig-po-qty::-webkit-inner-spin-button,
.sig-po-overlay .sig-po-row input.sig-po-qty::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.sig-po-overlay .sig-po-row input.sig-po-qty:focus {
	outline: 0;
	border-color: #333;
	box-shadow: 0 0 0 3px rgba( 0, 0, 0, .1 );
	background: #fff;
	color: #222;
}
.sig-po-overlay .sig-po-row input.sig-po-qty:disabled {
	opacity: 1;
	border-color: #e6e6e6;
	background: #f7f7f7;
	color: #bbb;
	-webkit-text-fill-color: #bbb; /* iOS 会给禁用框的字另外套色,统一掉 */
	pointer-events: none; /* 点灰掉的份数框 = 点这一行 → 直接勾上 */
}

.sig-po-msg {
	color: #c0392b;
	font-size: 13px;
	min-height: 0;
	padding: 0 20px;
}
.sig-po-msg:not(:empty) { padding: 6px 20px; }

.sig-po-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 20px;
	border-top: 1px solid #eee;
	background: #fafafa;
}
.sig-po-total { font-weight: 600; font-variant-numeric: tabular-nums; }

.sig-po-submit { white-space: nowrap; }
.sig-po-submit:disabled { opacity: .5; cursor: not-allowed; }

@media ( max-width: 480px ) {
	.sig-po-overlay { padding: 0; align-items: flex-end; }
	.sig-po-modal { max-width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
}
