/*
Theme Name: Banh Mai
Theme URI: https://banhmai.com.au
Author: MAG Flow
Description: Child theme for BANH MAI — Bakery & Vietnamese Food, Mackay QLD. Layout language adapted from the client's chosen reference (Estiene); colour, type and imagery from the client's own approved in-store menu boards.
Template: twentytwentyfive
Version: 2.0.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: banh-mai
*/

/* ============================================================
   1. NEN TANG
   ============================================================ */

body {
	background-color: var(--wp--preset--color--page);
	-webkit-font-smoothing: antialiased;
}

.bm-band-cream { background-color: var(--wp--preset--color--cream); }
.bm-band-deep  { background-color: var(--wp--preset--color--cream-deep); }

/* Dai section chay het chieu ngang man hinh */
.bm-full {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: 100vw;
}

/* ============================================================
   2. EYEBROW — nhan chu nho kem gach ngang, dac trung cua ref
   ============================================================ */

.bm-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--wp--preset--color--amber-text);
	margin-bottom: 0.9rem;
}
.bm-eyebrow::after {
	content: "";
	height: 1px;
	width: 3rem;
	background-color: var(--wp--preset--color--amber);
	flex: 0 0 auto;
}
.bm-eyebrow.is-center { justify-content: center; }
.bm-eyebrow.is-center::before {
	content: "";
	height: 1px;
	width: 3rem;
	background-color: var(--wp--preset--color--amber);
	flex: 0 0 auto;
}

/* ============================================================
   3. HERO — anh full-bleed, chu de chong len
   ============================================================ */

.bm-hero {
	position: relative;
	min-height: min(78vh, 680px);
	display: grid;
	place-items: center;
	overflow: hidden;
	background-color: var(--wp--preset--color--cream);
}
.bm-hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 58%;
}
.bm-hero::after {
	/* lop phu nhe de chu doc duoc tren anh sang */
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(42, 23, 16, 0.30) 0%, rgba(42, 23, 16, 0.48) 100%);
}
.bm-hero__inner {
	position: relative;
	z-index: 2;
	text-align: center;
	padding: 5rem 16px;
	max-width: 56rem;
}
.bm-hero__inner .bm-eyebrow { color: #F0DCC0; justify-content: center; }
.bm-hero__inner .bm-eyebrow::before,
.bm-hero__inner .bm-eyebrow::after { background-color: rgba(240, 220, 192, 0.75); }
.bm-hero h1 {
	color: #FFFFFF;
	margin: 0 0 1.1rem;
	text-shadow: 0 2px 18px rgba(42, 23, 16, 0.45);
}
.bm-hero p {
	color: #F6ECDF;
	font-size: 1.0625rem;
	max-width: 36rem;
	margin: 0 auto 2rem;
	text-shadow: 0 1px 10px rgba(42, 23, 16, 0.5);
}

/* ============================================================
   4. NUT — vien mong kieu ref
   ============================================================ */

.bm-btn {
	display: inline-block;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	padding: 1.05rem 2.5rem;
	text-decoration: none;
	border: 1px solid transparent;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.bm-btn--solid {
	background-color: var(--wp--preset--color--olive-deep);
	color: var(--wp--preset--color--page);
}
.bm-btn--solid:hover,
.bm-btn--solid:focus-visible {
	background-color: var(--wp--preset--color--amber-text);
	color: var(--wp--preset--color--page);
}
.bm-btn--ghost {
	background-color: transparent;
	color: #FFFFFF;
	border-color: rgba(255, 255, 255, 0.75);
}
.bm-btn--ghost:hover,
.bm-btn--ghost:focus-visible {
	background-color: #FFFFFF;
	color: var(--wp--preset--color--olive-deep);
}
.bm-btn--outline {
	background-color: transparent;
	color: var(--wp--preset--color--olive-deep);
	border-color: var(--wp--preset--color--amber);
}
.bm-btn--outline:hover,
.bm-btn--outline:focus-visible {
	background-color: var(--wp--preset--color--olive-deep);
	color: var(--wp--preset--color--page);
	border-color: var(--wp--preset--color--olive-deep);
}

/* ============================================================
   5. THE DANH MUC — anh + nhan chong len, hover phong nhe
   ============================================================ */

.bm-cat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 1px;
	background-color: rgba(197, 122, 55, 0.3);
}
.bm-cat {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	text-decoration: none;
	background-color: var(--wp--preset--color--cream);
}
.bm-cat img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.bm-cat:hover img,
.bm-cat:focus-visible img { transform: scale(1.07); }
.bm-cat::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(42, 23, 16, 0) 40%, rgba(42, 23, 16, 0.62) 100%);
}
.bm-cat__label {
	position: absolute;
	z-index: 2;
	left: 1.5rem;
	right: 1.5rem;
	bottom: 1.35rem;
	color: #FFFFFF;
}
.bm-cat__name {
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.5rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.2;
}
.bm-cat__sub {
	display: block;
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	color: #EFE0CC;
	margin-top: 0.3rem;
}

