/* ==========================================================================
   Little Wonder – chỉnh responsive chung (STT 33)
   Nạp sau lw-store.css / lw-shop.css / lw-refinements.css / lw-product.css.
   Chỉ sửa lỗi bố cục và vùng bấm; giữ nguyên hệ thị giác của site.
   ========================================================================== */

/* 1. Dải ảnh "Khám phá ngay" trên trang chủ tràn đúng bề ngang khung mà
      không tạo thanh cuộn ngang. 100vw tính cả thanh cuộn nên bị lố. */
body .lw-photo-links {
	width: auto !important;
	max-width: none !important;
	margin-left: calc(-1 * var(--wp--style--root--padding-left, 24px)) !important;
	margin-right: calc(-1 * var(--wp--style--root--padding-right, 24px)) !important;
	box-sizing: border-box;
}

/* 2. Không cho bất kỳ trang nào tự tạo thanh cuộn ngang */
html,
body {
	max-width: 100%;
	overflow-x: hidden;
}

/* 3. Vùng bấm tối thiểu 44×44 cho các nút nhỏ có sẵn */
.lw-search__form .lw-search__submit,
.lw-search-form .lw-search-button {
	min-height: 44px !important;
}

.lw-context-filters .lw-group-toggle {
	min-height: 44px;
	padding: 10px 0;
}

/* Mũi tên chuyển ảnh trong gallery sản phẩm */
body.single-product .wp-block-woocommerce-product-gallery-large-image-next-previous button,
body.single-product .wc-block-product-gallery-large-image__next-previous button {
	min-width: 44px;
	min-height: 44px;
	padding: 10px;
}

/* Dải ảnh nhỏ của gallery */
body.single-product .wp-block-woocommerce-product-gallery-thumbnails button {
	min-width: 44px;
	min-height: 44px;
}

/* Hiện/ẩn mật khẩu ở trang tài khoản */
.woocommerce-form-login .show-password-input,
.woocommerce-ResetPassword .show-password-input {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Nút xóa sản phẩm trong mini-cart */
.wc-block-cart-item__remove-link {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Nút số lượng trong trang sản phẩm */
body.single-product .wc-block-components-quantity-selector__button {
	min-width: 44px;
	min-height: 44px;
}

/* 4. Điện thoại: giữ ảnh đúng tỷ lệ, chữ không bị cắt */
@media (max-width: 640px) {
	body.single-product .wp-block-woocommerce-product-gallery img,
	body.single-product .wc-block-components-product-image img {
		max-width: 100%;
		height: auto;
	}

	/* Bảng thông tin sản phẩm không tràn khung */
	body.single-product .lw-pdp__specs th,
	body.single-product .lw-pdp__specs td {
		word-break: break-word;
	}

	/* Tiêu đề dài không đẩy khung */
	body .wp-block-post-title,
	body .wp-block-heading {
		overflow-wrap: anywhere;
	}

	/* Nút thêm vào giỏ và số lượng dùng hết bề ngang cho dễ bấm */
	body.single-product .wp-block-woocommerce-add-to-cart-with-options {
		max-width: 100%;
	}

	body.single-product .wp-block-woocommerce-add-to-cart-with-options .wp-block-button,
	body.single-product .wp-block-woocommerce-add-to-cart-with-options .wp-block-button__link {
		width: 100%;
	}

	/* Khối bộ lọc Shop: mở full màn hình, không cắt nội dung */
	.lw-filter-panel {
		max-height: calc(100dvh - 32px);
		overflow-y: auto;
	}
}

/* 5. Máy tính bảng dọc: lưới sản phẩm không quá dày */
@media (min-width: 641px) and (max-width: 900px) {
	body .wc-block-product-template {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

/* 6. Footer trên điện thoại: thương hiệu và liên hệ chiếm cả hàng */
@media (max-width: 700px) {
	.lw-footer {
		padding-top: 44px;
	}

	.lw-footer__grid {
		grid-template-columns: 1fr 1fr !important;
		gap: 32px 24px !important;
	}

	.lw-footer__brand,
	.lw-footer__col--contact {
		grid-column: 1 / -1;
	}

	.lw-footer ul a,
	.lw-footer__contact a,
	.lw-footer__account a {
		display: inline-flex;
		align-items: center;
		min-height: 36px;
		font-size: 14px;
	}

	.lw-footer__note {
		max-width: none;
		font-size: 12.5px;
	}

	.lw-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
	}
}

/* 7. Tôn trọng người dùng giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
	.lw-photo-links .lw-photo-links__image,
	body .wc-block-components-button {
		transition: none !important;
	}
}
