/* ============================================================
   Vua Mắm — Chi tiết sản phẩm
   ============================================================ */

.vm-single__crumb { padding-top: 22px; }

.vm-detail {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 54px;
	align-items: start;
	padding-top: 26px;
	padding-bottom: 20px;
}

/* Gallery */
.vm-detail__main {
	position: relative;
	background: #fff;
	border: 1px solid var(--vm-line);
	border-radius: 20px;
	padding: 22px;
	box-shadow: 0 16px 40px rgba(74, 16, 14, 0.06);
	height: 484px;
}

.vm-detail__mainimg {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 14px;
}

.vm-detail__thumbs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-top: 14px;
}

.vm-detail__thumb {
	padding: 3px;
	border: 2px solid #ede0c8;
	border-radius: 11px;
	background: #fff;
	line-height: 0;
	transition: border-color 0.15s;
}

.vm-detail__thumb.is-active { border-color: var(--vm-red); }

.vm-detail__thumb img {
	width: 100%;
	height: 78px;
	object-fit: cover;
	border-radius: 9px;
}

/* Info */
.vm-detail__tier {
	display: inline-block;
	background: var(--vm-red);
	color: #fff;
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	padding: 5px 12px;
	border-radius: 7px;
	margin-bottom: 14px;
}

.vm-detail__info h1 {
	font-family: var(--vm-font-head);
	font-weight: 800;
	font-size: 34px;
	line-height: 1.15;
	color: var(--vm-ink);
}