/* ============================================================
   6. DANH SACH MON KIEU THUC DON — gach chan cham, gia ben phai
   ============================================================ */

.bm-menu-list { display: grid; gap: 1.9rem; }
.bm-menu-row {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: baseline;
	gap: 0.85rem;
}
.bm-menu-row__name {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.3125rem;
	color: var(--wp--preset--color--olive-deep);
	position: relative;
	padding-right: 0.6rem;
}
.bm-menu-row__name::after {
	content: "";
	position: absolute;
	bottom: 0.3em;
	left: calc(100% + 0.1rem);
	width: 60vw;
	border-bottom: 1px dotted rgba(197, 122, 55, 0.75);
}
.bm-menu-row__price {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.3125rem;
	color: var(--wp--preset--color--amber-text);
	white-space: nowrap;
	z-index: 1;
	background-color: inherit;
	padding-left: 0.5rem;
}
.bm-menu-row__desc {
	grid-column: 1 / -1;
	font-size: 0.9375rem;
	color: #6A6455;
	margin-top: -0.35rem;
}

/* ============================================================
   7. DAI TRICH DAN — anh toi, chu giua
   ============================================================ */

.bm-quote {
	position: relative;
	min-height: 26rem;
	display: grid;
	place-items: center;
	overflow: hidden;
}
.bm-quote img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
}
.bm-quote::after {
	content: "";
	position: absolute; inset: 0;
	background-color: rgba(42, 23, 16, 0.66);
}
.bm-quote__inner {
	position: relative; z-index: 2;
	text-align: center;
	max-width: 46rem;
	padding: 4rem 16px;
	color: #FFFFFF;
}
.bm-quote__mark {
	font-family: var(--wp--preset--font-family--display);
	font-size: 4rem;
	line-height: 0.6;
	color: var(--wp--preset--color--amber);
	display: block;
	margin-bottom: 1.2rem;
}
.bm-quote__text {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.25rem, 2.4vw, 1.75rem);
	line-height: 1.55;
}

/* ============================================================
   8. BADGE TIN CAY
   ============================================================ */

.bm-badges {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 2.5rem;
	text-align: center;
	align-items: start;
}
.bm-badge__mark {
	width: 3rem; height: 3rem;
	margin: 0 auto 0.85rem;
	border-radius: 50%;
	border: 1px solid var(--wp--preset--color--amber);
	display: grid; place-items: center;
	color: var(--wp--preset--color--amber-text);
	font-size: 1.05rem;
}
.bm-badge__label {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--olive-deep);
}

/* ============================================================
   9. HEADER — dinh, thu gon khi cuon
   ============================================================ */

/* WordPress boc part trong <header class="wp-block-template-part"> cao dung bang
   header -> sticky dat tren .bm-header khong co cho truot. Phai dat tren lop boc. */
.wp-site-blocks > .wp-block-template-part:has(> .bm-header) {
	position: sticky;
	top: 0;
	z-index: 100;
}
.admin-bar .wp-site-blocks > .wp-block-template-part:has(> .bm-header) { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .wp-site-blocks > .wp-block-template-part:has(> .bm-header) { top: 46px; }
}
/* Co JS: header ra khoi luong trang de thu nho khong day noi dung (chong rung).
   Khong co JS: van la sticky o tren, header khong bao gio thu nho. */
