/**
 * Fardara Custom WooCommerce - Product Page Quantity Field UI/UX
 *
 * Premium pill-style quantity selector with targeted skeleton loading state and quantity label in wrapper container.
 */

/* Product Quantity Container Wrapper */
.fcww-product-qty-wrapper {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	gap: 12px;
	margin: 0;
	padding: 0;
}

/* Quantity Label HTML Tag Styling */
label.fcww-qty-label-text,
.fcww-qty-label-text {
	font-size: 14px;
	font-weight: 700;
	color: #1e293b;
	display: inline-block;
	vertical-align: middle;
	line-height: 1.4;
	margin: 0;
	padding: 0;
	user-select: none;
	cursor: pointer;
}

/* Skeleton Loading State ONLY for Quantity Containers that contain a visible number input */
.quantity:has(input.qty:not([type="hidden"])):not(.fcww-product-qty-selector),
.quantity:has(input[type="number"]:not([type="hidden"])):not(.fcww-product-qty-selector),
.quantity.fcww-has-qty-input:not(.fcww-product-qty-selector) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 124px;
	height: 42px;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	background: linear-gradient(90deg, #f8fafc 25%, #e2e8f0 50%, #f8fafc 75%);
	background-size: 200% 100%;
	animation: fcww-skeleton-shimmer 1.5s infinite ease-in-out;
	overflow: hidden;
	position: relative;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	float: none;
	vertical-align: middle;
}

.quantity:has(input.qty:not([type="hidden"])):not(.fcww-product-qty-selector) input,
.quantity:has(input.qty:not([type="hidden"])):not(.fcww-product-qty-selector) label,
.quantity:has(input.qty:not([type="hidden"])):not(.fcww-product-qty-selector) span,
.quantity.fcww-has-qty-input:not(.fcww-product-qty-selector) input,
.quantity.fcww-has-qty-input:not(.fcww-product-qty-selector) label,
.quantity.fcww-has-qty-input:not(.fcww-product-qty-selector) span {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	position: absolute;
}

@keyframes fcww-skeleton-shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

/* Transformed Quantity Selector Component */
.quantity.fcww-product-qty-selector,
.fcww-product-qty-selector {
	display: inline-flex;
	align-items: center;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	background: #ffffff;
	overflow: hidden;
	height: 42px;
	width: auto;
	box-sizing: border-box;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	vertical-align: middle;
	margin: 0;
	padding: 0;
	float: none;
	animation: fcww-qty-fadein 0.25s ease-out forwards;
}

@keyframes fcww-qty-fadein {
	from {
		opacity: 0.4;
		transform: scale(0.98);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.quantity.fcww-product-qty-selector:hover,
.fcww-product-qty-selector:hover,
.quantity.fcww-product-qty-selector:focus-within,
.fcww-product-qty-selector:focus-within {
	border-color: #cbd5e1;
	box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

/* Quantity Plus/Minus Buttons */
.quantity.fcww-product-qty-selector .fcww-qty-btn,
.fcww-product-qty-selector .fcww-qty-btn {
	background: transparent;
	border: none;
	color: #334155;
	width: 38px;
	min-width: 38px;
	height: 40px;
	cursor: pointer;
	font-size: 18px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	outline: none;
	box-shadow: none;
	padding: 0;
	margin: 0;
	user-select: none;
	-webkit-user-select: none;
	transition: background-color 0.15s ease, color 0.15s ease;
	line-height: 1;
	float: none;
}

.quantity.fcww-product-qty-selector .fcww-qty-btn:hover,
.fcww-product-qty-selector .fcww-qty-btn:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.quantity.fcww-product-qty-selector .fcww-qty-btn:active,
.fcww-product-qty-selector .fcww-qty-btn:active {
	background: #e2e8f0;
}

.quantity.fcww-product-qty-selector .fcww-qty-btn:disabled,
.fcww-product-qty-selector .fcww-qty-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	background: transparent;
	color: #94a3b8;
}

/* Quantity Input Number */
.quantity.fcww-product-qty-selector input.qty,
.fcww-product-qty-selector input.qty {
	width: 48px;
	min-width: 48px;
	max-width: 60px;
	height: 40px;
	border: none;
	border-left: 1px solid #e2e8f0;
	border-right: 1px solid #e2e8f0;
	border-top: none;
	border-bottom: none;
	background: #ffffff;
	text-align: center;
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	padding: 0 4px;
	margin: 0;
	box-shadow: none;
	outline: none;
	-moz-appearance: textfield;
	float: none;
	display: inline-block;
	border-radius: 0;
	visibility: visible;
	opacity: 1;
	position: static;
}

/* Remove default WebKit/Blink spin buttons */
.quantity.fcww-product-qty-selector input.qty::-webkit-outer-spin-button,
.quantity.fcww-product-qty-selector input.qty::-webkit-inner-spin-button,
.fcww-product-qty-selector input.qty::-webkit-outer-spin-button,
.fcww-product-qty-selector input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
