@charset "UTF-8";

/* ====================================
   販売生体一覧ページ専用スタイル（stocks テンプレート用）
   ※ article.css と同名クラスあり（.stocks-grid, .stock-card, .badge 等）
   ※ _main.php のテンプレート別自動読み込みにより同時には読み込まれない
   ==================================== */

/* PC: 左サイドバー + メインエリア */
@media (min-width: 768px) {
	.page-container {
		display: grid;
		grid-template-columns: 250px 1fr;
		grid-template-rows: auto auto 1fr;
		gap: 1em;
	}

	.page-header {
		grid-column: 1 / -1;
	}

	.filter-section {
		grid-column: 1;
		grid-row: 2 / 4;
	}

	.stocks-list-section {
		grid-column: 2;
		grid-row: 2 / 4;
	}

	/* 絞り込みメニュー: 縦積みレイアウト */
	.filter-section .stocks-filter-header {
		margin-top: 0;
		padding: 0.75em;
		/* position: sticky;
		top: 5rem;
		z-index: 2; */
	}

	.filter-section .stocks-filter-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25em;
		margin-bottom: 1em;
	}

	.stocks-filter-category{
		margin-bottom: 1em;
	}
	/* .filter-section .stocks-filter-item-label {
		width: 100%;
		min-width: auto;
	} */

	/* .filter-section .stocks-filter-categories,
	.filter-section .stocks-filter-radios {
		flex-direction: column;
		align-items: flex-start;
		width: 100%;
		gap: 0.5em;
	} */
	/* .filter-section .stocks-filter-label {
		width: 100%;
		justify-content: flex-start;
	} */

	.filter-section .stocks-keyword-input,
	.filter-section .stocks-sort-select {
		width: 100%;
	}

	.filter-section .stocks-price-slider-container {
		width: 100%;
		max-width: none;
	}
}

/* SP: 縦積み */
@media (max-width: 767px) {
	.page-container {
		display: flex;
		flex-direction: column;
		gap: 1em;
	}
}

/* 価格文字ちょっと大きく */
#content .stocks-price-range-display{
	margin: auto;
	font-size: 0.9em;
}

/* ====================================
   生体グリッド - article簡易表示と同じ構造
   ==================================== */

