/* ==========================================================================
   Nghĩa Nhân Agri – product listing (F04)
   Loaded on the shop, product category and product search pages, after main.css.
   ========================================================================== */

/* ---------- Product listing: shop, categories, search (F04) ---------- */

.nna-shop { padding-top: 16px; padding-bottom: 48px; }

.nna-shop__head { margin-bottom: 20px; }
.nna-shop__title {
	margin: 0;
	color: var(--nna-primary-dark);
	font-size: 26px;
	line-height: 1.3;
}
.nna-shop__desc { margin-top: 8px; color: var(--nna-muted); font-size: 15px; }
.nna-shop__desc > :last-child { margin-bottom: 0; }

.nna-shop__layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}

/* Sidebar */

.nna-shop__sidebar-head { display: none; }
.nna-shop__sidebar-foot { padding-top: 4px; }
.nna-shop__overlay { display: none; }

.nna-filter {
	margin-bottom: 16px;
	padding: 14px 16px;
	border: 1px solid var(--nna-border);
	border-radius: var(--nna-radius);
	background: var(--nna-white);
}
.nna-filter__title {
	margin: 0 0 8px;
	color: var(--nna-primary-dark);
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
}
.nna-filter__list { margin: 0; padding: 0; list-style: none; }

/* Category list: the home page menu rows (main.css .nna-catlist), edge to edge in the card. */
.nna-filter > .nna-catlist { margin: 0 -16px; }
.nna-filter .nna-catlist a { padding: 7px 16px; }
.nna-filter .nna-catlist .nna-catlist a { padding-left: 32px; }
.nna-filter .nna-catlist li + li { border-top: 1px solid var(--nna-border); }
.nna-filter__list .nna-filter__list { padding-left: 14px; }

.nna-filter__option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	color: var(--nna-text);
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
}
.nna-filter__option > span:nth-child(2) { flex: 1; }
.nna-filter__option:hover { color: var(--nna-primary); }
.nna-filter__count {
	flex: none;
	min-width: 26px;
	padding: 1px 6px;
	border-radius: 999px;
	background: var(--nna-soft);
	color: var(--nna-muted);
	font-size: 12px;
	text-align: center;
}

/* Radio-style mark (price) / checkbox-style mark (attributes). */
.nna-filter__check {
	flex: none;
	width: 16px;
	height: 16px;
	border: 2px solid var(--nna-border);
	border-radius: 50%;
	transition: border-color .15s, box-shadow .15s;
}
.nna-filter__check--box { border-radius: 4px; }
.nna-filter__option:hover .nna-filter__check { border-color: var(--nna-primary); }
.nna-filter__option.is-active { color: var(--nna-primary); font-weight: 600; }
.nna-filter__option.is-active .nna-filter__check {
	border-color: var(--nna-primary);
	background: var(--nna-primary);
	box-shadow: inset 0 0 0 2px var(--nna-white);
}

.nna-filter__clear {
	display: inline-block;
	color: var(--nna-danger);
	font-size: 14px;
	font-weight: 600;
}

/* Toolbar: result count + sorting */

.nna-shop__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin-bottom: 16px;
}
.nna-shop__toolbar .woocommerce-result-count { margin: 0 auto 0 0; color: var(--nna-muted); font-size: 14px; }

.nna-shop__filter-btn {
	position: relative;
	display: none;
	align-items: center;
	gap: 6px;
	height: 40px;
	padding: 0 14px;
	border: 1px solid var(--nna-border);
	border-radius: 6px;
	background: var(--nna-white);
	color: var(--nna-text);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.nna-shop__filter-dot {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--nna-accent);
}

.nna-ordering {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}
.nna-ordering label { margin: 0; color: var(--nna-muted); font-size: 14px; white-space: nowrap; }
.nna-ordering select { --theme-form-field-height: 40px; min-width: 190px; height: 40px; font-size: 14px; }

/* Grid: 4 columns desktop, 3 tablet, 2 mobile. */
.nna-products--shop { --nna-cols: 4; }
@media (max-width: 1099.98px) {
	.nna-products--shop { --nna-cols: 3; }
}
@media (max-width: 599.98px) {
	.nna-products--shop { --nna-cols: 2; }
}

.nna-pagination { margin-top: 32px; }
.nna-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
}
.nna-pagination li { margin: 0; }
.nna-pagination li > .page-numbers {
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--nna-border);
	border-radius: 6px;
	background: var(--nna-white);
	color: var(--nna-text);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: border-color .15s, color .15s, background-color .15s;
}
.nna-pagination li > a.page-numbers:hover { border-color: var(--nna-primary); color: var(--nna-primary); }
.nna-pagination li > .page-numbers.current { border-color: var(--nna-primary); background: var(--nna-primary); color: var(--nna-white); }
.nna-pagination li > .page-numbers.dots { border-color: transparent; background: none; }
.nna-pagination .prev .nna-icon { transform: rotate(180deg); }

.nna-shop__empty {
	padding: 48px 20px;
	border: 1px dashed var(--nna-border);
	border-radius: var(--nna-radius);
	background: var(--nna-soft);
	text-align: center;
}
.nna-shop__empty-title { margin: 0 0 6px; color: var(--nna-text); font-size: 18px; font-weight: 700; }
.nna-shop__empty .button { margin-top: 10px; }

@media (min-width: 850px) and (max-width: 1099.98px) {
	.nna-shop__layout { grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
}

/* Mobile: sidebar becomes a drawer opened by the "Lọc" button. */
@media (max-width: 849.98px) {
	.nna-shop { padding-top: 12px; }
	.nna-shop__title { font-size: 21px; }
	.nna-shop__layout { display: block; }

	.nna-shop__filter-btn { display: inline-flex; }

	.nna-shop__sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 100001;
		display: flex;
		flex-direction: column;
		width: min(320px, 86vw);
		overflow: hidden;
		background: var(--nna-white);
		box-shadow: var(--nna-shadow);
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform .25s, visibility 0s .25s;
	}
	.nna-shop__sidebar.is-open {
		transform: none;
		visibility: visible;
		transition: transform .25s;
	}
	.nna-shop__sidebar-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 10px 8px 10px 16px;
		border-bottom: 1px solid var(--nna-border);
	}
	.nna-shop__sidebar-title { margin: 0; font-size: 17px; font-weight: 700; }
	.nna-shop__sidebar-close {
		display: grid;
		place-items: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		background: none;
		color: var(--nna-text);
		cursor: pointer;
	}
	.nna-shop__sidebar-body { flex: 1; overflow-y: auto; padding: 12px; }
	.nna-shop__sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--nna-border); }
	.nna-filter__option { padding: 9px 0; }

	.nna-shop__overlay {
		position: fixed;
		inset: 0;
		z-index: 100000;
		display: block;
		background: rgba(0, 0, 0, .45);
		opacity: 0;
		transition: opacity .25s;
	}
	.nna-shop__overlay.is-open { opacity: 1; }
	.nna-shop__overlay[hidden] { display: none; }
}

@media (max-width: 599.98px) {
	.nna-shop__toolbar .woocommerce-result-count { order: 3; width: 100%; }
	.nna-ordering { flex: 1; }
	.nna-ordering label { display: none; }
	.nna-ordering select { flex: 1; min-width: 0; }
}
