/* ============================================================
 * Newzon — Catalogue / Product Listing (PLP) redesign
 * Loaded only on shop + product taxonomy archives.
 * Brand: primary #135289, accent green #009245.
 * ============================================================ */

/* Hide Shoptimizer's "Questions? Request a Call Back" floating button
   (it overlaps the WhatsApp float on product pages). */
.call-back-feature { display: none !important; }

/* Stop the off-canvas panels (mobile cart drawer .shoptimizer-mini-cart-wrap +
   mobile menu .col-full-nav), which are position:fixed just off the right/left
   edge, from creating horizontal page scroll on mobile. Nothing in the theme
   clips them (html/body/#page are overflow-x:visible). `clip` clips without
   creating a scroll container, so position:sticky keeps working. */
html { overflow-x: clip; }
body { overflow-x: clip; }

:root {
	--newzon-blue: #135289;
	--newzon-blue-dark: #0e3f6b;
	--newzon-green: #009245;
	--newzon-ink: #111827;
	--newzon-muted: #6b7280;
	--newzon-line: #e5e7eb;
	--newzon-bg: #f7f8fa;
	--newzon-radius: 3px;
}

/* ---------- Page heading + intro ---------- */
.woocommerce .page-header .woocommerce-products-header__title,
.woocommerce-page .page-header .woocommerce-products-header__title {
	font-weight: 700;
	color: var(--newzon-ink);
}

.term-description,
.woocommerce-product-loop-description,
.woocommerce-archive-description {
	color: #4b5563;
	font-size: 15px;
	line-height: 1.6;
}

/* "Read more" clamp for long category intros */
.newzon-clamp {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.newzon-readmore {
	background: none;
	border: 0;
	color: var(--newzon-blue);
	font-weight: 600;
	cursor: pointer;
	padding: 0 0 0 4px;
	font-size: 14px;
}

/* ---------- Results toolbar ---------- */
.woocommerce .woocommerce-result-count {
	color: var(--newzon-muted);
	font-size: 14px;
	margin-bottom: 0;
}

.woocommerce .woocommerce-ordering select,
.newzon-per-page select {
	border: 1px solid var(--newzon-line);
	border-radius: 3px;
	padding: 8px 30px 8px 12px;
	background-color: #fff;
	color: var(--newzon-ink);
	font-size: 14px;
	cursor: pointer;
}

/* Grid / list toggle */
.newzon-view-toggle {
	display: inline-flex;
	gap: 4px;
	margin-left: 10px;
	vertical-align: middle;
	float: right;
}

.newzon-view-btn {
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--newzon-line);
	background: #fff;
	border-radius: 3px;
	color: var(--newzon-muted);
	cursor: pointer;
	padding: 0;
	transition: all .15s ease;
}

.newzon-view-btn svg { width: 18px; height: 18px; }

.newzon-view-btn.is-active {
	background: var(--newzon-blue);
	border-color: var(--newzon-blue);
	color: #fff;
}

/* ---------- Product grid ---------- */
.woocommerce ul.products,
.woocommerce-page ul.products {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0 0 24px;
}

/* minmax(0, 1fr) lets columns shrink to fit the container — without it, on
 * archives WITH a sidebar the viewport-based column count overflows to the
 * right (cards get cut off) because 1fr won't shrink below card min-content. */