html.bm-header-fixed .wp-site-blocks > .wp-block-template-part:has(> .bm-header) {
	position: fixed;
	left: 0;
	right: 0;
}
html.bm-header-fixed body { padding-top: var(--bm-header-h0, 0px); }
.bm-header {
	background-color: var(--wp--preset--color--page);
	border-bottom: 1px solid rgba(197, 122, 55, 0.28);
	transition: padding 0.25s ease, box-shadow 0.25s ease;
}
.bm-header.is-stuck {
	box-shadow: 0 2px 22px rgba(42, 23, 16, 0.10);
}
/* Padding cua block la style inline -> can !important de thu gon khi dinh */
.bm-header > .wp-block-group { transition: padding 0.25s ease; }
.bm-header.is-stuck > .wp-block-group {
	padding-top: 0.4rem !important;
	padding-bottom: 0.4rem !important;
}
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close { color: var(--wp--preset--color--olive-deep); }
.wp-block-navigation a { text-decoration: none; }
.wp-block-navigation .wp-block-navigation-item__content {
	position: relative;
	padding-bottom: 0.2rem;
}
.wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0; bottom: 0;
	width: 0; height: 1px;
	background-color: var(--wp--preset--color--amber);
	transition: width 0.25s ease;
}
.wp-block-navigation .wp-block-navigation-item:hover .wp-block-navigation-item__content::after,
.wp-block-navigation .current-menu-item .wp-block-navigation-item__content::after { width: 100%; }

/* Logo — ban nau tren nen kem. Toi thieu 80px ngang: rang buoc cung cua brand guideline */
.bm-logo { display: inline-block; line-height: 0; border: 0; }
.bm-logo__img { display: block; width: 116px; height: auto; min-width: 80px; transition: width 0.25s ease; }
.bm-header.is-stuck .bm-logo__img { width: 88px; }
.bm-header .wp-block-shortcode { margin: 0; }

/* ============================================================
   10. RAIL DANH MUC DINH tren trang menu
   ============================================================ */

.bm-rail {
	position: sticky;
	top: var(--bm-header-h, 64px);
	z-index: 40;
	background-color: var(--wp--preset--color--page);
	border-bottom: 1px solid rgba(197, 122, 55, 0.28);
	padding-block: 0.85rem;
}
.admin-bar .bm-rail { top: calc(var(--bm-header-h, 64px) + 32px); }
@media (max-width: 782px) { .admin-bar .bm-rail { top: calc(var(--bm-header-h, 64px) + 46px); } }
.bm-rail ul {
	display: flex;
	gap: 1.75rem;
	overflow-x: auto;
	list-style: none;
	margin: 0 auto;
	padding: 0 16px;
	max-width: 1280px;
	scrollbar-width: thin;
}
.bm-rail a {
	white-space: nowrap;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--wp--preset--color--olive-deep);
	padding-bottom: 0.2rem;
	border-bottom: 1px solid transparent;
}
.bm-rail a:hover,
.bm-rail a:focus-visible { border-bottom-color: var(--wp--preset--color--amber); }

/* ============================================================
   11. WOOCOMMERCE — the san pham theo ngon ngu ref
   ============================================================ */

.woocommerce ul.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
	gap: 2.5rem 1.75rem;
	margin: 0;
	padding: 0;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after { content: none !important; }
.woocommerce ul.products li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
	text-align: center;
}
.woocommerce ul.products li.product a img {
	background-color: #FFFFFF;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	margin-bottom: 1rem;
	border: 1px solid rgba(197, 122, 55, 0.2);
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.woocommerce ul.products li.product:hover a img { transform: scale(1.04); }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--wp--preset--font-family--display) !important;
	font-size: 1.0625rem !important;
	font-weight: 400;
	color: var(--wp--preset--color--olive-deep);
	letter-spacing: 0.02em;
	padding: 0 !important;
	margin-bottom: 0.35rem;
}
.woocommerce ul.products li.product .price {
	font-family: var(--wp--preset--font-family--display);
	color: var(--wp--preset--color--amber-text) !important;
	font-size: 1.0625rem !important;
}
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart {
	display: inline-block;
	margin-top: 0.85rem;
	background-color: transparent;
	color: var(--wp--preset--color--olive-deep);
	border: 1px solid var(--wp--preset--color--amber);
	border-radius: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 0.7rem 1.4rem;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .added_to_cart:hover {
	background-color: var(--wp--preset--color--olive-deep);
	color: var(--wp--preset--color--page);
	border-color: var(--wp--preset--color--olive-deep);
}
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering { display: none; }

/* Nhom danh muc tren trang menu mot trang cuon */
.bm-cat-section { scroll-margin-top: 120px; padding-block: var(--wp--preset--spacing--60); }
.bm-cat-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	border-bottom: 1px solid rgba(197, 122, 55, 0.3);
	padding-bottom: 0.9rem;
	margin-bottom: 2.25rem;
}
.bm-cat-section__head h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.25rem); }
.bm-cat-section__count {
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--amber-text);
	white-space: nowrap;
}

