/* 20261101 商品列表篩選器（shop.php 載入，搭配 js/shop_filter.js）
   1. 商城內搜尋框
   2. 評價篩選星星
   3. 手機（≤768px）篩選改成底部面板：標題列與「套用」按鈕固定，中間可捲動
   全站 letter-spacing 2px 會讓新元件文字折行，這裡一律歸零 */

/* ---------- 1. 商城內搜尋框 ---------- */
.shop_searchbar { display: flex; align-items: stretch; gap: 8px; margin: 0 0 14px; letter-spacing: 0; }
.shop_searchbar input[type="search"] {
	flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px;
	border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: #1f2937;
	font-size: 15px; letter-spacing: 0; -webkit-appearance: none; appearance: none;
}
.shop_searchbar input[type="search"]:focus { outline: none; border-color: var(--sp-primary, #6366f1); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.shop_searchbtn {
	flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 44px; padding: 0 18px; border: none; border-radius: 10px;
	background: var(--sp-primary, #6366f1); color: #fff; font-size: 15px; letter-spacing: 0; cursor: pointer;
}
.shop_searchbtn:hover { filter: brightness(.95); }
.shop_searchico {
	width: 18px; height: 18px; background: currentColor; display: inline-block;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- 2. 評價篩選 ---------- */
.shop_filter_panel, .shop_filter_bar { letter-spacing: 0; }
.shop_filter_panel * , .shop_filter_bar * { letter-spacing: 0; }
.sf_stars { color: #f59e0b; font-size: 13px; letter-spacing: 1px; }

/* ---------- 3. 手機：底部面板 ---------- */
@media (max-width: 768px) {
	.shop_searchbar { margin-bottom: 10px; }
	.shop_searchtxt { display: none; }
	.shop_searchbtn { width: 48px; padding: 0; }

	body .shop_filter_panel {
		top: auto; bottom: 0; left: 0; right: 0;
		width: 100%; max-width: none; height: auto; max-height: 86vh;
		border-radius: 16px 16px 0 0; border: none;
		padding: 0; display: flex; flex-direction: column; overflow: hidden;
		transform: translateY(105%); transition: transform .28s ease, visibility .28s;
		visibility: hidden;
		box-shadow: 0 -10px 30px rgba(15, 23, 42, .18);
		z-index: 10001;
		padding-bottom: env(safe-area-inset-bottom, 0);
	}
	body .shop_filter_panel.is-open { transform: translateY(0); visibility: visible; }
	body .shop_filter_overlay { z-index: 10000; }

	/* 上方拉桿 + 標題列 */
	.shop_filter_panel .sf_head {
		flex: 0 0 auto; position: relative; margin: 0; padding: 18px 16px 12px;
		border-bottom: 1px solid #f1f5f9;
	}
	.shop_filter_panel .sf_head::before {
		content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px;
		border-radius: 2px; background: #cbd5e1;
	}
	.shop_filter_panel .sf_close { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -8px -8px -8px 0; }

	/* 表單：中間捲動，按鈕列固定在底部 */
	.shop_filter_panel .shop_filter_form { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
	.shop_filter_panel .shop_filter_form > .sf_group { padding-left: 16px; padding-right: 16px; }
	.shop_filter_panel .shop_filter_form { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
	.shop_filter_panel .sf_actions {
		position: sticky; bottom: 0; margin: auto 0 0; padding: 12px 16px;
		background: #fff; border-top: 1px solid #f1f5f9;
	}
	.shop_filter_panel .sf_apply { height: 48px; font-size: 16px; border-radius: 10px; }
	.shop_filter_panel .sf_clear { padding: 12px 6px; }

	/* 好按：選項加大 */
	.shop_filter_panel .sf_check { min-height: 44px; }
	.shop_filter_panel .sf_check input { width: 20px; height: 20px; }
	.shop_filter_panel .sf_preset { min-height: 38px; padding: 0 14px; }
	.shop_filter_panel .sf_chip span { min-height: 38px; padding: 0 14px; }
	.shop_filter_panel .sf_pricecustom input { height: 44px; font-size: 16px; }

	body.sf-lock { overflow: hidden; }
	/* 面板打開時藏起右下「聯絡我們」，不蓋住選項 */
	body.sf-lock .cf-wrap { display: none; }
}
