/* Vegas Product Card Widget - styles */

/*
 * Reset button/input defaults coming from the theme or browser UA styles.
 * Many themes apply a red outline/border on :invalid or :focus number inputs
 * and on generic buttons - without this reset that shows up as an unwanted
 * thin red line around swatches, the qty stepper, and the add-to-cart button.
 * Wrapped in :where() so this reset has ZERO specificity of its own and can
 * never outrank the actual component styles further down this file
 * (.vpc-swatch, .vpc-add-to-cart, .vpc-qty-btn, .vpc-qty-input, etc.).
 */
:where(.vpc-card button, .vpc-card input) {
	all: unset;
	box-sizing: border-box;
	font-family: inherit;
	font-size: inherit;
	color: inherit;
}

:where(.vpc-card button) {
	cursor: pointer;
}

.vpc-card input[type="number"] {
	-moz-appearance: textfield;
}

:where(.vpc-card button:focus, .vpc-card input:focus) {
	outline: none;
	box-shadow: none;
}

:where(.vpc-card input:invalid, .vpc-card input:out-of-range) {
	box-shadow: none;
	outline: none;
}

.vpc-card {
	direction: rtl;
	text-align: right;
	font-family: inherit;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 16px;
	background: #ffffff;
	box-sizing: border-box;
	position: relative;
}

.vpc-card.vpc-empty {
	color: #999;
	text-align: center;
	padding: 24px;
}

.vpc-row {
	width: 100%;
}

/* ---------- Title ---------- */

.vpc-title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.5;
	width: 100%;
}

.vpc-title a {
	color: inherit;
	text-decoration: none;
}

.vpc-title a:hover {
	text-decoration: underline;
}

/* ---------- Price ---------- */

.vpc-price {
	font-size: 15px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	transition: opacity 0.15s ease;
}

.vpc-price.vpc-price-updating {
	opacity: 0.4;
}

.vpc-price del {
	color: #8a8a8e;
	text-decoration: line-through;
	font-weight: 400;
	font-size: 14px;
	order: 1;
}

.vpc-price ins {
	color: #e53935;
	text-decoration: none;
	font-weight: 700;
	font-size: 16px;
	order: 2;
}

.vpc-price bdi,
.vpc-price .woocommerce-Price-amount {
	font-family: inherit;
}

/* ---------- Swatches ---------- */

.vpc-row-swatches {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.vpc-swatches-label {
	font-size: 13px;
	color: #6b6b6f;
	font-weight: 500;
}

.vpc-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-start;
}

.vpc-swatch {
	padding: 0 10px;
	border: 2px solid #e2e2e4;
	background-color: #f2f2f3;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
	box-sizing: border-box;
}

.vpc-swatch--color {
	min-width: 40px;
	height: 40px;
	border-radius: 50%;
}

.vpc-swatch--size {
	min-width: 44px;
	height: 44px;
	border-radius: 8px;
	color: #333333;
	font-weight: 600;
}

.vpc-swatch:hover {
	transform: scale(1.05);
}

.vpc-swatch.is-active {
	border-color: #1d1d1f;
	box-shadow: 0 0 0 1px #1d1d1f inset;
}

.vpc-swatch--size.is-active {
	background-color: #1d1d1f;
	color: #ffffff;
	box-shadow: none;
}

.vpc-swatch-text {
	font-size: 12px;
	white-space: nowrap;
	color: inherit;
}

.vpc-swatch.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* ---------- Actions row (button + stepper) ---------- */

.vpc-row-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.vpc-add-to-cart {
	flex: 1 1 auto;
	min-width: 140px;
	background-color: #1d1d1f;
	color: #ffffff;
	border: none;
	border-radius: 10px;
	padding: 12px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: opacity 0.15s ease, background-color 0.15s ease;
	position: relative;
}

.vpc-add-to-cart:hover {
	opacity: 0.9;
}

.vpc-add-to-cart:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.vpc-add-to-cart.is-loading .vpc-btn-label {
	opacity: 0.6;
}

.vpc-btn-spinner {
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	display: none;
	animation: vpc-spin 0.6s linear infinite;
}

.vpc-add-to-cart.is-loading .vpc-btn-spinner {
	display: inline-block;
}

@keyframes vpc-spin {
	to { transform: rotate(360deg); }
}

.vpc-add-to-cart.is-success {
	background-color: #2e7d32;
}

/* ---------- Quantity stepper ---------- */

.vpc-qty-stepper {
	display: flex;
	align-items: center;
	border: 1px solid #d8d8da;
	border-radius: 10px;
	overflow: hidden;
	flex: 0 0 auto;
}

.vpc-qty-btn {
	width: 36px;
	height: 44px;
	border: none;
	background: #f7f7f8;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #1d1d1f;
	display: flex;
	align-items: center;
	justify-content: center;
}

.vpc-qty-btn:hover {
	background: #ececed;
}

.vpc-qty-input {
	width: 44px;
	height: 44px;
	border: none;
	border-right: 1px solid #d8d8da;
	border-left: 1px solid #d8d8da;
	text-align: center;
	font-size: 14px;
	-moz-appearance: textfield;
}

.vpc-qty-input::-webkit-outer-spin-button,
.vpc-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ---------- Message / feedback ---------- */

.vpc-message {
	font-size: 13px;
	min-height: 0;
	transition: opacity 0.2s ease;
	opacity: 0;
}

.vpc-message.is-visible {
	opacity: 1;
}

.vpc-message.is-error {
	color: #e53935;
}

.vpc-message.is-success {
	color: #2e7d32;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	.vpc-add-to-cart {
		min-width: 100%;
		order: 2;
	}

	.vpc-qty-stepper {
		order: 1;
	}
}