/* ============================================================
   12. FOOTER — nen cocoa, giong bien hieu that cua tiem
   ============================================================ */

.bm-footer {
	background-color: var(--wp--preset--color--cocoa);
	color: var(--wp--preset--color--cream);
}
.bm-footer a {
	color: var(--wp--preset--color--cream);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}
.bm-footer a:hover,
.bm-footer a:focus-visible { border-bottom-color: var(--wp--preset--color--amber); }
.bm-footer h4 {
	color: var(--wp--preset--color--amber);
	font-size: 0.75rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	margin-bottom: 1.1rem;
}
.bm-footer__brand { margin: 0 0 1.25rem; }
.bm-footer__brand .bm-logo__img { width: 150px; }
.bm-footer__tagline {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	color: var(--wp--preset--color--amber);
}
.bm-footer__cols {
	display: grid;
	grid-template-columns: 1.3fr 1fr 1fr;
	gap: 3rem;
}
.bm-footer__bottom {
	border-top: 1px solid rgba(197, 122, 55, 0.28);
	margin-top: 3rem;
	padding-top: 1.75rem;
	text-align: center;
	font-size: 0.8125rem;
	color: #C9B79F;
}

/* ============================================================
   13. HIEU UNG — hien dan khi cuon
   ============================================================ */

/* Mac dinh noi dung HIEN. Chi khi motion.js da chay va gan html.bm-motion
   thi cac khoi CHUA toi moi bi an cho hieu ung. JS cham hay loi -> trang van
   day du noi dung, khong bao gio trang tron. */
.bm-reveal {
	transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
	            transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
html.bm-motion .bm-reveal:not(.is-in) {
	opacity: 0;
	transform: translateY(26px);
}
.bm-reveal.is-in { opacity: 1; transform: none; }
.bm-reveal--d1 { transition-delay: 0.1s; }
.bm-reveal--d2 { transition-delay: 0.2s; }
.bm-reveal--d3 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
	.bm-reveal,
	html.bm-motion .bm-reveal:not(.is-in) { opacity: 1; transform: none; transition: none; }
	.bm-cat img,
	.woocommerce ul.products li.product a img { transition: none; }
	.bm-cat:hover img { transform: none; }
	html { scroll-behavior: auto; }
}

html { scroll-behavior: smooth; }

/* ============================================================
   14. KHOI GHI CHU NOI BO — chan o may chu, khong phai giau bang CSS
   ============================================================ */

.bm-pending {
	border: 2px dashed var(--wp--preset--color--amber);
	background-color: #FFF8E7;
	padding: 1rem 1.15rem;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--wp--preset--color--cocoa);
	margin-block: 1.5rem;
}

/* ============================================================
   15. MOBILE
   ============================================================ */

@media (max-width: 781px) {
	.bm-footer__cols { grid-template-columns: 1fr; gap: 2.25rem; }
	.bm-logo__img { width: 92px; }
	.bm-header.is-stuck .bm-logo__img { width: 80px; }
	.bm-hero { min-height: 60vh; }
	.bm-cat-section__head { flex-wrap: wrap; }
	.woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 1rem; }
	.bm-menu-row__name::after { display: none; }
}

/* ============================================================
   16. TRANG CHI TIET MON — kieu Clover, don gian, de dat
   ============================================================ */

.woocommerce div.product { padding-block: var(--wp--preset--spacing--50); }
.woocommerce div.product .product_title {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	color: var(--wp--preset--color--olive-deep);
	letter-spacing: 0.02em;
	margin-bottom: 0.5rem;
}
.woocommerce div.product p.price {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.625rem;
	color: var(--wp--preset--color--amber-text) !important;
	margin-bottom: 1.5rem;
}
.woocommerce div.product .woocommerce-product-details__short-description {
	font-size: 1rem;
	color: #5E5849;
	max-width: 34rem;
}
.woocommerce div.product div.images img {
	background-color: #FFFFFF;
	border: 1px solid rgba(197, 122, 55, 0.22);
}

