/**
 * QAudio Product Cards — front-end styles.
 *
 * Card colors/radius are driven by CSS custom properties, set on :root via
 * an inline <style> block from QAudio_PC_Assets (see includes/class-qaudio-pc-assets.php).
 *
 * @package QAudio_Product_Cards
 */

:root {
	--qaudio-pc-primary: #e6332a;
	--qaudio-pc-badge: #ff6b00;
	--qaudio-pc-radius: 10px;
	--qaudio-pc-ribbon-bg: #f3e6c9;
	--qaudio-pc-stock-in: #1e8e3e;
	--qaudio-pc-stock-out: #d93025;
	--qaudio-pc-border: #e5e5e5;
}

/* Card shell — applies to every WooCommerce loop item (shop, category,
   related products, carousel, cross-sells). */
ul.products li.product {
	position: relative;
	background: #fff;
	border: 1px solid var( --qaudio-pc-border );
	border-radius: var( --qaudio-pc-radius );
	overflow: hidden;
	padding: 0 0 14px !important;
	text-align: center;
}

ul.products li.product img {
	border-radius: 0 !important;
}

/* Ribbon banner */

.qaudio-pc-ribbon {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	width: 100%;
	padding: 8px 10px;
	background: var( --qaudio-pc-ribbon-bg );
	font-size: 12px;
	line-height: 1.3;
	box-sizing: border-box;
}

.qaudio-pc-ribbon-line-1 {
	font-weight: 700;
	color: #1d1d1d;
}

.qaudio-pc-ribbon-line-2 {
	font-size: 11px;
	color: #333;
}

.qaudio-pc-highlight {
	color: var( --qaudio-pc-primary );
	font-weight: 800;
}

/* Badge + wishlist overlay */

.qaudio-pc-overlays {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 10px 10px 0;
}

.qaudio-pc-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	color: var( --qaudio-pc-badge );
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1.1;
}

.qaudio-pc-badge-icon {
	border-radius: 50%;
}

.qaudio-pc-wishlist {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin-left: auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #333;
	cursor: pointer;
	transition: color 0.15s ease, transform 0.15s ease;
}

.qaudio-pc-wishlist:hover,
.qaudio-pc-wishlist[aria-pressed="true"] {
	color: var( --qaudio-pc-primary );
	transform: scale( 1.08 );
}

/* Title / subtitle */

ul.products li.product .woocommerce-loop-product__title {
	margin: 10px 12px 2px;
	font-size: 15px;
	font-weight: 600;
	color: #1d1d1d;
}

.qaudio-pc-subtitle {
	margin: 0 12px 6px;
	font-size: 13px;
	color: #6b7280;
}

/* Rating */

ul.products li.product .star-rating {
	margin: 0 auto 6px;
}

/* Price, with superscript decimals (uses WooCommerce's own markup class) */

/* Reference design shows no visible decimal separator, just a space before
   the superscript cents, e.g. "189 98 lei" instead of "189,98 lei". */
.woocommerce-Price-decimalSeparator {
	display: none;
}

.woocommerce-Price-decimalSubunit {
	font-size: 0.65em;
	vertical-align: super;
}

.woocommerce-Price-decimalSubunit::before {
	content: ' ';
}

ul.products li.product .price {
	display: block;
	margin: 0 12px 4px;
	font-size: 20px;
	font-weight: 700;
	color: var( --qaudio-pc-primary );
}

ul.products li.product .price del {
	margin-right: 6px;
	font-size: 0.6em;
	font-weight: 400;
	color: #9aa0a6;
	opacity: 1;
}

ul.products li.product .price ins {
	text-decoration: none;
}

/* "After coupon" price box */

.qaudio-pc-coupon-price {
	display: inline-block;
	margin: 0 auto 8px;
	padding: 3px 8px;
	border-radius: 4px;
	background: var( --qaudio-pc-primary );
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}

.qaudio-pc-coupon-label {
	font-weight: 700;
}

