/* ==========================================================================
   WooCommerce Styles — Lepapa Theme (Catalog)

   Design ref: "Desktop" catalog page
   Page bg: #F3F4F5 · Font: Inter 12px · Grid: 3 cols, 25px gap, 40px margin
   ========================================================================== */

/* Kill ALL WooCommerce default & block styles that leak through
   ========================================================================== */

.woocommerce-result-count,
.woocommerce-ordering,
.woocommerce-breadcrumb,
.woocommerce .woocommerce-breadcrumb,
.woocommerce-page .page-title,
.woocommerce-notices-wrapper,
.wc-block-components-notice-banner {
	display: none;
}

.wc-block-grid,
.wp-block-woocommerce-product-categories,
.wc-block-product-categories {
	background: none;
}

/* Catalog Page — full background
   ========================================================================== */

body.post-type-archive-product,
body.tax-product_cat,
body.tax-collection {
	background-color: var(--color-light-grey);
}

body.post-type-archive-product #page,
body.tax-product_cat #page,
body.tax-collection #page,
body.post-type-archive-product .site-header,
body.tax-product_cat .site-header,
body.tax-collection .site-header,
body.post-type-archive-product .site-footer,
body.tax-product_cat .site-footer,
body.tax-collection .site-footer {
	background-color: var(--color-light-grey);
}

.catalog-page.site-main {
	width: 100%;
	padding: 8px var(--container-padding) 0;
}

/* Filter Bar
   ========================================================================== */

.catalog-filters {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 33px;
	margin-bottom: 25px;
}

.catalog-filters__chips {
	display: flex;
	gap: 12px;
	align-items: center;
}

.filter-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 33px;
	padding: 9px 15px;
	border: none;
	background: transparent;
	color: var(--color-dark-grey);
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--transition-fast);
}

.filter-chip:first-child {
	padding-left: 0;
}

.filter-chip:hover {
	color: var(--color-black);
	text-decoration: none;
}

.filter-chip--active,
.filter-chip--active:hover {
	color: var(--color-black);
	text-decoration: underline;
}

.catalog-filter-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-black);
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	padding: 0;
	flex-shrink: 0;
}

.catalog-filter-btn svg {
	width: 24px;
	height: 24px;
}

/* Filter Panel
   ========================================================================== */

.catalog-filters.catalog-filters--hidden {
	display: none;
}

.catalog-filter-panel {
	margin-bottom: 25px;
}

.catalog-filter-panel__header {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 33px;
}

.catalog-filter-panel__title {
	font-family: var(--font-body);
	font-size: 18px;
	font-weight: 500;
	line-height: 1;
	color: var(--color-black);
	flex-shrink: 0;
	width: calc((100vw - 60px - 144px) / 5);
}

.catalog-filter-panel__count {
	font-size: 10px;
	font-weight: 400;
	margin-left: 2px;
}

.catalog-filter-panel__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	flex: 1;
	min-width: 0;
}

.catalog-filter-tag {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 25px;
	padding: 0 8px;
	background: var(--color-light-blue);
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
	color: var(--color-black);
}

.catalog-filter-tag__remove {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	width: 9px;
	height: 9px;
	font-size: 0;
	color: var(--color-black);
	position: relative;
}

.catalog-filter-tag__remove::before,
.catalog-filter-tag__remove::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 1px;
	background: var(--color-black);
}

.catalog-filter-tag__remove::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.catalog-filter-tag__remove::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.catalog-filter-panel__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-black);
	padding: 0;
	flex-shrink: 0;
	margin-left: auto;
}

.catalog-filter-panel__body {
	display: flex;
	gap: 24px;
	margin-top: 15px;
}

/* Tab bar — hidden on desktop, shown on mobile via media query */
.catalog-filter-tabs {
	display: none;
}

.catalog-filter-group {
	display: flex;
	flex-direction: column;
	gap: 11px;
	flex-shrink: 0;
	min-width: 207px;
}

.catalog-filter-group__title {
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--color-black);
	text-transform: uppercase;
}

