/* PDP — 查看有貨分店彈層 */

.pdp-store-stock-modal {
	position: fixed;
	inset: 0;
	z-index: 100200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	box-sizing: border-box;
}

.pdp-store-stock-modal[hidden] {
	display: none !important;
}

.pdp-store-stock-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.pdp-store-stock-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 1120px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
	overflow: hidden;
}

.pdp-store-stock-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.pdp-store-stock-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #333;
}

.pdp-store-stock-modal__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	background: transparent;
	color: #999;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.pdp-store-stock-modal__close:hover {
	color: #666;
}

/* 篩選列 */
.pdp-store-stock-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 20px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
	flex-wrap: wrap;
}

.pdp-store-stock-toolbar__selects {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	min-width: 0;
}

.pdp-store-stock-select-wrap {
	flex: 1 1 0;
	min-width: 120px;
	max-width: 220px;
}

.pdp-store-stock-select {
	width: 100%;
	height: 40px;
	padding: 0 32px 0 12px;
	border: 1px solid #c5ced8;
	border-radius: 6px;
	background: #fff 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='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 12px center no-repeat;
	font-size: 14px;
	color: #333;
	appearance: none;
	cursor: pointer;
}

.pdp-store-stock-select:disabled {
	background-color: #f5f5f5;
	color: #999;
	cursor: not-allowed;
}

.pdp-store-stock-locate {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border: 1px solid #c5ced8;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
}

.pdp-store-stock-locate:hover {
	border-color: #3fa7f3;
	background: #f8fcff;
}

.pdp-store-stock-locate .icon {
	font-size: 20px;
	color: #6b7a8c;
}

.pdp-store-stock-instock {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	cursor: pointer;
	user-select: none;
}

.pdp-store-stock-instock__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.pdp-store-stock-instock__label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: #666;
	line-height: 1.4;
}

.pdp-store-stock-instock__label::before {
	content: '';
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	border: 2px solid #c8d4e0;
	border-radius: 6px;
	background: #fff;
	box-sizing: border-box;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.pdp-store-stock-instock__input:checked + .pdp-store-stock-instock__label::before {
	border-color: #3fa7f3;
	background-color: #3fa7f3;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10' fill='none'%3E%3Cpath d='M1 5.2L4.2 8.4L11 1.6' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 12px 10px;
}

.pdp-store-stock-instock__input:focus-visible + .pdp-store-stock-instock__label::before {
	outline: 2px solid #3fa7f3;
	outline-offset: 2px;
}

/* 主體：列表 + 地圖 */
.pdp-store-stock-main {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	min-height: 420px;
}

.pdp-store-stock-panel {
	display: flex;
	flex-direction: column;
	width: 400px;
	max-width: 42%;
	flex-shrink: 0;
	border-right: 1px solid #e8e8e8;
	background: #fff;
	min-height: 0;
	z-index: 2;
}

.pdp-store-stock-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.pdp-stock-list-empty {
	margin: 0;
	padding: 32px 20px;
	text-align: center;
	color: #999;
	font-size: 14px;
}

/* 桌面分店卡片 */
.pdp-stock-store-card {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	padding: 14px 16px 14px 14px;
	border: none;
	border-bottom: 1px dashed #e4e8ed;
	border-radius: 0;
	background: #fff;
	text-align: left;
	cursor: pointer;
	position: relative;
	box-sizing: border-box;
}

.pdp-stock-store-card:hover,
.pdp-stock-store-card.is-selected {
	background: #fcf6e4;
}

.pdp-stock-store-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.pdp-stock-store-card__brand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 20px;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.2;
}

.pdp-stock-store-card__brand--pns {
	background: linear-gradient(135deg, #e31837 0%, #003da5 100%);
	color: #fff;
}

.pdp-stock-store-card__brand--fusion {
	background: #7cb342;
	color: #fff;
}

.pdp-stock-store-card__shop-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%233FA7F3' stroke-width='1.8'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E") center no-repeat;
}

.pdp-stock-store-card__shop-icon--sm {
	width: 20px;
	height: 20px;
}

.pdp-stock-store-card__name {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 700;
	color: #5268b8;
	line-height: 1.35;
}

.pdp-stock-store-card__address,
.pdp-stock-store-card__hours,
.pdp-stock-store-card__phone {
	margin: 0 0 4px;
	font-size: 13px;
	line-height: 1.45;
	color: #666;
}

.pdp-stock-store-card__hours {
	padding-left: 20px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A96A8' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E") left 2px center no-repeat;
}

.pdp-stock-store-card__phone {
	padding-left: 20px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A96A8' stroke-width='2'%3E%3Cpath d='M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z'/%3E%3C/svg%3E") left 2px center no-repeat;
}

.pdp-stock-badge {
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 12px;
	border-radius: 14px;
	background: #ebf9eb;
	color: #2e7d32;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
}

.pdp-stock-mobile-card .pdp-stock-badge {
	position: static;
	flex-shrink: 0;
}

.pdp-stock-mobile-card__footer {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-top: 8px;
}

.pdp-stock-mobile-card__contact {
	flex: 1 1 auto;
	min-width: 0;
}

.pdp-stock-mobile-card__aside {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	flex-shrink: 0;
}

.pdp-stock-facilities {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-left: auto;
	flex-shrink: 0;
	color: #3fa7f3;
	font-size: 22px;
	line-height: 1;
}

.pdp-stock-facilities__item {
	display: inline-flex;
	align-items: center;
}

.pdp-stock-facilities .icon:before {
	color: #3fa7f3;
}

