/**
 * La-Kass WooCommerce Styles
 *
 * Shop archive, product cards, filters, toolbar, pagination.
 *
 * @package La-Kass
 * @since   1.0.0
 */

/* ══════════════════════════════════════════════
   CSS Custom Properties — Shop
   ══════════════════════════════════════════════ */
:root {
	--lk-shop-sale-bg: #e53935;
	--lk-shop-sale-color: #ffffff;
	--lk-shop-new-bg: #43a047;
	--lk-shop-new-color: #ffffff;
	--lk-shop-oos-bg: #9e9e9e;
	--lk-shop-oos-color: #ffffff;
	--lk-shop-atc-bg: var(--lk-color-primary, #ff4d00);
	--lk-shop-atc-color: #ffffff;
	--lk-shop-atc-hover-bg: var(--lk-color-primary-hover, #e64400);
	--lk-shop-card-overlay: rgba(0, 0, 0, 0.04);
	--lk-shop-card-radius: 8px;
	--lk-shop-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	--lk-shop-card-hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	--lk-shop-star-color: #ffc107;
	--lk-shop-star-empty: #e0e0e0;
	--lk-shop-filter-width: 280px;
}

/* ══════════════════════════════════════════════
   Shop Page Header
   ══════════════════════════════════════════════ */
.lk-shop-header {
	background-color: var(--lk-color-bg-alt, #f5f5f5);
	padding: 30px 0;
	margin-bottom: 30px;
}

.lk-shop-header__title {
	font-size: 28px;
	font-weight: 700;
	margin: 0;
	color: var(--lk-color-heading, #000);
}

.lk-shop-header .woocommerce-products-header__description {
	margin-top: 8px;
	color: var(--lk-color-text-light, #666);
	font-size: 14px;
}

/* ══════════════════════════════════════════════
   Shop Layout
   ══════════════════════════════════════════════ */
.lk-shop-layout {
	display: grid;
	gap: 30px;
	align-items: start;
}

.lk-shop-layout--sidebar-left {
	grid-template-columns: var(--lk-shop-filter-width) 1fr;
}

.lk-shop-layout--sidebar-right {
	grid-template-columns: 1fr var(--lk-shop-filter-width);
}

.lk-shop-layout--full,
.lk-shop-layout--sidebar-none {
	grid-template-columns: 1fr;
}

/* ══════════════════════════════════════════════
   Shop Toolbar
   ══════════════════════════════════════════════ */
.lk-shop-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 15px;
	padding: 12px 0;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--lk-color-border, #e5e5e5);
}

.lk-shop-toolbar__right {
	display: flex;
	align-items: center;
	gap: 15px;
}

.lk-shop-result-count {
	font-size: 14px;
	color: var(--lk-color-text-light, #666);
	margin: 0;
}

/* View toggle */
.lk-shop-toolbar__view-toggle {
	display: flex;
	gap: 4px;
}

.lk-view-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--lk-color-border, #e5e5e5);
	border-radius: 4px;
	background: transparent;
	color: var(--lk-color-text-light, #999);
	cursor: pointer;
	transition: all 0.2s ease;
}

.lk-view-btn:hover,
.lk-view-btn--active {
	color: var(--lk-color-primary, #ff4d00);
	border-color: var(--lk-color-primary, #ff4d00);
}

/* Order by select */
.lk-shop-orderby {
	position: relative;
}

.lk-shop-orderby__select {
	appearance: none;
	-webkit-appearance: none;
	padding: 8px 36px 8px 12px;
	border: 1px solid var(--lk-color-border, #e5e5e5);
	border-radius: 4px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
	font-size: 14px;
	color: var(--lk-color-text, #333);
	cursor: pointer;
	min-width: 180px;
	transition: border-color 0.2s;
}

.lk-shop-orderby__select:focus {
	outline: none;
	border-color: var(--lk-color-primary, #ff4d00);
}

/* ══════════════════════════════════════════════
   Products Grid
   ══════════════════════════════════════════════ */
.lk-products-grid {
	display: grid;
	gap: 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.lk-products-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.lk-products-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.lk-products-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.lk-products-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.lk-products-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }

/* List view */
.lk-products-grid--list {
	grid-template-columns: 1fr !important;
}

/* ══════════════════════════════════════════════
   Product Card — Grid View
   ══════════════════════════════════════════════ */
.lk-product-card {
	list-style: none;
}

.lk-product-card__inner {
	background: #fff;
	border-radius: var(--lk-shop-card-radius);
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
	box-shadow: var(--lk-shop-card-shadow);
	height: 100%;
	display: flex;
	flex-direction: column;
}

.lk-product-card__inner:hover {
	box-shadow: var(--lk-shop-card-hover-shadow);
	transform: translateY(-2px);
}

/* Image area */
.lk-product-card__image-wrap {
	position: relative;
	overflow: hidden;
	background: var(--lk-color-bg-alt, #f5f5f5);
	aspect-ratio: 1 / 1;
}

.lk-product-card__image-link {
	display: block;
	width: 100%;
	height: 100%;
}

.lk-product-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.4s ease, transform 0.4s ease;
}

.lk-product-card__image--hover {
	position: absolute;
	top: 0;
	left: 0;
	opacity: 0;
}

.lk-product-card__inner:hover .lk-product-card__image--primary {
	opacity: 0;
}

.lk-product-card__inner:hover .lk-product-card__image--hover {
	opacity: 1;
	transform: scale(1.05);
}

/* Badges */
.lk-product-card__badges {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	z-index: 2;
}

.lk-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.lk-badge--sale {
	background: var(--lk-shop-sale-bg);
	color: var(--lk-shop-sale-color);
}

.lk-badge--new {
	background: var(--lk-shop-new-bg);
	color: var(--lk-shop-new-color);
}

.lk-badge--out-of-stock {
	background: var(--lk-shop-oos-bg);
	color: var(--lk-shop-oos-color);
}

/* Hover actions */
.lk-product-card__actions {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	z-index: 2;
	opacity: 0;
	transform: translateX(10px);
	transition: all 0.3s ease;
}

.lk-product-card__inner:hover .lk-product-card__actions {
	opacity: 1;
	transform: translateX(0);
}

.lk-product-action {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: var(--lk-color-text, #333);
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	transition: all 0.2s ease;
}

.lk-product-action:hover {
	background: var(--lk-color-primary, #ff4d00);
	color: #fff;
	transform: scale(1.1);
}

.lk-product-action svg {
	width: 16px;
	height: 16px;
}

/* Cart wrap — bottom overlay */
.lk-product-card__cart-wrap {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 10px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
	transform: translateY(100%);
	transition: transform 0.3s ease;
	z-index: 2;
	text-align: center;
}

.lk-product-card__inner:hover .lk-product-card__cart-wrap {
	transform: translateY(0);
}

/* Info area */
.lk-product-card__info {
	padding: 15px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.lk-product-card__category {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--lk-color-text-light, #999);
	margin-bottom: 5px;
}

.lk-product-card__title {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 8px;
	line-height: 1.4;
}

.lk-product-card__title a {
	color: var(--lk-color-heading, #000);
	text-decoration: none;
	transition: color 0.2s;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.lk-product-card__title a:hover {
	color: var(--lk-color-primary, #ff4d00);
}

/* Star rating */
.lk-star-rating {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 8px;
}

.lk-star-rating__stars {
	display: flex;
	gap: 1px;
}

.lk-star--full,
.lk-star--half {
	color: var(--lk-shop-star-color);
}

.lk-star--empty {
	color: var(--lk-shop-star-empty);
}

.lk-star-rating__count {
	font-size: 12px;
	color: var(--lk-color-text-light, #999);
}

/* Price */
.lk-product-price {
	margin-top: auto;
	font-size: 16px;
	font-weight: 700;
	color: var(--lk-color-heading, #000);
}

.lk-product-price__regular {
	color: var(--lk-color-text-light, #999);
	font-weight: 400;
	font-size: 14px;
}

.lk-product-price__regular del {
	text-decoration: line-through;
}

.lk-product-price__sale {
	color: var(--lk-shop-sale-bg, #e53935);
}

.lk-product-price__range {
	font-size: 14px;
}

/* ══════════════════════════════════════════════
   Product Card — List View
   ══════════════════════════════════════════════ */
.lk-product-card__inner--list {
	flex-direction: row;
	align-items: stretch;
}

.lk-product-card__image-wrap--list {
	width: 250px;
	min-width: 250px;
	aspect-ratio: auto;
}

.lk-product-card__info--list {
	padding: 20px;
	justify-content: center;
}

.lk-product-card__info--list .lk-product-card__title {
	font-size: 18px;
	-webkit-line-clamp: 1;
}

.lk-product-card__excerpt {
	font-size: 14px;
	color: var(--lk-color-text-light, #666);
	line-height: 1.5;
	margin: 8px 0 15px;
}

.lk-product-card__list-actions {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-top: auto;
}

.lk-product-card__actions--inline {
	position: static;
	opacity: 1;
	transform: none;
	flex-direction: row;
}

/* ══════════════════════════════════════════════
   Buttons (Shop context)
   ══════════════════════════════════════════════ */
.lk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: none;
	border-radius: 4px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
	line-height: 1;
}

.lk-btn--sm {
	padding: 8px 16px;
	font-size: 13px;
}

.lk-btn--primary {
	background: var(--lk-shop-atc-bg);
	color: var(--lk-shop-atc-color);
}

.lk-btn--primary:hover {
	background: var(--lk-shop-atc-hover-bg);
	color: var(--lk-shop-atc-color);
}

.lk-btn--outline {
	background: transparent;
	border: 1px solid var(--lk-color-border, #e5e5e5);
	color: var(--lk-color-text, #333);
}

.lk-btn--outline:hover {
	border-color: var(--lk-color-primary, #ff4d00);
	color: var(--lk-color-primary, #ff4d00);
}

/* Add to Cart loading state */
.lk-add-to-cart.loading {
	opacity: 0.6;
	pointer-events: none;
}

.lk-add-to-cart.added::after {
	content: '✓';
	margin-left: 4px;
}

/* ══════════════════════════════════════════════
   Shop Sidebar / Filters
   ══════════════════════════════════════════════ */
.lk-shop-sidebar {
	position: sticky;
	top: 100px;
}

.lk-shop-filters {
	background: #fff;
	border-radius: var(--lk-shop-card-radius);
	padding: 20px;
	box-shadow: var(--lk-shop-card-shadow);
}

.lk-shop-filters__heading {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--lk-color-heading, #000);
}

/* Filter section (collapsible) */
.lk-filter-section {
	border-bottom: 1px solid var(--lk-color-border, #e5e5e5);
	padding-bottom: 15px;
	margin-bottom: 15px;
}

.lk-filter-section:last-child {
	border-bottom: none;
	padding-bottom: 0;
	margin-bottom: 0;
}

.lk-filter-section__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0;
	border: none;
	background: none;
	font-size: 15px;
	font-weight: 600;
	color: var(--lk-color-heading, #000);
	cursor: pointer;
	margin-bottom: 12px;
}

.lk-filter-section__arrow {
	transition: transform 0.3s ease;
}

.lk-filter-section--open .lk-filter-section__arrow {
	transform: rotate(180deg);
}

.lk-filter-section__body {
	transition: all 0.3s ease;
}

/* Filter list */
.lk-filter-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lk-filter-list__item {
	margin-bottom: 2px;
}

.lk-filter-list__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 0;
	color: var(--lk-color-text, #333);
	text-decoration: none;
	font-size: 14px;
	transition: color 0.2s;
}

.lk-filter-list__link:hover,
.lk-filter-list__item--active > .lk-filter-list__link {
	color: var(--lk-color-primary, #ff4d00);
}

.lk-filter-list__count {
	font-size: 12px;
	color: var(--lk-color-text-light, #999);
}

.lk-filter-list__children {
	list-style: none;
	margin: 0;
	padding-left: 15px;
}

/* Checkbox filter */
.lk-filter-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 0;
	cursor: pointer;
	font-size: 14px;
	color: var(--lk-color-text, #333);
}

.lk-filter-checkbox__input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.lk-filter-checkbox__checkmark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border: 2px solid var(--lk-color-border, #ddd);
	border-radius: 3px;
	transition: all 0.2s;
	flex-shrink: 0;
}

.lk-filter-checkbox__input:checked + .lk-filter-checkbox__checkmark {
	background: var(--lk-color-primary, #ff4d00);
	border-color: var(--lk-color-primary, #ff4d00);
}

.lk-filter-checkbox__input:checked + .lk-filter-checkbox__checkmark::after {
	content: '';
	display: block;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	margin-top: -2px;
}

.lk-filter-checkbox__input:focus-visible + .lk-filter-checkbox__checkmark {
	box-shadow: 0 0 0 2px var(--lk-color-primary, #ff4d00);
}

/* Color swatch */
.lk-filter-swatch {
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid var(--lk-color-border, #ddd);
	flex-shrink: 0;
}

/* Price filter */
.lk-price-filter {
	padding: 5px 0;
}

.lk-price-filter__slider {
	height: 4px;
	background: var(--lk-color-border, #e5e5e5);
	border-radius: 2px;
	margin: 15px 0;
	position: relative;
}

.lk-price-filter__inputs {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.lk-price-filter__field {
	display: flex;
	align-items: center;
	gap: 4px;
	flex: 1;
}

.lk-price-filter__currency {
	font-size: 13px;
	color: var(--lk-color-text-light, #666);
	font-weight: 600;
}

.lk-price-filter__input {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid var(--lk-color-border, #e5e5e5);
	border-radius: 4px;
	font-size: 13px;
	text-align: center;
}

.lk-price-filter__input:focus {
	outline: none;
	border-color: var(--lk-color-primary, #ff4d00);
}

.lk-price-filter__separator {
	color: var(--lk-color-text-light, #999);
}

.lk-price-filter__apply {
	width: 100%;
}

/* Active filters / reset */
.lk-active-filters {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid var(--lk-color-border, #e5e5e5);
}

.lk-active-filters__reset {
	width: 100%;
	text-align: center;
}

.lk-active-filters__reset svg {
	vertical-align: middle;
}

/* ══════════════════════════════════════════════
   Pagination
   ══════════════════════════════════════════════ */
.lk-shop-pagination {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--lk-color-border, #e5e5e5);
}

.lk-shop-pagination .woocommerce-pagination {
	text-align: center;
}

.lk-shop-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 4px;
}

.lk-shop-pagination .page-numbers li {
	list-style: none;
}

.lk-shop-pagination .page-numbers a,
.lk-shop-pagination .page-numbers span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--lk-color-border, #e5e5e5);
	border-radius: 4px;
	color: var(--lk-color-text, #333);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s ease;
}

.lk-shop-pagination .page-numbers a:hover {
	border-color: var(--lk-color-primary, #ff4d00);
	color: var(--lk-color-primary, #ff4d00);
}

.lk-shop-pagination .page-numbers .current {
	background: var(--lk-color-primary, #ff4d00);
	border-color: var(--lk-color-primary, #ff4d00);
	color: #fff;
}

.lk-shop-pagination .page-numbers .dots {
	border: none;
	padding: 0 4px;
}

.lk-shop-pagination .page-numbers .prev,
.lk-shop-pagination .page-numbers .next {
	font-size: 0;
}

.lk-shop-pagination .page-numbers .prev svg,
.lk-shop-pagination .page-numbers .next svg {
	display: block;
}

/* ══════════════════════════════════════════════
   No Products Found
   ══════════════════════════════════════════════ */
.lk-no-products {
	text-align: center;
	padding: 60px 20px;
	color: var(--lk-color-text-light, #666);
	font-size: 16px;
	grid-column: 1 / -1;
}

.lk-empty-cart {
	text-align: center;
	padding: 60px 20px;
}

.lk-empty-cart svg {
	color: var(--lk-color-text-light, #ccc);
	margin-bottom: 15px;
}

.lk-empty-cart p {
	font-size: 18px;
	color: var(--lk-color-text-light, #666);
}

/* ══════════════════════════════════════════════
   WooCommerce Notices
   ══════════════════════════════════════════════ */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	padding: 12px 20px;
	border-radius: 4px;
	margin-bottom: 20px;
	font-size: 14px;
}

.woocommerce-message {
	background: #e8f5e9;
	border-left: 4px solid #43a047;
	color: #2e7d32;
}

.woocommerce-info {
	background: #e3f2fd;
	border-left: 4px solid #1e88e5;
	color: #1565c0;
}

.woocommerce-error {
	background: #ffebee;
	border-left: 4px solid #e53935;
	color: #c62828;
}

.woocommerce-error li {
	list-style: none;
}

/* ══════════════════════════════════════════════
   Responsive — Tablet
   ══════════════════════════════════════════════ */
@media (max-width: 1024px) {
	.lk-shop-layout--sidebar-left,
	.lk-shop-layout--sidebar-right {
		grid-template-columns: 1fr;
	}

	.lk-shop-sidebar {
		position: static;
		order: -1;
	}

	.lk-shop-filters {
		display: none; /* Hidden on tablet, toggled via JS */
	}

	.lk-shop-filters--active {
		display: block;
	}

	.lk-products-grid--cols-5,
	.lk-products-grid--cols-6 {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ══════════════════════════════════════════════
   Responsive — Mobile
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
	.lk-shop-header {
		padding: 20px 0;
		margin-bottom: 20px;
	}

	.lk-shop-header__title {
		font-size: 22px;
	}

	.lk-shop-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.lk-shop-toolbar__right {
		justify-content: space-between;
	}

	.lk-products-grid--cols-3,
	.lk-products-grid--cols-4,
	.lk-products-grid--cols-5,
	.lk-products-grid--cols-6 {
		grid-template-columns: repeat(2, 1fr);
	}

	.lk-products-grid {
		gap: 12px;
	}

	.lk-product-card__info {
		padding: 10px;
	}

	.lk-product-card__title {
		font-size: 13px;
	}

	.lk-product-price {
		font-size: 14px;
	}

	/* List view: stack on mobile */
	.lk-product-card__inner--list {
		flex-direction: column;
	}

	.lk-product-card__image-wrap--list {
		width: 100%;
		min-width: auto;
		aspect-ratio: 4 / 3;
	}

	/* Always show actions on mobile */
	.lk-product-card__actions {
		opacity: 1;
		transform: translateX(0);
	}

	.lk-product-card__cart-wrap {
		transform: translateY(0);
		background: rgba(0, 0, 0, 0.4);
	}
}

@media (max-width: 480px) {
	.lk-products-grid--cols-2,
	.lk-products-grid--cols-3,
	.lk-products-grid--cols-4,
	.lk-products-grid--cols-5,
	.lk-products-grid--cols-6 {
		grid-template-columns: repeat(2, 1fr);
	}

	.lk-products-grid {
		gap: 8px;
	}

	.lk-product-card__info {
		padding: 8px;
	}

	.lk-product-card__category {
		font-size: 10px;
	}

	.lk-product-card__title {
		font-size: 12px;
	}

	.lk-product-action {
		width: 30px;
		height: 30px;
	}

	.lk-product-action svg {
		width: 14px;
		height: 14px;
	}
}