.catalog-filter-group__options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.catalog-filter-group__options--columns {
	flex-wrap: wrap;
	max-height: calc(5 * (16px + 8px) - 8px);
}

.catalog-filter-group__options--columns[data-columns="3"] {
	width: 322px;
}

.catalog-filter-group__options--columns[data-columns="2"] {
	width: 322px;
}

.catalog-filter-group__options--columns[data-columns="3"] .catalog-checkbox {
	width: calc(100% / 3 - 6px);
}

.catalog-filter-group__options--columns[data-columns="2"] .catalog-checkbox {
	width: calc(50% - 4px);
}

.catalog-checkbox {
	display: flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
	user-select: none;
}

.catalog-checkbox__box {
	width: 12px;
	height: 12px;
	border: 1px solid #111;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.catalog-checkbox__box--checked {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='7 8 9.5 7.2' fill='none'%3E%3Cpath d='M11.0149 14.2835L7.84863 11.1172L7.0001 11.9657L10.1664 15.132L11.0149 14.2835Z' fill='%23111111'/%3E%3Cpath d='M10.167 15.1299L16.4492 8.84766L15.6007 7.99913L9.31845 14.2814L10.167 15.1299Z' fill='%23111111'/%3E%3C/svg%3E");
	background-size: 8px 6px;
	background-position: center;
	background-repeat: no-repeat;
}

.catalog-checkbox__label {
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--color-black);
}

/* Product Grid
   ========================================================================== */

.catalog-page ul.products {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 25px;
	list-style: none;
	margin: 0;
	padding: 0;
	clear: both;
}

.catalog-page ul.products::before,
.catalog-page ul.products::after {
	display: none;
}

/* Product Card
   ========================================================================== */

.catalog-page .product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	width: auto;
	float: none;
	border: none;
	box-shadow: none;
	list-style: none;
}

/* Product Card — Image Slider
   ========================================================================== */

.product-card__slider {
	padding: 57px 48px 0;
}

.product-card__slides {
	position: relative;
	width: 100%;
	aspect-ratio: 365 / 449;
	overflow: hidden;
}

.product-card__slide {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.product-card__slide--active {
	display: flex;
}

.product-card__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	margin: 0;
	box-shadow: none;
}

/* Slider arrow buttons — visible on hover only */
.product-card__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-black);
	padding: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
	z-index: 2;
}

.product-card__arrow svg {
	width: 20px;
	height: 20px;
}

.product-card__slides:hover .product-card__arrow {
	opacity: 1;
	pointer-events: auto;
}

.product-card__arrow:hover {
	color: var(--color-dark-grey);
}

.product-card__arrow--prev {
	left: 8px;
}

.product-card__arrow--next {
	right: 8px;
}

.product-card__meta {
	padding: 40px 48px 48px;
	position: relative;
}

/* Slide indicators — small horizontal lines */
.product-card__indicators {
	display: flex;
	gap: 2px;
	align-items: center;
	margin-bottom: 12px;
}

.product-card__indicator {
	display: block;
	width: 8px;
	height: 1px;
	background: var(--color-dark-grey);
}

.product-card__indicator--active {
	background: var(--color-black);
}

/* Product title & price */
.product-card__info {
	display: flex;
	flex-direction: column;
}

.product-card__title {
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--color-black);
	text-decoration: none;
}

.product-card__title:hover {
	color: var(--color-black);
	text-decoration: none;
}

.product-card__price,
.product-card .price {
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--color-black);
	margin: 0;
	padding: 0;
}

.product-card .price del {
	opacity: 0.5;
}

.product-card .price ins {
	text-decoration: none;
	font-weight: 400;
}

/* Bookmark / save button */
.product-card__save {
	position: absolute;
	right: 48px;
	bottom: 48px;
	width: 24px;
	height: 24px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-black);
	padding: 0;
}

.product-card__save:hover {
	color: inherit;
}

/* Hide WooCommerce default elements inside cards */
.catalog-page .product-card a {
	color: var(--color-black);
	text-decoration: none;
}