/* 移動端卡片（複用 store-locator 類名） */
.pdp-store-stock-modal .ulive-store-locator-card {
	padding: 18px 16px;
	border-bottom: 1px solid #e4e8ed;
}

.pdp-store-stock-modal .ulive-store-locator-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

/* 移動端品牌標籤（與 PC .pdp-stock-store-card__brand 一致；PDP 不載入 store-locator.css） */
.pdp-store-stock-modal .ulive-store-locator-card__brand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 22px;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
}

.pdp-store-stock-modal .ulive-store-locator-card__brand--pns {
	background: linear-gradient(135deg, #e31837 0%, #003da5 100%);
	color: #fff;
}

.pdp-store-stock-modal .ulive-store-locator-card__brand--fusion {
	background: #7cb342;
	color: #fff;
}

.pdp-store-stock-modal .ulive-store-locator-card__brand-img {
	display: block;
	width: auto;
	height: 22px;
	max-width: 120px;
	object-fit: contain;
	object-position: left center;
}

.pdp-store-stock-modal .ulive-store-locator-card__name {
	color: #5268b8;
}

.pdp-store-stock-modal .ulive-store-locator-card__hours {
	margin: 0 0 8px;
	padding-left: 22px;
	font-size: 14px;
	color: #6b7a8c;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7A8C' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E") left center no-repeat;
}

.pdp-store-stock-modal .ulive-store-locator-card__phone {
	margin: 0;
	padding-left: 22px;
	font-size: 14px;
	color: #6b7a8c;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7A8C' stroke-width='2'%3E%3Cpath d='M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z'/%3E%3C/svg%3E") left center no-repeat;
}

.pdp-store-stock-modal .ulive-store-locator-card__map-link {
	display: block;
	text-align: right;
	font-size: 14px;
	color: #3fa7f3 !important;
	text-decoration: underline;
	white-space: nowrap;
}

/* 分頁 */
.pdp-store-stock-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 10px 12px 12px;
	border-top: 1px solid #eee;
	flex-shrink: 0;
}

.pdp-store-stock-pagination button {
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border: 1px solid #d8dde6;
	border-radius: 4px;
	background: #fff;
	color: #3e3e3e;
	font-size: 14px;
	cursor: pointer;
}

.pdp-store-stock-pagination button.is-active {
	border-color: #3fa7f3;
	color: #3fa7f3;
	font-weight: 600;
}

.pdp-store-stock-pagination button:disabled {
	opacity: 0.45;
	cursor: default;
}

.pdp-store-stock-pagination__arrow {
	color: #9aa8b8;
	font-size: 18px;
	border-color: transparent;
}

.pdp-store-stock-pagination__status {
	min-width: 56px;
	text-align: center;
	font-size: 16px;
	font-weight: 600;
}

/* 地圖 */
.pdp-store-stock-map-wrap {
	flex: 1 1 auto;
	min-width: 0;
	position: relative;
	background: #e8ecef;
}

.pdp-store-stock-map {
	width: 100%;
	height: 100%;
	min-height: 420px;
}

.pdp-store-stock-map--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	color: #666;
	font-size: 14px;
}

.pdp-stock-info-window__map-link {
	display: inline-block;
	margin-top: 8px;
	color: #3fa7f3;
	font-size: 13px;
}

/* 底部提示 */
.pdp-store-stock-notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 20px 16px;
	border-top: 1px solid #eee;
	background: #fafafa;
	flex-shrink: 0;
}

.pdp-store-stock-notice__icon {
	flex-shrink: 0;
	color: #999;
	font-size: 18px;
	line-height: 1.4;
}

.pdp-store-stock-notice__text {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: #666;
}

.pdp-store-stock-notice__text p {
	margin: 0 0 4px;
}

.pdp-store-stock-notice__updated {
	color: #999;
}

body.pdp-store-stock-modal-open {
	overflow: hidden;
}

/* 查看供應 — 按鈕樣式 */
.pdp-summary-extra .pdp-shipping-link[data-pdp-stock-open],
button.pdp-shipping-link {
	padding: 0;
	border: none;
	background: none;
	font: inherit;
	color: #3fa7f3;
	text-decoration: underline;
	cursor: pointer;
}

.pdp-summary-extra .pdp-shipping-link[data-pdp-stock-open]:hover,
button.pdp-shipping-link:hover {
	color: #2b97e3;
}

/* 移動端：底部彈層、頂部留白 + 圓角、隱藏地圖 */
@media (max-width: 768px) {
	.pdp-store-stock-modal {
		padding: 12px 0 0;
		padding-top: max(12px, env(safe-area-inset-top, 0px));
		align-items: stretch;
	}

	.pdp-store-stock-modal__dialog {
		max-width: none;
		width: 100%;
		height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)));
		height: calc(100vh - max(12px, env(safe-area-inset-top, 0px)));
		max-height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)));
		border-radius: 16px 16px 0 0;
		overflow: hidden;
	}

	.pdp-store-stock-toolbar {
		flex-direction: column;
		align-items: stretch;
		background: #f5f5f5;
		border-bottom-color: #eee;
	}

	.pdp-store-stock-toolbar__selects {
		width: 100%;
	}

	.pdp-store-stock-select-wrap {
		max-width: none;
	}

	.pdp-store-stock-instock {
		align-self: flex-start;
	}

	.pdp-store-stock-main {
		flex-direction: column;
		min-height: 0;
	}

	.pdp-store-stock-panel {
		width: 100%;
		max-width: none;
		border-right: none;
		flex: 1 1 auto;
	}

	.pdp-store-stock-map-wrap {
		display: none !important;
	}

	.pdp-store-stock-modal.is-mobile .pdp-store-stock-map-wrap {
		display: none !important;
	}
}
