/* Shop / category pages — loaded by inc/shop.php.
 * Every rule starts with body.woocommerce so it beats Woodmart's widget styles,
 * which load later in the page. */

:root {
	--kp-shop-green: var(--wd-primary-color, #216837);
	--kp-shop-line: #ebe8e0;          /* card border + dividers (off-white) */
	--kp-shop-radius: 14px;
	--kp-shop-shadow: 0 2px 14px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
	--kp-shop-input-h: 42px;
}

/* ---------- Filters card ---------- */

body.woocommerce .elementor-widget-wd_sidebar > .elementor-widget-container,
body.woocommerce .elementor-widget-wd_sidebar:not(:has(> .elementor-widget-container)) {
	padding: 22px 20px 8px;
	background: #fff;
	border: 1px solid var(--kp-shop-line);
	border-radius: var(--kp-shop-radius);
	box-shadow: var(--kp-shop-shadow);
}

body.woocommerce .elementor-widget-wd_sidebar > .elementor-widget-container::before,
body.woocommerce .elementor-widget-wd_sidebar:not(:has(> .elementor-widget-container))::before {
	content: "Filters";
	display: block;
	padding-bottom: 14px;
	margin-bottom: 18px;
	border-bottom: 1px solid var(--kp-shop-line);
	color: #1a1a1a;
	font-size: 18px;
	font-weight: 700;
}

body.woocommerce .elementor-widget-wd_sidebar .sidebar-widget {
	margin-bottom: 18px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--kp-shop-line);
}

body.woocommerce .elementor-widget-wd_sidebar .sidebar-widget:last-child {
	border-bottom: 0;
	margin-bottom: 0;
}

body.woocommerce .elementor-widget-wd_sidebar .widget-title {
	margin-bottom: 16px;
	color: #1a1a1a;
	font-size: 15px;
	font-weight: 600;
	text-transform: none;
}

/* ---------- Price filter ---------- */

body.woocommerce .widget_price_filter .price_slider {
	margin: 8px 9px 22px; /* room for the round handles */
}

body.woocommerce .widget_price_filter .ui-slider {
	height: 4px;
	border-radius: 4px;
	background: #e6ebe7;
}

body.woocommerce .widget_price_filter .ui-slider .ui-slider-range {
	height: 100%;
	border-radius: 4px;
	background: var(--kp-shop-green);
}

body.woocommerce .widget_price_filter .ui-slider .ui-slider-handle {
	top: 50%;
	width: 18px;
	height: 18px;
	margin-left: -9px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--kp-shop-green);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
	transform: translateY(-50%);
	cursor: grab;
}

body.woocommerce .widget_price_filter .ui-slider .ui-slider-handle:active {
	cursor: grabbing;
}

/* Min / max boxes side by side, Filter button full width underneath. */
body.woocommerce .widget_price_filter .price_slider_amount {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

body.woocommerce .widget_price_filter .price_slider_amount input#min_price,
body.woocommerce .widget_price_filter .price_slider_amount input#max_price {
	display: block !important; /* WooCommerce hides these; we show them as editable boxes */
	width: 100%;
	height: var(--kp-shop-input-h);
	padding: 0 12px;
	border: 1px solid var(--kp-shop-line);
	border-radius: 10px;
	background: #fff;
	color: #1a1a1a;
	font-size: 15px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	transition: border-color .2s, box-shadow .2s;
}

body.woocommerce .widget_price_filter .price_slider_amount input:focus {
	border-color: var(--kp-shop-green);
	box-shadow: 0 0 0 3px rgba(33, 104, 55, .12);
	outline: none;
}

body.woocommerce .widget_price_filter .price_slider_amount .button {
	grid-column: 1 / -1;
	order: 3;
	width: 100%;
	height: var(--kp-shop-input-h);
	margin: 4px 0 0;
	border-radius: 999px;
	background: var(--kp-shop-green);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	transition: filter .2s, box-shadow .2s;
}

body.woocommerce .widget_price_filter .price_slider_amount .button:hover {
	filter: brightness(1.08);
	box-shadow: 0 6px 16px rgba(33, 104, 55, .25);
}

body.woocommerce .widget_price_filter .price_label,
body.woocommerce .widget_price_filter .price_slider_amount .clear {
	display: none !important; /* the boxes show the same numbers */
}

/* ---------- Stock status checkboxes ---------- */

body.woocommerce .wd-widget-stock-status .wd-checkboxes-on > li > a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 0;
	color: #333;
	font-size: 15px;
}

body.woocommerce .wd-widget-stock-status .wd-checkboxes-on > li > a::before {
	width: 18px;
	height: 18px;
	margin: 0;
	border: 1.5px solid #c8ccc9;
	border-radius: 5px;
	transition: border-color .2s, background-color .2s;
}

body.woocommerce .wd-widget-stock-status .wd-checkboxes-on > li > a:hover::before {
	border-color: var(--kp-shop-green);
}

body.woocommerce .wd-widget-stock-status .wd-checkboxes-on > li.wd-active > a::before {
	border-color: var(--kp-shop-green);
	background-color: var(--kp-shop-green);
}

/* ---------- Sort dropdown ---------- */

body.woocommerce .woocommerce-ordering select.orderby {
	height: var(--kp-shop-input-h);
	padding: 0 40px 0 18px;
	border: 1px solid var(--kp-shop-line);
	border-radius: 999px;
	background-color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
	color: #333;
	font-size: 14px;
}

body.woocommerce .woocommerce-ordering select.orderby:focus {
	border-color: var(--kp-shop-green);
	outline: none;
}