/* --- Nhom tuy chon --- */
.bm-mods { margin-block: 2rem; }
.bm-mod {
	border: 0;
	border-top: 1px solid rgba(197, 122, 55, 0.3);
	padding: 1.4rem 0 0.4rem;
	margin: 0 0 0.6rem;
}
.bm-mod__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	padding: 0;
	margin-bottom: 0.9rem;
}
.bm-mod__name {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--olive-deep);
}
.bm-mod__rule {
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	color: #6A6455;
	background-color: var(--wp--preset--color--cream);
	border-radius: 999px;
	padding: 0.3rem 0.85rem;
	white-space: nowrap;
}
.bm-mod__rule.is-required {
	color: var(--wp--preset--color--cocoa);
	background-color: var(--wp--preset--color--cream-deep);
	font-weight: 700;
}
.bm-mod__list { list-style: none; margin: 0; padding: 0; }
.bm-mod__row { border-bottom: 1px solid rgba(197, 122, 55, 0.18); }
.bm-mod__row:last-child { border-bottom: 0; }
.bm-mod__row input {
	position: absolute;
	opacity: 0;
	width: 1px; height: 1px;
}
.bm-mod__row label {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0.85rem 0.2rem;
	cursor: pointer;
	font-size: 1rem;
}
.bm-mod__row label::before {
	content: "";
	flex: 0 0 auto;
	width: 1.2rem; height: 1.2rem;
	border: 1px solid #B9AE99;
	border-radius: 50%;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bm-mod__row input[type="checkbox"] + label::before { border-radius: 3px; }
.bm-mod__row input:checked + label::before {
	border-color: var(--wp--preset--color--olive-deep);
	box-shadow: inset 0 0 0 4px var(--wp--preset--color--olive-deep);
}
.bm-mod__row input:focus-visible + label::before {
	outline: 2px solid var(--wp--preset--color--amber);
	outline-offset: 2px;
}
.bm-mod__label { flex: 1 1 auto; }
.bm-mod__price { color: #6A6455; font-size: 0.9375rem; white-space: nowrap; }
.bm-mod__error {
	color: #9B2C16;
	font-size: 0.875rem;
	margin: 0.5rem 0 0;
	font-weight: 700;
}
.bm-mod.is-invalid { background-color: rgba(155, 44, 22, 0.04); }

.bm-mods__note { margin-top: 1.6rem; }
.bm-mods__note label {
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--olive-deep);
	margin-bottom: 0.6rem;
}
.bm-mods__note textarea {
	width: 100%;
	border: 1px solid rgba(197, 122, 55, 0.4);
	background-color: #FFFFFF;
	border-radius: 0;
	padding: 0.8rem 0.9rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.9375rem;
	resize: vertical;
}

/* --- Nut mua + bo dem --- */
.woocommerce div.product form.cart { margin-top: 1.5rem; }
.woocommerce div.product form.cart .quantity input.qty {
	height: 3.25rem;
	width: 4.5rem;
	text-align: center;
	border: 1px solid rgba(197, 122, 55, 0.5);
	border-radius: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.125rem;
	background-color: #FFFFFF;
}
.woocommerce div.product form.cart .single_add_to_cart_button {
	height: 3.25rem;
	border-radius: 0;
	background-color: var(--wp--preset--color--olive-deep);
	color: var(--wp--preset--color--page);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	padding-inline: 2.5rem;
	transition: background-color 0.2s ease;
}
.woocommerce div.product form.cart .single_add_to_cart_button:hover {
	background-color: var(--wp--preset--color--amber-text);
}

/* --- Thanh dat hang: CHI o so luong + nut dat dinh o day man hinh dien thoai.
       Ban dau cho ca form.cart dinh -> ca khoi tuy chon ~1500px bi ghim theo. --- */
.bm-order-bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
}
.bm-order-bar .quantity { margin: 0 !important; }
.bm-order-bar .single_add_to_cart_button { flex: 0 0 auto; margin: 0 !important; }

@media (max-width: 781px) {
	/* fixed, khong phai sticky: sticky khong duoc vuot len tren mep tren cua
	   form (form bat dau duoi anh + ten mon) nen luc mo trang thanh chi lo 33px.
	   Clover hien thanh ngay tu dau -> dung fixed + dem day cho body. */
	.bm-order-bar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 90;
		margin: 0;
		background-color: var(--wp--preset--color--page);
		border-top: 1px solid rgba(197, 122, 55, 0.4);
		padding: 0.85rem 16px calc(0.85rem + env(safe-area-inset-bottom));
		box-shadow: 0 -4px 18px rgba(42, 23, 16, 0.09);
	}
	body.single-product { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
	.bm-order-bar .single_add_to_cart_button {
		flex: 1 1 auto;
		display: flex;
		align-items: center;
		justify-content: center;
	}
}

