/* ============ 购物车抽屉 ============ */
.merc-drawer {
	display: none;
}
.merc-drawer.is-open {
	display: block;
}
.merc-drawer__mask {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 1040;
}
.merc-drawer__panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 420px;
	max-width: 92vw;
	background: #fff;
	z-index: 1050;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.28s ease;
}
.merc-drawer.is-open .merc-drawer__panel {
	transform: translateX(0);
}
.merc-drawer__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 24px;
	border-bottom: 1px solid var(--merc-border);
}
.merc-drawer__head .merc-drawer__close {
	margin-right: 0;
}
.merc-drawer__head .merc-drawer__title {
	flex-shrink: 0;
}
.merc-drawer__head .merc-drawer__postcode {
	flex: 1;
	min-width: 0;
	align-self: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.merc-drawer__head .merc-drawer__title {
	align-self: center;
}
.merc-drawer__head .merc-drawer__close {
	align-self: center;
}
.merc-drawer__head-actions {
	margin-left: auto;
}
.merc-drawer__title {
	font-size: 18px;
	font-weight: 800;
	color: var(--merc-chocolat);
}
.merc-drawer__close {
	background: none;
	border: 0;
	color: #8a857c;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
}
.merc-drawer__close:hover {
	color: var(--merc-hover);
}
.merc-drawer__postcode {
	background: transparent;
	border: 0;
	color: var(--merc-hover);
	font-size: 14px;
	padding: 0;
	font-weight: 600;
}
.merc-drawer__deliver {
	color: var(--merc-hover);
}
.merc-drawer__list {
	flex: 1;
	overflow-y: auto;
	padding: 8px 20px;
}
.merc-drawer-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 18px 0;
	border-bottom: 1px solid #f0eae1;
}
.merc-drawer-thumb {
	width: 100px;
	height: 100px;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	background: #f4efe7;
}
.merc-drawer-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
/* 抽屉缩略图 = 可点击按钮 → quickview */
.merc-drawer-thumb__btn {
	background: none;
	border: 0;
	cursor: pointer;
	display: block;
	height: 100%;
	padding: 0;
	width: 100%;
}
.merc-drawer-thumb__btn:hover img {
	opacity: 0.85;
}
.merc-drawer-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.merc-drawer-item__name {
	font-size: 15px;
	color: var(--merc-chocolat);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* 缺货提醒(购物车抽屉): 行标签 + 顶部警告条 */
.merc-drawer-item__oos {
	display: inline-block;
	align-self: flex-start;
	background: #fbe9e2;
	color: #b3401a;
	font-size: 12px;
	font-weight: 700;
	padding: 2px 10px;
	border-radius: 10px;
}
.merc-drawer-item__oos.is-limited {
	background: #fdf3e3;
	color: #9a6a00;
}
.merc-drawer-item__retirar {
	background: transparent;
	border: 0;
	color: #b3401a;
	font-size: 12px;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
	padding: 0 2px;
	margin-left: 4px;
}
.merc-drawer-item.is-agotado {
	opacity: 0.72;
}
.merc-drawer__oos-banner {
	background: #fdf3ec;
	border: 1px solid #f0d4c2;
	color: #9c3d16;
	font-size: 13px;
	line-height: 1.5;
	padding: 10px 12px;
	border-radius: 8px;
	margin-bottom: 12px;
}
/* 达到库存上限的 + 按钮 */
.merc-qty-btn.is-max {
	opacity: 0.4;
	cursor: not-allowed;
}
/* 加购失败/库存上限 toast */
.merc-cart-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: #2e2a27;
	color: #fff;
	font-size: 14px;
	padding: 12px 20px;
	border-radius: 10px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s, transform 0.25s;
	z-index: 3000;
	max-width: 80vw;
	text-align: center;
}
.merc-cart-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
.merc-drawer-item__unit {
	display: none;
}
.merc-drawer-item__price {
	font-size: 17px;
	font-weight: 800;
	color: var(--merc-chocolat);
}
.merc-drawer-item__unit-suffix {
	font-size: 12px;
	color: #8a857c;
	font-weight: 400;
}
.merc-drawer-item__qty {
	font-size: 13px;
	color: #6b6966;
	font-weight: 600;
}
.merc-drawer-item__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 4px;
}
.merc-drawer-item__controls {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 0;
}
.merc-drawer-item__en-carro {
	font-size: 14px;
	font-weight: 700;
	color: var(--merc-deepgreen);
}
.merc-drawer-item__qty-val {
	font-size: 16px;
	font-weight: 700;
	min-width: 22px;
	text-align: center;
}
.merc-drawer-item .merc-qty-btn {
	height: 44px;
	width: 44px;
	font-size: 20px;
}

