/* =========================================================================
   Nông Sản Hôm Nay — giao diện (theo design.html)
   Phần 1: token + nền tảng   Phần 2: header + ticker   Phần 3: khối giá
   Phần 4: thẻ nhỏ            Phần 5: tin tức           Phần 6: footer
   ========================================================================= */

:root {
	--nsh-bg: #fafafa;
	--nsh-card: #ffffff;
	--nsh-ink: #14200f;
	--nsh-ink-2: #2f3a2a;
	--nsh-muted: #59634f;
	--nsh-line: #e5e8e0;
	--nsh-line-2: #eef0ea;
	--nsh-btn-line: #d7dcd1;
	--nsh-head-bg: #eaf5e6;
	--nsh-head-ink: #2e5a24;
	--nsh-row-hover: #f4faf2;
	--nsh-green: #137a04;
	--nsh-green-tint: #e7f4e4;
	--nsh-orange: #fa7101;
	--nsh-orange-ink: #c2540a;
	--nsh-orange-tint: #fff1e4;
	--nsh-up: #137a04;
	--nsh-down: #c4291c;
	--nsh-flat: #59634f;
	--nsh-wrap: 1240px;
	--nsh-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html body {
	background: var(--nsh-bg);
	color: var(--nsh-ink);
	font-family: var(--nsh-font);
}

html body h1:not(.entry-content *), html body h2:not(.entry-content *), html body h3:not(.entry-content *), html body h4:not(.entry-content *), html body h5:not(.entry-content *), html body h6:not(.entry-content *),
html body .nav > li > a, html body button, html body input, html body select, html body textarea {
	font-family: var(--nsh-font);
}

html body a:not(.entry-content a) { color: inherit; }
html body a:not(.entry-content a):hover { color: var(--nsh-green); }

.nsh-main a, .nsh-footer a, .nsh-ticker a { text-decoration: none; }

/* ---------- Header ---------- */
#header .header-wrapper { background: rgba(255, 255, 255, 0.95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--nsh-line); }
#header .header-bg-color, #header .header-bg-container { background: transparent; }
#header .header-main { border: 0; }
#header .header-main .header-inner { max-width: var(--nsh-wrap); }
#header .logo img { max-height: 58px; width: auto; }
#header .header-bottom { border-top: 1px solid var(--nsh-line-2); min-height: 0; }
#header .header-bottom .flex-row { min-height: 48px; }
#header .header-bottom .nav > li { margin: 0 13px; }
#header .header-bottom .nav > li > a {
	font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--nsh-ink-2);
	min-height: 48px; display: inline-flex; align-items: center; padding: 0; margin: 0;
}
#header .header-bottom .nav > li > a:hover { color: var(--nsh-green); }
#header .header-bottom .nav > li.current-menu-item > a,
#header .header-bottom .nav > li.active > a { font-weight: 700; color: var(--nsh-green); box-shadow: inset 0 -3px 0 var(--nsh-orange); }

.nsh-updated { display: inline-flex; align-items: center; gap: 0; font-size: 13px; color: var(--nsh-muted); margin-right: 18px; list-style: none; }
.nsh-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--nsh-orange); display: inline-block; flex: 0 0 auto; margin-right: 10px; }