@media (min-width: 600px)  { .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px)  { .woocommerce ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .woocommerce ul.products { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1440px) { .woocommerce ul.products { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- Product card ---------- */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	width: auto !important;
	margin: 0 !important;
	padding: 12px;
	background: #fff;
	border: 1px solid var(--newzon-line);
	border-radius: var(--newzon-radius);
}

/* Image */
.woocommerce ul.products li.product .woocommerce-image__wrapper {
	position: relative;
	margin-bottom: 10px;
}

.woocommerce ul.products li.product img {
	aspect-ratio: 1 / 1;
	object-fit: contain;
	width: 100%;
	height: auto;
	background: #fff;
}

/* Sale bubble -> small pill top-left */
.woocommerce ul.products li.product .sale-item,
.woocommerce span.onsale {
	position: absolute;
	top: 8px;
	left: 8px;
	margin: 0;
	min-height: 0;
	min-width: 0;
	width: auto;
	height: auto;
	line-height: 1;
	padding: 5px 8px;
	font-size: 11px;
	font-weight: 700;
	border-radius: 3px;
	background: var(--newzon-green);
	color: #fff;
	z-index: 3;
}

/* Card body */
.woocommerce ul.products li.product .woocommerce-card__header {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

/* Eyebrow (category) */
.woocommerce ul.products li.product .product__categories {
	margin: 0 0 4px;
	font-size: 11px;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1.3;
}

.woocommerce ul.products li.product .product__categories a {
	color: var(--newzon-muted);
	text-decoration: none;
}

/* Title */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	margin: 0 0 8px;
	min-height: 38px;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title a {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--newzon-ink);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-decoration: none;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title a:hover { color: var(--newzon-blue); }

/* Price */
.woocommerce ul.products li.product .price {
	margin: 0 0 6px;
	color: var(--newzon-ink);
	font-size: 16px;
	font-weight: 700;
	display: block;
}

.woocommerce ul.products li.product .price del {
	color: #9ca3af;
	font-weight: 400;
	font-size: 13px;
	opacity: 1;
	margin-right: 6px;
}

.woocommerce ul.products li.product .price ins { text-decoration: none; }

.woocommerce ul.products li.product .price .woocommerce-price-suffix {
	display: inline-block;
	color: var(--newzon-muted);
	font-size: 11px;
	font-weight: 400;
}

/* In-stock indicator */
.newzon-stock {
	display: flex;
	align-items: center;
	gap: 5px;
	margin: 0 0 10px;
	font-size: 12.5px;
	font-weight: 500;
}

.newzon-stock svg { width: 15px; height: 15px; }
.newzon-stock.is-in { color: var(--newzon-green); }
.newzon-stock.is-out { color: #dc2626; }

/* Add to cart button */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart {
	/* Always in flow + visible (override Shoptimizer's absolute/opacity-0 hover reveal) */
	position: relative !important;
	opacity: 1 !important;
	visibility: visible !important;
	bottom: auto !important;
	margin-top: auto;
	width: 100% !important;
	height: auto !important;
	line-height: 1.4 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 9px 12px;
	font-size: 13.5px;
	font-weight: 600;
	border-radius: 3px;
	border: 1px solid var(--newzon-blue);
	background: #fff !important;
	color: var(--newzon-blue) !important;
	text-align: center;
}

.woocommerce ul.products li.product .button::before {
	content: "";
	width: 16px;
	height: 16px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='21' r='1'/><circle cx='20' cy='21' r='1'/><path d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/></svg>") center/contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='21' r='1'/><circle cx='20' cy='21' r='1'/><path d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/></svg>") center/contain no-repeat;
	flex: 0 0 auto;
}

.woocommerce ul.products li.product .button:hover {
	background: var(--newzon-blue) !important;
	color: #fff !important;
}

.woocommerce ul.products li.product .added_to_cart::before { content: none; }

.woocommerce ul.products li.product .button.loading { color: var(--newzon-blue) !important; }

/* ---------- List view ---------- */
.woocommerce ul.products.newzon-list {
	grid-template-columns: 1fr !important;
	gap: 12px;
}

.woocommerce ul.products.newzon-list li.product {
	flex-direction: row;
	align-items: center;
	gap: 18px;
	padding: 14px 16px;
}

.woocommerce ul.products.newzon-list li.product .woocommerce-image__wrapper {
	flex: 0 0 130px;
	width: 130px;
	margin-bottom: 0;
}

.woocommerce ul.products.newzon-list li.product .woocommerce-card__header {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 24px;
}

.woocommerce ul.products.newzon-list li.product .woocommerce-loop-product__title {
	flex: 1 1 320px;
	min-height: 0;
}

.woocommerce ul.products.newzon-list li.product .woocommerce-loop-product__title a { -webkit-line-clamp: 2; }
.woocommerce ul.products.newzon-list li.product .product__categories { flex: 1 1 100%; }
.woocommerce ul.products.newzon-list li.product .price { margin: 0; }
.woocommerce ul.products.newzon-list li.product .newzon-stock { margin: 0; }

.woocommerce ul.products.newzon-list li.product .button {
	width: auto;
	margin: 0;
	padding: 10px 22px;
}

@media (max-width: 600px) {
	.woocommerce ul.products.newzon-list li.product { flex-direction: column; align-items: stretch; }
	.woocommerce ul.products.newzon-list li.product .woocommerce-image__wrapper { width: 100%; flex-basis: auto; }
	.woocommerce ul.products.newzon-list li.product .button { width: 100%; }
}

/* ---------- Sidebar widgets ---------- */
#secondary .widget {
	background: #fff;
	border: 1px solid var(--newzon-line);
	border-radius: var(--newzon-radius);
	padding: 18px;
	margin-bottom: 18px;
}

#secondary .widget .widget-title,
#secondary .widget h2,
#secondary .widget h3 {
	font-size: 15px;
	font-weight: 700;
	color: var(--newzon-ink);
	margin: 0 0 14px;
}

/* Price filter — track */
#secondary .widget_price_filter .price_slider_wrapper .ui-widget-content,
#secondary .widget_price_filter .ui-slider-horizontal {
	background: #e5e7eb !important;
	border: 0;
	border-radius: 999px;
	height: 6px !important;
}

