/**
 * Shop Archive page styles.
 *
 * @package Kadence_Child
 */

/* Filter Bar
-------------------------------------------------------------- */
.kc-shop-filters {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 24px;
	margin-top: 24px;
	flex-wrap: wrap;
}

.kc-shop-filters__search {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px 8px 8px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	min-width: 180px;
	color: #9ca3af;
}

.kc-shop-filters__search:focus-within {
	border-color: var(--global-palette1, #c569ff);
	color: var(--global-palette3, #1A1A2E);
}

.kc-shop-filters__input {
	border: none !important;
	font-size: 12px;
	width: 100%;
	padding: 0 !important;
}

.kc-shop-filters__input::placeholder {
	color: #9ca3af;
}

/* Dropdown */
.kc-shop-filters__dropdown {
	position: relative;
}

.kc-shop-filters__toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	font-size: 12px;
	color: var(--global-palette3, #1A1A2E);
	cursor: pointer;
	white-space: nowrap;
}

.kc-shop-filters__toggle:hover {
	border-color: #9ca3af;
}

.kc-shop-filters__toggle svg:first-child {
	color: #6b7280;
}

.kc-shop-filters__chevron {
	color: #6b7280;
	transition: transform 0.2s;
}

.kc-shop-filters__dropdown.is-open .kc-shop-filters__chevron {
	transform: rotate(180deg);
}

.kc-shop-filters__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 50%;
	background: var(--global-palette1, #c569ff);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	position: absolute;
	top: -6px;
	right: -6px;
}

/* Panel */
.kc-shop-filters__panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 20;
	min-width: 180px;
	max-height: 240px;
	overflow-y: auto;
	padding: 8px 0;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.kc-shop-filters__option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 8px;
	font-size: 12px;
	color: var(--global-palette3, #1A1A2E);
	cursor: pointer;
	white-space: nowrap;
}

.kc-shop-filters__option:hover {
	background: #f9fafb;
}

.kc-shop-filters__option input[type="checkbox"] {
	width: 12px;
	height: 12px;
	accent-color: var(--global-palette1, #c569ff);
	cursor: pointer;
	margin: 0;
}

/* Clear button */
.kc-shop-filters__clear {
	padding: 8px 10px;
	border: none;
	border-radius: 8px;
	background: none;
	font-size: 12px;
	font-weight: 600;
	color: var(--global-palette1, #c569ff);
	cursor: pointer;
	white-space: nowrap;
}

.kc-shop-filters__clear:hover {
	text-decoration: underline;
}

/* Loading state */
.kc-shop-products--loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s;
}

/* Hide default Kadence shop top row as fallback */
.kadence-shop-top-row {
	display: none !important;
}

/* Product Grid
-------------------------------------------------------------- */
.woocommerce ul.products {
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 32px !important;
}

.woocommerce ul.products li.product {
	display: flex;
	flex-direction: column;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	background: none !important;
	box-shadow: none !important;
}

/* Disable Kadence hover animation (content sliding up) */
.woocommerce ul.products li.product:hover .entry-content-wrap,
.woocommerce ul.products li.product:focus-within .entry-content-wrap {
	transform: none !important;
}

.woocommerce ul.products li.product .entry-content-wrap {
	transition: none !important;
}

/* Product Card Image */
.woocommerce ul.products li.product .woocommerce-loop-image-link {
	display: block;
	border-radius: 8px;
	margin-bottom: 16px;
	margin-left: 16px;
}

.woocommerce ul.products li.product .woocommerce-loop-image-link img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 8px;
	box-shadow: -8px 8px 10px rgba(0, 0, 0, 0.4);
}

/* Product Card Content */
.woocommerce ul.products li.product .product-details {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 0 !important;
	background: none !important;
	border: none !important;
}

.woocommerce ul.products li.product .price {
	margin-top: auto;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 20px !important;
	font-weight: 700 !important;
	color: var(--global-palette3, #1A1A2E) !important;
	padding: 0 !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title a {
	color: inherit;
	text-decoration: none;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title a:hover {
	color: var(--global-palette1, #c569ff);
}

/* Product Excerpt */
.kc-product-card__excerpt {
	font-size: 16px;
	color: var(--global-palette4, #6B7280);
	line-height: 1.5;
	margin-bottom: 12px;
}

/* Product Price */
.woocommerce ul.products li.product .price {
	font-size: 22px !important;
	color: var(--global-palette1, #c569ff) !important;
	font-weight: 600 !important;
}

.kc-product-card__from {
	font-size: 22px;
	font-weight: 400;
	color: var(--global-palette4, #6B7280);
}

/* Hide elements we don't need */
.woocommerce ul.products li.product .product-action-wrap,
.woocommerce ul.products li.product .product-excerpt {
	display: none !important;
}

@media (max-width: 1024px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 768px) {
	.kc-shop-filters {
		gap: 8px;
	}

	.kc-shop-filters__search {
		min-width: 100%;
	}

	.woocommerce ul.products {
		grid-template-columns: 1fr !important;
		gap: 24px !important;
	}
}