.nsh-search-li { list-style: none; margin: 0; }
.nsh-search {
	margin: 0; width: 280px; max-width: 100%; display: flex; align-items: center; gap: 10px; color: var(--nsh-muted);
	background: var(--nsh-bg); border: 1px solid var(--nsh-line); border-radius: 12px; padding: 0 14px;
}
.nsh-search input[type='search'] {
	flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; margin: 0; height: auto;
	font-size: 14px; color: var(--nsh-ink); padding: 11px 0; border-radius: 6px;
}
.nsh-search input::placeholder { color: #6f786c; }
.nsh-search input:focus, .nsh-search input:focus-visible { outline: none; box-shadow: none; }

@media (max-width: 849px) {
	.nsh-updated { display: none; }
}

/* ---------- Ticker ---------- */
.nsh-ticker { background: var(--nsh-tick-bg, #fff); border-bottom: 1px solid var(--nsh-line); display: flex; align-items: center; overflow: hidden; }
.nsh-ticker__label {
	flex: 0 0 auto; position: relative; z-index: 1; background: var(--nsh-tick-label-bg, var(--nsh-orange)); color: var(--nsh-tick-label-ink, #2a1405);
	font-size: 12px; font-weight: 700; letter-spacing: 0.06em; padding: 0 16px; height: var(--nsh-tick-h, 44px); display: inline-flex; align-items: center;
}
.nsh-ticker__view { flex: 1; min-width: 0; overflow: hidden; }
.nsh-ticker__track { display: flex; width: max-content; animation: nsh-marq var(--nsh-tick-speed, 45s) linear infinite; }
.nsh-ticker.is-pausable .nsh-ticker__track:hover { animation-play-state: paused; }
.nsh-tick {
	flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 0 20px; height: var(--nsh-tick-h, 44px); font-size: 13px;
	white-space: nowrap; border-right: 1px solid var(--nsh-line-2); font-variant-numeric: tabular-nums;
}
.nsh-tick__name { font-weight: 600; color: var(--nsh-tick-name, #3b4636); }
.nsh-tick__price { font-weight: 700; }
.nsh-tick__chg { font-weight: 700; color: var(--nsh-flat); }
@keyframes nsh-marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .nsh-ticker__track { animation: none; } }

/* ---------- Khung + khối giá ---------- */
.nsh-main { max-width: var(--nsh-wrap); margin: 0 auto; padding: 36px 24px 72px; display: flex; flex-direction: column; gap: var(--nsh-main-gap, 56px); box-sizing: border-box; }
.nsh-section { display: flex; flex-direction: column; gap: 18px; }
.nsh-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.nsh-section__title { display: flex; align-items: center; gap: 14px; }
.nsh-section__text { display: flex; flex-direction: column; gap: 4px; }
.nsh-section__text > :first-child, .nsh-h2 { margin: 0; font-size: var(--nsh-h2-size, 28px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; color: var(--nsh-h2-ink, var(--nsh-ink)); }
.nsh-sub { font-size: var(--nsh-sub-size, 13px); color: var(--nsh-muted); }

.nsh-ico {
	width: 42px; height: 42px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
	background: var(--nsh-ico-bg, var(--nsh-green-tint)); color: var(--nsh-ico-ink, var(--nsh-green)); flex: 0 0 auto;
}
.nsh-ico--lg { width: 48px; height: 48px; border-radius: 16px; }
.is-orange .nsh-ico { background: var(--nsh-ico-bg, var(--nsh-orange-tint)); color: var(--nsh-ico-ink, var(--nsh-orange-ink)); }

.nsh-cta {
	font-size: 14px; font-weight: 600; border: 1px solid var(--nsh-btn-line); background: #fff; border-radius: 999px;
	padding: 0 18px; min-height: 42px; display: inline-flex; align-items: center; gap: 8px; color: var(--nsh-cta-ink, var(--nsh-ink));
}
.nsh-cta:hover { border-color: var(--nsh-green); }

.nsh-tables { display: flex; flex-wrap: wrap; gap: var(--nsh-tables-gap, 16px); align-items: stretch; }

.nsh-card { background: var(--nsh-card); border: 1px solid var(--nsh-line); border-radius: var(--nsh-radius, 20px); overflow: hidden; }
.nsh-tablecard { min-width: 0; display: flex; flex-direction: column; }
.nsh-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--nsh-line-2); }
.nsh-card__title { font-size: var(--nsh-title-size, 16px); font-weight: 700; color: var(--nsh-title-ink, inherit); }
.nsh-card__unit { font-size: 12px; color: var(--nsh-muted); }
.nsh-scroll { overflow-x: auto; flex: 1; display: flex; flex-direction: column; }

.nsh-table { font-size: var(--nsh-font-size, 15px); flex: 1; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.nsh-row { flex: 1; display: grid; gap: 12px; padding: var(--nsh-row-pad, 14px) 20px; border-top: 1px solid var(--nsh-line-2); align-items: center; transition: background 0.15s; }
.nsh-row:hover { background: var(--nsh-row-hover); }
.nsh-row--head { flex: 0 0 auto; padding: 11px 20px; background: var(--nsh-head-bg); border-top: 0; }
.nsh-row--head:hover { background: var(--nsh-head-bg); }
.nsh-row--head span { font-size: 12px; font-weight: 700; color: var(--nsh-head-ink); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.nsh-row span { white-space: nowrap; }
.nsh-row .is-left { text-align: left; }
.nsh-row .is-right { text-align: right; }
.nsh-row .is-strong { font-weight: 600; }
.nsh-row .is-num { font-weight: 700; color: var(--nsh-price-ink, inherit); }
.nsh-row .is-muted { color: #9aa394; }

.nsh-chg.is-up { color: var(--nsh-up); }
.nsh-chg.is-down { color: var(--nsh-down); }
.nsh-chg.is-flat, .nsh-chg.is-none { color: var(--nsh-flat); }
.nsh-tick__chg.is-up { color: var(--nsh-up); }
.nsh-tick__chg.is-down { color: var(--nsh-down); }

.nsh-empty { padding: 14px 18px; border: 1px dashed var(--nsh-btn-line); border-radius: 12px; color: var(--nsh-muted); font-size: 13px; }

@media (max-width: 549px) {
	.nsh-main { padding: 24px 16px 48px; gap: 40px; }
	.nsh-section__text h2, .nsh-h2 { font-size: 24px; }
}

/* ---------- Thẻ nhỏ ---------- */
.nsh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--nsh-cards-min, 360px), 100%), 1fr)); gap: var(--nsh-cards-gap, 16px); }
.nsh-cards.has-cols { grid-template-columns: repeat(var(--nsh-cards-cols), minmax(0, 1fr)); }
@media (max-width: 849px) { .nsh-cards.has-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 549px) { .nsh-cards.has-cols { grid-template-columns: 1fr; } }
.nsh-minicard { display: flex; flex-direction: column; }
.nsh-minicard__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px; }
.nsh-minicard__title { display: flex; align-items: center; gap: 12px; }
.nsh-minicard .nsh-section__text { gap: 2px; }
.nsh-minicard .nsh-section__text h2 { font-size: var(--nsh-title-size, 20px); line-height: 1.2; }
.nsh-minicard .nsh-sub { font-size: 12px; }
.nsh-circle {
	width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--nsh-btn-line); display: inline-flex;
	align-items: center; justify-content: center; color: var(--nsh-ink); flex: 0 0 auto;
}
.nsh-circle:hover { border-color: var(--nsh-green); }
/* Thẻ nhỏ: cột nhãn co giãn + xuống dòng, cột giá / thay đổi theo độ dài nội dung (khoảng giá dài không bị cắt). */
.nsh-row--card { grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 14px; }
.nsh-row--card.nsh-row--head { padding: 10px 20px; }
.nsh-row--card .is-left { white-space: normal; }