#secondary .widget_price_filter .ui-slider .ui-slider-range {
	background: var(--newzon-blue) !important;
	height: 100%;
}

/* Price filter — handle (vertically centred on the track) */
#secondary .widget_price_filter .ui-slider .ui-slider-handle,
#secondary .widget_price_filter .ui-slider .ui-slider-handle:last-child {
	width: 16px !important;
	height: 16px !important;
	background: var(--newzon-blue) !important;
	border: 3px solid #fff !important;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .3) !important;
	border-radius: 50% !important;
	top: 50% !important;
	margin-top: -8px !important;
	margin-left: -8px !important;
}

/* Price filter — amount row: range label on top, full-width Filter button */
#secondary .widget_price_filter .price_slider_amount {
	display: block !important;
	text-align: left;
}

#secondary .widget_price_filter .price_slider_amount input[type="text"] {
	display: none !important;
}

#secondary .widget_price_filter .price_label {
	color: var(--newzon-muted);
	font-size: 13px;
	margin: 0 0 12px;
}

#secondary .widget_price_filter .button {
	width: 100%;
	background: var(--newzon-blue) !important;
	color: #fff !important;
	border-radius: 3px;
	padding: 9px !important;
	font-weight: 600;
	float: none !important;
	margin: 0 !important;
}

#secondary .widget_price_filter .button:hover { background: var(--newzon-blue-dark) !important; }

/* Filter / category lists */
#secondary .widget ul { margin: 0; list-style: none; }

/* Remove the theme's circular bullet markers (look like radio buttons) */
#secondary .widget_layered_nav ul li::before,
#secondary .widget_product_categories ul li::before,
#secondary .widget_categories ul li::before {
	content: none !important;
	display: none !important;
}

#secondary .widget_layered_nav ul li,
#secondary .widget_product_categories ul li,
#secondary .widget_categories ul li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0 !important;
	padding-left: 0 !important;
	border: 0;
	font-size: 14px;
	color: #374151;
}

#secondary .widget_layered_nav ul li a,
#secondary .widget_product_categories ul li a,
#secondary .widget_categories ul li a {
	color: #374151;
	text-decoration: none;
	flex: 1 1 auto;
}

#secondary .widget_layered_nav ul li a:hover,
#secondary .widget_product_categories ul li a:hover,
#secondary .widget_categories ul li a:hover { color: var(--newzon-blue); }