/* 分组标题 */
.merc-drawer-group {
	margin-bottom: 8px;
}
.merc-drawer-group__title {
	color: var(--merc-chocolat);
	font-size: 15px;
	font-weight: 700;
	padding: 10px 0 6px;
	border-bottom: 1px solid var(--merc-border);
}

/* 排序下拉（紧凑，高度为头部一半） */
.merc-drawer__sort {
	align-items: center;
	display: flex;
	gap: 8px;
	padding: 6px 24px;
	border-bottom: 1px solid var(--merc-border);
	background: #faf8f4;
}
.merc-drawer__sort-label {
	color: #8a857c;
	font-size: 12px;
}
.merc-drawer__sort-select {
	background: transparent;
	border: 0;
	color: var(--merc-text);
	font-size: 12px;
	font-weight: 600;
	padding: 2px 20px 2px 4px;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='none' stroke='%236b6966' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 4px center;
	cursor: pointer;
}

/* 头部动作（三点菜单 + 关闭） */
.merc-drawer__head-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}
.merc-drawer__menu {
	background: none;
	border: 0;
	color: var(--merc-chocolat);
	cursor: pointer;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: 1px;
	line-height: 1;
	padding: 0;
}
.merc-drawer__menu:hover {
	color: var(--merc-hover);
}
.merc-drawer__menu-pop {
	position: absolute;
	right: 48px;
	top: 52px;
	background: #fff;
	border: 1px solid var(--merc-border);
	border-radius: 8px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
	z-index: 30;
	min-width: 200px;
	padding: 6px 0;
}
.merc-drawer__menu-item {
	background: none;
	border: 0;
	color: var(--merc-text);
	cursor: pointer;
	display: block;
	font-size: 14px;
	padding: 10px 16px;
	text-align: left;
	width: 100%;
}
.merc-drawer__menu-item:hover {
	background: #faf6f0;
	color: var(--merc-hover);
}
/* 删除/清空类菜单项:红色 + 垃圾桶图标(2026-08-23 Marc:全局删除/提醒用红) */
.merc-drawer__menu-item--danger {
	color: var(--merc-tomato, #C3273B);
	font-weight: 700;
}
.merc-drawer__menu-item--danger:hover {
	background: #fdf3ef;
	color: var(--merc-tomato, #C3273B);
}
/* 内联 SVG 垃圾桶(继承 currentColor 红色)与文字对齐 */
.merc-svg-trash {
	flex-shrink: 0;
	vertical-align: -2px;
	margin-right: 2px;
}
.merc-drawer__menu-item--danger,
.merc-listadetail__opt-danger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* 配送地址行可点击 */
.merc-drawer-empty {
	padding: 40px 20px;
	text-align: center;
	color: #8a857c;
	font-size: 14px;
}
.merc-drawer__foot {
	border-top: 1px solid var(--merc-border);
	padding: 16px 24px 20px;
	position: relative;
	background: #fff;
}
.merc-drawer__total-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}
.merc-drawer__total-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: var(--merc-chocolat);
	position: relative;
}
.merc-drawer__total-text {
	font-weight: 600;
}
.merc-drawer__info {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1.5px solid #8a857c;
	color: #8a857c;
	font-size: 11px;
	font-style: normal;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	user-select: none;
}
.merc-drawer__total {
	font-size: 26px;
	font-weight: 800;
	color: var(--merc-chocolat);
}
.merc-drawer__info-bubble {
	position: absolute;
	bottom: calc(100% + 8px);
	right: calc(100% + 12px);
	width: 240px;
	max-width: 240px;
	/* 底色 = 抽屉「Ordenar」分栏色（Marc 2026-09-11：白底小字看着吃力） */
	background: #faf8f4;
	border: 1px solid var(--merc-border);
	border-radius: 10px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	padding: 12px 16px;
	font-size: 12px;
	line-height: 1.6;
	word-spacing: 2px;
	color: #4a453e;
	z-index: 30;
	display: none;
}
.merc-drawer__info-bubble:before {
	content: "";
	position: absolute;
	bottom: -6px;
	right: 14px;
	width: 10px;
	height: 10px;
	background: #faf8f4;
	border-right: 1px solid var(--merc-border);
	border-bottom: 1px solid var(--merc-border);
	transform: rotate(45deg);
}
.merc-drawer__checkout {
	width: 100%;
	height: 44px;
	background: var(--merc-button);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	border: none;
	border-radius: 22px;
	cursor: pointer;
}
.merc-drawer__checkout:hover {
	background: var(--merc-button-dark);
}

/* ============ 搜索空态 ============ */
.merc-search-empty {
	padding: 60px 20px;
	text-align: center;
}
.merc-search-empty__title {
	color: var(--merc-chocolat);
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 10px;
}
.merc-search-empty__sub {
	color: #6b675f;
	font-size: 14px;
	margin: 0 0 18px;
}
.merc-search-empty__link {
	color: var(--merc-hover);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}
