/**
 * Frontend Styles for Vehicle Compatibility Search
 * Matches WoodMart theme aesthetics
 */

.vcs-search-widget {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	padding: 15px 20px;
	margin: 10px 0 15px 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Shop page integration */
.woocommerce .vcs-search-widget,
.woocommerce-page .vcs-search-widget {
	margin: 0 0 0px 0;
	clear: both;
	width: 100%;
	display: block;
}

/* Ensure widget appears before products area */
.vcs-search-widget-wrapper {
	width: 100%;
	clear: both;
	margin-bottom: 15px;
	display: block;
}

.woodmart-before-shop-page .vcs-search-widget-wrapper,
.shop-loop-head ~ .vcs-search-widget-wrapper {
	margin-bottom: 15px;
}

.vcs-search-title {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 12px 0;
	color: #333;
}

.vcs-selected-vehicle-info {
	background: #f5f5f5;
	border-left: 4px solid rgb(28,97,231);
	padding: 10px 12px;
	margin-bottom: 12px;
	border-radius: 4px;
}

.vcs-selected-vehicle-info p {
	margin: 0;
	font-size: 14px;
}

.vcs-selected-vehicle-info .vcs-clear-selection {
	color: #dc3232;
	text-decoration: none;
	margin-left: 10px;
	font-size: 13px;
}

.vcs-selected-vehicle-info .vcs-clear-selection:hover {
	text-decoration: underline;
}

.vcs-search-form {
	margin: 0;
}

.vcs-cascading-dropdowns {
	display: grid;
	grid-template-columns: repeat(4, 1fr) auto;
	gap: 12px;
	margin-bottom: 0;
	align-items: end;
	width: 100%;
	max-width: 100%;
}

.vcs-dropdown-group {
	display: flex;
	flex-direction: column;
	min-width: 0; /* Prevents grid overflow */
	width: 100%;
}

.vcs-dropdown-group:last-child {
	grid-column: 5;
	align-self: end;
}

.vcs-dropdown-group label {
	font-weight: 500;
	margin-bottom: 8px;
	font-size: 14px;
	color: #555;
}

.vcs-dropdown-group:last-child label {
	opacity: 0;
	height: 0;
	margin: 0;
	overflow: hidden;
}

.vcs-dropdown-group .vcs-select {
	padding: 12px 15px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 10px;
	font-size: 14px;
	background: #fff;
	color: #333;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	width: 100%;
	max-width: 100%;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px;
	padding-right: 35px;
	height: 42px;
	box-sizing: border-box;
	min-width: 0; /* Prevents overflow in grid */
}

.vcs-dropdown-group .vcs-select:hover:not(:disabled) {
	border-color: rgb(28,97,231);
}

.vcs-dropdown-group .vcs-select:focus {
	outline: none;
	border-color: rgb(28,97,231);
	box-shadow: 0 0 0 3px rgba(28, 97, 231, 0.15);
}

.vcs-dropdown-group .vcs-select:active:not(:disabled) {
	border-color: rgb(28,97,231);
	box-shadow: 0 0 0 2px rgba(28, 97, 231, 0.2);
}

.vcs-dropdown-group .vcs-select:disabled {
	background-color: #f5f5f5;
	cursor: not-allowed;
	opacity: 0.6;
}

.vcs-search-button {
	padding: 12px 25px;
	background: rgb(28, 97, 231) !important;
    color: #fff !important;
	border: none;
	border-radius: 10px !important;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
	width: 100%;
	max-width: 100%;
	margin-top: 0;
	white-space: nowrap;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.vcs-search-button:hover:not(:disabled) {
	background: rgb(28,97,231);
	color: #fff;
	border-radius: 10px;
}

.vcs-search-button:active:not(:disabled) {
	background: rgb(28,97,231);
	color: #fff;
	border-radius: 10px;
}

.vcs-search-button:focus:not(:disabled) {
	outline: none;
	box-shadow: 0 0 0 3px rgba(28, 97, 231, 0.3);
	border-radius: 10px;
}

.vcs-search-button:disabled {
	background: #ccc;
	cursor: not-allowed;
	opacity: 0.6;
	border-radius: 10px;
}

.vcs-active-filter {
	background: rgba(28, 97, 231, 0.08);
	border: 1px solid rgb(28,97,231);
	border-radius: 10px;
	padding: 15px;
	margin: 20px 0;
}

.vcs-filter-message {
	margin: 0;
	font-size: 14px;
	color: rgb(20, 75, 200);
}

.vcs-filter-message strong {
	font-weight: 600;
}

.vcs-clear-filter {
	color: #dc3232;
	text-decoration: none;
	margin-left: 10px;
	font-size: 13px;
}

.vcs-clear-filter:hover {
	text-decoration: underline;
}

/* Loading state */
.vcs-dropdown-group .vcs-select.loading {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%231C61E7' d='M10 2a8 8 0 0 1 8 8h-2a6 6 0 0 0-6-6V2z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 10 10' to='360 10 10' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
	background-size: 16px;
}

/* No products message */
.vcs-no-products-message {
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 10px;
	padding: 20px;
	margin: 20px 0;
	text-align: center;
}

.vcs-no-products-message p {
	margin: 10px 0;
}

.vcs-no-products-message .button {
	margin-top: 10px;
}

/* Responsive Design - Tablet and Mobile */

/* Large Tablets (768px - 1024px) */
@media (max-width: 1024px) {
	.vcs-search-widget {
		padding: 15px 18px;
		margin: 10px 0 12px 0;
	}

	.vcs-cascading-dropdowns {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.vcs-dropdown-group:last-child {
		grid-column: 1 / -1;
		margin-top: 0;
	}

	.vcs-search-title {
		font-size: 19px;
		margin-bottom: 12px;
	}

	.vcs-selected-vehicle-info {
		padding: 10px;
		margin-bottom: 12px;
		font-size: 13px;
	}
}

/* Tablets (600px - 768px) */
@media (max-width: 768px) {
	.vcs-search-widget {
		padding: 15px;
		margin: 10px 0 12px 0;
	}

	.vcs-cascading-dropdowns {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.vcs-dropdown-group:last-child {
		grid-column: 1 / -1;
		margin-top: 0;
	}

	.vcs-search-title {
		font-size: 18px;
		margin-bottom: 12px;
	}

	.vcs-selected-vehicle-info {
		padding: 10px;
		margin-bottom: 12px;
		font-size: 13px;
	}

	.vcs-dropdown-group .vcs-select {
		padding: 12px 15px;
		font-size: 16px; /* Prevents zoom on iOS */
		height: 42px;
	}

	.vcs-search-button {
		height: 42px;
		padding: 12px 20px;
		border-radius: 10px;
		font-size: 15px;
	}
}

/* Mobile Landscape (480px - 600px) */
@media (max-width: 600px) {
	.vcs-search-widget {
		padding: 12px 15px;
		margin: 8px 0 10px 0;
	}

	.vcs-search-title {
		font-size: 17px;
		margin-bottom: 10px;
	}

	.vcs-selected-vehicle-info {
		padding: 8px 10px;
		margin-bottom: 10px;
		font-size: 12px;
	}

	.vcs-selected-vehicle-info .vcs-clear-selection {
		font-size: 12px;
		margin-left: 8px;
	}

	.vcs-cascading-dropdowns {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.vcs-dropdown-group:last-child {
		grid-column: 1 / -1;
	}

	.vcs-dropdown-group label {
		font-size: 13px;
		margin-bottom: 6px;
	}

	.vcs-dropdown-group .vcs-select {
		padding: 10px 12px;
		font-size: 16px;
		height: 42px;
		padding-right: 35px;
	}

	.vcs-search-button {
		height: 42px;
		padding: 12px 18px;
		font-size: 14px;
	}
}

/* Mobile Portrait (360px - 480px) */
@media (max-width: 480px) {
	.vcs-search-widget {
		padding: 12px;
		margin: 8px 0 10px 0;
		border-radius: 8px;
	}

	.vcs-search-title {
		font-size: 16px;
		margin-bottom: 10px;
		line-height: 1.3;
	}

	.vcs-selected-vehicle-info {
		padding: 8px 10px;
		margin-bottom: 10px;
		font-size: 12px;
		line-height: 1.4;
	}

	.vcs-selected-vehicle-info p {
		font-size: 12px;
	}

	.vcs-selected-vehicle-info .vcs-clear-selection {
		font-size: 11px;
		margin-left: 6px;
		display: inline-block;
	}

	.vcs-cascading-dropdowns {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.vcs-dropdown-group:last-child {
		grid-column: 1 / -1;
	}

	.vcs-dropdown-group {
		width: 100%;
	}

	.vcs-dropdown-group label {
		font-size: 12px;
		margin-bottom: 6px;
	}

	.vcs-dropdown-group .vcs-select {
		padding: 10px 12px;
		font-size: 16px;
		height: 42px;
		padding-right: 35px;
		border-radius: 8px;
	}

	.vcs-search-button {
		height: 42px;
		padding: 12px 16px;
		font-size: 14px;
		border-radius: 8px;
	}
}

/* Very Small Screens (< 360px) */
@media (max-width: 360px) {
	.vcs-search-widget {
		padding: 10px;
		margin: 5px 0 8px 0;
	}

	.vcs-search-title {
		font-size: 15px;
		margin-bottom: 8px;
	}

	.vcs-selected-vehicle-info {
		padding: 8px;
		margin-bottom: 8px;
		font-size: 11px;
	}

	.vcs-selected-vehicle-info p {
		font-size: 11px;
	}

	.vcs-cascading-dropdowns {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.vcs-dropdown-group:last-child {
		grid-column: 1 / -1;
	}

	.vcs-dropdown-group label {
		font-size: 11px;
		margin-bottom: 5px;
	}

	.vcs-dropdown-group .vcs-select {
		padding: 10px;
		font-size: 14px;
		height: 40px;
		padding-right: 30px;
	}

	.vcs-search-button {
		height: 40px;
		padding: 10px 14px;
		font-size: 13px;
	}
}

/* Ensure wrapper is responsive */
@media (max-width: 768px) {
	.vcs-search-widget-wrapper {
		margin-bottom: 12px;
		padding: 0;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}
}

@media (max-width: 480px) {
	.vcs-search-widget-wrapper {
		margin-bottom: 10px;
	}
}