.catalog-page .product-card .button,
.catalog-page .product-card .add_to_cart_button,
.catalog-page .product-card .added_to_cart,
.catalog-page .product-card .star-rating,
.catalog-page .product-card .woocommerce-loop-product__title {
	display: none;
}

/* Pagination — "Ещё X/Y" button
   ========================================================================== */

.catalog-pagination {
	display: flex;
	justify-content: center;
	padding: 40px 0;
}

.catalog-load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 24px;
	border: 1px solid var(--color-black);
	border-radius: 25px;
	color: var(--color-black);
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
	transition: all var(--transition-fast);
}

.catalog-load-more:hover {
	background: var(--color-black);
	color: var(--color-white);
	text-decoration: none;
}

/* Empty state
   ========================================================================== */

.catalog-empty {
	text-align: center;
	padding: 96px 0;
	color: var(--color-dark-grey);
	font-size: 12px;
}

/* Generic WooCommerce pages (cart, checkout, account)
   ========================================================================== */

.woocommerce-page .site-main {
	width: 100%;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	background-color: var(--color-black);
	color: var(--color-white);
	border: 1px solid var(--color-black);
	border-radius: 0;
	padding: 9px 24px;
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 400;
	transition: all var(--transition-fast);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
	background-color: var(--color-white);
	color: var(--color-black);
	border-color: var(--color-black);
}

.woocommerce a.button:disabled,
.woocommerce button.button:disabled,
.woocommerce input.button:disabled,
.woocommerce #respond input#submit:disabled {
	background-color: var(--color-light-grey);
	color: var(--color-black);
	border-color: var(--color-light-grey);
	cursor: default;
}

.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
	border-radius: 0;
	border-color: var(--color-light-blue);
	background-color: var(--color-light-grey);
	color: var(--color-black);
}

.woocommerce-info::before,
.woocommerce-message::before {
	color: var(--color-black);
}

/* Side Drawer (Wishlist / Cart preview)
   ========================================================================== */

.side-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 395px;
	z-index: 200;
	background-color: var(--color-light-grey);
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.16);
	transform: translateX(100%);
	transition: transform var(--transition-base);
}

.side-drawer[data-open="true"] {
	transform: translateX(0);
}

.side-drawer__inner {
	padding: 34px;
	display: flex;
	flex-direction: column;
}

.side-drawer__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: var(--color-text);
}

.side-drawer__close:hover {
	opacity: 0.6;
}

.side-drawer__message {
	font-size: var(--font-size-body1);
	font-weight: 400;
	line-height: 1.2;
	color: var(--color-text);
	margin: 0 0 36px;
	padding-right: 30px;
}

.side-drawer__label {
	font-size: var(--font-size-body1);
	font-weight: 400;
	line-height: 1.2;
	color: var(--color-text);
	margin-bottom: 36px;
}

.side-drawer__label-text {
	text-transform: uppercase;
}

.side-drawer__label-count {
	font-size: 8px;
	vertical-align: super;
}

.side-drawer__product {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.side-drawer__product-image {
	width: 101px;
	height: 164px;
	overflow: hidden;
}

.side-drawer__product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.side-drawer__product-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: var(--font-size-body1);
	line-height: 1.2;
	color: var(--color-text);
}

.side-drawer__actions {
	display: flex;
	gap: 0;
}

.side-drawer__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	flex: 1;
	font-size: var(--font-size-body1);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-decoration: none;
	cursor: pointer;
	transition: all var(--transition-fast);
}

.side-drawer__btn--outline {
	border: 1px solid var(--color-black);
	background: transparent;
	color: var(--color-text);
}

.side-drawer__btn--outline:hover {
	background: var(--color-black);
	color: var(--color-white);
}

.side-drawer__btn--filled {
	background-color: var(--color-black);
	color: var(--color-white);
	border: 1px solid var(--color-black);
}

.side-drawer__btn--filled:hover {
	background-color: var(--color-white);
	color: var(--color-black);
	border-color: var(--color-black);
}

