/**
 * Trang chủ — Redesign Nước Đá 168
 */

/* 1. Hero — flex-start (không center): tránh CLS khi font/text đổi chiều cao. */
.h168-hero {
	position: relative;
	min-height: clamp(520px, 88vh, 760px);
	display: flex;
	align-items: flex-start;
	background: var(--main-color);
	overflow: hidden;
}

.h168-hero__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	z-index: 0;
}

.h168-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, rgba(2, 27, 66, 0.92) 0%, rgba(2, 27, 66, 0.72) 45%, rgba(0, 80, 130, 0.55) 100%);
	z-index: 1;
}

.h168-hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	/* Padding cố định thay vì căn giữa theo chiều cao nội dung. */
	padding-top: clamp(56px, 10vh, 100px);
	padding-bottom: 80px;
}

.h168-hero__content {
	max-width: 720px;
	/* Giữ chỗ tiêu đề — giảm nhảy khi webfont optional kịp/không kịp load. */
	min-height: 11.5rem;
}

.h168-hero__title {
	font-family: var(--font-heading, "Montserrat", system-ui, sans-serif);
	font-size: clamp(1.5rem, 3.2vw, 2.5rem);
	font-weight: 800;
	line-height: 1.15;
	color: var(--white);
	margin: 0 0 20px;
}

.h168-hero__title-main {
	display: block;
	white-space: normal;
}

.h168-hero__title-accent {
	display: block;
	color: var(--accent-color);
	font-size: 0.92em;
	margin-top: 6px;
}

.h168-hero__desc {
	font-size: clamp(1.0625rem, 2.5vw, 1.35rem);
	color: rgba(255, 255, 255, 0.9);
	line-height: 1.75;
	margin: 0 0 32px;
	max-width: 580px;
}

.h168-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 32px;
}

.h168-hero__stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	max-width: 520px;
}

.h168-hero__stat {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--radius-md);
	padding: 18px 18px;
	backdrop-filter: blur(6px);
}

.h168-hero__stat strong {
	display: block;
	font-size: 1.6rem;
	color: var(--accent-color);
	line-height: 1.2;
}

.h168-hero__stat span {
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.8);
}

.h168-hero__wave {
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 100%;
	line-height: 0;
	z-index: 3;
}

.h168-hero__wave svg {
	display: block;
	width: 100%;
	height: 56px;
}

/* 2. About */
.h168-about__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(32px, 5vw, 64px);
	align-items: center;
}

.h168-about__media {
	position: relative;
}

.h168-about__media img {
	width: 100%;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	display: block;
	aspect-ratio: 4/3;
	object-fit: cover;
}

.h168-about__badge {
	position: absolute;
	bottom: -20px;
	right: 24px;
	background: linear-gradient(135deg, var(--accent-color), #009acd);
	color: var(--white);
	border-radius: var(--radius-lg);
	padding: 18px 22px;
	text-align: center;
	box-shadow: var(--shadow-accent);
	border: 4px solid var(--white);
}

.h168-about__badge-num {
	display: block;
	font-size: 3rem;
	font-weight: 800;
	line-height: 1;
}

.h168-about__badge-text {
	font-size: 0.875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.h168-commit-list {
	list-style: none;
	padding: 0;
	margin: 0 0 28px;
	display: grid;
	gap: 16px;
}

.h168-commit-list li {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	background: var(--bg-light);
	border-radius: var(--radius-md);
	padding: 16px 18px;
}

.h168-commit-list li i {
	color: var(--accent-color);
	font-size: 1.4rem;
	margin-top: 2px;
}

.h168-commit-list strong {
	display: block;
	color: var(--main-color);
	font-size: var(--font-size-base);
	margin-bottom: 4px;
}

.h168-about__content .h168-link {
	margin-top: 4px;
}

.h168-commit-list span {
	color: var(--text-muted);
	font-size: var(--font-size-sm);
	line-height: 1.6;
}

/* 3. Products */
.h168-products__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

.h168-product-card {
	background: var(--white);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-md);
	border: 1px solid rgba(2, 27, 66, 0.04);
	display: flex;
	flex-direction: column;
	transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.h168-product-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--shadow-card-hover);
}

.h168-product-card__img {
	height: 230px;
	overflow: hidden;
}

.h168-product-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.h168-product-card:hover .h168-product-card__img img {
	transform: scale(1.06);
}

.h168-product-card__body {
	padding: 26px 22px 28px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 12px;
}

.h168-product-card__body h3 {
	margin: 0;
	font-size: var(--font-size-md);
	color: var(--main-color);
}

.h168-product-card__body p {
	margin: 0;
	flex-grow: 1;
	color: var(--text-muted);
	font-size: var(--font-size-sm);
	line-height: 1.6;
}

