/**
 * Shamrock Addons - Public Styles
 *
 * @package ShamrockAddons
 * @version 1.0.0
 */

/* ========================================
   Engine Selector Styles
   ======================================== */

.shamrock-engine-selector {
	margin: 25px 0 30px 0;
	padding: 20px;
	background: #f9f9f9;
	border: 2px solid #ddd;
	border-radius: 6px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.shamrock-selector-header {
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #ddd;
}

.shamrock-selector-header h3 {
	margin: 0 0 8px 0;
	font-size: 1.3em;
	color: #333;
	font-weight: 600;
}

.shamrock-selector-header .description {
	margin: 0;
	color: #666;
	font-size: 0.95em;
	line-height: 1.5;
}

/* Field Grid */
.shamrock-selector-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 20px;
}

@media (max-width: 768px) {
	.shamrock-selector-fields {
		grid-template-columns: 1fr;
		gap: 15px;
	}
}

.shamrock-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
	font-size: 0.95em;
}

.shamrock-field label .required {
	color: #d63638;
	font-weight: 700;
}

.shamrock-field select {
	width: 100%;
	padding: 12px 14px;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background-color: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 20px;
	padding-right: 40px;
}

.shamrock-field select:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.shamrock-field select:disabled {
	background-color: #f0f0f0;
	cursor: not-allowed;
	opacity: 0.6;
}

/* Messages */
.shamrock-selector-messages {
	margin-top: 15px;
}

.shamrock-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	background: #fff;
	border-left: 3px solid #2271b1;
	font-size: 0.95em;
	color: #666;
}

.shamrock-loading .spinner {
	float: none;
	margin: 0;
}

.shamrock-validation-message {
	margin: 15px 0;
	animation: slideDown 0.3s ease;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.shamrock-validation-message.woocommerce-message,
.shamrock-validation-message.woocommerce-error,
.shamrock-validation-message.woocommerce-info {
	padding: 12px 15px;
	margin: 0 0 15px 0;
	border-radius: 4px;
}

.shamrock-unsupported-message {
	margin-top: 15px;
}

.shamrock-unsupported-message .woocommerce-info {
	background: #fff3cd;
	border-left: 3px solid #ff9800;
	color: #856404;
	padding: 15px;
	margin: 0;
}

.shamrock-unsupported-message .button {
	margin-top: 10px;
	background: #ff9800;
	border-color: #ff9800;
	color: #fff;
}

.shamrock-unsupported-message .button:hover {
	background: #e68900;
	border-color: #e68900;
}

/* Add to Cart Button States */
.single_add_to_cart_button.disabled,
button[name="add-to-cart"].disabled {
	opacity: 0.5;
	cursor: not-allowed;
	background-color: #ccc !important;
	border-color: #ccc !important;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
	.shamrock-engine-selector {
		padding: 15px;
		margin: 20px 0;
	}

	.shamrock-selector-header h3 {
		font-size: 1.15em;
	}

	.shamrock-field select {
		padding: 10px 12px;
		font-size: 16px; /* Prevent zoom on iOS */
	}
}

/* Page Builder Compatibility */
.elementor-widget-woocommerce-product-add-to-cart .shamrock-engine-selector,
.vc_col-sm-12 .shamrock-engine-selector {
	max-width: 100%;
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
	.shamrock-engine-selector {
		background: #1e1e1e;
		border-color: #444;
	}

	.shamrock-selector-header {
		border-bottom-color: #444;
	}

	.shamrock-selector-header h3,
	.shamrock-field label {
		color: #e0e0e0;
	}

	.shamrock-field select {
		background-color: #2a2a2a;
		border-color: #444;
		color: #e0e0e0;
	}

	.shamrock-loading {
		background: #2a2a2a;
		border-left-color: #4a90e2;
		color: #ccc;
	}
}

/* Loading Overlay */
.shamrock-engine-selector.loading::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.7);
	z-index: 10;
	border-radius: 6px;
}

/* Accessibility */
.shamrock-field select:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
}

/* ========================================
   Checkout Custom Fields Styles
   ======================================== */

