/*
 * Hân Võ — tối ưu cho điện thoại (≤ 768px).
 * Nguyên tắc: ảnh vừa đủ nhìn, nội dung quan trọng lên trước, ít cuộn,
 * nút đủ lớn để chạm (≥ 44px), khoảng cách đều 16/24/32px.
 */

@media (max-width: 768px) {
	/* ---------- Nhịp chữ & khoảng cách chung ---------- */
	body {
		font-size: 15px;
	}
	.hanvo-wrap {
		padding: 0 16px;
	}
	.hanvo-fp-sec {
		padding: 32px 0 0;
	}
	.hanvo-fp-products + .hanvo-fp-products {
		padding-top: 32px;
	}
	.hanvo-front .hanvo-sec-title,
	.hanvo-catalog .hanvo-explore__title,
	.hanvo-fp-testimonials .uagb-heading-text {
		gap: 0;
		margin-bottom: 18px !important;
		font-size: 21px !important;
		line-height: 1.3 !important;
	}
	/* Tiêu đề dài: bỏ đường kẻ hai bên để không xuống dòng lộn xộn */
	.hanvo-front .hanvo-sec-title::before,
	.hanvo-front .hanvo-sec-title::after {
		display: none;
	}
	.hanvo-sec-title span {
		max-width: 100%;
	}

	/* ---------- Header ---------- */
	.ast-mobile-header-wrap .ast-primary-header-bar {
		min-height: 60px;
	}
	.ast-mobile-header-wrap .site-title {
		font-size: 19px;
	}
	.ast-mobile-header-wrap .custom-logo-link img {
		max-width: 38px;
	}

	/* ---------- Slider ---------- */
	.hanvo-home .metaslider .slides img {
		height: 46vw !important;
		min-height: 0 !important;
	}
	.hanvo-home .metaslider .flex-direction-nav a {
		transform: scale(0.75);
	}

	/* ---------- Dải cam kết: 3 cột nhỏ, icon trên chữ ---------- */
	.hanvo-fp-services__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		padding: 0 8px;
	}
	.hanvo-fp-service {
		flex-direction: column;
		justify-content: flex-start;
		gap: 8px;
		padding: 16px 4px;
		text-align: center;
	}
	.hanvo-fp-service + .hanvo-fp-service {
		border-top: 0;
		border-left: 1px dashed #e0d3c4;
	}
	.hanvo-fp-service__icon {
		width: 40px;
		height: 40px;
	}
	.hanvo-fp-service__icon svg {
		width: 20px;
		height: 20px;
	}
	.hanvo-front .hanvo-fp-service__title {
		font-size: 12.5px;
		line-height: 1.3;
	}
	.hanvo-fp-service__desc {
		display: none;
	}

	/* ---------- Dòng sản phẩm chính: thẻ nhỏ gọn, vuốt ngang ---------- */
	.hanvo-fp-lines__grid {
		gap: 12px;
		margin: 0 -16px;
		padding: 0 16px 6px;
		scroll-padding-left: 16px;
		scrollbar-width: none;
	}
	.hanvo-fp-lines__grid::-webkit-scrollbar {
		display: none;
	}
	.hanvo-fp-line {
		flex: 0 0 62%;
	}
	.hanvo-fp-line__img {
		aspect-ratio: 4 / 3;
	}
	.hanvo-fp-line__body {
		padding: 12px 12px 16px;
	}
	.hanvo-front .hanvo-fp-line__title {
		margin-bottom: 4px;
		font-size: 17px;
	}
	.hanvo-front .hanvo-fp-line__desc {
		display: -webkit-box;
		margin-bottom: 12px;
		overflow: hidden;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		font-size: 13px;
		line-height: 1.5;
	}
	.hanvo-fp-line .hanvo-btn-outline {
		padding: 7px 16px;
		font-size: 13px;
	}

	/* ---------- Lưới sản phẩm ---------- */
	.hanvo-front .woocommerce ul.products,
	.hanvo-catalog .hanvo-products ul.products,
	.woocommerce ul.products {
		gap: 20px 12px !important;
	}
	/* Trang chủ: mỗi bộ sưu tập hiện 4 mẫu, xem thêm bằng nút bên dưới */
	.hanvo-front .woocommerce ul.products li.product:nth-child(n + 5) {
		display: none !important;
	}
	/* Bỏ nút "Mua ngay" đè lên ảnh cho thoáng — chạm vào thẻ là mở sản phẩm */
	.hanvo-card__actions,
	.hanvo-front .hanvo-card__actions,
	.hanvo-home .hanvo-card__actions {
		display: none !important;
	}
	.hanvo-card__img {
		border-radius: 8px;
		overflow: hidden;
	}
	.hanvo-card__body {
		padding-top: 10px;
	}
	.hanvo-card .hanvo-card__title {
		margin-bottom: 4px !important;
		font-size: 13.5px !important;
	}
	.hanvo-price,
	.hanvo-price .woocommerce-Price-amount {
		font-size: 14px;
	}
	.hanvo-card__sizes {
		display: none;
	}
	.hanvo-fp-more {
		margin-top: 20px;
	}
	.hanvo-fp-more .hanvo-btn {
		width: 100%;
		max-width: 320px;
	}

	/* ---------- Bộ sưu tập chưa có sản phẩm: một hàng ngang gọn ---------- */
	.hanvo-fp-empty {
		grid-template-columns: 96px minmax(0, 1fr);
		gap: 14px;
		padding: 12px;
		text-align: left;
	}
	.hanvo-fp-empty__img {
		aspect-ratio: 1;
	}
	.hanvo-front .hanvo-fp-empty__title {
		margin-bottom: 4px;
		font-size: 16px;
		line-height: 1.35;
	}
	.hanvo-front .hanvo-fp-empty__desc {
		margin-bottom: 8px;
		font-size: 13px;
		line-height: 1.5;
	}
	.hanvo-fp-empty .hanvo-btn-outline {
		margin-top: 0;
		padding: 6px 14px;
		font-size: 13px;
	}

	/* ---------- Kích thước giường: hàng vuốt ngang ---------- */
	.hanvo-fp-beds {
		padding-bottom: 32px;
	}
	.hanvo-fp-beds__list {
		display: flex;
		gap: 10px;
		margin: 0 -16px;
		padding: 0 16px 6px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}
	.hanvo-fp-beds__list::-webkit-scrollbar {
		display: none;
	}
	.hanvo-fp-bed {
		flex: 0 0 112px;
		gap: 10px;
		padding: 14px 8px;
		scroll-snap-align: start;
	}
	.hanvo-fp-bed__shape {
		width: calc(var(--w) * 62px);
		height: 70px;
	}
	.hanvo-fp-bed__shape i {
		top: 5px;
		height: 11px;
	}
	.hanvo-fp-bed__label {
		font-size: 12.5px;
	}

	/* ---------- Cảm nhận khách hàng: ảnh thấp lại ---------- */
	.hanvo-fp-testimonials .entry-content > .wp-block-uagb-container {
		padding-top: 36px !important;
		padding-bottom: 36px !important;
	}
	.hanvo-fp-testimonials .wp-block-uagb-image img,
	.hanvo-home .wp-block-uagb-image img {
		width: 100% !important;
		max-height: 190px;
		object-fit: cover;
		border-radius: 10px !important;
	}
	.hanvo-fp-testimonials .wp-block-uagb-container {
		row-gap: 12px !important;
	}
	.hanvo-fp-testimonials .uagb-tm__desc,
	.hanvo-fp-testimonials .uagb-tm__desc em {
		font-size: 14px !important;
	}

	/* ---------- Khối nhận tư vấn ---------- */
	.hanvo-fp-cta__inner {
		gap: 16px;
		padding-top: 28px;
		padding-bottom: 28px;
	}
	.hanvo-front .hanvo-fp-cta__title {
		font-size: 20px;
	}
	.hanvo-front .hanvo-fp-cta__text {
		font-size: 14px;
	}
	.hanvo-fp-cta__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		width: 100%;
		gap: 10px;
	}
	.hanvo-fp-cta__actions .hanvo-btn {
		padding: 11px 12px;
		font-size: 14px;
	}

	/* ---------- Footer ---------- */
	.hanvo-footer .hanvo-wrap {
		padding: 0 16px;
	}
	.hanvo-footer__grid {
		grid-template-columns: 1fr 1fr !important;
		gap: 24px 16px !important;
		padding-top: 32px !important;
		padding-bottom: 24px !important;
	}
	.hanvo-footer__brand,
	.hanvo-footer__grid > .hanvo-footer__col:last-child {
		grid-column: 1 / -1;
	}
	.hanvo-footer .hanvo-footer__logo {
		font-size: 22px;
	}
	.hanvo-footer__tagline {
		margin: 6px 0 14px;
	}
	.hanvo-footer h2.hanvo-footer__title {
		margin-bottom: 10px;
	}
	.hanvo-footer__col li {
		margin-bottom: 6px;
	}
	.site-below-footer-wrap .ast-builder-grid-row {
		gap: 4px;
	}
	.site-below-footer-wrap {
		padding-bottom: 72px; /* chừa chỗ cho nút liên hệ nổi */
	}

	/* ---------- Trang danh mục ---------- */
	.hanvo-hero__media {
		height: 200px !important;
	}
	.hanvo-hero__text {
		padding: 18px 16px 22px !important;
	}
	.hanvo-catalog .hanvo-hero__title {
		margin: 12px 0 10px;
		font-size: 24px;
	}
	.hanvo-hero__cats {
		gap: 10px 14px;
		padding-top: 12px;
	}
	.hanvo-toolbar {
		padding: 12px 0;
	}
	.hanvo-body {
		padding: 20px 0 40px;
	}
	.hanvo-explore {
		padding: 36px 0 44px;
	}

	/* ---------- Trang nội dung (Giới thiệu, Liên hệ, Cửa hàng) ---------- */
	.entry-content > .wp-block-uagb-container.uagb-is-root-container {
		padding-top: 32px !important;
		padding-bottom: 32px !important;
	}
	.entry-content > .wp-block-uagb-container.uagb-is-root-container:first-child {
		min-height: 0 !important;
		padding-top: 48px !important;
		padding-bottom: 48px !important;
	}
	.entry-content h1,
	.entry-content h1.uagb-heading-text {
		font-size: 28px !important;
	}
	.entry-content h2,
	.entry-content h2.uagb-heading-text {
		font-size: 22px !important;
	}
	.entry-content h3,
	.entry-content h3.uagb-heading-text {
		font-size: 19px !important;
	}
	.entry-content .wp-block-uagb-image img {
		max-height: 260px;
		object-fit: cover;
	}
	.entry-content iframe {
		max-height: 260px;
	}
	.page-id-118 .entry-content > .wp-block-uagb-container:first-child {
		padding-top: 36px !important;
		padding-bottom: 36px !important;
	}
}

