/**
 * Achol Shop / Archive
 * Version: 1.0.0
 */

/* Toolbar */
.achol-shop-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--achol-space-3);
	margin-bottom: var(--achol-space-6);
	padding-bottom: var(--achol-space-4);
	border-bottom: 1px solid var(--achol-color-border-light);
}

.achol-shop-toolbar__count {
	font-size: var(--achol-font-size-sm);
	color: var(--achol-color-text-secondary);
	flex: 1;
}

.achol-shop-toolbar__sort {
	margin-left: auto;
}

.achol-shop-toolbar__sort .woocommerce-ordering {
	margin: 0;
}

.achol-shop-toolbar__sort select {
	font-size: var(--achol-font-size-sm);
	padding: 0.5rem 2rem 0.5rem 0.75rem;
	border: 1px solid var(--achol-color-border);
	border-radius: var(--achol-radius-input);
	background: var(--achol-color-background);
}

.achol-shop-filter-toggle {
	display: inline-flex;
}

@media (min-width: 1024px) {
	.achol-shop-filter-toggle {
		display: none;
	}
}

/* Layout */
.achol-shop-layout {
	display: grid;
	gap: var(--achol-space-8);
	grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
	.achol-shop--has-sidebar .achol-shop-layout {
		grid-template-columns: 260px 1fr;
		align-items: start;
	}
}

.achol-shop-main {
	min-width: 0;
}

/* Sidebar */
.achol-shop-sidebar {
	display: none;
}

@media (min-width: 1024px) {
	.achol-shop-sidebar {
		display: block;
		position: sticky;
		top: calc(var(--achol-header-height) + var(--achol-space-4));
	}
}

/* Mobile sidebar drawer */
@media (max-width: 1023px) {
	.achol-shop-sidebar.is-open {
		display: block;
		position: fixed;
		inset: 0;
		z-index: var(--achol-z-modal);
		background: rgba(0, 0, 0, 0.4);
	}

	.achol-shop-sidebar.is-open .achol-shop-sidebar__inner {
		position: absolute;
		top: 0;
		left: 0;
		width: min(320px, 90vw);
		height: 100%;
		background: var(--achol-color-background);
		padding: var(--achol-space-4);
		overflow-y: auto;
		box-shadow: var(--achol-shadow-lg);
	}
}

.achol-shop-sidebar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--achol-space-4);
}

@media (min-width: 1024px) {
	.achol-shop-sidebar__close {
		display: none;
	}
}

.achol-shop-sidebar__title {
	margin: 0;
	font-size: var(--achol-font-size-md);
	font-weight: var(--achol-font-weight-semibold);
}

.achol-shop-sidebar__close {
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	font-size: 1.5rem;
	cursor: pointer;
	border-radius: var(--achol-radius-full);
}

.achol-shop-sidebar__close:focus-visible {
	outline: var(--achol-focus-outline);
}

.achol-shop-filter-block {
	margin-bottom: var(--achol-space-6);
}

.achol-shop-filter-block__title {
	margin: 0 0 var(--achol-space-3);
	font-size: var(--achol-font-size-sm);
	font-weight: var(--achol-font-weight-semibold);
	text-transform: uppercase;
	letter-spacing: var(--achol-letter-spacing-wide);
}

.achol-shop-filter-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.achol-shop-filter-list li {
	margin: 0 0 var(--achol-space-2);
}

.achol-shop-filter-list a {
	font-size: var(--achol-font-size-sm);
	color: var(--achol-color-text-secondary);
	text-decoration: none;
}

.achol-shop-filter-list a:hover,
.achol-shop-filter-list .current-cat > a {
	color: var(--achol-color-primary);
}

.achol-shop-sidebar__hint {
	font-size: var(--achol-font-size-xs);
	color: var(--achol-color-text-muted);
}

/* Product grid – use WC ul.products */
.achol-shop ul.products {
	display: grid;
	gap: var(--achol-space-6) var(--achol-space-4);
	grid-template-columns: repeat(2, 1fr);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.achol-shop ul.products {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.achol-shop-cols-3 ul.products {
		grid-template-columns: repeat(3, 1fr);
	}
	.achol-shop-cols-4 ul.products {
		grid-template-columns: repeat(4, 1fr);
	}
	.achol-shop-cols-5 ul.products {
		grid-template-columns: repeat(5, 1fr);
	}
}

.achol-shop ul.products::before,
.achol-shop ul.products::after {
	display: none;
}

.achol-shop ul.products li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
}

/* Card refinements for shop */
.achol-product-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--achol-space-2);
	margin-top: var(--achol-space-3);
}

.achol-product-card__actions .button,
.achol-product-card__actions .achol-btn {
	font-size: var(--achol-font-size-xs);
	padding: 0.5rem 0.75rem;
}

.achol-product-card__title {
	font-size: var(--achol-font-size-sm);
	margin: 0;
}

.achol-product-card__title-link {
	text-decoration: none;
	color: inherit;
}

.achol-product-card__title-link:hover .achol-product-card__title {
	color: var(--achol-color-primary);
}

/* Empty state */
.achol-shop .woocommerce-info {
	border-color: var(--achol-color-border);
	background: var(--achol-color-soft-neutral);
}

/* Pagination */
.achol-shop .woocommerce-pagination {
	margin-top: var(--achol-space-10);
	text-align: center;
}

.achol-shop .woocommerce-pagination ul {
	display: inline-flex;
	gap: var(--achol-space-1);
	list-style: none;
	margin: 0;
	padding: 0;
}

.achol-shop .woocommerce-pagination a,
.achol-shop .woocommerce-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 var(--achol-space-2);
	font-size: var(--achol-font-size-sm);
	border: 1px solid var(--achol-color-border);
	border-radius: var(--achol-radius-md);
	text-decoration: none;
	color: var(--achol-color-secondary);
}

.achol-shop .woocommerce-pagination .current {
	background: var(--achol-color-secondary);
	border-color: var(--achol-color-secondary);
	color: #fff;
}

.achol-shop .woocommerce-pagination a:hover {
	border-color: var(--achol-color-primary);
	color: var(--achol-color-primary);
}
