/* ==========================================================================
   線上採購（商店、商品分類、商品搜尋）2026-10-02
   設計稿 https://claude.ai/artifact/QCbw11nmmH7FkpYpHNyFjh 第 7 排
   標記在 inc/shop-archive.php。全部以 body.tz-shop-archive 起頭，開關關掉時完全不生效。
   ========================================================================== */

.tz-shop-archive {
	--tzs-head:    #192a3d;
	--tzs-text:    #3a4f66;
	--tzs-caption: #5f6b7a;
	--tzs-line:    #e1e8ed;
	--tzs-field:   #c9d3dc;
	--tzs-soft:    #f5f7f9;
	--tzs-blue:    var(--theme-palette-color-1, #1559ed);
}

/* Blocksy 自己的「顯示第 x 至 y 項＋排序」那一列：件數與排序已經搬進篩選列 */
.tz-shop-archive .woo-listing-top { display: none; }

/* 橫幅拿掉之後，內容離頁首 44px（原本容器自己的上邊距是給橫幅底下用的） */
.tz-shop-archive #main > .ct-container[data-vertical-spacing*="top"] { padding-top: 44px; }

/* --------------------------------------------------------------------------
   篩選列
   -------------------------------------------------------------------------- */

.tz-shop { margin-bottom: 26px; }

.tz-shop__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	flex-wrap: wrap;
}

.tz-shop__title {
	margin: 0;
	color: var(--tzs-head);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.3;
}

.tz-shop__title a { color: inherit; text-decoration: none; }
.tz-shop__title a:hover { color: var(--tzs-blue); }
.tz-shop__sep { margin: 0 10px; color: var(--tzs-field); font-weight: 400; }

.tz-shop__tools {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

/* 搜尋框 */
.tz-shop__search {
	position: relative;
	width: 360px;
	max-width: 100%;
	margin: 0;
}

.tz-shop__search > .tz-icon--search {
	position: absolute;
	left: 14px;
	top: 50%;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	color: var(--tzs-caption);
	pointer-events: none;
}

.tz-shop__search input[type="search"] {
	width: 100%;
	height: 44px;
	box-sizing: border-box;
	margin: 0;
	padding: 0 40px 0 42px;
	border: 1px solid var(--tzs-field);
	border-radius: 4px;
	background: #fff;
	color: var(--tzs-head);
	font-size: 15px;
	-webkit-appearance: none;
	appearance: none;
}

.tz-shop__search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.tz-shop__search input[type="search"]:focus { border-color: var(--tzs-blue); outline: 0; box-shadow: 0 0 0 3px rgba(21, 89, 237, .15); }

.tz-shop__clear {
	position: absolute;
	right: 6px;
	top: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	transform: translateY(-50%);
	color: var(--tzs-caption);
}

.tz-shop__clear:hover { color: var(--tzs-head); }
.tz-shop__clear .tz-icon { width: 16px; height: 16px; }

/* 排序（WooCommerce 的 form.woocommerce-ordering，搬進來重排） */
.tz-shop__tools .woocommerce-ordering {
	position: relative;
	flex-shrink: 0;
	width: 180px;
	margin: 0;
}

.tz-shop__tools .woocommerce-ordering select {
	width: 100%;
	height: 44px;
	box-sizing: border-box;
	margin: 0;
	padding: 0 36px 0 14px;
	border: 1px solid var(--tzs-field);
	border-radius: 4px;
	background-color: #fff;
	color: var(--tzs-text);
	font-size: 15px;
}

.tz-shop__tools .woocommerce-ordering .ct-sort-icon { display: none; }

/* 品牌標籤 */
.tz-shop__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 22px;
}

.tz-shop__chips--sub { margin-top: 14px; }
.tz-shop__sublabel { color: var(--tzs-caption); font-size: 13px; white-space: nowrap; }

.tz-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	height: 36px;
	box-sizing: border-box;
	padding: 0 14px;
	border: 1px solid var(--tzs-line);
	border-radius: 18px;
	background: #fff;
	color: var(--tzs-text);
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color .15s ease, color .15s ease;
}

.tz-chip:hover { border-color: var(--tzs-head); color: var(--tzs-head); }
.tz-chip__n { color: var(--tzs-caption); font-size: 12px; }

.tz-chip.is-active,
.tz-chip.is-active:hover { border-color: var(--tzs-head); background: var(--tzs-head); color: #fff; }
.tz-chip.is-active .tz-chip__n { color: rgba(255, 255, 255, .75); }

.tz-chip--sm { height: 32px; border-radius: 16px; }

/* 結果列 */
.tz-shop__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--tzs-line);
	color: var(--tzs-caption);
	font-size: 14px;
}

.tz-shop__count { margin: 0; }
.tz-shop__count strong { color: var(--tzs-head); font-weight: 600; }
.tz-shop__range { white-space: nowrap; }
.tz-shop__reset { color: var(--tzs-blue); text-decoration: none; white-space: nowrap; }
.tz-shop__reset:hover { text-decoration: underline; }

/* 找不到商品 */
.tz-shop-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 56px 20px 72px;
	text-align: center;
}

.tz-shop-empty__title { margin: 0; color: var(--tzs-head); font-size: 20px; font-weight: 600; }
.tz-shop-empty__text { margin: 0; color: var(--tzs-caption); font-size: 15px; }

.tz-shop-empty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin-top: 10px;
	padding: 0 22px;
	border-radius: 3px;
	background: var(--tzs-blue);
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
}