#secondary .widget_layered_nav ul li .count,
#secondary .widget_product_categories ul li .count,
#secondary .widget_categories ul li .count {
	position: static !important;
	top: auto !important;
	right: auto !important;
	flex: 0 0 auto;
	color: var(--newzon-muted);
	font-size: 13px;
}

/* Help card */
.newzon-help-card {
	background: #eef4fb;
	border: 1px solid #d6e3f2;
	border-radius: var(--newzon-radius);
	padding: 20px 18px;
	text-align: center;
	margin-bottom: 18px;
}

.newzon-help-icon {
	width: 44px;
	height: 44px;
	margin: 0 auto 10px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--newzon-blue);
}

.newzon-help-icon svg { width: 24px; height: 24px; }
.newzon-help-title { font-weight: 700; color: var(--newzon-ink); margin: 0 0 2px; font-size: 15px; }
.newzon-help-text { color: var(--newzon-muted); font-size: 13px; margin: 0 0 14px; }

.newzon-help-btn {
	display: block;
	background: #fff;
	border: 1px solid var(--newzon-blue);
	color: var(--newzon-blue);
	font-weight: 600;
	border-radius: 3px;
	padding: 9px 14px;
	text-decoration: none;
	transition: all .15s ease;
}

.newzon-help-btn:hover { background: var(--newzon-blue); color: #fff; }

/* ---------- Per-page selector ---------- */
.newzon-per-page {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	float: right;
	color: var(--newzon-muted);
	font-size: 14px;
}

/* ---------- Pagination ---------- */
.woocommerce nav.woocommerce-pagination ul {
	border: 0;
	display: flex;
	gap: 6px;
	justify-content: center;
}

.woocommerce nav.woocommerce-pagination ul li {
	border: 0;
	margin: 0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	border: 1px solid var(--newzon-line);
	border-radius: 3px;
	min-width: 38px;
	height: 38px;
	line-height: 38px;
	padding: 0 8px;
	color: var(--newzon-ink);
	background: #fff;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
	background: var(--newzon-blue);
	border-color: var(--newzon-blue);
	color: #fff;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
	background: var(--newzon-bg);
	border-color: #cdd6e0;
}

/* ---------- Compact category archive header (bring products above the fold) ---------- */
/* All sizes: smaller title + tighter section gaps (fine on mobile too) */
/* NB: theme sets .woocommerce-products-header margin-top:-10px which pulls the
   description up into the H1 on mobile — reset it to a small positive here. */
.woocommerce-products-header { margin-top: 6px !important; margin-bottom: 4px !important; padding: 0 !important; }
.woocommerce-products-header__title.page-title,
.woocommerce-products-header .page-title {
	font-size: clamp(18px, 1rem + 0.7vw, 23px) !important;
	margin-bottom: 4px !important;
	line-height: 1.15 !important;
}
.newzon-desc-row,
.term-description { margin: 0 0 4px !important; }
.mcat-container { margin: 0 0 5px !important; margin-top: 0 !important; padding: 3px !important; }
.mcat-btn { padding: 5px 11px !important; }
.content-area > .woocommerce-notices-wrapper:empty { margin: 0 !important; padding: 0 !important; }
.woocommerce ul.products { margin-top: 0 !important; }

/* Desktop only: aggressive top tightening (mobile keeps its normal spacing) */
@media (min-width: 992px) {
	.shoptimizer-archive { padding-top: 0 !important; margin-top: 0 !important; }
	.shoptimizer-archive .archive-header { padding: 0 !important; }
	.woocommerce-breadcrumb { margin-bottom: 0 !important; padding-bottom: 0 !important; font-size: 13px !important; }
	.shoptimizer-archive > .col-full { padding-top: 0 !important; }
	#primary.content-area, main.site-main { padding-top: 0 !important; margin-top: 0 !important; }
	.woocommerce-products-header { margin-top: -8px !important; }
	.woocommerce-products-header__title.page-title,
	.woocommerce-products-header .page-title { margin-top: -8px !important; }
}

/* ---------- Hide YITH compare preview bar (it auto-pops with queued items) ---------- */
#yith-woocompare-preview-bar { display: none !important; }