/* Màn hình rất nhỏ */
@media (max-width: 360px) {
	.hanvo-front .hanvo-fp-service__title {
		font-size: 11.5px;
	}
	.hanvo-fp-line {
		flex-basis: 72%;
	}
}

/* Thẻ sản phẩm ở mọi danh sách (kể cả trang Cửa hàng): bỏ lề dưới mặc định của Astra */
.woocommerce ul.products li.product.hanvo-card {
	margin-bottom: 32px !important;
}
@media (max-width: 768px) {
	.woocommerce ul.products li.product.hanvo-card {
		margin-bottom: 18px !important;
	}
	.hanvo-front .woocommerce ul.products li.product.hanvo-card,
	.hanvo-catalog .hanvo-products ul.products li.product.hanvo-card {
		margin-bottom: 0 !important; /* các lưới này đã dùng gap */
	}
}

@media (max-width: 768px) {
	.hanvo-hero__cats {
		flex-wrap: nowrap;
		gap: 14px;
		margin-right: -16px;
		padding-right: 16px;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.hanvo-hero__cats::-webkit-scrollbar {
		display: none;
	}
	.hanvo-hero-cat {
		flex: 0 0 auto;
	}
	.hanvo-hero-cat a {
		width: 72px;
	}
	.hanvo-hero-cat__img {
		width: 60px !important;
		height: 60px !important;
	}
	.hanvo-hero-cat__label {
		margin-top: 6px;
		font-size: 12.5px;
	}
}