/* ============================================================
   17. SUA BO CUC SAU LAN CHUP MAN DAU TIEN
   ============================================================ */

/* The danh muc: cao hon, dung 5 cot tren man rong — ban dau qua thap,
   nhan chong len anh trong khi ref de the cao hon han. */
.bm-cat { aspect-ratio: 3 / 4; }
@media (min-width: 1100px) {
	.bm-cat-grid { grid-template-columns: repeat(5, 1fr); }
	.bm-cat { aspect-ratio: 4 / 5; }
}
@media (max-width: 1099px) and (min-width: 700px) {
	.bm-cat-grid { grid-template-columns: repeat(3, 1fr); }
	.bm-cat { aspect-ratio: 1 / 1; }
}
@media (max-width: 699px) {
	.bm-cat-grid { grid-template-columns: repeat(2, 1fr); }
	.bm-cat { aspect-ratio: 1 / 1; }
	.bm-cat__name { font-size: 1.125rem; }
	.bm-cat__sub { font-size: 0.6875rem; }
}

/* Trang menu: pha khung 760px de luoi san pham duoc rong nhu ref */
.bm-rail,
.bm-cat-section {
	width: min(1280px, 100vw - 32px);
	margin-left: calc(50% - min(1280px, 100vw - 32px) / 2);
	margin-right: calc(50% - min(1280px, 100vw - 32px) / 2);
	max-width: none;
}
.bm-rail {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/* Khoi featured o trang chu: dung 4 cot, khong de vo thanh 3 + 1 */
.bm-featured .woocommerce ul.products,
.bm-featured ul.products {
	grid-template-columns: repeat(4, 1fr);
	width: min(1100px, 100%);
	margin-inline: auto;
}
@media (max-width: 899px) {
	.bm-featured .woocommerce ul.products,
	.bm-featured ul.products { grid-template-columns: repeat(2, 1fr); }
}

/* Anh san pham Clover co nen trang — dat trong khung kem cho do choi mat */
.woocommerce ul.products li.product a img {
	padding: 0.75rem;
	background-color: #FFFFFF;
}

/* Dai trich dan: anh mon an rat sang nen lop phu 0.66 lam phang het anh,
   nhin ra mot mang nau tron. Doi sang gradient nhe hon + bong chu. */
.bm-quote::after {
	background: linear-gradient(
		180deg,
		rgba(42, 23, 16, 0.34) 0%,
		rgba(42, 23, 16, 0.58) 55%,
		rgba(42, 23, 16, 0.68) 100%
	);
}
.bm-quote__text,
.bm-quote__mark { text-shadow: 0 2px 14px rgba(42, 23, 16, 0.75); }
.bm-quote img { object-position: center 62%; }

/* O so luong va nut cao bang nhau trong thanh dat hang */
.bm-order-bar { align-items: stretch; }
.bm-order-bar .quantity input.qty,
.woocommerce div.product form.cart .bm-order-bar .quantity input.qty { height: 3.25rem; box-sizing: border-box; }
.bm-order-bar .quantity { display: flex; }

/* Trang mon: bot khoang trong phia tren breadcrumb */
body.single-product main.wp-block-group { padding-top: var(--wp--preset--spacing--30) !important; margin-top: 0 !important; }
body.single-product .wp-block-woocommerce-breadcrumbs { margin-top: 0; margin-bottom: 1.25rem; font-size: 0.8125rem; }

/* BM-QV */
/* ============================================================
   18. THE SAN PHAM + POPUP DAT MON KIEU CLOVER
   ============================================================ */

/* --- Luoi the: anh bo goc, ten, gia dam. Khong nut. --- */
.bm-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 2.5rem 1.5rem;
}
.bm-grid--featured { width: min(1100px, 100%); margin-inline: auto; }
@media (max-width: 999px) { .bm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 781px) { .bm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 0.875rem; } }

.bm-card-item { min-width: 0; margin: 0; }
.bm-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	border-radius: 12px;
}
.bm-card:focus-visible { outline: 2px solid var(--wp--preset--color--amber); outline-offset: 4px; }
.bm-card__media {
	display: block;
	aspect-ratio: 3 / 4;
	border-radius: 12px;
	overflow: hidden;
	background-color: #F3EBDF;
}
.bm-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}
.bm-card:hover .bm-card__img { transform: scale(1.04); }
.bm-card__name {
	margin-top: 0.8rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}
