/*
 * トップの検索（part-top-search.php）
 * スマホ優先。タップ領域は40px以上、入力欄は16px（iOSで勝手に拡大されないように）。
 * テーマ全体のCSS（fieldset・details・label 等）に影響されないよう .ts 配下でリセットしている。
 */
.ts {
	--ts-accent: #fc531f;
	--ts-accent-soft: rgba(252, 83, 31, 0.12);
	--ts-text: #222;
	--ts-sub: #767676;
	--ts-line: #dcdcdc;
	--ts-bg: #fff;
	--ts-radius: 14px;
	max-width: 720px;
	margin: 0 auto 40px;
	padding: 0 16px;
	color: var(--ts-text);
	text-align: left;
}
.ts *,
.ts *::before,
.ts *::after {
	box-sizing: border-box;
}
.ts .ts-icon {
	width: 22px;
	height: 22px;
	flex: none;
	fill: currentColor;
}

/* 見出し（既存のロゴ画像） */
.ts .ts__title {
	margin: 0 0 20px;
	padding: 0;
}
.ts .ts__title img {
	display: block;
	width: min(100%, 440px);
	height: auto;
	margin: 0 auto;
}

/* 検索欄 */
.ts .ts__bar {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 56px;
	padding: 0 6px 0 16px;
	border: 2px solid var(--ts-accent);
	border-radius: 999px;
	background: var(--ts-bg);
	color: var(--ts-accent);
	transition: box-shadow 0.15s;
}
.ts .ts__bar:focus-within {
	box-shadow: 0 0 0 4px var(--ts-accent-soft);
}
.ts .ts__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ts-text);
	font-size: 16px;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.ts .ts__input::placeholder {
	color: #9a9a9a;
}
.ts .ts__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}
.ts .ts__go {
	height: 44px;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--ts-accent);
	color: #fff;
	font-size: 15px;
	font-weight: bold;
	cursor: pointer;
}

/* 人気のエリア（横スクロール） */
.ts .ts__quick {
	margin: 20px 0 16px;
}
.ts .ts__quick-title {
	margin: 0 0 8px;
	color: var(--ts-sub);
	font-size: 13px;
	font-weight: bold;
}
.ts .ts__quick-list {
	display: flex;
	gap: 8px;
	margin: 0 -16px;
	padding: 2px 16px 6px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}
.ts .ts__quick-list::-webkit-scrollbar {
	display: none;
}
.ts .ts__quick-list li {
	flex: none;
	margin: 0;
	padding: 0;
	scroll-snap-align: start;
}
.ts .ts__quick-list li::before {
	content: none;
}
.ts .ts-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 16px;
	border: 1.5px solid var(--ts-line);
	border-radius: 999px;
	background: var(--ts-bg);
	color: var(--ts-text);
	font-size: 14px;
	font-weight: bold;
	text-decoration: none;
	white-space: nowrap;
}
.ts .ts-pill:hover {
	border-color: var(--ts-accent);
	color: var(--ts-accent);
}
.ts .ts-pill span {
	color: var(--ts-sub);
	font-size: 12px;
	font-weight: normal;
}

/* 絞り込みを開くボタン */
.ts .ts__open {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 52px;
	padding: 0 16px;
	border: 1.5px solid var(--ts-line);
	border-radius: var(--ts-radius);
	background: var(--ts-bg);
	color: var(--ts-text);
	font-size: 15px;
	font-weight: bold;
	cursor: pointer;
}
.ts .ts__open:hover {
	border-color: var(--ts-accent);
}
.ts .ts__badge {
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--ts-accent);
	color: #fff;
	font-size: 12px;
	line-height: 22px;
	text-align: center;
}
.ts [hidden] {
	display: none !important;
}

/* ---------- シート（<dialog>） ---------- */
.ts .ts-sheet {
	width: 100%;
	max-width: 100%;
	height: auto;
	max-height: 92dvh;
	margin: auto 0 0;
	padding: 0;
	border: 0;
	border-radius: 20px 20px 0 0;
	background: var(--ts-bg);
	color: var(--ts-text);
	box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
	overflow: hidden;
}
.ts .ts-sheet[open] {
	display: flex;
	flex-direction: column;
	animation: ts-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ts .ts-sheet::backdrop {
	background: rgba(0, 0, 0, 0.45);
}
@keyframes ts-up {
	from { transform: translateY(40px); opacity: 0; }
	to { transform: none; opacity: 1; }
}
html:has(.ts-sheet[open]) {
	overflow: hidden; /* 背面をスクロールさせない */
}

.ts .ts-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: none;
	min-height: 56px;
	padding: 8px 8px 8px 20px;
	border-bottom: 1px solid #eee;
}
.ts .ts-sheet__title {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ts-text);
	font-size: 17px;
	font-weight: bold;
}
.ts .ts-sheet__title:focus {
	outline: none; /* 開いたときにフォーカスを置くだけ（操作対象ではない） */
}
.ts .ts-sheet__title::before,
.ts .ts-sheet__title::after {
	content: none;
}
.ts .ts-sheet__close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ts-text);
	cursor: pointer;
}
.ts .ts-sheet__close:hover {
	background: #f3f3f3;
}
.ts .ts-sheet__close svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}
.ts .ts-sheet__body {
	flex: 1;
	min-height: 0;
	padding: 4px 20px 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}