.side-drawer__btn--filled:active {
	background-color: var(--color-black);
	color: var(--color-white);
}

.side-drawer__btn--full {
	flex: none;
	width: 100%;
}

/* Wishlist active state — filled bookmark icon */
.js-wishlist-btn--active svg {
	fill: var(--color-text);
}

/* Wishlist drawer — products grid (hidden on desktop, shown on mobile) */
.side-drawer__products-grid {
	display: none;
}

/* Mobile bottom-sheet drawer
   ========================================================================== */

@media (max-width: 768px) {
	.drawer-overlay {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(17, 17, 17, 0.3);
		z-index: 199;
	}

	.drawer-overlay--visible {
		display: block;
	}

	.side-drawer {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-height: 80vh;
		overflow-y: auto;
		border-radius: 18px 18px 0 0;
		transform: translateY(100%);
		box-shadow: none;
	}

	.side-drawer[data-open="true"] {
		transform: translateY(0);
	}

	.side-drawer__inner {
		padding: 0 24px 24px;
	}

	/* Drag handle */
	.side-drawer__inner::before {
		content: '';
		display: block;
		width: 62px;
		height: 3px;
		background: #999;
		border-radius: 2px;
		margin: 16px auto 20px;
	}

	/* Hide close button — replaced by drag handle */
	.side-drawer__close {
		display: none;
	}

	/* Message — 39px from popup top, label at 89px */
	.side-drawer__message {
		font-size: 14px;
		font-weight: 500;
		line-height: 1;
		margin-bottom: 36px;
		padding-right: 0;
	}

	/* Label */
	.side-drawer__label {
		font-size: 14px;
		font-weight: 500;
		margin-bottom: 16px;
	}

	.side-drawer__label-count {
		font-size: 9px;
	}

	/* Product — card in horizontal scroll area */
	.side-drawer__product {
		flex-direction: column;
		gap: 8px;
		width: 134px;
		margin-bottom: 24px;
	}

	.side-drawer__product-image {
		width: 134px;
		height: 193px;
	}

	.side-drawer__product-meta {
		font-size: 12px;
		line-height: 1.2;
	}

	/* Wishlist drawer — show products grid, hide single product + actions */
	.side-drawer--wishlist .side-drawer__product {
		display: none;
	}

	.side-drawer--wishlist .side-drawer__actions {
		display: none;
	}

	.side-drawer--wishlist .side-drawer__products-grid {
		display: flex;
		gap: 12px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		margin-bottom: 8px;
	}

	.side-drawer--wishlist .side-drawer__products-grid::-webkit-scrollbar {
		display: none;
	}

	.side-drawer__grid-card {
		width: 120px;
		flex-shrink: 0;
		text-decoration: none;
		color: inherit;
	}

	.side-drawer__grid-card-image {
		width: 120px;
		height: 155px;
		background: #E8E8E8;
		overflow: hidden;
	}

	.side-drawer__grid-card-image img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}

	.side-drawer__grid-card-name {
		font-size: 12px;
		font-weight: 400;
		line-height: 1.4;
		color: var(--color-text);
		margin-top: 7px;
	}

	.side-drawer__grid-card-price {
		font-size: 12px;
		font-weight: 400;
		line-height: 1.2;
		color: var(--color-dark-grey);
		margin-top: 2px;
	}

	/* Cart drawer — buttons side by side */
	.side-drawer__actions {
		gap: 10px;
	}

	.side-drawer__btn {
		font-size: 12px;
		letter-spacing: 0;
	}

	.side-drawer__btn--full {
		width: auto;
		flex: 1;
	}
}

/* Responsive
   ========================================================================== */