.bm-card__price {
	margin-top: 0.3rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	font-weight: 700;
	color: var(--wp--preset--color--cocoa);
}

/* Rail danh muc tren mobile: an thanh cuon xam (van vuot ngang duoc) */
.bm-rail ul { scrollbar-width: none; }
.bm-rail ul::-webkit-scrollbar { display: none; }

/* --- Popup --- */
html.bm-qv-open { overflow: hidden; }

.bm-qv {
	padding: 0;
	border: 0;
	border-radius: 16px;
	width: min(960px, calc(100vw - 48px));
	max-width: none;
	height: min(660px, calc(100dvh - 48px));
	max-height: none;
	overflow: hidden;
	background-color: #FFFFFF;
	color: var(--wp--preset--color--ink);
	box-shadow: 0 24px 64px rgba(42, 23, 16, 0.3);
}
.bm-qv::backdrop { background-color: rgba(42, 23, 16, 0.55); }
.bm-qv[open] { animation: bm-qv-in 0.22s ease-out; }
@keyframes bm-qv-in {
	from { opacity: 0; transform: translateY(12px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

.bm-qv__form { display: flex; flex-direction: column; height: 100%; margin: 0; }

/* May tinh: 2 cot — trai noi dung (cuon rieng), phai anh */
.bm-qv__main {
	flex: 1 1 auto;
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr);
}
.bm-qv__body {
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 2.25rem 2.25rem 1.5rem;
}
.bm-qv__media { order: 2; min-height: 0; background-color: #F3EBDF; }
.bm-qv__media img { display: block; width: 100%; height: 100%; object-fit: cover; }

.bm-qv__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.94);
	color: var(--wp--preset--color--cocoa);
	box-shadow: 0 2px 10px rgba(42, 23, 16, 0.2);
	cursor: pointer;
}
.bm-qv__close:hover { background-color: #FFFFFF; }
.bm-qv__close:focus-visible { outline: 2px solid var(--wp--preset--color--amber); outline-offset: 2px; }

.bm-qv__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.5rem, 3vw, 1.875rem);
	line-height: 1.2;
	letter-spacing: 0.01em;
	text-transform: none;
	color: var(--wp--preset--color--olive-deep);
	margin: 0 3rem 0.4rem 0;
}
.bm-qv__price {
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--wp--preset--color--cocoa);
	margin: 0 0 1rem;
}
.bm-qv__desc { font-size: 1rem; line-height: 1.55; color: #4E4839; margin: 0 0 1rem; }
.bm-qv__ingredients { margin: 0 0 1rem; }
.bm-qv__ingredients h3 {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--olive-deep);
	margin: 0 0 0.35rem;
}
.bm-qv__ingredients p { font-size: 0.9375rem; line-height: 1.5; color: #4E4839; margin: 0; }
.bm-qv__mods { margin: 1.25rem 0 0; }
.bm-qv .bm-mods__note textarea { border-radius: 10px; }
.bm-qv__msg { color: #9B2C16; font-weight: 700; margin: 1rem 0 0; }

/* Thanh duoi: bo dem so luong + nut, chu can giua */
.bm-qv__bar {
	flex: 0 0 auto;
	display: flex;
	align-items: stretch;
	gap: 0.75rem;
	padding: 0.9rem 1.25rem calc(0.9rem + env(safe-area-inset-bottom));
	border-top: 1px solid rgba(197, 122, 55, 0.25);
	background-color: #FFFFFF;
}
.bm-qv__qty {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	border: 1px solid rgba(62, 58, 44, 0.22);
	border-radius: 10px;
	overflow: hidden;
}
.bm-qv__step {
	width: 3rem;
	height: 3.25rem;
	border: 0;
	background: transparent;
	font-size: 1.375rem;
	line-height: 1;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}
.bm-qv__step:hover:not(:disabled) { background-color: var(--wp--preset--color--cream); }
.bm-qv__step:disabled { opacity: 0.35; cursor: default; }
.bm-qv__count {
	min-width: 2.25rem;
	text-align: center;
	font-weight: 700;
	font-size: 1.0625rem;
}
.bm-qv__add {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 3.25rem;
	border: 0;
	border-radius: 10px;
	background-color: var(--wp--preset--color--olive-deep);
	color: var(--wp--preset--color--page);
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.bm-qv__add:hover:not(:disabled) { background-color: var(--wp--preset--color--amber-text); }
.bm-qv__add:disabled { opacity: 0.6; cursor: default; }
.bm-qv__add:focus-visible,
.bm-qv__step:focus-visible { outline: 2px solid var(--wp--preset--color--amber); outline-offset: 2px; }

/* Dien thoai: toan man hinh, anh o tren va cuon cung noi dung */
@media (max-width: 781px) {
	.bm-qv {
		width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border-radius: 0;
		margin: 0;
	}
	.bm-qv__main { display: block; overflow-y: auto; overscroll-behavior: contain; }
	.bm-qv__body { overflow: visible; padding: 1.25rem 16px 1.5rem; }
	.bm-qv__media { aspect-ratio: 4 / 3; }
	.bm-qv__close { top: 12px; right: 12px; }
	.bm-qv__bar { padding-inline: 16px; }
}

/* --- Thong bao da them --- */
.bm-toast {
	position: fixed;
	left: 50%;
	bottom: calc(20px + env(safe-area-inset-bottom));
	transform: translateX(-50%);
	z-index: 1000;
	display: flex;
	align-items: center;
	gap: 1rem;
	max-width: calc(100vw - 32px);
	padding: 0.85rem 1.25rem;
	border-radius: 999px;
	background-color: var(--wp--preset--color--cocoa);
	color: var(--wp--preset--color--cream);
	font-size: 0.9375rem;
	box-shadow: 0 10px 30px rgba(42, 23, 16, 0.3);
}
.bm-toast.is-in { animation: bm-toast-in 0.25s ease-out; }
@keyframes bm-toast-in {
	from { opacity: 0; transform: translate(-50%, 10px); }
	to { opacity: 1; transform: translateX(-50%); }
}
.bm-toast__link { color: var(--wp--preset--color--amber); font-weight: 700; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
	.bm-card__img { transition: none; }
	.bm-card:hover .bm-card__img { transform: none; }
	.bm-qv[open], .bm-toast.is-in { animation: none; }
}

/* Sua sau lan chup dau */
.bm-toast[hidden] { display: none; }
.bm-mods__note textarea { box-sizing: border-box; max-width: 100%; }
.bm-qv .bm-mod { padding-top: 1.1rem; }
.bm-qv .bm-mod__head { margin-bottom: 0.35rem; float: left; }
.bm-qv .bm-mod__head + * { clear: both; }
.bm-qv .bm-mod__row label { padding-block: 0.75rem; }

/* Ten + gia can giua theo anh (founder 22/09) */
.bm-card { text-align: center; }

/* O chon da tich: to den KIN toan bo o, khong phai chi vien (founder 22/09).
   Truoc day dung inset box-shadow 4px nen giua o con mang trang. */
.bm-mod__row input:checked + label::before {
	background-color: var(--wp--preset--color--olive-deep);
	border-color: var(--wp--preset--color--olive-deep);
	box-shadow: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.6l3 3 6.6-7' fill='none' stroke='%23FBF7F0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 0.85rem 0.85rem;
}

/* Danh muc tren dien thoai: 5 o chia 2 cot -> hang cuoi le 1 o.
   Cho o cuoi trai het chieu ngang thanh mot dai (founder 23/09). */
@media (max-width: 699px) {
	.bm-cat-grid > :last-child { grid-column: 1 / -1; }
	.bm-cat-grid > :last-child .bm-cat { aspect-ratio: 16 / 9; }
}
/* Badge tren dien thoai: ep 2 cot de thanh 2x2 (auto-fit 11rem khong du cho o 358px) */
@media (max-width: 699px) {
	.bm-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
}
/* Badge: 4 o deu nhau tren man rong (auto-fit 11rem chi xep duoc 3+1 trong khung 760px),
   2x2 tren dien thoai. Quy tac nay phai nam sau quy tac mobile nen dung min-width. */
@media (min-width: 700px) {
	.bm-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.25rem; }
}

/* Dai tran man hinh: le am bi CSS global padding cua WordPress ghi de
   (margin-left ve 0) nen ca dai lech phai 16px -> trang thua 16px ngang. */
.bm-full,
.bm-hero,
.bm-rail {
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
}