.ts .ts-sheet__foot {
	display: grid;
	grid-template-columns: 1fr 2.2fr;
	gap: 12px;
	flex: none;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	border-top: 1px solid #eee;
	background: var(--ts-bg);
}
.ts .ts-sheet__reset,
.ts .ts-sheet__submit {
	min-height: 52px;
	border-radius: var(--ts-radius);
	font-size: 15px;
	font-weight: bold;
	cursor: pointer;
}
.ts .ts-sheet__reset {
	border: 1.5px solid var(--ts-line);
	background: var(--ts-bg);
	color: var(--ts-text);
}
.ts .ts-sheet__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	background: var(--ts-accent);
	color: #fff;
}
.ts .ts-sheet__submit:disabled {
	background: #c9c9c9;
	cursor: not-allowed;
}

/* 条件のグループ */
.ts .ts-group {
	min-width: 0;
	margin: 0;
	padding: 20px 0 4px;
	border: 0;
	border-top: 1px solid #f0f0f0;
}
.ts .ts-group:first-child {
	border-top: 0;
}
.ts .ts-group__title {
	float: left; /* legend の特殊な配置（下に余白が出る）をやめる */
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 8px;
	width: 100%;
	margin: 0 0 12px;
	padding: 0;
	font-size: 16px;
	font-weight: bold;
}
.ts .ts-group__title + * {
	clear: both;
}
.ts .ts-group__title small {
	color: var(--ts-sub);
	font-size: 12px;
	font-weight: normal;
}
.ts .ts-group__n,
.ts .ts-pref__n {
	margin-left: auto;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--ts-accent-soft);
	color: var(--ts-accent);
	font-size: 12px;
	line-height: 22px;
}

/* 都道府県・「ほかのこだわり」の開閉 */
.ts .ts-pref,
.ts .ts-more {
	margin: 0;
	border: 0;
}
.ts .ts-pref + .ts-pref {
	border-top: 1px solid #f3f3f3;
}
.ts .ts-pref > summary,
.ts .ts-more > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0;
	font-size: 15px;
	font-weight: bold;
	list-style: none;
	cursor: pointer;
}
.ts .ts-pref > summary::-webkit-details-marker,
.ts .ts-more > summary::-webkit-details-marker {
	display: none;
}
.ts .ts-pref > summary::after,
.ts .ts-more > summary::after {
	content: "";
	width: 8px;
	height: 8px;
	margin: 0 6px 0 auto;
	border-right: 2px solid #999;
	border-bottom: 2px solid #999;
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.2s;
}
.ts .ts-pref[open] > summary::after,
.ts .ts-more[open] > summary::after {
	transform: rotate(-135deg) translateY(-2px);
}
.ts .ts-pref__n {
	margin-left: 0;
}
.ts .ts-pref > .ts-chips {
	padding-bottom: 12px;
}
.ts .ts-more > summary {
	color: var(--ts-accent);
	font-size: 14px;
}
.ts .ts-more > .ts-chips {
	padding-bottom: 8px;
}

/* 選択チップ */
.ts .ts-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.ts .ts-chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	margin: 0;
	padding: 6px 14px;
	border: 1.5px solid var(--ts-line);
	border-radius: 999px;
	background: var(--ts-bg);
	color: var(--ts-text);
	font-size: 14px;
	font-weight: normal;
	line-height: 1.3;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.ts .ts-chip::before,
.ts .ts-chip::after {
	content: none;
}
.ts .ts-chip input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.ts .ts-chip__count {
	color: var(--ts-sub);
	font-size: 12px;
}
.ts .ts-chip:has(input:checked) {
	border-color: var(--ts-accent);
	background: var(--ts-accent);
	color: #fff;
}
.ts .ts-chip:has(input:checked) .ts-chip__count {
	color: rgba(255, 255, 255, 0.85);
}
.ts .ts-chip:has(input:focus-visible) {
	outline: 3px solid var(--ts-accent-soft);
	outline-offset: 2px;
}
@media (hover: hover) {
	.ts .ts-chip:hover {
		border-color: var(--ts-accent);
	}
}

/* PC：シートは中央のダイアログ */
@media (min-width: 768px) {
	.ts .ts__quick-list {
		flex-wrap: wrap;
		margin: 0;
		padding: 2px 0;
		overflow: visible;
	}
	.ts .ts-sheet {
		width: min(720px, calc(100vw - 48px));
		max-height: min(86dvh, 820px);
		margin: auto;
		border-radius: 20px;
	}
	.ts .ts-sheet__foot {
		grid-template-columns: 160px 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ts .ts-sheet[open] {
		animation: none;
	}
	.ts * {
		transition: none !important;
	}
}