/* ---------- Tin tức ---------- */
.nsh-news__lead { flex: 1.3 1 460px; min-width: 0; display: flex; flex-direction: column; transition: border-color 0.2s, box-shadow 0.2s; }
.nsh-news__lead:hover { border-color: #a9d89f; box-shadow: 0 16px 32px -22px rgba(19, 122, 4, 0.45); }
.nsh-news__img { overflow: hidden; aspect-ratio: 16 / 9; background: var(--nsh-orange-tint); }
.nsh-news__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.nsh-news__lead:hover .nsh-news__img img { transform: scale(1.04); }
.nsh-news__body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.nsh-news__meta { font-size: 12px; color: var(--nsh-muted); }
.nsh-news__meta b { font-weight: 700; color: var(--nsh-orange-ink); }
.nsh-news__t { margin: 0; font-size: var(--nsh-lead-size, 22px); line-height: 1.32; font-weight: 700; letter-spacing: -0.01em; transition: color 0.2s; }
.nsh-news__lead:hover .nsh-news__t, .nsh-news__item:hover .nsh-news__t2 { color: var(--nsh-green); }
.nsh-news__side { flex: 1 1 440px; min-width: 0; padding: 6px 14px; display: flex; flex-direction: column; }
.nsh-news__item { flex: 1; display: flex; gap: 14px; align-items: center; padding: 10px 8px; border-radius: 14px; }
.nsh-news__item:hover { background: var(--nsh-row-hover); }
.nsh-news__thumb { flex: 0 0 104px; width: 104px; height: 70px; border-radius: 12px; overflow: hidden; background: var(--nsh-green-tint); }
.nsh-news__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nsh-news__txt { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.nsh-news__t2 { font-size: 15px; line-height: 1.4; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.2s; }

/* ---------- Footer ---------- */
.nsh-footer { background: var(--nsh-foot-bg, #fff); border-top: 1px solid var(--nsh-line); color: var(--nsh-foot-ink, inherit); }
.nsh-footer__in { max-width: var(--nsh-wrap); margin: 0 auto; padding: 44px 24px 28px; display: flex; flex-direction: column; gap: 28px; box-sizing: border-box; }
.nsh-footer__top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.5fr) minmax(0, 0.75fr); gap: 32px 56px; align-items: start; }
.nsh-footer__brand { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.nsh-footer__brand img { height: var(--nsh-logo-h, 76px); width: auto; align-self: flex-start; }
.nsh-footer__brand p { margin: 0; font-size: 14px; line-height: 1.7; color: #4a5445; }
.nsh-footer__col { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nsh-footer__col--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; min-width: 0; }
.nsh-footer__h { font-size: 13px; font-weight: 700; color: var(--nsh-foot-h, var(--nsh-orange-ink)); margin-bottom: 6px; }
.nsh-footer__col a { font-size: 14px; font-weight: 500; min-height: 36px; display: inline-flex; align-items: center; }
.nsh-footer__notice { background: var(--nsh-foot-note, #f8f9f5); border: 1px solid var(--nsh-line-2); border-radius: 16px; padding: 16px 20px; font-size: 13px; line-height: 1.7; color: #4a5445; }
.nsh-footer__notice strong { color: var(--nsh-ink); }
.nsh-footer__copy { font-size: 13px; color: var(--nsh-muted); }
.nsh-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.nsh-social { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.nsh-social__a { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--nsh-line); background: #fff; color: #4a5445; display: inline-flex; align-items: center; justify-content: center; transition: color 0.15s, border-color 0.15s, background 0.15s; }
/* cần độ ưu tiên cao hơn rule toàn site "html body a:hover { color: green }" — nếu không icon xanh trên nền xanh (mất hình) */
html body .nsh-footer .nsh-social a.nsh-social__a { color: #4a5445; }
html body .nsh-footer .nsh-social a.nsh-social__a:hover, html body .nsh-footer .nsh-social a.nsh-social__a:focus-visible { color: #fff; background: var(--nsh-green); border-color: var(--nsh-green); }
.nsh-social__a svg { display: block; }
@media (max-width: 549px) { .nsh-footer__bottom { flex-direction: column; align-items: flex-start; } .nsh-social { margin-left: 0; justify-content: flex-start; } }

/* Flatsome: bỏ khoảng trắng thừa quanh footer dùng UX Block */
#footer .nsh-footer { margin: 0; }
.footer-wrapper { background: #fff; }

/* ---------- Tuỳ chọn bổ sung của element ---------- */
.nsh-card.is-striped .nsh-row:not(.nsh-row--head):nth-child(even) { background: rgba(20, 32, 15, 0.025); }
.nsh-section.is-center .nsh-section__head { justify-content: center; text-align: center; flex-direction: column; align-items: center; }
.nsh-section.is-center .nsh-section__title { flex-direction: column; text-align: center; }
.nsh-section.cta-solid .nsh-cta { background: var(--nsh-cta-bg, var(--nsh-green)); border-color: var(--nsh-cta-bg, var(--nsh-green)); color: var(--nsh-cta-ink, #fff); }
.nsh-section .nsh-cta { background: var(--nsh-cta-bg, #fff); }
.nsh-row a { color: inherit; }
.nsh-row a:hover { color: var(--nsh-green); }

/* Xem trước trong UX Builder: khung cha + dòng con dạng chip */
.nsh-bldr__rows { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.nsh-bldr__row { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; background: var(--nsh-head-bg); border-radius: 10px; font-size: 13px; }
.nsh-bldr__row span { color: var(--nsh-muted); font-size: 12px; }

@media (max-width: 849px) { .nsh-footer__top { grid-template-columns: 1fr 1fr; } .nsh-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 549px) { .nsh-footer__top { grid-template-columns: 1fr; } }

/* ---------- Sub menu (dropdown) của header ---------- */
#header .nav-dropdown {
	border: 1px solid var(--nsh-line); border-radius: 14px; padding: 8px; min-width: 220px; background: #fff;
	box-shadow: 0 18px 40px -18px rgba(20, 32, 15, 0.35); margin-top: 0;
}
#header .nav-dropdown-has-arrow li.has-dropdown:after, #header .nav-dropdown-has-arrow li.has-dropdown:before { display: none; }
#header .nav-dropdown > li > a, #header .header-bottom .nav-dropdown > li > a {
	min-height: 40px; padding: 0 14px; margin: 0; border-radius: 10px; display: flex; align-items: center; box-shadow: none;
	font-size: 14px; font-weight: 500; color: var(--nsh-ink-2); text-transform: none; letter-spacing: 0; border: 0;
}
#header .nav-dropdown > li > a:hover, #header .nav-dropdown > li.current-menu-item > a { background: var(--nsh-row-hover); color: var(--nsh-green); }
#header .nav-dropdown > li.current-menu-item > a { font-weight: 700; }
#header .nav-dropdown li + li { border-top: 0; }
#header .nav > li.has-dropdown > a .icon-angle-down { margin-left: 4px; opacity: 0.55; font-size: 0.9em; }
/* menu mobile (off-canvas) */
#main-menu .sidebar-menu .nav > li > a, .off-canvas .nav > li > a { font-size: 15px; font-weight: 600; color: var(--nsh-ink-2); text-transform: none; letter-spacing: 0; }
/* menu-item cấp 1 trong menu mobile/tablet: đệm trên-dưới của thẻ a 15px → 12px */
@media (max-width: 849px) {
	#main-menu .nav-sidebar.nav-vertical > li > a, .off-canvas .nav-vertical > li > a { padding-top: 12px; padding-bottom: 12px; }
}
#main-menu .sidebar-menu .nav > li.current-menu-item > a { color: var(--nsh-green); }
#main-menu .sidebar-menu .children a, #main-menu .nav-sidebar .sub-menu a { font-size: 14px; font-weight: 500; text-transform: none; }

/* ---------- Breadcrumb Rank Math — 1 bộ CSS dùng chung (hero archive / bài viết / trang + landing giá) ---------- */
.rank-math-breadcrumb { --nsh-crumb-bg: #fff; align-self: flex-start; display: flex; max-width: 100%; min-width: 0; margin: 0; }
.rank-math-breadcrumb p {
	margin: 0; max-width: 100%; min-width: 0; overflow: hidden;
	display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
	padding: 8px 18px; background: var(--nsh-crumb-bg); border: 1px solid var(--nsh-line); border-radius: 999px;
	box-shadow: 0 1px 2px rgba(20, 32, 15, 0.04);
	font-size: 13px; line-height: 1.3; color: var(--nsh-muted);
}
.rank-math-breadcrumb a { flex: 0 0 auto; color: var(--nsh-muted); font-weight: 500; white-space: nowrap; }
.rank-math-breadcrumb p > a:first-child { color: #2c382f; font-weight: 600; }
.rank-math-breadcrumb a:hover { color: var(--nsh-green); }
.rank-math-breadcrumb .last { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--nsh-green); font-weight: 700; }
.rank-math-breadcrumb .separator {
	flex: 0 0 auto; font-size: 0; width: 12px; height: 12px; display: inline-block;
	background: no-repeat center / 12px 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa394' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
}
/* trong hero trang (nền trắng) pill dùng nền xám nhạt của theme; ở landing (nền xám) pill nền trắng để nổi lên */
.wt-hero-page .rank-math-breadcrumb { --nsh-crumb-bg: var(--wt-bg, #f4f6f3); }
.nsh-crumbs { display: flex; }
@media (max-width: 549px) {
	.rank-math-breadcrumb p { padding: 7px 14px; gap: 6px; }
	.rank-math-breadcrumb .last { max-width: 42vw; }
}

/* điện thoại: bảng giá gọn hơn một chút (đệm giảm nhẹ, chữ 15px → 14px). Đặt cuối file để thắng các luật nền ở trên. */
@media (max-width: 549px) {
	.nsh-table { font-size: min(var(--nsh-font-size, 15px), 14px); }
	.nsh-card__head { padding: 16px; }
	/* cột co giãn theo dữ liệu: bảng dạng table, cột rộng bằng ô dài nhất, cột đầu (tên) nhận phần dư; các hàng thẳng cột dọc */
	.nsh-table { display: table; width: 100%; min-width: 0 !important; border-spacing: 0; }
	.nsh-row { display: table-row; padding: 0; }
	.nsh-row > span { display: table-cell; vertical-align: middle; padding: calc(var(--nsh-row-pad, 14px) - 2px) 0 calc(var(--nsh-row-pad, 14px) - 2px) 20px; border-top: 1px solid var(--nsh-line-2); }
	.nsh-row--head > span { padding-top: 9px; padding-bottom: 9px; border-top: 0; white-space: nowrap; }
	.nsh-row > span:first-child { width: 100%; min-width: 120px; padding-left: 16px; white-space: normal; }
	.nsh-row > span:last-child { padding-right: 16px; }
}