/* 4. Why */
.h168-why__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.h168-why-card {
	background: var(--white);
	border-radius: var(--radius-lg);
	padding: 32px 26px;
	box-shadow: var(--shadow-sm);
	border: 1px solid rgba(2, 27, 66, 0.05);
	transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.h168-why-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-md);
}

.h168-why-card__icon {
	width: 60px;
	height: 60px;
	border-radius: 16px;
	background: linear-gradient(135deg, rgba(0, 195, 255, 0.15), rgba(0, 195, 255, 0.05));
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 18px;
}

.h168-why-card__icon i {
	font-size: 1.6rem;
	color: var(--accent-color);
}

.h168-why-card h3 {
	margin: 0 0 10px;
	font-size: var(--font-size-base);
	color: var(--main-color);
}

.h168-why-card p {
	margin: 0;
	font-size: var(--font-size-sm);
	color: var(--text-muted);
	line-height: 1.65;
}

/* 5. Stats */
.h168-stats {
	background: linear-gradient(135deg, #021b42 0%, #033a7a 55%, #005f9e 100%);
	padding: clamp(48px, 6vw, 72px) 0;
}

.h168-stats__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.h168-stat {
	text-align: center;
	padding: 20px 16px;
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.h168-stat__num {
	display: block;
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	font-weight: 800;
	color: var(--accent-color);
	line-height: 1.1;
	margin-bottom: 8px;
}

.h168-stat__label {
	font-size: var(--font-size-base);
	color: rgba(255, 255, 255, 0.88);
}

/* 6. Stores */
.h168-stores__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.h168-store-card {
	background: var(--white);
	border-radius: var(--radius-md);
	padding: 24px 20px;
	box-shadow: var(--shadow-sm);
	border: 1px solid rgba(2, 27, 66, 0.05);
	transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.h168-store-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
}

.h168-store-card__icon {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: rgba(0, 195, 255, 0.12);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
}

.h168-store-card__icon i {
	color: var(--accent-color);
	font-size: 1.1rem;
}

.h168-store-card h3 {
	margin: 0 0 10px;
	font-size: var(--font-size-sm);
	color: var(--main-color);
	line-height: 1.4;
}

.h168-store-card p {
	margin: 0;
	font-size: var(--font-size-sm);
	color: var(--text-muted);
	line-height: 1.6;
}

/* 8. Map */
.h168-map__embed {
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-lg);
	border: 1px solid rgba(2, 27, 66, 0.06);
}

.h168-map__embed iframe {
	display: block;
	width: 100%;
	min-height: 460px;
}

/* 9. Reviews */
.h168-reviews__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.h168-review-card {
	margin: 0;
	background: var(--white);
	border-radius: var(--radius-lg);
	padding: 32px 28px;
	box-shadow: var(--shadow-sm);
	border: 1px solid rgba(2, 27, 66, 0.05);
}

.h168-review-card__stars {
	color: #f5a623;
	margin-bottom: 16px;
	font-size: 1rem;
	display: flex;
	gap: 4px;
}

.h168-review-card p {
	margin: 0 0 18px;
	color: var(--text-color);
	font-size: var(--font-size-base);
	line-height: 1.7;
	font-style: italic;
}

.h168-review-card cite {
	font-style: normal;
	font-weight: 700;
	font-size: var(--font-size-sm);
	color: var(--main-color);
}

/* 10. Hình ảnh nhà máy & chứng nhận (tabs) */
.h168-media__tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-bottom: clamp(28px, 4vw, 40px);
}

.h168-media-tab {
	min-height: var(--btn-min-height-sm);
	min-width: 140px;
	padding: 14px 32px;
	border-radius: var(--radius-pill);
	border: 2px solid rgba(2, 27, 66, 0.12);
	background: var(--white);
	color: var(--main-color);
	font-size: var(--font-size-base);
	font-weight: 700;
	cursor: pointer;
	transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.h168-media-tab:hover {
	border-color: var(--accent-color);
	color: var(--accent-color);
}

.h168-media-tab.is-active {
	background: var(--main-color);
	border-color: var(--main-color);
	color: var(--white);
	box-shadow: 0 6px 20px rgba(2, 27, 66, 0.2);
}

.h168-media-panel[hidden] {
	display: none !important;
}

/* Tab 1 — Nhà máy */
.h168-factory-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.h168-factory-item {
	margin: 0;
}

.h168-factory-item__btn {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	border-radius: var(--radius-md);
	overflow: hidden;
	cursor: pointer;
	box-shadow: var(--shadow-sm);
	background: var(--bg-light);
	aspect-ratio: 4 / 3;
}

.h168-factory-item__btn img {
	width: 100%;
	height: 100%;
	max-width: none;
	aspect-ratio: unset;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.45s ease;
}

.h168-factory-item__btn img[data-lazyloaded],
.h168-factory-item__btn img.lazyloaded,
.h168-factory-item__btn img.lazyload,
.h168-factory-item__btn img[data-src] {
	width: 100% !important;
	height: 100% !important;
	max-height: none !important;
	object-fit: cover !important;
}

.h168-factory-item__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(2, 27, 66, 0.35);
	color: var(--white);
	font-size: 1.5rem;
	opacity: 0;
	transition: opacity var(--transition-base);
}

