/**
 * WC Variable Product Selector Widget - Frontend Styles
 * This file contains all the CSS styling for the widget on the frontend
 * The design matches the screenshot provided
 */

/* Main Container */
.wc-vps-container {
	display: flex;
	flex-direction: column;
	gap: 15px;
	width: 100%;
}

/* ====================================
   SELECTOR (DROPDOWN) STYLING
   ==================================== */

/* Selector Wrapper Container */
.wc-vps-selector-wrapper {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Label Typography */
.wc-vps-label {
	font-size: 14px;
	font-weight: 500;
	color: #333;
	display: block;
}

/* Dropdown Select Element */
.wc-vps-selector {
	padding: 10px 15px;
	border: 2px solid #ddd;
	border-radius: 25px;
	font-size: 14px;
	background-color: #fff;
	cursor: pointer;
	color: #333;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 20px;
	padding-right: 35px;
	transition: all 0.3s ease;
	min-width: 150px;
}

/* Selector Hover State */
.wc-vps-selector:hover {
	border-color: #999;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Selector Focus State */
.wc-vps-selector:focus {
	outline: none;
	border-color: #333;
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* ====================================
   QUANTITY SELECTOR STYLING
   ==================================== */

/* Quantity Wrapper Container */
.wc-vps-quantity-wrapper {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Quantity Container */
.wc-vps-quantity {
	display: flex;
	align-items: center;
	gap: 0;
	border: 2px solid #ddd;
	border-radius: 25px;
	background-color: #fff;
	width: fit-content;
	transition: all 0.3s ease;
}

/* Quantity Button Styling */
.wc-vps-qty-btn {
	background: transparent;
	border: none;
	width: 40px;
	height: 40px;
	cursor: pointer;
	font-size: 18px;
	font-weight: bold;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	padding: 0;
}

/* Quantity Button Hover State */
.wc-vps-qty-btn:hover {
	color: #000;
	background-color: #f5f5f5;
}

/* Quantity Button Active State */
.wc-vps-qty-btn:active {
	transform: scale(0.95);
}

/* Minus Button */
.wc-vps-qty-minus {
	border-right: 1px solid #ddd;
}

/* Plus Button */
.wc-vps-qty-plus {
	border-left: 1px solid #ddd;
}

/* Quantity Input Field */
.wc-vps-qty-input {
	border: none;
	background: transparent;
	width: 50px;
	height: 40px;
	text-align: center;
	font-size: 16px;
	font-weight: 500;
	color: #333;
	padding: 0;
	-moz-appearance: textfield; /* Remove spinner in Firefox */
}

/* Remove number input spinner for Chrome, Safari, Edge */
.wc-vps-qty-input::-webkit-outer-spin-button,
.wc-vps-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Quantity Input Focus */
.wc-vps-qty-input:focus {
	outline: none;
}

/* ====================================
   ADD TO CART BUTTON STYLING
   ==================================== */

/* Add to Cart Button */
.wc-vps-add-to-cart {
	width: 100%;
	padding: 14px 20px;
	background-color: #FFC107;
	color: #000;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: all 0.3s ease;
	text-transform: uppercase;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Add to Cart Button Hover */
.wc-vps-add-to-cart:hover {
	background-color: #FFB300;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transform: translateY(-2px);
}

/* Add to Cart Button Active */
.wc-vps-add-to-cart:active {
	transform: translateY(0);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Add to Cart Button Loading State */
.wc-vps-add-to-cart.loading {
	opacity: 0.7;
	cursor: not-allowed;
	pointer-events: none;
}

/* Add to Cart Button Disabled */
.wc-vps-add-to-cart:disabled {
	background-color: #ccc;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

/* ====================================
   ERROR MESSAGE STYLING
   ==================================== */

/* Error Message */
.wc-vps-error {
	background-color: #f8d7da;
	color: #721c24;
	padding: 12px 15px;
	border-radius: 4px;
	border: 1px solid #f5c6cb;
	font-size: 14px;
	margin-bottom: 10px;
}

/* Success Message */
.wc-vps-success {
	background-color: #d4edda;
	color: #155724;
	padding: 12px 15px;
	border-radius: 4px;
	border: 1px solid #c3e6cb;
	font-size: 14px;
	margin-bottom: 10px;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

/* Tablet Devices (768px and below) */
@media (max-width: 768px) {
	/* Adjust selector styling for mobile */
	.wc-vps-selector {
		font-size: 13px;
		padding: 8px 12px;
		padding-right: 30px;
		min-width: 130px;
	}

	/* Adjust quantity button size for mobile */
	.wc-vps-qty-btn {
		width: 36px;
		height: 36px;
		font-size: 16px;
	}

	/* Adjust quantity input width for mobile */
	.wc-vps-qty-input {
		width: 45px;
		height: 36px;
		font-size: 14px;
	}

	/* Adjust button padding for mobile */
	.wc-vps-add-to-cart {
		padding: 12px 16px;
		font-size: 15px;
	}
}

/* Mobile Devices (480px and below) */
@media (max-width: 480px) {
	/* Stack elements more tightly on mobile */
	.wc-vps-container {
		gap: 12px;
	}

	/* Make selector full width on mobile */
	.wc-vps-selector {
		width: 100%;
	}

	/* Adjust button for mobile */
	.wc-vps-add-to-cart {
		padding: 12px 14px;
		font-size: 14px;
	}

	/* Make quantity buttons smaller on mobile */
	.wc-vps-qty-btn {
		width: 32px;
		height: 32px;
		font-size: 14px;
	}

	/* Adjust quantity input for mobile */
	.wc-vps-qty-input {
		width: 40px;
		height: 32px;
		font-size: 12px;
	}

	/* Adjust label font for mobile */
	.wc-vps-label {
		font-size: 12px;
	}
}

/* ====================================
   ACCESSIBILITY IMPROVEMENTS
   ==================================== */

/* Focus visible for keyboard navigation */
.wc-vps-selector:focus-visible,
.wc-vps-qty-btn:focus-visible,
.wc-vps-add-to-cart:focus-visible {
	outline: 2px solid #333;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
	.wc-vps-selector,
	.wc-vps-quantity,
	.wc-vps-add-to-cart {
		border-width: 3px;
	}
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	.wc-vps-label {
		color: #f0f0f0;
	}

	.wc-vps-selector {
		background-color: #1e1e1e;
		color: #f0f0f0;
		border-color: #444;
	}

	.wc-vps-selector:hover {
		border-color: #666;
	}

	.wc-vps-quantity {
		background-color: #1e1e1e;
		border-color: #444;
	}

	.wc-vps-qty-input {
		background-color: #1e1e1e;
		color: #f0f0f0;
	}

	.wc-vps-qty-btn {
		color: #f0f0f0;
	}

	.wc-vps-qty-btn:hover {
		background-color: #333;
	}

	.wc-vps-qty-minus,
	.wc-vps-qty-plus {
		border-color: #444;
	}
}

/* ====================================
   ANIMATION AND TRANSITION
   ==================================== */

/* Smooth transitions for all interactive elements */
.wc-vps-selector,
.wc-vps-qty-btn,
.wc-vps-add-to-cart {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading spinner animation (if needed) */
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.wc-vps-add-to-cart.loading::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	border: 2px solid rgba(0, 0, 0, 0.3);
	border-top-color: #000;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}
