/* W-77: trang Giỏ hàng kiểu Shopee — 1 cột giữa (≤ 760px), khung shop trắng bo góc, thanh dính đáy. */
body.mitomo-w77-trang .page-checkout {
	background: #f5f5f5;
}

@media (max-width: 849px) {
	body.mitomo-w77-trang {
		padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important;
	}
}

.mitomo-w77 {
	max-width: 760px;
	margin: 0 auto;
	color: #222;
	font-size: 14px;
	transition: opacity 0.15s;
}

.mitomo-w77.is-dang {
	opacity: 0.6;
	pointer-events: none;
}

/* Ô tích (ô vuông tự vẽ, vùng chạm ≥ 44px). */
.mitomo-w77-o {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	min-height: 44px;
	margin: 0;
	cursor: pointer;
	font-weight: 400;
}

.mitomo-w77-o input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.mitomo-w77-o span {
	position: relative;
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 1.5px solid #bbb;
	border-radius: 3px;
	background: #fff;
}

.mitomo-w77-o input:checked + span {
	border-color: #0074bf;
	background: #0074bf;
}

.mitomo-w77-o input:checked + span::after {
	position: absolute;
	top: 2px;
	left: 6px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	content: "";
}

.mitomo-w77-o input:focus-visible + span {
	outline: 2px solid #0074bf;
	outline-offset: 2px;
}

/* Khung shop. */
.mitomo-w77-shop {
	margin: 0 0 12px;
	padding: 0 12px;
	border-radius: 8px;
	background: #fff;
}

.mitomo-w77-shop__dau {
	display: flex;
	align-items: center;
	gap: 8px;
	border-bottom: 1px solid #f0f0f0;
}

.mitomo-w77-shop__ten {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 15px;
	font-weight: 700;
}

.mitomo-w77-shop__ten svg {
	color: #0074bf;
}

/* 1 hàng nhỏ «🚚 Miễn phí vận chuyển» trong khung shop (không khối xanh lá to). */
.mitomo-w77-ship {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f0;
	color: #00875a;
	font-size: 13px;
}

/* Dòng SP. */
.mitomo-w77-sp {
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid #f0f0f0;
}

.mitomo-w77-sp__trong {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 12px 0;
	background: #fff;
	touch-action: pan-y; /* vuốt dọc vẫn cuộn trang; vuốt ngang do JS xử lý. */
}

/* 2 nút lộ ra khi vuốt trái (cao bằng dòng). */
.mitomo-w77-sp__vuot {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 0;
	display: flex;
}

.mitomo-w77-sp__vuot a,
.mitomo-w77-sp__vuot button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	min-height: 0;
	margin: 0;
	padding: 0 8px;
	border: 0;
	border-radius: 0;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-transform: none;
	letter-spacing: 0;
}

.mitomo-w77-sp__vuot a {
	background: #f5a623;
}

.mitomo-w77-sp__vuot button {
	background: #ee4d2d;
	cursor: pointer;
}

/* Máy tính (chuột): không vuốt, dùng chữ «Xóa» nhỏ. */
@media (hover: hover) and (pointer: fine) {
	.mitomo-w77-sp__vuot {
		display: none;
	}
}

/* «Đã xóa · Hoàn tác». */
.mitomo-w77-hoan {
	position: fixed;
	bottom: calc(76px + env(safe-area-inset-bottom));
	left: 50%;
	z-index: 1001;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 14px;
	border-radius: 6px;
	background: #222;
	color: #fff;
	font-size: 14px;
	transform: translateX(-50%);
}

.mitomo-w77-hoan button {
	min-height: 0;
	margin: 0;
	padding: 4px 6px;
	border: 0;
	background: none;
	color: #ffb84d;
	font-size: 14px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}

.mitomo-w77-sp .mitomo-w77-o {
	align-self: center;
}

.mitomo-w77-sp__anh {
	flex: 0 0 80px;
	width: 80px;
	height: 80px;
	overflow: hidden;
	border: 1px solid #eee;
	border-radius: 4px;
	background: #fafafa;
}

.mitomo-w77-sp__anh img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mitomo-w77-sp__tt {
	flex: 1 1 auto;
	min-width: 0;
}