.stocks-grid {
	display: flex;
	flex-direction: column;
	gap: 1px;
	background: light-dark(#ddd, #444);
	border: 1px solid light-dark(#ddd, #444);
	border-radius: 4px;
	overflow: hidden;
}

.stock-card {
	display: grid;
	grid-template-columns: 60px 1fr;
	align-items: center;
	padding: 0;
	border: none;
	border-radius: 0;
	background: light-dark(#fff, #2a2a2a);
}

.stock-card-link {
	display: contents;
	text-decoration: none;
	color: inherit;
}

/* 写真エリア */
.stock-card-image {
	aspect-ratio: 1 / 1;
	width: 60px;
	overflow: hidden;
	border-radius: 0;
}

.stock-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 情報エリア */
.stock-info {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
	padding: 0.5em 0.75em;
	min-width: 0;
	overflow: hidden;
}

/* キャッチコピー行 */
.slogan-line {
	font-size: 0.7em;
	margin-bottom: 0.15em;
	color: light-dark(#555, #bbb);
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 名前行 */
.name-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.4em;
	line-height: 1.2;
}

.name-line .species-name {
	font-weight: bold;
	font-size: 0.95em;
}

.name-line .variety {
	font-size: 0.75em;
	font-weight: bold;
	color: light-dark(#333, #ddd);
}

.name-line .scientific-name {
	font-size: 0.65em;
	font-style: italic;
	color: light-dark(#888, #777);
}

/* 基本情報行（産地・CB/WC・性別・価格を1行に） */
.info-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	font-size: 0.75em;
}

.info-line .basic-info {
	font-weight: bold;
	color: light-dark(#444, #ddd);
}

.info-line .price {
	font-weight: bold;
	font-size: 1.25em;
	color: light-dark(#d32f2f, #ff6b6b);
}

/* 日付行 */
.date-line {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	font-size: 0.7em;
	color: light-dark(#666, #999);
}

/* 販売状況バッジ */
.badge {
	font-size: 0.7em;
	font-weight: normal;
	padding: 0.1em 0.4em;
	border-radius: 3px;
}

.badge-sold {
	background: light-dark(#ffebee, #5c2828);
	color: light-dark(#c62828, #ff8a80);
}

.badge-pending {
	background: light-dark(#fff3e0, #5c4a28);
	color: light-dark(#ef6c00, #ffb74d);
}

/* 検索結果なし表示 */
.no-results {
	padding: 2em;
	text-align: center;
	color: light-dark(#666, #999);
	background: light-dark(#f5f5f5, #2a2a2a);
	border-radius: 4px;
}

.no-stocks {
	padding: 2em;
	text-align: center;
	color: light-dark(#666, #999);
}

/* SP: 簡易表示はSP/PC統一のため特別な調整なし */

/* ====================================
   リスト上部ツールバー
   ==================================== */

.stocks-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	/* justify-content: space-between; */
	gap: 0.75em;
	padding: 0.5em 0;
}

@media (min-width: 768px) {
	.stocks-toolbar {
		grid-column: 2;
		grid-row: 2;
	}

	.stocks-list-section {
		grid-row: 3;
	}
}

/* ====================================
   絞り込み条件表示 & リセットボタン
   ==================================== */

.filter-status-section {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.4em 0.6em;
	background: light-dark(#f5f5f5, #333);
	border-radius: 4px;
	font-size: 0.85em;
}

.filter-status-label {
	color: light-dark(#666, #aaa);
	white-space: nowrap;
}

.filter-status-tags {
	flex: 1;
	color: light-dark(#333, #ddd);
	font-weight: 500;
}

.filter-reset-btn {
	padding: 0.25em 0.6em;
	border: 1px solid light-dark(#ccc, #555);
	border-radius: 3px;
	background: light-dark(#fff, #444);
	color: light-dark(#666, #aaa);
	cursor: pointer;
	font-size: 0.9em;
	white-space: nowrap;
}

.filter-reset-btn:hover {
	background: light-dark(#eee, #555);
	color: light-dark(#333, #ddd);
}

/* ====================================
   売り切れ表示チェック＆オーバーレイ
   ==================================== */

.sold-filter {
	font-size: 0.9em;
	color: light-dark(#666, #aaa);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
}

.sold-filter input {
	cursor: pointer;
}

/* 売約済み・交渉中のオーバーレイ */
.stock-card[data-sale-status="2"],
.stock-card[data-sale-status="3"] {
	position: relative;
}

.stock-card[data-sale-status="2"]::after,
.stock-card[data-sale-status="3"]::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	pointer-events: none;
}

/* ====================================
   表示切替トグル
   ==================================== */

.view-toggle {
	display: flex;
	align-items: center;
	gap: 0.5em;
	font-size: 0.85em;
}

.view-toggle-label {
	color: light-dark(#666, #aaa);
}

.view-toggle-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.25em;
	padding: 0.35em 0.5em 0.25em;
	border: 1px solid light-dark(#ccc, #555);
	border-radius: 2px;
	background: light-dark(#fff, #2a2a2a);
	color: light-dark(#666, #999);
	cursor: pointer;
	transition: all 0.15s;
}

.view-toggle-btn .material-symbols-outlined {
	font-size: 1.6em;
	vertical-align: middle;
}

.view-toggle-btn:hover {
	background: light-dark(#f0f0f0, #3a3a3a);
	color: light-dark(#333, #ddd);
}

.view-toggle-btn.active {
	background: light-dark(#e8e8e8, #444);
	color: light-dark(#333, #eee);
	border-color: light-dark(#999, #666);
}

/* ====================================
   カード表示モード
   ==================================== */

.stocks-grid[data-view="card"] {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1em;
	background: transparent;
	border: none;
}

.stocks-grid[data-view="card"] .stock-card {
	display: block;
	border: 1px solid light-dark(#ddd, #444);
	border-radius: 6px;
	overflow: hidden;
}

.stocks-grid[data-view="card"] .stock-card-link {
	display: block;
}

.stocks-grid[data-view="card"] .stock-card-image {
	width: 100%;
}

.stocks-grid[data-view="card"] .stock-card-image img {
	width: 100%;
	height: auto;
	display: block;
}

.stocks-grid[data-view="card"] .stock-info {
	padding: 0.6em;
}

.stocks-grid[data-view="card"] .slogan-line {
	white-space: normal;
}

.stocks-grid[data-view="card"] .name-line {
	flex-direction: column;
	align-items: flex-start;
}

.stocks-grid[data-view="card"] .info-line {
	flex-direction: column;
	align-items: flex-start;
	gap: 0.3em;
}

.stocks-grid[data-view="card"] .info-line .price {
	font-size: 1.5em;
	display: block;
	width: 100%;
	text-align: right;
}

.stocks-grid[data-view="card"] .date-line {
	flex-direction: column;
	gap: 0;
}

.stocks-grid[data-view="card"] .date-line > span + span {
	margin-top: 0.1em;
}

/* SP: カード2列 */
@media (max-width: 767px) {
	.stocks-grid[data-view="card"] {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.5em;
	}

	.stocks-grid[data-view="card"] .stock-info {
		padding: 0.5em;
	}

	.stocks-grid[data-view="card"] .name-line .species-name {
		font-size: 0.9em;
	}
}
