/*
 * Sidebar domain stylesheet — mirrors inc/sidebar.php.
 *
 * Styles whatever widgets the admin places in GeneratePress's Left Sidebar
 * (sidebar-2). Enqueued by just2euro_sidebar_assets() in inc/sidebar.php whenever
 * that sidebar is active, so it loads on every page that shows the sidebar
 * (content pages included), depending on 'generate-child' for the :root tokens.
 * New sidebar widgets get styled here, not in woocommerce.css.
 *
 * Today the admin uses two WooCommerce widgets — Product Categories + Cart;
 * selectors cover both the classic and block markup. Because this sidebar is
 * visible across the site, Woo widget presentation is scoped here under
 * #left-sidebar instead of forcing WooCommerce page CSS to load globally. See
 * tasks/woo-shop-archive.md.
 *
 * --------------------------------------------------------------------------- */

#left-sidebar .widget {
	margin-bottom: 0;
}

#left-sidebar .widget-title,
#left-sidebar .widgettitle,
#left-sidebar .wp-block-heading {
	margin: 0;
	padding: 0 0 0.45rem;
	font-size: 1.05rem;
	line-height: 1.3;
	color: var(--j2e-heading-1);
	background-color: transparent;
	border-bottom: 2px solid var(--j2e-purple);
	border-radius: 0;
}

/* Product categories — classic (ul.product-categories) and block
   (ul.wc-block-product-categories-list) markup share one look. */
#left-sidebar ul.product-categories,
#left-sidebar ul.wc-block-product-categories-list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 0;
}

#left-sidebar ul.product-categories li,
#left-sidebar ul.wc-block-product-categories-list li {
	position: relative;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--j2e-border);
	list-style: none;
	font-size: 0.9rem;
	line-height: 1.35;
}

#left-sidebar ul.product-categories li a,
#left-sidebar ul.wc-block-product-categories-list li a {
	display: inline-block;
	max-width: calc(100% - 2.9rem);
	padding: 0.43rem 0;
	color: var(--j2e-muted);
	text-decoration: none;
}

#left-sidebar ul.product-categories li a:hover,
#left-sidebar ul.wc-block-product-categories-list li a:hover {
	color: var(--j2e-purple);
}

#left-sidebar ul.product-categories li.current-cat > a {
	color: var(--j2e-purple);
	font-weight: 700;
}

#left-sidebar ul.product-categories .count,
#left-sidebar .wc-block-product-categories-list-item-count {
	color: var(--j2e-heading-2);
	font-size: 0.86em;
	font-weight: 700;
}

#left-sidebar ul.product-categories .children,
#left-sidebar ul.wc-block-product-categories-list ul {
	margin: 0;
	padding: 0;
	list-style: none;
	background-color: var(--j2e-surface-subtle);
	border-top: 1px solid var(--j2e-border);
}

#left-sidebar ul.product-categories.j2e-category-tree .children,
#left-sidebar ul.wc-block-product-categories-list.j2e-category-tree ul {
	display: none;
}

#left-sidebar ul.product-categories.j2e-category-tree li.is-expanded > .children,
#left-sidebar ul.wc-block-product-categories-list.j2e-category-tree li.is-expanded > ul {
	display: block;
}

#left-sidebar ul.product-categories .children li,
#left-sidebar ul.wc-block-product-categories-list ul li {
	padding-left: 0.9rem;
}

#left-sidebar ul.product-categories .children .children li,
#left-sidebar ul.wc-block-product-categories-list ul ul li {
	padding-left: 1.8rem;
}

.j2e-category-toggle {
	position: absolute;
	top: 0.1rem;
	right: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.8rem;
	height: 1.8rem;
	padding: 0;
	color: var(--j2e-purple);
	background: transparent;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

.j2e-category-toggle:hover,
.j2e-category-toggle:focus {
	color: var(--j2e-nav-text);
	background-color: var(--j2e-purple);
}

.j2e-category-toggle:focus-visible {
	outline: 2px solid var(--j2e-cyan);
	outline-offset: 2px;
}

.j2e-category-toggle__icon::before {
	content: "+";
	display: block;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1;
}

.is-expanded > .j2e-category-toggle .j2e-category-toggle__icon::before {
	content: "-";
}

/* Cart widget — classic widget_shopping_cart and the mini-cart block. */
#left-sidebar .widget_shopping_cart .cart_list,
#left-sidebar .wc-block-mini-cart__items {
	margin: 0;
	padding: 0;
}

#left-sidebar .widget_shopping_cart .total {
	padding: 0.6rem 0;
	border-top: 1px solid var(--j2e-border);
	border-bottom: 1px solid var(--j2e-border);
}

#left-sidebar .widget_shopping_cart .total strong {
	color: var(--j2e-heading-2);
}

#left-sidebar .widget_shopping_cart .amount,
#left-sidebar .wc-block-mini-cart__amount,
#left-sidebar .wc-block-components-product-price__value,
#left-sidebar .wc-block-components-totals-item__value {
	color: var(--j2e-purple);
	font-weight: 600;
}

#left-sidebar .widget_shopping_cart a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	color: var(--j2e-purple) !important;
	border-radius: 999px;
	line-height: 1;
}

#left-sidebar .widget_shopping_cart a.remove:hover,
#left-sidebar .widget_shopping_cart a.remove:focus {
	color: var(--j2e-nav-text) !important;
	background-color: var(--j2e-purple);
}

#left-sidebar .widget_shopping_cart .buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0;
}

#left-sidebar .widget_shopping_cart .buttons a {
	flex: 1 1 auto;
	color: var(--j2e-nav-text);
	background-color: var(--j2e-purple);
	border-radius: 5px;
	text-align: center;
	transition: background-color 0.15s ease;
}

#left-sidebar .widget_shopping_cart .buttons a:hover,
#left-sidebar .widget_shopping_cart .buttons a:focus {
	color: var(--j2e-nav-text);
	background-color: var(--j2e-purple-hover);
}

#left-sidebar .widget_shopping_cart .buttons a:focus-visible {
	outline: 2px solid var(--j2e-cyan);
	outline-offset: 2px;
}