.qaudio-pc-coupon-amount .woocommerce-Price-amount {
	color: #ebff00;
	font-size: 12px;
}

/* Stock status */

.qaudio-pc-stock {
	margin: 0 12px 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.qaudio-pc-stock.is-in-stock {
	color: var( --qaudio-pc-stock-in );
}

.qaudio-pc-stock.is-out-of-stock {
	color: var( --qaudio-pc-stock-out );
}

/* Add to cart button */

ul.products li.product a.button,
ul.products li.product .add_to_cart_button,
ul.products li.product .ajax_add_to_cart {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: calc( 100% - 24px );
	margin: 4px 12px 0;
	padding: 10px 12px;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	background: #fff;
	color: #1d1d1d;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

ul.products li.product a.button:hover {
	border-color: var( --qaudio-pc-badge );
	background: #fffaf3;
}

.qaudio-pc-cart-icon {
	flex: 0 0 auto;
	padding: 6px;
	border-radius: 4px;
	background: var( --qaudio-pc-badge );
	color: #fff;
	box-sizing: content-box;
}

.qaudio-pc-cart-label {
	flex: 0 1 auto;
}

/* ---------------------------------------------------------------------- */
/* Carousel                                                                */
/* ---------------------------------------------------------------------- */

.qaudio-pc-carousel {
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.qaudio-pc-carousel-title {
	margin: 0 0 14px;
	font-size: 22px;
	font-weight: 700;
}

.qaudio-pc-carousel-viewport {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
}

.qaudio-pc-carousel-track.products {
	display: flex !important;
	flex-wrap: nowrap;
	gap: 16px;
	margin: 0;
	padding: 4px 2px 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	list-style: none;
}

.qaudio-pc-carousel-track.products li.product {
	flex: 0 0 auto;
	width: 220px;
	scroll-snap-align: start;
}

.qaudio-pc-carousel-nav {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var( --qaudio-pc-border );
	border-radius: 50%;
	background: #fff;
	color: #1d1d1d;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.qaudio-pc-carousel-nav:disabled {
	opacity: 0.35;
	cursor: default;
}

@media ( max-width: 600px ) {
	.qaudio-pc-carousel-track.products li.product {
		width: 168px;
	}
}

/* ---------------------------------------------------------------------- */
/* Filter bar                                                              */
/* ---------------------------------------------------------------------- */

.qaudio-pc-filters {
	width: 100%;
	box-sizing: border-box;
}

.qaudio-pc-filters[aria-busy="true"] {
	opacity: 0.6;
	pointer-events: none;
}

.qaudio-pc-filters-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.qaudio-pc-filters-title {
	font-weight: 700;
	font-size: 14px;
}

.qaudio-pc-filters-clear {
	font-size: 12px;
	color: var( --qaudio-pc-primary );
	text-decoration: none;
}

.qaudio-pc-filters-clear:hover {
	text-decoration: underline;
}

.qaudio-pc-filter-group {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
}

.qaudio-pc-filter-group-label {
	margin-bottom: 6px;
	padding: 0;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: #444;
}

.qaudio-pc-filter-options {
	margin: 0;
	padding: 0;
	list-style: none;
}

.qaudio-pc-filter-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	color: #1d1d1d;
	font-size: 13px;
	text-decoration: none;
}

.qaudio-pc-filter-checkbox {
	flex: 0 0 auto;
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 1px solid #b5b5b5;
	border-radius: 3px;
	background: #fff;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

.qaudio-pc-filter-option.is-selected .qaudio-pc-filter-checkbox {
	border-color: var( --qaudio-pc-primary );
	background: var( --qaudio-pc-primary ) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='m6.5 11.5-3-3 1-1 2 2 5-5 1 1z'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.qaudio-pc-filter-option.is-selected .qaudio-pc-filter-label {
	font-weight: 700;
}

.qaudio-pc-filter-count {
	color: #9aa0a6;
	font-size: 12px;
}