/* Checkout field wrappers */
.shamrock-checkout-fields-wrapper,
.shamrock-checkout-fields-shortcode {
	margin: 30px 0;
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.shamrock-checkout-fields-wrapper h3,
.shamrock-checkout-fields-shortcode h3 {
	margin-top: 0;
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid #ddd;
	font-size: 1.2em;
}

/* Section header for fields in order notes area */
.woocommerce-checkout h3:has(+ .form-row[id*="shamrock_"]),
.woocommerce-checkout .woocommerce-additional-fields h3 {
	margin-top: 30px !important;
	margin-bottom: 20px;
	padding: 12px 15px;
	background: #f5f5f5;
	border-left: 4px solid #2271b1;
	border-radius: 3px;
	font-size: 1.15em;
}

/* Checkout field section header */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-additional-fields h3 {
	margin-top: 30px;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 2px solid #ddd;
	font-size: 1.2em;
}

/* Radio button group styling */
.shamrock-radio-group {
	padding: 10px 0;
}

/* WooCommerce radio field wrapper */
.shamrock-radio-group .woocommerce-input-wrapper {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Individual radio option styling */
.shamrock-radio-group .woocommerce-input-wrapper label {
	display: flex !important;
	align-items: center;
	margin: 0 !important;
	padding: 12px 15px;
	background: #f9f9f9;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
}

.shamrock-radio-group .woocommerce-input-wrapper label:hover {
	background: #fff;
	border-color: #2271b1;
}

/* Radio input styling */
.shamrock-radio-group input[type="radio"] {
	margin: 0 10px 0 0 !important;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	cursor: pointer;
}

/* Label text */
.shamrock-radio-group .woocommerce-input-wrapper label span {
	flex: 1;
	font-size: 0.95em;
}

/* Checked state */
.shamrock-radio-group input[type="radio"]:checked + span {
	font-weight: 600;
}

.shamrock-radio-group .woocommerce-input-wrapper label:has(input[type="radio"]:checked) {
	background: #e7f3ff;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

/* General field input styling */
.woocommerce-checkout .form-row[id*="shamrock_"] input[type="text"],
.woocommerce-checkout .form-row[id*="shamrock_"] select,
.woocommerce-checkout .form-row[id*="shamrock_"] textarea {
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce-checkout .form-row[id*="shamrock_"] input[type="text"]:focus,
.woocommerce-checkout .form-row[id*="shamrock_"] select:focus,
.woocommerce-checkout .form-row[id*="shamrock_"] textarea:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

/* VIN input styling */
input[name="shamrock_vin"] {
	font-family: 'Courier New', monospace;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 1.05em !important;
	font-weight: 500;
}

/* Adapter type help text */
.shamrock-adapter-info {
	font-size: 0.9em;
	color: #666;
	font-style: italic;
	margin-top: 5px;
}

/* Order details display */
.woocommerce-shamrock-details {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #ddd;
}

.woocommerce-shamrock-details h2 {
	margin-bottom: 15px;
	font-size: 1.3em;
}

.woocommerce-shamrock-details table {
	width: 100%;
	border-collapse: collapse;
}

.woocommerce-shamrock-details th {
	text-align: left;
	padding: 10px 15px;
	background: #f8f8f8;
	font-weight: 600;
	width: 35%;
}

.woocommerce-shamrock-details td {
	padding: 10px 15px;
	border-bottom: 1px solid #eee;
}

.woocommerce-shamrock-details tr:last-child td {
	border-bottom: none;
}

/* Mobile optimizations for checkout */
@media (max-width: 768px) {
	.shamrock-radio-group label {
		padding: 10px 12px;
		font-size: 0.95em;
	}

	.woocommerce-shamrock-details th {
		width: 40%;
		font-size: 0.9em;
	}

	.woocommerce-shamrock-details td {
		font-size: 0.9em;
	}
}

/* Field spacing and layout improvements */
.woocommerce-checkout .form-row[id*="shamrock_"] {
	margin-bottom: 20px;
}

.woocommerce-checkout .form-row[id*="shamrock_"] label {
	margin-bottom: 10px;
	margin-top: 8px;
	display: block;
	font-weight: 600;
	color: #333;
}

/* First field needs top margin */
.woocommerce-checkout .form-row[id*="shamrock_"]:first-of-type {
	margin-top: 20px;
}

/* Required field indicator */
.woocommerce-checkout .form-row abbr.required {
	color: #d63638;
	text-decoration: none;
	border: none;
	font-weight: 700;
}

/* Checkout field validation states */
.woocommerce-checkout .form-row.woocommerce-invalid input,
.woocommerce-checkout .form-row.woocommerce-invalid select,
.woocommerce-checkout .form-row.woocommerce-invalid textarea {
	border-color: #d63638;
}

.woocommerce-checkout .form-row.woocommerce-validated input,
.woocommerce-checkout .form-row.woocommerce-validated select {
	border-color: #46b450;
}

/* Textarea styling */
textarea[name="shamrock_appointment_notes"] {
	resize: vertical;
	min-height: 100px;
	font-family: inherit;
}

/* Print styles for order details */
@media print {
	.shamrock-order-details,
	.woocommerce-shamrock-details {
		page-break-inside: avoid;
		border: 1px solid #000;
		padding: 15px;
		margin: 10px 0;
	}

	.shamrock-order-details h3,
	.woocommerce-shamrock-details h2 {
		border-bottom: 2px solid #000;
	}
}

/* ========================================
   Dealer Dashboard Styles
   ======================================== */

/* Dealer dashboard wrapper */
.shamrock-dealer-dashboard {
	max-width: 1200px;
	margin: 0 auto;
}

.shamrock-dealer-dashboard h2 {
	margin-bottom: 10px;
	font-size: 1.8em;
}

.dealer-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	background: linear-gradient(135deg, #2271b1 0%, #1e5a8e 100%);
	color: #fff;
	border-radius: 20px;
	font-weight: 600;
	font-size: 0.9em;
	margin-bottom: 30px;
}

.dealer-badge .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* Dashboard sections grid */
.dashboard-sections {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 30px;
	margin-top: 30px;
}

@media (max-width: 768px) {
	.dashboard-sections {
		grid-template-columns: 1fr;
	}
}

.dashboard-section {
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 20px;
}

.dashboard-section h3 {
	margin-top: 0;
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid #ddd;
	font-size: 1.2em;
}

.dashboard-section.recent-orders {
	grid-column: 1 / -1;
}

.dashboard-section ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.dashboard-section ul li {
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}

.dashboard-section ul li:last-child {
	border-bottom: none;
}

.dashboard-section ul li a {
	text-decoration: none;
	color: #2271b1;
	transition: color 0.2s;
}

.dashboard-section ul li a:hover {
	color: #135e96;
}

/* Not dealer message */
.shamrock-not-dealer {
	max-width: 600px;
	margin: 40px auto;
	padding: 30px;
	background: #fff;
	border: 2px solid #ddd;
	border-radius: 8px;
	text-align: center;
}

.shamrock-not-dealer h3 {
	margin-top: 0;
	color: #333;
}

.shamrock-not-dealer .button {
	margin-top: 20px;
	padding: 12px 30px;
	font-size: 1.1em;
}

/* Dealer application form */
.shamrock-dealer-application-form {
	max-width: 700px;
	margin: 0 auto;
	background: #fff;
	padding: 30px;
	border: 1px solid #ddd;
	border-radius: 6px;
}

.shamrock-dealer-application-form h2 {
	margin-top: 0;
	margin-bottom: 15px;
}

.shamrock-dealer-application-form form {
	margin-top: 30px;
}

.shamrock-dealer-application-form .form-row {
	margin-bottom: 20px;
}

.shamrock-dealer-application-form label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #333;
}

.shamrock-dealer-application-form .required {
	color: #d63638;
}

.shamrock-dealer-application-form input[type="text"],
.shamrock-dealer-application-form input[type="tel"],
.shamrock-dealer-application-form textarea {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	transition: border-color 0.2s;
}

.shamrock-dealer-application-form select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	display: block;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	transition: border-color 0.2s;
	background-color: #fff;
}

.shamrock-dealer-application-form input[type="text"]:focus,
.shamrock-dealer-application-form input[type="tel"]:focus,
.shamrock-dealer-application-form textarea:focus,
.shamrock-dealer-application-form select:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.shamrock-dealer-application-form .form-row-first,
.shamrock-dealer-application-form .form-row-last {
	width: 48%;
	display: inline-block;
}



@media (max-width: 600px) {
	.shamrock-dealer-application-form .form-row-first,
	.shamrock-dealer-application-form .form-row-last {
		width: 100%;
		margin-right: 0;
	}
}

.shamrock-dealer-application-form button[type="submit"] {
	padding: 12px 40px;
	font-size: 1.1em;
	background: #131313;
	border: none;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s;
}

.shamrock-dealer-application-form button[type="submit"]:hover {
	background: #135e96;
}

/* Guest application form fieldsets */
.shamrock-dealer-application-form fieldset {
	border: 1px solid #ddd;
	padding: 20px;
	margin-bottom: 20px;
	border-radius: 4px;
	background: #fafafa;
}

.shamrock-dealer-application-form fieldset legend {
	font-weight: 600;
	padding: 0 10px;
	font-size: 1.1em;
	color: #333;
}

.shamrock-dealer-application-form input[type="email"] {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	transition: border-color 0.2s;
}

.shamrock-dealer-application-form input[type="email"]:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

/* Dealer body class styling */
body.shamrock-partner-user .partner-only-badge {
	display: inline-block;
	padding: 4px 10px;
	background: #2271b1;
	color: #fff;
	font-size: 0.75em;
	border-radius: 3px;
	margin-left: 8px;
	font-weight: 600;
}

/* Dealer products filter message */
.dealer-products-message {
	padding: 15px 20px;
	background: #e3f2fd;
	border-left: 4px solid #2271b1;
	margin-bottom: 20px;
	border-radius: 4px;
}

.dealer-products-message .dashicons {
	vertical-align: middle;
	margin-right: 5px;
	color: #2271b1;
}
