/* ==========================================================================
   全局右侧购物车抽屉（#CartDrawer）
   目的：不再依赖 Porto 的 .cart-popup，也不依赖复刻页那份 450KB 的 theme.css，
        任何页面（首页 / 购物车 / 商品页）都用同一套复刻页风格的侧栏。
   视觉基线（对齐 docs/design-spec.md）：
        底色 #0e0e0e、正文 #dadada、强调铜金 #9f8561、标题 Oswald。
   ========================================================================== */

#CartDrawer.drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	right: 0;
	width: 420px;
	max-width: 92vw;
	display: none;
	z-index: 9000;
	background: #0e0e0e;
	color: #dadada;
	box-shadow: -12px 0 40px rgba(0, 0, 0, .55);
	border-left: 1px solid rgba(255, 255, 255, .08);
}

#CartDrawer.drawer--is-open {
	display: block;
}

#CartDrawer .drawer__contents {
	display: flex;
	flex-direction: column;
	height: 100%;
}

#CartDrawer .drawer__fixed-header {
	flex: 0 0 auto;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
}

#CartDrawer .drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 24px;
}

#CartDrawer .drawer__title {
	margin: 0;
	font-family: Oswald, sans-serif;
	font-size: 17px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: #fff;
	font-weight: 500;
}

#CartDrawer .drawer__close-button {
	background: none;
	border: 0;
	padding: 6px;
	cursor: pointer;
	color: #dadada;
	line-height: 0;
}

#CartDrawer .drawer__close-button:hover {
	color: #9f8561;
}

#CartDrawer .drawer__close-button .icon {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
}

#CartDrawer .drawer__inner {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

#CartDrawer .drawer__scrollable {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 20px 24px;
}

#CartDrawer .cart__item {
	display: flex;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .07);
}

#CartDrawer .cart__item-image img {
	width: 70px;
	height: 70px;
	object-fit: cover;
	display: block;
}

#CartDrawer .cart__item-title a {
	color: #fff;
	text-decoration: none;
	font-size: 15px;
}

#CartDrawer .cart__item-title a:hover {
	color: #9f8561;
}

#CartDrawer .cart__item-row {
	font-size: 13px;
	color: rgba(218, 218, 218, .78);
	margin-top: 4px;
}

#CartDrawer .drawer__footer {
	flex: 0 0 auto;
	padding: 18px 24px 24px;
	border-top: 1px solid rgba(255, 255, 255, .1);
	background: #0e0e0e;
}

#CartDrawer .cart__item-sub {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-family: Oswald, sans-serif;
	letter-spacing: .1em;
	text-transform: uppercase;
	font-size: 14px;
	color: #fff;
}

#CartDrawer .cart__checkout-wrapper {
	margin-top: 16px;
}

#CartDrawer .cart__checkout {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 14px 18px;
	background: #9f8561;
	color: #0e0e0e;
	text-align: center;
	text-decoration: none;
	font-family: Oswald, sans-serif;
	font-size: 13px;
	letter-spacing: .16em;
	text-transform: uppercase;
	border: 0;
	transition: background-color .18s ease;
}

#CartDrawer .cart__checkout:hover {
	background: #b89a72;
	color: #0e0e0e;
}

/* 遮罩：用 body 上的类控制，避免额外 DOM */
body.js-drawer-open::after {
	content: "";
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	z-index: 8990;
}

body.js-drawer-open {
	overflow: hidden;
}

/* 复刻页的 theme.css 里还有一套 .drawer--right{right:-350px;width:350px}
   与 .drawer--right.drawer--is-open{transform:translate(-350px)}；
   首页加载了那份 CSS，会把抽屉再往左推 350px（实测 right 变成 990 而不是 1440）。
   这里用更具体的选择器压掉它，保证任何页面都贴右边缘。 */
#CartDrawer.drawer--right {
	right: 0;
	left: auto;
	width: 420px;
	max-width: 92vw;
}

#CartDrawer.drawer--right.drawer--is-open {
	transform: none;
}