/*
 * Quick Purchase for WooCommerce — Front-end styles
 * Colors / radius / column counts come from CSS variables set inline by
 * QPFW_Frontend::inline_css_vars() based on the admin Appearance settings.
 */

.qpfw-wrapper {
	direction: rtl;
	font-family: inherit;
}

.qpfw-admin-warning {
	background: #FFF4E5;
	border: 1px solid #F0C36D;
	color: #8A6116;
	padding: 10px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: 13px;
}

/* ---------- Filters bar ---------- */
.qpfw-filters-bar {
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
	background: #ffffff;
	border: 1px solid #ECEDF3;
	border-radius: 20px;
	padding: 20px 28px;
	margin-bottom: 28px;
}

.qpfw-filters-title h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--qpfw-btn-bg, #21285B);
}

.qpfw-filters-title p {
	margin: 2px 0 0;
	font-size: 12px;
	color: #9A9AB0;
}

.qpfw-filter-item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 120px;
}

.qpfw-filter-item label {
	font-size: 12px;
	color: #6B6B85;
	font-weight: 600;
}

.qpfw-filter {
	border: 1px solid #E4E4EF;
	border-radius: 10px;
	padding: 9px 14px;
	font-size: 13px;
	background: #fff;
	color: #33334D;
	min-width: 130px;
}

/* ---------- Color swatches (real radio inputs, visually hidden) ---------- */
.qpfw-swatch-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.qpfw-swatch,
.qpfw-swatch-all {
	position: relative;
	cursor: pointer;
}

.qpfw-swatch input[type="radio"],
.qpfw-swatch-all input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.qpfw-swatch {
	display: inline-block;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px #E4E4EF;
}

.qpfw-swatch:has(input:checked) {
	box-shadow: 0 0 0 2px var(--qpfw-accent, #D4A843);
}

.qpfw-swatch-all {
	font-size: 12px;
	color: #6B6B85;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.qpfw-swatch-all:has(input:checked) {
	color: var(--qpfw-btn-bg, #21285B);
	font-weight: 700;
}

/* ---------- Stock toggle (single checkbox) ---------- */
.qpfw-stock-toggle {
	display: flex;
	align-items: center;
	height: 38px;
}

.qpfw-stock-toggle label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 400;
	color: #33334D;
	cursor: pointer;
	white-space: nowrap;
}

.qpfw-stock-toggle input[type="checkbox"] {
	width: 15px;
	height: 15px;
	accent-color: var(--qpfw-btn-bg, #21285B);
	cursor: pointer;
}

/* ---------- Search box ---------- */
.qpfw-search-box {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-right: auto;
}

.qpfw-search-input {
	border: 1px solid #E4E4EF;
	border-radius: 10px;
	padding: 9px 16px;
	font-size: 13px;
	min-width: 160px;
}

.qpfw-search-btn {
	background: var(--qpfw-btn-bg, #21285B);
	color: var(--qpfw-btn-text, #fff);
	border: none;
	border-radius: 10px;
	padding: 10px 22px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.qpfw-search-btn:hover {
	opacity: .9;
}

/* ---------- Product grid ---------- */
.qpfw-grid {
	display: grid;
	grid-template-columns: repeat(var(--qpfw-cols-desktop, 4), 1fr);
	gap: 22px;
	transition: opacity .15s;
}

.qpfw-grid.qpfw-loading {
	opacity: .5;
}

@media (max-width: 1024px) {
	.qpfw-grid {
		grid-template-columns: repeat(var(--qpfw-cols-tablet, 3), 1fr);
	}
}

@media (max-width: 640px) {
	.qpfw-grid {
		grid-template-columns: repeat(var(--qpfw-cols-mobile, 2), 1fr);
	}
	.qpfw-filters-bar {
		padding: 16px;
	}
	.qpfw-search-box {
		margin-right: 0;
		width: 100%;
	}
	.qpfw-search-input {
		flex: 1;
	}
}

/* ---------- Product card ---------- */
.qpfw-card {
	background: var(--qpfw-card-bg, #fff);
	border: 1px solid var(--qpfw-card-border, #ECEDF3);
	border-radius: var(--qpfw-radius, 16px);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
	transition: box-shadow .2s;
}

.qpfw-card:hover {
	box-shadow: 0 8px 24px rgba(20, 20, 50, .08);
}

.qpfw-card-thumb {
	position: relative;
	display: block;
	border-radius: calc(var(--qpfw-radius, 16px) - 6px);
	overflow: hidden;
	background: #FAFAFC;
}

.qpfw-card-thumb img {
	width: 100%;
	height: auto;
	display: block;
}

.qpfw-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	font-size: 11px;
	padding: 4px 10px;
	border-radius: 20px;
	font-weight: 600;
}

.qpfw-badge-in {
	background: #E7F6EC;
	color: #2E9E52;
}

.qpfw-badge-out {
	background: #FBE7E7;
	color: #D44;
}

.qpfw-card-title {
	font-size: 14px;
	margin: 0;
	font-weight: 600;
	line-height: 1.5;
}

.qpfw-card-title a {
	color: #28283D;
	text-decoration: none;
}

.qpfw-card-price {
	font-size: 14px;
	font-weight: 700;
	color: var(--qpfw-btn-bg, #21285B);
}

.qpfw-card-price del {
	color: #AAAAAA;
	font-weight: 400;
	margin-left: 6px;
}

.qpfw-card-variations {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.qpfw-variation-select {
	border: 1px solid #E4E4EF;
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 12px;
}

.qpfw-card-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;
}

.qpfw-qty-wrap {
	display: flex;
	align-items: center;
	border: 1px solid #E4E4EF;
	border-radius: 10px;
	overflow: hidden;
}

.qpfw-qty-btn {
	background: #F7F7FB;
	border: none;
	width: 28px;
	height: 34px;
	cursor: pointer;
	font-size: 14px;
}

.qpfw-qty-input {
	width: 36px;
	text-align: center;
	border: none;
	font-size: 13px;
}

.qpfw-add-to-cart {
	flex: 1;
	background: var(--qpfw-btn-bg, #21285B);
	color: var(--qpfw-btn-text, #fff);
	border: none;
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.qpfw-add-to-cart:hover {
	opacity: .9;
}

.qpfw-add-to-cart:disabled,
.qpfw-qty-input:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.qpfw-card-message {
	font-size: 12px;
	min-height: 14px;
}

.qpfw-msg-success {
	color: #2E9E52;
}

.qpfw-msg-error {
	color: #D44;
}

.qpfw-no-products {
	text-align: center;
	padding: 40px;
	color: #999;
	grid-column: 1 / -1;
}

.qpfw-load-more-wrap {
	text-align: center;
	margin-top: 28px;
}

.qpfw-load-more {
	background: #fff;
	border: 1px solid var(--qpfw-btn-bg, #21285B);
	color: var(--qpfw-btn-bg, #21285B);
	padding: 10px 28px;
	border-radius: 30px;
	font-weight: 600;
	cursor: pointer;
}

.qpfw-load-more:hover {
	background: var(--qpfw-btn-bg, #21285B);
	color: var(--qpfw-btn-text, #fff);
}

.qpfw-load-more:disabled {
	opacity: .6;
	cursor: not-allowed;
}