.vm-detail__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.vm-detail__rate-txt { font-size: 13.5px; color: var(--vm-ink-3); }
.vm-detail__bar { color: #d8c4a4; }
.vm-detail__stock { font-size: 13.5px; color: var(--vm-green); font-weight: 600; }
.vm-detail__stock.is-out { color: var(--vm-error); }

.vm-detail__price-row { display: flex; align-items: baseline; gap: 12px; margin: 20px 0 18px; }

.vm-detail__price {
	font-family: var(--vm-font-head);
	font-weight: 800;
	font-size: 36px;
	color: var(--vm-red);
}

.vm-detail__price-old { font-size: 22px; color: var(--vm-ink-4); font-weight: 500; text-decoration: line-through; }
.vm-detail__unit { font-size: 15px; color: var(--vm-ink-5); }

.vm-detail__short { font-size: 15.5px; line-height: 1.75; color: var(--vm-ink-2); margin-bottom: 24px; }

.vm-detail__qty-row {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.vm-detail__qty-row > span { font-size: 14px; color: var(--vm-ink-2); font-weight: 600; }

.vm-qty--lg { border-radius: 11px; }
.vm-qty--lg button { width: 44px; height: 46px; font-size: 20px; }
.vm-qty--lg span { width: 48px; font-weight: 700; font-size: 16px; }

.vm-buyrow { display: flex; gap: 14px; }

.vm-buyrow__add, .vm-buyrow__buy {
	flex: 1;
	height: 56px;
	border-radius: 13px;
	font-weight: 700;
	font-size: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	transition: background 0.2s, color 0.2s;
}

.vm-buyrow__add { border: 1.5px solid var(--vm-red); background: #fff; color: var(--vm-red); }
.vm-buyrow__add:hover { background: var(--vm-cream); }
.vm-buyrow__add.loading { opacity: 0.6; pointer-events: none; }
.vm-buyrow .added_to_cart { display: none; }

.vm-buyrow__buy {
	background: var(--vm-red);
	color: #fff;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	box-shadow: 0 12px 26px rgba(138, 30, 27, 0.28);
}

.vm-buyrow__buy:hover { background: var(--vm-red-hover); }

.vm-detail__usps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-top: 26px;
	padding-top: 24px;
	border-top: 1px solid var(--vm-line);
}

.vm-detail__usps > div {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 12.5px;
	color: var(--vm-ink-2);
}

.vm-detail__usps span { color: var(--vm-red); display: flex; flex: none; }

/* ---------- Tabs ---------- */
.vm-tabs-wrap { padding-top: 30px; padding-bottom: 10px; }

.vm-tabs {
	display: flex;
	gap: 6px;
	border-bottom: 1px solid var(--vm-line-2);
}

.vm-tab {
	padding: 13px 22px;
	color: var(--vm-ink-3);
	font-weight: 500;
	font-size: 14.5px;
	border-radius: 12px 12px 0 0;
	border: 1px solid transparent;
	border-bottom: 0;
	margin-bottom: -1px;
	transition: color 0.15s;
}

.vm-tab:hover { color: var(--vm-red); }

.vm-tab.is-active {
	background: #fff;
	color: var(--vm-red);
	font-weight: 700;
	border-color: var(--vm-line);
}

/* Label rút gọn cho mobile (mặc định ẩn) */
.vm-tab__short { display: none; }

.vm-tabs__panel {
	background: #fff;
	border: 1px solid var(--vm-line);
	border-top: 0;
	border-radius: 0 0 16px 16px;
	padding: 30px 32px;
}

.vm-tabpane { display: none; }
.vm-tabpane.is-active { display: block; }

.vm-tabpane__content { max-width: 760px; }
.vm-tabpane__content p { font-size: 15.5px; line-height: 1.8; color: var(--vm-ink-2); margin-bottom: 16px; }

.vm-checks { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.vm-checks > div { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: #3a2c25; }
.vm-checks span { color: var(--vm-green); }

.vm-specs { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.vm-spec { display: flex; gap: 16px; font-size: 14.5px; }
.vm-spec span { width: 160px; color: var(--vm-ink-4); flex: none; }
.vm-spec strong { color: var(--vm-ink); font-weight: 600; }

/* ---------- Reviews ---------- */
.vm-rev-sum {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 30px;
	align-items: center;
	padding: 24px 26px;
	background: #fdfaf3;
	border: 1px solid var(--vm-line);
	border-radius: 16px;
	margin-bottom: 24px;
}

.vm-rev-sum__score { text-align: center; }

.vm-rev-sum__num {
	font-family: var(--vm-font-head);
	font-weight: 800;
	font-size: 50px;
	color: var(--vm-red);
	line-height: 1;
	margin-bottom: 8px;
}

.vm-rev-sum__count { font-size: 13px; color: var(--vm-ink-4); margin-top: 8px; }

.vm-rev-sum__bars { display: flex; flex-direction: column; gap: 9px; }

.vm-rev-bar { display: flex; align-items: center; gap: 12px; }
.vm-rev-bar__label { font-size: 13px; color: var(--vm-ink-3); width: 34px; flex: none; }
.vm-rev-bar__label i { color: var(--vm-gold-2); font-style: normal; }
.vm-rev-bar__track { flex: 1; height: 8px; border-radius: 5px; background: #ece0c8; overflow: hidden; }
.vm-rev-bar__track div { height: 100%; background: var(--vm-gold-2); }
.vm-rev-bar__count { font-size: 12.5px; color: var(--vm-ink-4); width: 32px; text-align: right; flex: none; }

.vm-rev-form {
	padding: 24px 26px;
	background: #fff;
	border: 1px solid var(--vm-line);
	border-radius: 16px;
	margin-bottom: 26px;
}

.vm-rev-form__title { font-family: var(--vm-font-head); font-weight: 700; font-size: 19px; color: var(--vm-ink); margin-bottom: 4px; }
.vm-rev-form > p { font-size: 13.5px; color: var(--vm-ink-3); margin-bottom: 18px; }

.vm-rev-form__ok {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--vm-green-bg);
	border: 1px solid #cfe8cf;
	border-radius: 11px;
	padding: 13px 16px;
	margin-bottom: 18px;
	color: #2f6b2c;
	font-size: 13.5px;
	font-weight: 600;
}

.vm-rev-form form { display: flex; flex-direction: column; gap: 16px; }
.vm-rev-form .vm-btn { align-self: flex-start; }
.vm-rev-form__as { font-size: 13.5px; color: var(--vm-ink-3); }

.vm-rev-form__stars-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vm-rev-form__stars-row > span { font-size: 14px; color: var(--vm-ink-2); font-weight: 600; }

.vm-starpick { display: flex; gap: 2px; }

.vm-starpick button {
	font-size: 26px;
	line-height: 1;
	padding: 0 2px;
	color: #d8c4a4;
	transition: color 0.12s, transform 0.12s;
}

.vm-starpick button.is-on { color: var(--vm-gold-2); }
.vm-starpick button:hover { transform: scale(1.15); }

.vm-rev-list { display: flex; flex-direction: column; gap: 20px; }

.vm-rev-item { display: flex; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--vm-line); }

.vm-rev-item__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--vm-cream);
	color: var(--vm-red);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	flex: none;
}

.vm-rev-item__head { display: flex; align-items: center; gap: 10px; }
.vm-rev-item__name { font-weight: 700; font-size: 14.5px; }
.vm-rev-item__date { font-size: 12px; color: var(--vm-ink-4); margin-top: 2px; }
.vm-rev-item p { font-size: 14.5px; line-height: 1.7; color: var(--vm-ink-2); margin-top: 8px; }

.vm-rev-none { color: var(--vm-ink-3); font-size: 14.5px; }

/* ---------- Liên quan: slider trượt ngang ---------- */
.vm-related { padding-top: 40px; padding-bottom: 60px; }
.vm-related .vm-orna-head h2 { font-size: 28px; }

.vm-relslider { position: relative; margin-top: 30px; }

.vm-relslider__track {
	display: flex;
	gap: 22px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 6px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.vm-relslider__track::-webkit-scrollbar { display: none; }

.vm-relslider__track .vm-pcard {
	flex: 0 0 calc((100% - 66px) / 4);
	scroll-snap-align: start;
}

.vm-relslider__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid var(--vm-line);
	background: #fff;
	color: var(--vm-red);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
	transition: background 0.2s, color 0.2s, opacity 0.2s;
	z-index: 2;
}

.vm-relslider__nav:hover { background: var(--vm-red); color: #fff; }
.vm-relslider__nav.is-prev { left: -20px; }
.vm-relslider__nav.is-next { right: -20px; }
.vm-relslider__nav.is-off { opacity: 0.35; pointer-events: none; }

.vm-rel .vm-pcard__img { height: 170px; }
.vm-rel .vm-pcard__name { font-size: 15.5px; margin-top: 14px; }
.vm-rel .vm-pcard__price { font-size: 19px; }
.vm-rel .vm-pcard__add { width: 42px; height: 42px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.vm-detail { grid-template-columns: 1fr; gap: 30px; }
	.vm-relslider__track .vm-pcard { flex-basis: calc((100% - 44px) / 3); }
}

@media (max-width: 640px) {
	.vm-detail__info h1 { font-size: 27px; }
	.vm-detail__main { height: 320px; padding: 14px; }
	/* Xếp dọc: bỏ flex:1 (trong cột nó ép nút lùn theo nội dung ~27px) */
	.vm-buyrow { flex-direction: column; }
	.vm-buyrow__add, .vm-buyrow__buy { flex: none; width: 100%; }
	.vm-rev-sum { grid-template-columns: 1fr; text-align: center; }

	/* Tiêu đề "Sản phẩm liên quan" gọn 1 hàng */
	.vm-related .vm-orna-head h2 { font-size: 19px; white-space: nowrap; }
	.vm-related .vm-orna-head { gap: 8px; }
	.vm-related .vm-orna-head__line { width: 22px; }

	/* Liên quan: card ~46% (lộ mép card kế), mũi tên sát mép */
	.vm-relslider__track { gap: 12px; }
	.vm-relslider__track .vm-pcard { flex-basis: 46%; }
	.vm-relslider__nav.is-prev { left: -8px; }
	.vm-relslider__nav.is-next { right: -8px; }

	/* Tab Thành phần: mỗi mục 1 khối dọc — nhãn nhỏ trên, nội dung đậm dưới */
	.vm-specs { gap: 0; }
	.vm-spec { flex-direction: column; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--vm-line); }
	.vm-spec:first-child { padding-top: 0; }
	.vm-spec:last-child { border-bottom: 0; padding-bottom: 0; }
	.vm-spec span { width: auto; font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600; }
	.vm-spec strong { font-size: 14px; line-height: 1.65; }
	/* 3 tab phải cùng lộ diện: rút gọn label + thu padding (dự phòng vẫn cuộn được) */
	.vm-tabs { overflow-x: auto; }
	.vm-tab { white-space: nowrap; padding: 11px 13px; font-size: 13px; }
	.vm-tab__full { display: none; }
	.vm-tab__short { display: inline; }
	.vm-tabs__panel { padding: 20px 18px; }
	.vm-detail__usps { grid-template-columns: 1fr; }
}

@media (max-width: 374px) {
	.vm-related .vm-orna-head h2 { font-size: 16px; }
	.vm-related .vm-orna-head__line { width: 12px; }
}

/* ---------- Lightbox phóng to ảnh sản phẩm ---------- */
.vm-detail__mainimg { cursor: zoom-in; }

.vm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(20, 8, 6, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
	animation: vm-lb-fade 0.18s ease;
}
.vm-lightbox[hidden] { display: none; }
.vm-lightbox__stage { display: flex; }
.vm-lightbox__img {
	max-width: 92vw;
	max-height: 88vh;
	width: auto;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.vm-lightbox__close {
	position: absolute;
	top: 18px;
	right: 22px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 30px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s;
}
.vm-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 32px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s;
}
.vm-lightbox__close:hover, .vm-lightbox__nav:hover { background: rgba(255, 255, 255, 0.28); }
.vm-lightbox__nav.is-prev { left: 18px; }
.vm-lightbox__nav.is-next { right: 18px; }
.vm-lightbox__nav[hidden] { display: none; }

@keyframes vm-lb-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 560px) {
	.vm-lightbox { padding: 16px; }
	.vm-lightbox__nav { width: 44px; height: 44px; font-size: 28px; }
	.vm-lightbox__nav.is-prev { left: 8px; }
	.vm-lightbox__nav.is-next { right: 8px; }
	.vm-lightbox__close { top: 12px; right: 12px; width: 42px; height: 42px; }
}
