/*
 * Base — reset, token và các thành phần dùng chung.
 *
 * Màu và font KHÔNG khai báo lại ở đây: WordPress đã sinh ra biến
 * --wp--preset--* từ theme.json. Sửa màu chỉ cần sửa một chỗ là theme.json.
 * Các biến --bk-* dưới đây chỉ đặt bí danh ngắn gọn để CSS dễ đọc.
 *
 * Fallback sau dấu phẩy CỐ Ý là xám trung tính, không phải màu của ngành nào:
 * child theme thay nguyên mảng palette trong theme.json, thiếu một slug là
 * component đó mất màu — xám lộ ra ngay lúc dev nhìn thấy, thay vì âm thầm rơi
 * về màu của ngành khác mà không ai để ý.
 */

:root {
	--bk-cream:      var(--wp--preset--color--cream, #F4F4F4);
	--bk-surface:    var(--wp--preset--color--surface, #FFFFFF);
	--bk-sand:       var(--wp--preset--color--sand, #E6E6E6);
	--bk-cocoa:      var(--wp--preset--color--cocoa, #222222);
	--bk-cocoa-soft: var(--wp--preset--color--cocoa-soft, #666666);
	/* Màu nhấn của ngành (--gold) phải đạt WCAG AA (4.5:1) trên nền sáng và đủ
	   tối để chữ trắng trên nút cũng đạt — xem theme.json của child theme. */
	--bk-gold:       var(--wp--preset--color--gold, #555555);
	--bk-gold-soft:  var(--wp--preset--color--gold-soft, #DDDDDD);
	--bk-berry:      var(--wp--preset--color--berry, #444444);
	--bk-leaf:       var(--wp--preset--color--leaf, #4D4D4D);
	--bk-line:       var(--wp--preset--color--line, #D9D9D9);

	--bk-font-body:    var(--wp--preset--font-family--body, system-ui, sans-serif);
	--bk-font-display: var(--wp--preset--font-family--display, Georgia, serif);

	/* Token HÌNH HỌC — skin (biến thể giao diện) đè được đúng nhóm này bằng
	   một khối :root{} inline, xem plugin core includes/skin.php và
	   inc/skin.php của theme. Màu và font KHÔNG đè ở đây: skin đổi chúng ở
	   tầng trên (theme.json runtime) nên các alias --bk-* phía trên tự ăn
	   theo. --bk-gold/--bk-gold-soft là của mùa/sự kiện, skin không được
	   chạm — xem docblock includes/skin.php. */
	--bk-radius:     12px;
	--bk-radius-lg:  20px;
	--bk-btn-radius: 999px;
	--bk-shadow:     0 1px 2px rgb(51 36 28 / 6%), 0 4px 16px rgb(51 36 28 / 6%);
	--bk-shadow-lg:  0 2px 6px rgb(51 36 28 / 8%), 0 12px 32px rgb(51 36 28 / 10%);

	--bk-container: 1240px;
	--bk-gutter:    1.25rem;

	--bk-header-h: 64px;

	--bk-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (min-width: 768px) {
	:root {
		--bk-gutter:   2rem;
		--bk-header-h: 76px;
	}
}

/* --- Reset ---------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bk-cream);
	color: var(--bk-cocoa);
	font-family: var(--bk-font-body);
	font-size: 1rem;
	line-height: 1.65;
	/* Trên mobile, thanh cuộn ngang là lỗi hiển thị phổ biến nhất khi có
	   phần tử tràn. Chặn từ gốc. */
	overflow-x: hidden;
}

img,
picture,
video,
iframe { max-width: 100%; }

img { height: auto; }

h1, h2, h3, h4 {
	font-family: var(--bk-font-display);
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 0.5em;
	/* Tránh dòng cuối chỉ còn một chữ */
	text-wrap: balance;
}

p { margin: 0 0 1em; }

p:last-child { margin-bottom: 0; }

a {
	color: var(--bk-gold);
	text-underline-offset: 0.2em;
	transition: color 0.18s var(--bk-ease);
}

a:hover { color: var(--bk-cocoa); }

ul, ol { padding-left: 1.25rem; }

/* --- Trợ năng ------------------------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed !important;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 999;
	width: auto;
	height: auto;
	padding: 0.75rem 1.25rem;
	clip-path: none;
	background: var(--bk-cocoa);
	color: var(--bk-cream);
	border-radius: var(--bk-radius);
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--bk-gold);
	outline-offset: 2px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* --- Container ------------------------------------------------------------ */

.container {
	width: 100%;
	max-width: var(--bk-container);
	margin-inline: auto;
	padding-inline: var(--bk-gutter);
}

.section {
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section--muted { background: var(--bk-sand); }

/* --- Nút ------------------------------------------------------------------ */

.button,
.wp-block-button__link,
button.single_add_to_cart_button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.85em 1.9em;
	border: 1px solid transparent;
	border-radius: var(--bk-btn-radius);
	background: var(--bk-cocoa);
	color: var(--bk-cream);
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s var(--bk-ease), color 0.18s var(--bk-ease), transform 0.18s var(--bk-ease);
}

.button:hover,
.wp-block-button__link:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	background: var(--bk-gold);
	color: #fff;
	transform: translateY(-1px);
}

/* WooCommerce core đặt `color: inherit` cho nút :disabled (vd "Cập nhật giỏ
   hàng" trước khi đổi số lượng) — chữ ăn theo màu chữ mặc định của trang
   (cocoa, tối), trong khi nền nút vẫn là cocoa tối y hệt nên chữ biến mất.
   !important vì hai rule cùng độ đặc hiệu, thắng thua phụ thuộc thứ tự nạp. */
.woocommerce a.button:disabled,
.woocommerce button.button:disabled,
.woocommerce input.button:disabled {
	color: var(--bk-cream) !important;
}

.button--primary { background: var(--bk-gold); color: #fff; }
.button--primary:hover { background: var(--bk-cocoa); color: var(--bk-cream); }

.button--ghost {
	background: transparent;
	border-color: var(--bk-cocoa);
	color: var(--bk-cocoa);
}

.button--ghost:hover {
	background: var(--bk-cocoa);
	color: var(--bk-cream);
}

.button--link {
	padding: 0.85em 0;
	background: none;
	color: var(--bk-gold);
	text-decoration: underline;
}

.button--link:hover { background: none; transform: none; }

/* --- Ô tìm kiếm ----------------------------------------------------------- */

.search-form {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	max-width: 560px;
	padding: 0.25rem 0.25rem 0.25rem 1rem;
	background: var(--bk-surface);
	border: 1px solid var(--bk-line);
	border-radius: 999px;
}

.search-form__input {
	flex: 1;
	min-width: 0;
	padding: 0.6rem 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
}

.search-form__input:focus { outline: none; }

.search-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bk-cocoa);
	color: var(--bk-cream);
	cursor: pointer;
}

.search-form__submit:hover { background: var(--bk-gold); }

/* --- Form ----------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--bk-line);
	border-radius: var(--bk-radius);
	background: var(--bk-surface);
	color: inherit;
	font: inherit;
	/* 16px trở lên để iOS không tự phóng to khi focus vào input */
	font-size: max(1rem, 16px);
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--bk-gold);
	outline: none;
}

label { font-weight: 500; }

/* --- Icon ----------------------------------------------------------------- */

.icon {
	flex: none;
	vertical-align: middle;
}

/* --- Tiêu đề khối --------------------------------------------------------- */

.section__header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.section__title {
	margin: 0;
	font-size: clamp(1.5rem, 3.5vw, 2rem);
}

.section__subtitle {
	max-width: 52ch;
	margin: 0.35rem 0 0;
	color: var(--bk-cocoa-soft);
}

.section__link {
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.section__link:hover { text-decoration: underline; }

/* --- Breadcrumb ----------------------------------------------------------- */

.breadcrumb {
	padding-block: 0.9rem;
	color: var(--bk-cocoa-soft);
	font-size: 0.8125rem;
}

.breadcrumb a {
	color: inherit;
	text-decoration: none;
}

.breadcrumb a:hover { color: var(--bk-gold); text-decoration: underline; }

.breadcrumb__sep { margin-inline: 0.4rem; opacity: 0.5; }

/* --- Nhóm nút liên hệ nổi (Zalo / Facebook / gọi điện) --------------------- */

.floating-contact {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 40;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.floating-contact__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	color: #fff;
	box-shadow: var(--bk-shadow-lg);
	transition: transform 0.15s var(--bk-ease);
}

.floating-contact__btn:hover { transform: scale(1.08); color: #fff; }

/* Màu thương hiệu từng kênh — cố định, không lấy theo token của theme, vì
   khách quen mặt logo Zalo/Facebook theo đúng màu gốc. */
.floating-contact__btn--zalo     { background: #0068FF; }
.floating-contact__btn--facebook { background: #1877F2; }
.floating-contact__btn--phone    { background: var(--bk-gold); }
.floating-contact__btn--phone:hover { background: var(--bk-cocoa); }

/* Hotline đã hiện sẵn ở header trên desktop — ẩn riêng nút gọi trong nhóm
   nổi để đỡ trùng lặp, còn Zalo/Facebook thì vẫn nổi ở mọi kích thước màn
   hình vì hai kênh đó không có ở đâu khác. */
@media (min-width: 1024px) {
	.floating-contact__btn--phone { display: none; }
}

/* --- Nội dung bài viết ---------------------------------------------------- */

.entry-content {
	max-width: 760px;
	margin-inline: auto;
}

.entry-content > .alignwide {
	max-width: var(--bk-container);
}

.entry-content img { border-radius: var(--bk-radius); }

.entry-content blockquote {
	margin: 1.5rem 0;
	padding-left: 1.25rem;
	border-left: 3px solid var(--bk-gold);
	color: var(--bk-cocoa-soft);
	font-style: italic;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
}

.entry-content :is(th, td) {
	padding: 0.6rem;
	border-bottom: 1px solid var(--bk-line);
	text-align: left;
}
