/* ==========================================================================
   提示改成卡片（inc/notice-card.php、assets/js/notice-card.js）2026-10-02
   設計稿：畫布「TechEZ 選單與購物車」第 6 列。回退：TECHEZ_NOTICE_CARD = false
   ========================================================================== */

/* 原本那一條：JS 接手時藏起來（html.tz-nc-on 由 <head> 的小段 script 加上，JS 沒起來會拿掉） */
.tz-nc-on .woocommerce-notices-wrapper > .woocommerce-error,
.tz-nc-on .woocommerce-notices-wrapper > .woocommerce-message,
.tz-nc-on .woocommerce-notices-wrapper > .woocommerce-info:not(.cart-empty),
.tz-nc-on .woocommerce-notices-wrapper > .woocommerce > .woocommerce-error,
.tz-nc-on .woocommerce-notices-wrapper > .woocommerce > .woocommerce-message,
.tz-nc-on .woocommerce-notices-wrapper > .woocommerce > .woocommerce-info:not(.cart-empty),
.tz-nc-on .woocommerce-NoticeGroup {
	display: none !important;
}

.tz-nc {
	--tz-nc-ink: #192a3d;
	--tz-nc-text: #3a4f66;
	--tz-nc-caption: #5f6b7a;
	--tz-nc-line: #e1e8ed;
	--tz-nc-primary: #1559ed;
	--tz-nc-error: #b42318;
	--tz-nc-ok: #17754a;
	font-family: inherit;
	color: var(--tz-nc-text);
	box-sizing: border-box;
}

.tz-nc *,
.tz-nc *::before,
.tz-nc *::after {
	box-sizing: border-box;
}

.tz-nc svg {
	flex: 0 0 auto;
	display: block;
}

/* --------------------------------------------------------------------------
   跟欄位無關的錯誤：正中央的卡片＋遮罩
   -------------------------------------------------------------------------- */
.tz-nc--dialog {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(25, 42, 61, .45);
	opacity: 0;
	transition: opacity .18s ease;
}

.tz-nc--dialog.is-open {
	opacity: 1;
}

.tz-nc__card {
	width: 100%;
	max-width: 420px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 28px;
	overflow-y: auto;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(25, 42, 61, .28);
	transform: translateY(10px);
	transition: transform .18s ease;
}

.tz-nc--dialog.is-open .tz-nc__card {
	transform: none;
}

.tz-nc__alert {
	color: var(--tz-nc-error);
}

.tz-nc__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}

.tz-nc__msg {
	margin: 0;
	font-size: 16px;
	line-height: 1.7;
	color: var(--tz-nc-ink);
	overflow-wrap: anywhere;
}

.tz-nc__msg a {
	color: var(--tz-nc-primary);
}

.tz-nc__foot {
	display: flex;
	justify-content: flex-end;
	margin-top: 14px;
}

.tz-nc__ok {
	min-height: 46px;
	padding: 0 28px;
	border: 0;
	border-radius: 6px;
	background: var(--tz-nc-primary);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.tz-nc__ok:hover {
	background: #0f46bd;
}

.tz-nc__ok:focus-visible,
.tz-nc__x:focus-visible,
.tz-nc__btn:focus-visible {
	outline: 2px solid var(--tz-nc-primary);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   小卡：頁首購物車圖示下方（手機在底部）
   -------------------------------------------------------------------------- */
.tz-nc--pop {
	position: fixed;
	top: var(--tz-pop-top, 140px);
	right: var(--tz-pop-right, 20px);
	z-index: 99990;
	width: 400px;
	max-width: calc(100vw - 24px);
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}

.tz-nc__caret {
	display: none;
	position: absolute;
	top: -7px;
	right: 30px;
	z-index: 1;
	width: 14px;
	height: 14px;
	background: #fff;
	border-left: 1px solid var(--tz-nc-line);
	border-top: 1px solid var(--tz-nc-line);
	transform: rotate(45deg);
}

.tz-nc--pop.has-caret .tz-nc__caret {
	display: block;
}

.tz-nc__pcard {
	pointer-events: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px;
	background: #fff;
	border: 1px solid var(--tz-nc-line);
	border-radius: 12px;
	box-shadow: 0 18px 48px rgba(25, 42, 61, .2);
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity .2s ease, transform .2s ease;
}

.tz-nc__pcard.is-open {
	opacity: 1;
	transform: none;
}

.tz-nc__phead {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.tz-nc__ptitle {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	min-width: 0;
	color: var(--tz-nc-ok);
	font-size: 15px;
	font-weight: 700;
	line-height: 22px;
}

.tz-nc__ptitle svg {
	margin-top: 2px;
}

.tz-nc__pcard--info .tz-nc__ptitle {
	color: var(--tz-nc-primary);
}

.tz-nc__ptext {
	font-size: 14.5px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--tz-nc-ink);
	overflow-wrap: anywhere;
}

.tz-nc__ptext a {
	color: var(--tz-nc-primary);
}

.tz-nc__x {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	margin: -12px -12px -12px 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--tz-nc-caption);
	cursor: pointer;
}

.tz-nc__x:hover {
	color: var(--tz-nc-ink);
}

.tz-nc__item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.tz-nc__img {
	flex: 0 0 auto;
	display: block;
	width: 72px;
	height: 72px;
	object-fit: cover;
	border: 1px solid var(--tz-nc-line);
	border-radius: 6px;
}

.tz-nc__info {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.tz-nc__name {
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.55;
	color: var(--tz-nc-ink);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tz-nc__qty {
	font-size: 14px;
	color: var(--tz-nc-text);
}

.tz-nc__sum {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding-top: 14px;
	border-top: 1px solid var(--tz-nc-line);
	font-size: 14px;
}

.tz-nc__count {
	color: var(--tz-nc-caption);
}

.tz-nc__subtotal {
	color: var(--tz-nc-ink);
	font-weight: 600;
}

.tz-nc__btns {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.tz-nc__btns--2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tz-nc__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 18px;
	border: 1px solid var(--tz-nc-primary);
	border-radius: 6px;
	background: #fff;
	color: var(--tz-nc-primary);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.tz-nc__btn:hover {
	background: #f3f7ff;
	color: var(--tz-nc-primary);
}

.tz-nc__btn--primary {
	background: var(--tz-nc-primary);
	color: #fff;
}

.tz-nc__btn--primary:hover {
	background: #0f46bd;
	color: #fff;
}

@media (max-width: 689.98px) {
	.tz-nc--dialog {
		padding: 16px;
	}

	.tz-nc__card {
		padding: 24px 20px 20px;
	}

	.tz-nc__ok {
		width: 100%;
	}

	/* 手機：底部卡片 */
	.tz-nc--pop {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: auto;
		max-width: none;
		gap: 0;
	}

	.tz-nc--pop.has-caret .tz-nc__caret {
		display: none;
	}

	.tz-nc__pcard {
		border-radius: 18px 18px 0 0;
		border-width: 1px 0 0;
		box-shadow: 0 -12px 40px rgba(25, 42, 61, .2);
		padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
		transform: translateY(12px);
	}

	.tz-nc__pcard + .tz-nc__pcard {
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tz-nc--dialog,
	.tz-nc__card,
	.tz-nc__pcard {
		transition: none;
	}
}
