/*
Theme Name: Vị Bánh Vàng Son
Theme URI: https://vibanhvangson.vn
Author: Vị Bánh Vàng Son
Description: Theme riêng cho website Vị Bánh Vàng Son by Madam Thu – xưởng bánh sỉ Cần Thơ. Block theme nhẹ, không cần page builder; sửa nội dung trực tiếp bằng trình soạn thảo khối của WordPress.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: vbvs
*/

/* ---------- Nền tảng ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
.wp-site-blocks { padding-top: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }
main.wp-block-group { margin-top: 0; }
.vb-nowrap { white-space: nowrap; }
.vb-ib { display: inline-block; }

/* Dòng chữ nhỏ phía trên tiêu đề */
.vb-eyebrow { font-size: 13px !important; letter-spacing: .18em; font-weight: 600; color: var(--wp--preset--color--xanh); text-transform: uppercase; margin: 0; }
.vb-note { font-size: 14px; color: var(--wp--preset--color--xanh); }
.vb-muted { color: var(--wp--preset--color--chu-phu); }

/* ---------- Header cố định ---------- */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: 0; z-index: 100; }
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; } }
.vb-header { background: #fff; border-bottom: 1px solid var(--wp--preset--color--vien); box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.vb-header__inner { max-width: 1200px; margin: 0 auto; min-height: 74px; gap: 16px; }
.vb-logo img { height: 50px; width: auto; display: block; }
.vb-header .wp-block-navigation { font-size: 15px; font-weight: 600; gap: 24px; }
.vb-header .wp-block-navigation-item__content { color: var(--wp--preset--color--chu); padding: 8px 0; border-bottom: 2px solid transparent; }
.vb-header .wp-block-navigation-item__content:hover,
.vb-header .current-menu-item > .wp-block-navigation-item__content,
.vb-header .current-menu-ancestor > .wp-block-navigation-item__content { color: var(--wp--preset--color--cam); border-bottom-color: var(--wp--preset--color--cam); }
/* Menu sổ xuống Sản phẩm */
.vb-header .wp-block-navigation__submenu-container { min-width: 300px !important; background: #fff !important; border: 1px solid var(--wp--preset--color--vien) !important; border-radius: 10px; box-shadow: 0 14px 32px rgba(0,0,0,.14); padding: 8px !important; }
.vb-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 10px 12px !important; border-radius: 8px; border-bottom: 0 !important; display: flex; flex-direction: column; }
.vb-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { background: var(--wp--preset--color--kem-dam); }
.vb-header .wp-block-navigation-item__description { font-weight: 400; font-size: 13px; opacity: .75; }
.vb-call { display: none; }
.vb-call a { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }

@media (max-width: 1180px) {
	.vb-header__inner { min-height: 64px; flex-wrap: nowrap !important; }
	.vb-header .wp-block-navigation { order: -1; flex: 0 0 44px; }
	.vb-logo { flex: 1 1 auto; display: flex; justify-content: center; }
	.vb-logo img { height: 44px; }
	.vb-cta { display: none !important; }
	.vb-call { display: block; flex: 0 0 44px; }
	/* Dùng nút 3 gạch cho mọi màn hình dưới 1180px (mặc định WordPress chỉ dưới 600px). */
	.vb-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.vb-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
	.vb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { display: flex !important; }
	.vb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { position: static !important; opacity: 1 !important; visibility: visible !important; height: auto !important; width: auto !important; min-width: 0 !important; }
	.vb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-icon { display: none !important; }
}
/* Menu điện thoại phủ toàn màn hình (nút 3 gạch) */
.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg { width: 28px; height: 28px; }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--kem) !important; padding: 72px 24px 32px !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { left: 16px !important; right: auto !important; top: 16px !important; width: 44px; height: 44px; align-items: center; justify-content: center; background: #fff; border-radius: 10px; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: stretch !important; gap: 0 !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 0 !important; align-items: stretch !important; width: 100%; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { border-bottom: 1px solid var(--wp--preset--color--vien); align-items: flex-start !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > .wp-block-navigation-item__content { font-family: var(--wp--preset--font-family--heading); font-size: 26px; font-weight: 700; padding: 14px 0 !important; border: 0 !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { border: 0 !important; border-left: 2px solid var(--wp--preset--color--cam) !important; box-shadow: none !important; background: transparent !important; padding: 0 0 12px 14px !important; margin-bottom: 8px; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item { border: 0; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-family: var(--wp--preset--font-family--body) !important; font-size: 16px !important; font-weight: 600 !important; padding: 8px 0 !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__description { display: none; }

/* ---------- Khối dùng chung ---------- */
.vb-sec { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px); }
.vb-sec-sm { padding-top: clamp(36px, 5vw, 56px); padding-bottom: clamp(36px, 5vw, 56px); }
.vb-white { background: #fff; border-top: 1px solid var(--wp--preset--color--vien); border-bottom: 1px solid var(--wp--preset--color--vien); }
.vb-lead { font-size: 17px; color: var(--wp--preset--color--chu-phu); max-width: 780px; }
.vb-italic { font-family: var(--wp--preset--font-family--heading); font-style: italic; font-weight: 400; font-size: clamp(18px, 2vw, 22px); color: var(--wp--preset--color--chu-phu); }
.vb-card__body { padding: 18px 20px 22px; }
.vb-card__body > * + * { margin-top: 10px; }
.vb-card__body h3, .vb-card h3 { color: var(--wp--preset--color--chu); }
.vb-pad { padding: 20px 22px; }
.vb-cards { gap: 20px; }
.vb-collage { gap: 14px; align-items: stretch; }
.vb-collage > .wp-block-image { flex: 3 1 0; margin: 0; }
.vb-collage > .wp-block-image img { height: clamp(300px, 36vw, 480px); width: 100%; object-fit: cover; }
.vb-collage__side { flex: 2 1 0; display: flex; flex-direction: column; gap: 14px; }
.vb-collage__side .wp-block-image { margin: 0; flex: 1 1 0; }
.vb-collage__side .wp-block-image img { height: calc((clamp(300px, 36vw, 480px) - 14px) / 2); width: 100%; object-fit: cover; }
.vb-band__title { font-size: clamp(24px, 3vw, 32px) !important; }
.vb-band__btn { display: flex; justify-content: flex-end; }
@media (max-width: 781px) { .vb-band__btn { justify-content: flex-start; } }
.vb-contact-band { background: var(--wp--preset--gradient--cam-vang); color: #FFF6EC; }
.vb-contact-band h2 { color: #fff; }
.vb-contact-band a { color: #fff; font-weight: 700; }
.vb-quote { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: clamp(24px, 3vw, 32px); line-height: 1.35; color: var(--wp--preset--color--cam); }
.vb-num-big { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 40px; line-height: 1; color: var(--wp--preset--color--xanh); margin: 0; }
.vb-addr { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid #F0D3B6; border-radius: 16px; padding: 14px 16px; text-decoration: none; color: inherit; }
.vb-addr__ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--wp--preset--color--kem-dam); color: var(--wp--preset--color--cam); display: flex; align-items: center; justify-content: center; }
.vb-btn-zalo .wp-block-button__link { background: #0068FF; }
.vb-card__title-cam { color: var(--wp--preset--color--cam) !important; font-family: var(--wp--preset--font-family--body) !important; font-size: 18px !important; }
.vb-right { text-align: right; }
@media (max-width: 781px) { .vb-right { text-align: left; } }
.vb-split { gap: clamp(28px, 5vw, 56px) !important; }
.vb-other a { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--wp--preset--color--vien); border-radius: 16px; padding: 12px; text-decoration: none; color: var(--wp--preset--color--chu); font-weight: 700; }
.vb-other img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.vb-banner { background: var(--wp--preset--color--kem-dam); }
.vb-breadcrumb { font-size: 13px; color: var(--wp--preset--color--xanh); margin: 0; }
.vb-breadcrumb a { color: var(--wp--preset--color--xanh); }
.vb-band { background: var(--wp--preset--gradient--cam-vang); color: #fff; }
.vb-band h2, .vb-band p { color: #fff; }
.vb-band .wp-block-button__link { background: #fff !important; color: var(--wp--preset--color--cam) !important; }
.is-style-outline > .wp-block-button__link, .wp-block-button.is-style-outline .wp-block-button__link { border: 1.5px solid var(--wp--preset--color--cam); color: var(--wp--preset--color--cam); background: transparent; padding: 13px 22px; }
.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--kem-dam); color: var(--wp--preset--color--cam-dam); }
.vb-card { background: #fff; border: 1px solid var(--wp--preset--color--vien); border-radius: 16px; }
.vb-card .wp-block-image img, .vb-card figure img { border-radius: 0; }
.vb-cover img { width: 100%; object-fit: cover; }
.vb-h-sm img { height: clamp(110px, 12vw, 160px); }
.vb-h-md img { height: clamp(220px, 26vw, 340px); }
.vb-h-lg img { height: clamp(260px, 32vw, 440px); }
.vb-h-card img { height: 210px; }
.vb-link-more a { font-weight: 700; text-decoration: none; }
.vb-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.vb-check li { position: relative; padding-left: 34px; color: var(--wp--preset--color--chu-phu); }
.vb-check li::before { content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; background: var(--wp--preset--color--cam); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; }
.vb-chips { gap: 10px; }
.vb-chips .wp-block-button__link { background: #fff; color: var(--wp--preset--color--cam); border: 1px solid #F0D3B6; border-radius: 999px; padding: 10px 16px; font-size: 14px; font-weight: 600; }
.vb-chips .wp-block-button__link:hover { background: var(--wp--preset--color--cam); color: #fff; }

/* ---------- Giá trị cốt lõi ---------- */
.vb-values { position: relative; overflow: hidden; background: linear-gradient(180deg, #FFF1E3 0%, #FFE6CC 100%); }
.vb-values::before, .vb-values::after { content: ""; position: absolute; background: url("assets/images/logo-icon.webp") center/contain no-repeat; opacity: .08; pointer-events: none; }
.vb-values::before { width: 420px; height: 420px; left: -140px; top: -120px; }
.vb-values::after { width: 360px; height: 360px; right: -110px; bottom: -130px; }
.vb-values > * { position: relative; }
.vb-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.vb-val { flex: 1 1 190px; box-sizing: border-box; min-width: 0; position: relative; overflow: hidden; background: #fff; border: 1px solid var(--wp--preset--color--vien); border-radius: 22px; padding: 28px 22px 32px; box-shadow: 0 10px 30px rgba(242,117,33,.10); transition: transform .35s ease, box-shadow .35s ease; }
.vb-val::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 36%; background: linear-gradient(90deg, #F1C120, #F27521); transition: width .45s ease; }
.vb-val:hover { transform: translateY(-8px); box-shadow: 0 18px 40px rgba(242,117,33,.2); }
.vb-val:hover::after { width: 100%; }
.vb-val h3 { color: var(--wp--preset--color--chu); margin-top: 18px; font-size: 20px; }
.vb-val p { font-size: 14.5px; color: var(--wp--preset--color--chu-phu); margin-top: 10px; }
.vb-ico { width: 62px; height: 62px; border-radius: 18px; background: linear-gradient(135deg, #F1C120 0%, #F27521 55%, #F2550F 100%); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(242,117,33,.35); transform: rotate(-6deg); transition: transform .35s ease; }
.vb-val:hover .vb-ico { transform: rotate(0) scale(1.06); }
.vb-num { position: absolute; top: 10px; right: 16px; font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 64px; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px #F6C9A3; }
@media (min-width: 1100px) { .vb-val:nth-child(even) { margin-top: 36px; } }
@media (max-width: 640px) { .vb-val { flex-basis: 100%; } .vb-values::before, .vb-values::after { display: none; } }

/* ---------- Danh sách bài viết ---------- */
.vb-posts .wp-block-post { background: #fff; border: 1px solid var(--wp--preset--color--vien); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.vb-posts .wp-block-post-featured-image img { border-radius: 0; height: 200px; width: 100%; object-fit: cover; }
.vb-posts .wp-block-post-featured-image { margin: 0; }
.vb-posts .wp-block-post-title a { color: var(--wp--preset--color--chu); text-decoration: none; }
.vb-posts .wp-block-post-terms a { color: var(--wp--preset--color--xanh); font-weight: 700; font-size: 13px; text-decoration: none; }
.vb-single h2, .vb-single h3 { margin-top: 1.6em; }

/* ---------- Form báo giá ---------- */
.vb-form { display: flex; flex-wrap: wrap; gap: 14px; background: var(--wp--preset--color--kem); border: 1px solid #F0D3B6; border-radius: 16px; padding: clamp(20px, 3vw, 32px); box-sizing: border-box; color: var(--wp--preset--color--chu); }
.vb-form h3 { flex: 1 1 100%; margin: 0; font-size: 26px; }
.vb-form label { flex: 1 1 200px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.vb-form label.vb-full { flex-basis: 100%; }
.vb-form input, .vb-form select, .vb-form textarea { font: inherit; font-size: 16px; font-weight: 400; padding: 12px 14px; border: 1px solid #E9CDB0; border-radius: 8px; background: #fff; color: inherit; width: 100%; box-sizing: border-box; }
.vb-form input:focus, .vb-form select:focus, .vb-form textarea:focus { outline: 2px solid var(--wp--preset--color--cam); outline-offset: 1px; }
.vb-form button { flex: 1 1 100%; font: inherit; font-weight: 700; background: var(--wp--preset--color--cam); color: #fff; border: 0; border-radius: 8px; padding: 15px; cursor: pointer; }
.vb-form button:hover { background: var(--wp--preset--color--cam-dam); }
.vb-form .vb-hp { position: absolute; left: -9999px; }
.vb-form-msg { flex: 1 1 100%; padding: 12px 14px; border-radius: 8px; font-weight: 600; }
.vb-form-msg.ok { background: #E3F1E8; color: var(--wp--preset--color--xanh); }
.vb-form-msg.err { background: #FDE7E2; color: var(--wp--preset--color--cam-dam); }

/* ---------- Footer ---------- */
.vb-footer { background: var(--wp--preset--color--xanh); color: #E3F1E8; }
.vb-footer a { color: #E3F1E8; }
.vb-footer .vb-fhead { color: var(--wp--preset--color--vang); font-weight: 700; font-size: 15px; margin: 0; }
.vb-footer .vb-flinks a { display: block; padding: 6px 0; text-decoration: none; }
.vb-footer .vb-flinks a:hover { color: var(--wp--preset--color--vang); }
.vb-footer .vb-accent a, .vb-footer a.vb-accent { color: var(--wp--preset--color--vang); font-weight: 600; }
.vb-social { display: flex; gap: 12px; }
.vb-social img { width: 42px; height: 42px; display: block; }
.vb-map { position: relative; margin-top: 12px; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10; background: #E8E8E8; }
.vb-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vb-copy { border-top: 1px solid rgba(255,255,255,.14); text-align: center; font-size: 13px; opacity: .85; padding: 16px 0; margin-top: 30px !important; }
.vb-footer { padding-top: 48px; }
.vb-footer__cols { gap: 32px !important; }
.vb-footer p { font-size: 14px; line-height: 1.7; }
.vb-flogo { margin: 0; }
.vb-flogo img { width: 190px; max-width: 70%; border-radius: 0 !important; }
.vb-brandline { font-size: clamp(16px, 4.4vw, 26px) !important; }
.vb-thumbs { gap: 12px; margin-top: 12px; }
.vb-thumbs .wp-block-image { flex: 1 1 0; margin: 0; }
.vb-collage > .vb-offset { margin-top: 36px; }
.vb-narrow { max-width: 820px; margin-left: auto !important; margin-right: auto !important; }

/* ---------- Nút nổi Gọi · Zalo · Messenger (PC và điện thoại giống nhau) ---------- */
.vb-float { position: fixed; right: 12px; bottom: 96px; display: flex; flex-direction: column; gap: 12px; z-index: 90; }
.vb-float a { width: 52px; height: 52px; border-radius: 50%; background: var(--wp--preset--color--cam); color: #fff; display: flex; align-items: center; justify-content: center; text-decoration: none; font-family: Arial, sans-serif; font-weight: 700; font-size: 14px; box-shadow: 0 6px 16px rgba(0,0,0,.22); transition: transform .2s ease; }
.vb-float a:hover { transform: scale(1.08); color: #fff; }
@media (max-width: 820px) {
	.vb-float { bottom: 20px; right: 10px; gap: 8px; }
	.vb-float a { width: 44px; height: 44px; }
}

/* ---------- Hiệu ứng xuất hiện khi cuộn (CSS thuần, không JS) ---------- */
@keyframes vbRise { from { opacity: 0; translate: 0 32px; } to { opacity: 1; translate: 0 0; } }
@keyframes vbImg { from { opacity: 0; translate: 0 24px; scale: .97; } to { opacity: 1; translate: 0 0; scale: 1; } }
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		main :is(h1, h2, h3, p, .wp-block-buttons, .vb-val, .vb-card, .vb-form, .wp-block-post) { animation: vbRise linear both; animation-timeline: view(); animation-range: entry 5% entry 45%; }
		main .wp-block-image { animation: vbImg linear both; animation-timeline: view(); animation-range: entry 0% entry 50%; }
		main :is(.vb-val, .vb-card, .wp-block-post, .vb-form) :is(h3, p, .wp-block-image, .wp-block-buttons) { animation: none; }
	}
}