.mitomo-w77-sp__dau {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.mitomo-w77-sp__ten {
	display: -webkit-box;
	flex: 1 1 auto;
	overflow: hidden;
	color: #222;
	font-size: 14px;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

a.mitomo-w77-sp__ten:hover {
	color: #0074bf;
}

.mitomo-w77-xoa {
	flex: 0 0 auto;
	min-height: 0;
	margin: 0;
	padding: 0 2px;
	border: 0;
	background: none;
	color: #888;
	font-size: 12px;
	font-weight: 400;
	line-height: 19px;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}

.mitomo-w77-xoa:hover,
.mitomo-w77-xoa:focus {
	color: var(--w46-do, #c40025);
}

.mitomo-w77-sp__pl {
	display: inline-block;
	max-width: 100%;
	margin-top: 4px;
	padding: 2px 6px;
	overflow: hidden;
	border-radius: 3px;
	background: #f5f5f5;
	color: #777;
	font-size: 12px;
	line-height: 1.4;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.mitomo-w77-sp__duoi {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 6px;
	margin-top: 6px;
}

.mitomo-w77-sp__gia {
	flex: 1 1 auto;
	min-width: 0;
}

.mitomo-w77-sp__duoi .mitomo-w77-sl {
	margin-left: auto;
}

.mitomo-w77-sp__gia b {
	color: var(--w46-do, #c40025);
	font-size: 15px;
	white-space: nowrap;
}

.mitomo-w77-sp__gia del {
	margin-left: 6px;
	color: #999;
	font-size: 12px;
	white-space: nowrap;
}

/* −/+ */
.mitomo-w77-sl {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #ddd;
	border-radius: 3px;
}

.mitomo-w77-sl button {
	width: 32px;
	min-height: 30px;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fff;
	color: #333;
	font-size: 18px;
	font-weight: 400;
	line-height: 30px;
	cursor: pointer;
}

.mitomo-w77-sl button:disabled {
	color: #ccc;
	cursor: default;
}

.mitomo-w77-sl input {
	width: 42px;
	height: 30px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-right: 1px solid #ddd;
	border-left: 1px solid #ddd;
	box-shadow: none;
	font-size: 14px;
	text-align: center;
	-moz-appearance: textfield;
}

.mitomo-w77-sl input::-webkit-inner-spin-button,
.mitomo-w77-sl input::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

/* Hàng voucher. */
.mitomo-w77-ma__nut {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: #222;
	font-size: 14px;
	font-weight: 400;
	text-align: left;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}

.mitomo-w77-ma__nut > span:first-child {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.mitomo-w77-ma__nut svg {
	color: var(--w46-do, #c40025);
}

.mitomo-w77-ma__v {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	color: #888;
	font-size: 13px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.mitomo-w77-ma__v.is-co {
	color: var(--w46-do, #c40025);
	font-weight: 600;
}

.mitomo-w77-ma .mitomo-w72-bao {
	margin: -8px 0 10px;
}

.mitomo-w77-trong {
	padding: 16px;
	color: #888;
	text-align: center;
}

/* Thanh dính đáy. */
.mitomo-w77-day {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 998;
	display: flex;
	align-items: stretch;
	max-width: 760px;
	min-height: 56px;
	margin: 0 auto;
	padding-bottom: env(safe-area-inset-bottom);
	background: #fff;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.mitomo-w77-day__tat {
	gap: 6px;
	padding: 0 8px 0 12px;
	font-size: 14px;
}

.mitomo-w77-day__so {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	padding: 4px 10px;
	text-align: right;
	line-height: 1.3;
}

.mitomo-w77-day__ship {
	color: #00875a;
	font-size: 11px;
}

.mitomo-w77-day__so b {
	color: var(--w46-do, #c40025);
	font-size: 16px;
	white-space: nowrap;
}

.mitomo-w77-day__so small {
	color: var(--w46-do, #c40025);
	font-size: 12px;
}

.mitomo-w77-day__so .mitomo-w77-day__nhac {
	color: #888;
}

.mitomo-w77-day__mua {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-width: 120px;
	padding: 0 16px;
	background: #0074bf;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
}

.mitomo-w77-day__mua:hover,
.mitomo-w77-day__mua:focus {
	background: #005f9e;
	color: #fff;
}

.mitomo-w77-day__mua.is-tat {
	background: #a9c6dc;
	cursor: not-allowed;
}

/* Thông báo nhanh (hết kho, chưa chọn SP…). */
.mitomo-w77-bao {
	position: fixed;
	bottom: calc(76px + env(safe-area-inset-bottom));
	left: 50%;
	z-index: 1000;
	max-width: calc(100% - 32px);
	padding: 10px 16px;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.82);
	color: #fff;
	font-size: 14px;
	text-align: center;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%);
	transition: opacity 0.2s, visibility 0.2s;
}

.mitomo-w77-bao.is-hien {
	opacity: 1;
	visibility: visible;
}

/* Nút nổi / lên đầu trang nằm trên thanh đáy. */
/* w77-2 — Điện thoại (≤ 849px), như Shopee / trang thanh toán W-66: giỏ không có nút nổi Chat / Messenger, nút lên đầu
   trang, chân trang; trang dừng ở khung giỏ, chừa chỗ cho thanh đáy (padding-bottom của body). */
@media (max-width: 849px) {
	body.mitomo-w77-trang .mitomo-float,
	body.mitomo-w77-trang #top-link,
	body.mitomo-w77-trang .back-to-top,
	body.mitomo-w77-trang #footer,
	body.mitomo-w77-trang .footer-wrapper,
	body.mitomo-w77-trang .mitomo-w46-ft,
	body.mitomo-w77-trang .absolute-footer {
		display: none !important;
	}

	body.mitomo-w77-trang .page-checkout {
		padding-bottom: 12px;
	}

	/* w77-3 — Flatsome tô html xám sẫm rgb(77,77,77) (màu chân trang); chân trang đã ẩn nên giỏ ngắn hơn màn hình lộ
	   màu đó dưới khung giỏ. Tô html + body cùng màu nền trang giỏ, body cao ít nhất 1 màn (dự phòng trình duyệt cũ
	   không có :has). */
	html:has(body.mitomo-w77-trang) {
		background-color: #f5f5f5 !important;
	}

	body.mitomo-w77-trang {
		min-height: 100vh;
		min-height: 100dvh;
		background-color: #f5f5f5;
	}
}

/* w77-2 — Máy tính: thanh đáy dính trong cột giỏ (sticky), cuộn hết khung giỏ thì dừng ở đáy khung, không đè chân trang. */
@media (min-width: 850px) {
	.mitomo-w77-day {
		position: sticky;
		right: auto;
		left: auto;
		max-width: none;
		margin: 0 0 16px;
		border-radius: 8px;
	}
}

/* w77-2 — Nút «Xong» khung voucher ở giỏ: xanh thương hiệu. */
[data-mitomo-w77-sheet] .mitomo-w66-sheet__chan .button.alt {
	border-color: #0074bf;
	background-color: #0074bf;
	color: #fff;
}

[data-mitomo-w77-sheet] .mitomo-w66-sheet__chan .button.alt:hover,
[data-mitomo-w77-sheet] .mitomo-w66-sheet__chan .button.alt:focus {
	border-color: #005f9e;
	background-color: #005f9e;
}

@media (max-width: 549px) {
	.mitomo-w77-ma__nut > span:first-child {
		font-size: 13px;
	}

	.mitomo-w77-sp__anh {
		flex-basis: 72px;
		width: 72px;
		height: 72px;
	}

	.mitomo-w77-day__mua {
		min-width: 0;
		padding: 0 14px;
	}

	.mitomo-w77-day__tat {
		padding-left: 8px;
		font-size: 13px;
	}
}

.mitomo-w77 b .amount,
.mitomo-w77 small .amount {
	color: inherit;
}

/* Giỏ trống sau khi xóa SP cuối (dựng tại chỗ, còn «Hoàn tác»). */
.mitomo-w77-rong .mitomo-w77-shop {
	padding: 24px 16px;
	text-align: center;
}

.mitomo-w77-rong__nut {
	margin: 8px 0 0;
}