.h168-factory-item__btn:hover img {
	transform: scale(1.06);
}

.h168-factory-item__btn:hover .h168-factory-item__overlay {
	opacity: 1;
}

/* Tab 2 — Chứng nhận */
.h168-cert-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.h168-cert-item {
	margin: 0;
	text-align: center;
}

.h168-cert-item__btn {
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
}

.h168-cert-item__frame {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 280px;
	padding: 16px;
	background: var(--white);
	border: 1px solid var(--border-light);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.h168-cert-item__btn:hover .h168-cert-item__frame {
	box-shadow: var(--shadow-md);
	transform: translateY(-3px);
}

.h168-cert-item__frame img {
	max-width: 100%;
	max-height: 260px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.h168-cert-item figcaption {
	margin-top: 12px;
	font-size: var(--font-size-sm);
	font-weight: 600;
	color: var(--main-color);
	line-height: 1.4;
}

/* 11. FAQ */
.h168-faq__list {
	max-width: 820px;
	margin: 0 auto;
	display: grid;
	gap: 12px;
}

.h168-faq__item {
	background: var(--white);
	border-radius: var(--radius-md);
	border: 1px solid rgba(2, 27, 66, 0.06);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}

.h168-faq__item summary {
	padding: 20px 24px;
	font-size: var(--font-size-base);
	font-weight: 700;
	color: var(--main-color);
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.h168-faq__item summary::-webkit-details-marker {
	display: none;
}

.h168-faq__item summary::after {
	content: "+";
	font-size: 1.5rem;
	color: var(--accent-color);
	font-weight: 400;
}

.h168-faq__item[open] summary::after {
	content: "−";
}

.h168-faq__item p {
	margin: 0;
	padding: 0 24px 22px;
	color: var(--text-muted);
	font-size: var(--font-size-sm);
	line-height: 1.7;
}

/* Responsive */
@media (max-width: 1100px) {
	.h168-products__grid,
	.h168-why__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.h168-stores__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.h168-factory-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.h168-cert-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 992px) {
	.h168-about__grid {
		grid-template-columns: 1fr;
	}

	.h168-about__media {
		max-width: 560px;
		margin: 0 auto;
	}

	.h168-about__badge {
		right: 50%;
		transform: translateX(50%);
		bottom: -24px;
	}

	.h168-stats__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.h168-reviews__grid {
		grid-template-columns: 1fr;
	}

	.h168-factory-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.h168-cert-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	/* Khớp critical CSS — tránh CLS khi CSS async/đầy đủ áp dụng. */
	.h168-hero {
		min-height: 520px;
		min-height: 100svh;
		text-align: center;
	}

	.h168-hero__title-main {
		white-space: normal;
	}

	.h168-hero__content {
		margin: 0 auto;
	}

	.h168-hero__desc {
		margin-left: auto;
		margin-right: auto;
	}

	.h168-hero__actions {
		flex-direction: column;
	}

	.h168-hero__stats {
		max-width: 100%;
	}

	.h168-products__grid,
	.h168-why__grid,
	.h168-stores__grid {
		grid-template-columns: 1fr;
	}

	.h168-why-card {
		text-align: center;
		padding: 28px 22px;
	}

	.h168-why-card__icon {
		margin-left: auto;
		margin-right: auto;
	}

	.h168-why-card h3 {
		text-align: center;
	}

	.h168-stores__grid {
		gap: 12px;
	}

	.h168-store-card {
		display: grid;
		grid-template-columns: 42px 1fr;
		grid-template-rows: auto auto;
		gap: 0 14px;
		align-items: start;
		padding: 16px 18px;
	}

	.h168-store-card__icon {
		grid-column: 1;
		grid-row: 1 / span 2;
		align-self: center;
		margin-bottom: 0;
		width: 40px;
		height: 40px;
	}

	.h168-store-card h3 {
		grid-column: 2;
		grid-row: 1;
		margin: 0 0 6px;
	}

	.h168-store-card p {
		grid-column: 2;
		grid-row: 2;
	}

	.h168-stats__grid {
		grid-template-columns: 1fr 1fr;
	}

	.h168-factory-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.h168-cert-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.h168-cert-item__frame {
		min-height: 240px;
	}
}

@media (max-width: 480px) {
	.h168-stats__grid {
		grid-template-columns: 1fr;
	}

	.h168-media__tabs {
		flex-direction: column;
		align-items: stretch;
	}

	.h168-media-tab {
		width: 100%;
	}

	.h168-cert-grid {
		grid-template-columns: 1fr;
	}

	.h168-cert-item__frame {
		min-height: 220px;
	}
}