@media (max-width: 1024px) {
	.catalog-page.site-main {
		padding-left: var(--container-padding);
		padding-right: var(--container-padding);
	}

	.catalog-filter-panel__body {
		flex-direction: column;
		gap: 16px;
	}

	.catalog-filter-group__options--columns[data-columns="3"],
	.catalog-filter-group__options--columns[data-columns="2"] {
		width: auto;
		max-height: none;
	}

	.catalog-filter-group__options--columns[data-columns="3"] .catalog-checkbox,
	.catalog-filter-group__options--columns[data-columns="2"] .catalog-checkbox {
		width: auto;
	}

	.catalog-page ul.products {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}

	.product-card__slider {
		padding: 42px 32px 0;
	}

	.product-card__meta {
		padding: 28px 32px 36px;
	}

	.product-card__save {
		right: 32px;
		bottom: 36px;
	}
}

@media (max-width: 768px) {
	/* Remove side padding — grid goes edge-to-edge */
	.catalog-page.site-main {
		padding: 8px 0 0;
		overflow-x: hidden;
	}

	/* Filters: stack chips & filter button vertically */
	.catalog-filters {
		flex-direction: column;
		height: auto;
		margin-bottom: 32px;
		gap: 16px;
		overflow: hidden;
	}

	/* Chips: swipe left/right (no visible scrollbar), same style as desktop */
	.catalog-filters__chips {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding: 0 8px;
		max-width: 100%;
	}

	.catalog-filters__chips::-webkit-scrollbar {
		display: none;
	}

	/* Filter button: full-width row with top/bottom borders */
	.catalog-filter-btn {
		width: 100%;
		justify-content: space-between;
		padding: 4px 24px;
		border-top: 1px solid #DFE3E8;
		border-bottom: 1px solid #DFE3E8;
	}

	/* --- Filter Panel (opened state) --- */
	.catalog-filter-panel {
		padding: 0 24px;
		margin-bottom: 32px;
	}

	.catalog-filter-panel__header {
		height: auto;
	}

	/* Hide tags row — replaced by tab navigation */
	.catalog-filter-panel__tags {
		display: none;
	}

	/* Mobile tab bar (built by JS) */
	.catalog-filter-tabs {
		display: flex;
		gap: 33px;
		align-items: center;
		margin-top: 20px;
	}

	.catalog-filter-tab {
		background: none;
		border: none;
		padding: 0;
		font-family: var(--font-body);
		font-size: 12px;
		font-weight: 400;
		line-height: 1.4;
		color: var(--color-black);
		text-transform: uppercase;
		cursor: pointer;
		white-space: nowrap;
	}

	.catalog-filter-tab--active {
		text-decoration: underline;
	}

	/* Filter body — single column on mobile */
	.catalog-filter-panel__body {
		flex-direction: column;
		gap: 16px;
		margin-top: 16px;
	}

	/* Hide group titles — replaced by tab bar */
	.catalog-filter-group__title {
		display: none;
	}

	/* Hide inactive groups, show only active */
	.catalog-filter-group {
		display: none;
	}

	.catalog-filter-group--active {
		display: flex;
	}

	/* Re-enable column layout for color/material checkboxes */
	.catalog-filter-group__options--columns {
		flex-wrap: wrap;
		max-height: 112px;
	}

	.catalog-filter-group__options--columns[data-columns="3"] {
		width: 100%;
	}

	.catalog-filter-group__options--columns[data-columns="3"] .catalog-checkbox {
		width: calc(100% / 3 - 8px);
	}

	.catalog-filter-group__options--columns[data-columns="2"] {
		width: 100%;
	}

	.catalog-filter-group__options--columns[data-columns="2"] .catalog-checkbox {
		width: calc(50% - 6px);
	}

	/* Product grid: 2 columns, 8px gap, edge-to-edge */
	.catalog-page ul.products {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	/* Hide slider arrows on mobile — swipe handles navigation */
	.product-card__arrow {
		display: none;
	}

	/* Product card: image fills full width, no padding */
	.product-card__slider {
		padding: 0;
	}

	.product-card__meta {
		padding: 0 24px 16px 24px;
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: start;
	}

	.product-card__indicators {
		grid-column: 1 / -1;
	}

	.product-card__save {
		position: static;
	}

	/* Pagination & empty state need their own padding */
	.catalog-pagination {
		padding: 40px 24px;
	}

	.catalog-empty {
		padding: 60px 24px;
	}
}