.tz-shop-empty__btn:hover { color: #fff; filter: brightness(.92); }

/* --------------------------------------------------------------------------
   商品格：四欄不變，列距 30 → 56px
   每張卡固定順序：圖 → 品牌 → 品名（兩行）→ 價格一行 → 整寬按鈕，所以每張一樣高
   -------------------------------------------------------------------------- */

.tz-shop-archive ul.products {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 56px 32px;
}

.tz-shop-archive ul.products > li.product {
	display: flex;
	flex-direction: column;
	min-width: 0;
	text-align: left;
}

.tz-shop-archive ul.products > li.product > figure { order: 0; margin: 0 0 14px; }

.tz-shop-archive ul.products > li.product > figure .ct-media-container {
	border-radius: 6px;
	overflow: hidden;
	background: var(--tzs-soft);
}

/* 品牌（商品分類）。一件掛好幾個分類時只留一行 */
.tz-shop-archive ul.products > li.product > .entry-meta {
	order: 1;
	display: block;
	margin: 0 0 4px;
	overflow: hidden;
	color: var(--tzs-caption);
	font-size: 12px;
	letter-spacing: .5px;
	line-height: 1.4;
	text-overflow: ellipsis;
	text-transform: none;
	white-space: nowrap;
}

.tz-shop-archive ul.products > li.product > .entry-meta li { display: inline; }
.tz-shop-archive ul.products > li.product > .entry-meta a { color: inherit; }

.tz-shop-archive ul.products > li.product > .woocommerce-loop-product__title {
	order: 2;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	min-height: 48px;   /* 兩行：一行的品名也佔兩行，下面的價格才會對齊 */
	margin: 0;
	overflow: hidden;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
}

.tz-shop-archive ul.products > li.product > .price {
	order: 3;
	display: flex;
	align-items: baseline;
	gap: 8px;
	min-height: 26px;
	margin: 10px 0 0;
	color: var(--tzs-head);
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
}

/* 特價：售價在前、劃掉的原價在後 */
.tz-shop-archive ul.products > li.product > .price .sale-price { display: inline-flex; align-items: baseline; gap: 8px; }
.tz-shop-archive ul.products > li.product > .price ins { order: 0; background: none; color: var(--tzs-head); text-decoration: none; }
.tz-shop-archive ul.products > li.product > .price del { order: 1; color: var(--tzs-caption); font-size: 13px; font-weight: 400; }

.tz-shop-archive ul.products > li.product > .price .woocommerce-price-suffix {
	color: var(--tzs-caption);
	font-size: 12px;
	font-weight: 400;
}

.tz-shop-archive ul.products > li.product > .price .tz-inquiry {
	color: var(--tzs-text);
	font-size: 15px;
	font-weight: 600;
}

.tz-shop-archive ul.products > li.product > .ct-woo-card-actions {
	order: 4;
	display: block;
	margin-top: 14px;
}

.tz-shop-archive ul.products > li.product > .ct-woo-card-actions > .button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 40px;
	min-height: 0;
	box-sizing: border-box;
	padding: 0 12px;
	border: 1px solid var(--tzs-blue);
	border-radius: 3px;
	font-size: 15px;
	font-weight: 500;
}

/* 不能直接買的（要詢價、要選規格）：外框按鈕 */
.tz-shop-archive ul.products > li.product > .ct-woo-card-actions > .button:not(.add_to_cart_button) {
	background: #fff;
	color: var(--tzs-blue);
}

.tz-shop-archive ul.products > li.product > .ct-woo-card-actions > .button:not(.add_to_cart_button):hover {
	background: var(--tzs-blue);
	color: #fff;
}

/* --------------------------------------------------------------------------
   窄螢幕
   -------------------------------------------------------------------------- */

@media (max-width: 999px) {
	.tz-shop-archive ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 24px; }
	.tz-shop__search { width: 280px; }
}

@media (max-width: 689px) {
	.tz-shop-archive #main > .ct-container[data-vertical-spacing*="top"] { padding-top: 28px; }

	.tz-shop { margin-bottom: 20px; }
	.tz-shop__title { font-size: 24px; }
	.tz-shop__top { gap: 16px; }
	/* 搜尋框與排序同一行：搜尋吃剩下的寬度 */
	.tz-shop__tools { width: 100%; gap: 8px; }
	.tz-shop__search { flex: 1 1 auto; width: auto; min-width: 0; }
	.tz-shop__tools .woocommerce-ordering { width: 128px; }
	.tz-shop__tools .woocommerce-ordering select { padding: 0 28px 0 10px; font-size: 14px; }

	/* 品牌標籤：一排橫向滑動，滑到螢幕邊緣 */
	.tz-shop__chips {
		flex-wrap: nowrap;
		gap: 8px;
		margin: 14px -16px 0;
		padding: 0 16px;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.tz-shop__chips::-webkit-scrollbar { display: none; }
	.tz-shop__chips--sub { margin-top: 10px; }

	.tz-shop__meta { margin-top: 16px; padding-top: 14px; }

	/* 兩欄（原本一欄，一頁 16 件要捲九千多 px） */
	.tz-shop-archive ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 14px; }

	.tz-shop-archive ul.products > li.product > figure { margin-bottom: 10px; }
	.tz-shop-archive ul.products > li.product > .woocommerce-loop-product__title { min-height: 42px; font-size: 14px; }
	.tz-shop-archive ul.products > li.product > .price { margin-top: 8px; font-size: 15px; }
	.tz-shop-archive ul.products > li.product > .price del { display: none; }
	.tz-shop-archive ul.products > li.product > .price .tz-inquiry { font-size: 13px; }
	.tz-shop-archive ul.products > li.product > .ct-woo-card-actions { margin-top: 10px; }
	.tz-shop-archive ul.products > li.product > .ct-woo-card-actions > .button { height: 36px; font-size: 13px; }
}