.merc-search-empty__link:hover {
	text-decoration: underline;
}

/* ============ 加载更多按钮 ============ */
.merc-loadmore {
	margin: 28px 0 10px;
	text-align: center;
}
.merc-loadmore__btn {
	background: #fff;
	border: 2px solid var(--merc-button);
	border-radius: 22px;
	color: var(--merc-button);
	cursor: pointer;
	font-size: 15px;
	font-weight: 700;
	min-height: 44px;
	padding: 10px 36px;
	transition: background 0.2s, color 0.2s;
}
.merc-loadmore__btn:hover {
	background: var(--merc-button);
	color: #fff;
}
.merc-loadmore__btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* ============ Mis habituales（常购商品） ============ */
.merc-frequent {
	margin: 28px auto 0;
	max-width: 1400px;
	padding: 0 16px;
}
.merc-frequent__head {
	margin-bottom: 14px;
}
.merc-frequent__title {
	color: var(--merc-chocolat);
	font-size: 22px;
	font-weight: 800;
	margin: 0;
}
.merc-frequent__track-wrap {
	position: relative;
}
.merc-frequent__track {
	display: flex;
	gap: 15px;
	overflow-x: auto;
	padding: 6px 0 14px;
	scroll-behavior: smooth;
}
.merc-frequent__track::-webkit-scrollbar {
	display: none;
}
.merc-frequent-card {
	background: #fff;
	border-radius: 8px;
	flex: 0 0 210px;
	width: 210px;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.merc-frequent-card:hover {
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
	transform: translateY(-1px);
}
.merc-frequent-link {
	color: inherit;
	display: block;
	padding: 8px;
	text-decoration: none;
}
.merc-frequent-img {
	background: transparent;
	border-radius: 6px;
	display: block;
	overflow: hidden;
}
.merc-frequent-img img {
	border-radius: 6px;
	display: block;
	height: auto;
	width: 100%;
}
.merc-frequent-name {
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: var(--merc-chocolat);
	display: -webkit-box;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	margin: 6px 4px 2px;
	min-height: 38px;
	overflow: hidden;
}
.merc-frequent-format {
	color: #8a857c;
	display: block;
	font-size: 12px;
	margin: 0 4px 4px;
}
.merc-frequent-price {
	color: var(--merc-chocolat);
	display: block;
	font-size: 18px;
	font-weight: 800;
	margin: 0 4px 8px;
}
.merc-frequent-add {
	margin: 0 8px 10px;
	width: calc(100% - 16px);
}
.merc-frequent-add.is-added {
	background: #e8e0d8;
	color: var(--merc-deepgreen);
	cursor: default;
}
.merc-frequent__arrow {
	align-items: center;
	background: #fff;
	border: 1px solid var(--merc-border);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	height: 40px;
	justify-content: center;
	position: absolute;
	top: 42%;
	transform: translateY(-50%);
	width: 40px;
	z-index: 2;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.merc-frequent__arrow.prev {
	left: -14px;
}
.merc-frequent__arrow.next {
	right: -14px;
}
.merc-frequent__arrow:hover {
	background: #f4f0e9;
}
.merc-frequent__guest {
	align-items: center;
	background: #faf8f4;
	border-radius: 12px;
	display: flex;
	gap: 12px;
	padding: 18px 22px;
}
.merc-frequent__guest span {
	color: #6b6966;
	font-size: 15px;
}
.merc-frequent__login {
	color: var(--merc-hover);
	font-weight: 700;
	text-decoration: none;
}
.merc-frequent__login:hover {
	text-decoration: underline;
}

/* ============ 固定 5 列商品网格（首页 + 列表页共用）============ */
.products-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 16px 15px;
	padding: 4px 15px 16px;
	box-sizing: border-box;
}
.products-grid > * {
	flex: 0 0 210px;
	width: 210px;
	box-sizing: border-box;
}

/* 分类页网格不再单独覆盖：与首页/搜索/列表页共用同一套规则见 90-responsive.css
   （历史坑：这里曾写 body#category .products-grid > * {flex:0 0 210px}，
    id 优先级压掉响应式列数规则 → 手机上分类页只有 1 列） */

/* ============ Mercadona 商品卡 ============ */
.product-miniature {
	background: #ffffff;
	border: 0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: none;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.product-miniature:hover {
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
	transform: translateY(-1px);
}
.merc-img-wrap {
	position: relative;
	background: var(--merc-img-bg, #F5F5F5);
	aspect-ratio: 1 / 1;
	overflow: hidden;
	padding: 8px;
	margin: 6px 6px 0;
	box-sizing: border-box;
	border-radius: 8px;
}
.merc-img-wrap img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 8px;
}
.merc-card-link {
	display: flex;
	flex-direction: column;
	flex: 1;
	text-decoration: none;
	color: inherit;
}
.merc-card-link:hover {
	color: inherit;
	text-decoration: none;
}
.merc-card-body {
	padding: 8px 14px 14px;
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #ffffff;
}
.merc-card-actions {
	padding: 2px 14px 14px;
	background: #ffffff;
}
.merc-card-actions .merc-add-capsule {
	margin-top: 0;
}
.merc-title {
	color: var(--merc-chocolat);
	display: -webkit-box;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	min-height: 38px;
}
.merc-format {
	color: #8a857c;
	font-size: 12px;
	margin: 4px 0 6px;
	min-height: 18px;
	line-height: 18px;
}
.merc-format__unit-price {
	color: #a09a90;
	margin-left: 4px;
}
.merc-price-line {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 8px;
	margin-top: auto;
}
.merc-price {
	color: var(--merc-chocolat);
	font-size: 18px;
	font-weight: 800;
}
/* 折扣原价: 红色 + 删除线(2026-08-23 Marc: 折扣产品直接原价横线标红) */
.merc-price-old {
	color: var(--merc-tomato, #C3273B);
	font-size: 14px;
	font-weight: 600;
	text-decoration: line-through;
}

/* Añadir 胶囊按钮(定稿 v2: 白底绿框,hover 绿底白字) */
.merc-add-capsule {
	background: #fff;
	border: 1.5px solid var(--merc-add);
	border-radius: 20px;
	color: var(--merc-add);
	cursor: pointer;
	display: block;
	font-size: 15px;
	font-weight: 700;
	height: 39px;
	line-height: 36px;
	margin: 0 auto;
	padding: 0 12px;
	text-align: center;
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	width: 100%;
}
.merc-add-capsule:hover {
	background: var(--merc-add);
	color: #fff;
	box-shadow: none;
}
.merc-add-capsule:active {
	transform: scale(0.97);
	box-shadow: none;
}

.merc-add-capsule[disabled] {
	background: #f0f0ee;
	border-color: #c9c6c1;
	color: #c9c6c1;
	cursor: not-allowed;
}

/* 缺货态 */
.product-miniature.is-out-of-stock .merc-img-wrap img {
	opacity: 0.45;
	filter: grayscale(1);
}
.merc-oos-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 5;
	background: rgba(46, 42, 39, 0.85);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 4px;
}

/* 商品 flags（新品/促销 左上角） */
.product-miniature .product-flags {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 5;
	list-style: none;
	padding: 0;
	margin: 0;
}
.product-miniature .product-flags .product-flag {
	background: var(--merc-add);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 4px;
	margin-bottom: 4px;
}

/* En carro 数量控件（M4 填充） */
.merc-qty-picker {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 8px;
}
/* 库存上限红字提示(常驻显示在按钮上方) */
.merc-max-hint {
	color: #b3401a;
	font-size: 12px;
	font-weight: 700;
	flex-basis: 100%;
	text-align: center;
	line-height: 1.3;
}
.merc-qty-label {
	color: var(--merc-deepgreen);
	font-size: 14px;
	font-weight: 700;
}
.merc-qty-btn {
	background: #fff;
	border: 1px solid var(--merc-border);
	border-radius: 50%;
	height: 32px;
	width: 32px;
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
}
.merc-qty-btn:hover {
	border-color: var(--merc-hover);
	color: var(--merc-hover);
}
/* 删除警示态(qty=1): − 变垃圾桶SVG(与购物车Vaciar同一icon), 红色边框/文字, hover 红底白字 (2026-08-26) */
.merc-qty-btn.merc-qty-minus.is-delete {
	border-color: var(--merc-tomato, #C3273B);
	color: var(--merc-tomato, #C3273B);
}
.merc-qty-btn.merc-qty-minus.is-delete:hover {
	background: var(--merc-tomato, #C3273B);
	border-color: var(--merc-tomato, #C3273B);
	color: #fff;
}
/* 按钮内 SVG 垃圾桶居中 */
.merc-qty-btn .merc-svg-trash {
	display: block;
	margin: 0 auto;
}
.merc-qty-value {
	font-size: 15px;
	font-weight: 700;
	min-width: 20px;
	text-align: center;
}

/* 手机/平板：ⓘ 提示气泡必须留在抽屉面板内 —— 原 right: calc(100% + 12px) 把它整个推到面板左侧，
   390px 实测 left = -221（屏幕外）；桌面（≥1024px）保持原样贴在抽屉左边。 */
@media (max-width: 1023px) {
	.merc-drawer__info-bubble {
		left: 8px;
		right: 8px;
		width: auto;
		max-width: none;
	}
	.merc-drawer__info-bubble:before {
		right: auto;
		left: 12px;
	}
}
