/* ERP Configurator Styles */

.erp-configurator {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	display: flex;
	gap: 128px;
	align-items: flex-start;
}

.erp-configurator-main {
	flex: 1;
	min-width: 0;
}

.erp-configurator-summary {
	width: 30%;
	min-width: 300px;
}

.erp-section-title-wrapper {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
	margin-bottom: 15px;
}

.erp-section-title {
	margin: 0;
	font-size: 24px;
	color: #333;
	font-weight: 600;
	flex: 1 1 0;
	min-width: 0;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.erp-clear-link {
	font-size: 16px;
	font-weight: 600;
	color: #181516;
	text-decoration: underline !important;
	transition: color 0.2s ease;
	flex-shrink: 0;
}

.erp-clear-link:hover {
	color: var(--wp--preset--color--secondary, #005a87);
	text-decoration: underline !important;
}

.erp-configurator-section {
	margin-bottom: 40px;
	padding: 20px;
	background: var(--wp--preset--color--contrast, #fff);
	border-radius: 16px;
}

.erp-configurator-section h2 {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 24px;
	color: #333;
}

.erp-configurator-section h3 {
	margin-top: 0;
	margin-bottom: 15px;
	font-size: 18px;
	color: #555;
}

/* Date Selection */

.erp-date-fields {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-bottom: 20px;
}

.erp-date-field {
	width: 100%;
}

.erp-date-field label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #333;
}

.erp-date-input-wrapper {
	position: relative;
	width: 100%;
}

.erp-date-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.erp-date-calendar-icon {
	position: absolute;
	right: 12px;
	width: 20px;
	height: 20px;
	pointer-events: none;
	z-index: 1;
}

.erp-date-input {
	width: 100%;
	padding: 10px 40px 10px 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	cursor: pointer;
	box-sizing: border-box;
}

.erp-date-input:focus {
	outline: none;
	border-color: #0073aa;
}

/* Info Messages */
.erp-info-message {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 15px;
	margin-bottom: 15px;
	padding: 0;
	background: none;
	border: none;
	font-size: 14px;
	color: #333;
}

.erp-info-text {
	flex: 1;
	line-height: 1.5;
}

.erp-info-text strong {
	font-weight: 600;
}

.erp-info-text a {
	color: #181516;
	text-decoration: underline !important;
	transition: color 0.2s ease;
}

.erp-info-text a:hover {
	color: #181516;
}

.erp-info-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	display: block;
}

/* Product Options */
.erp-product-options {
	display: flex;
	gap: 15px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.erp-product-options label {
	display: flex;
	align-items: center;
	padding: 10px 20px;
	background: #fff;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s;
}

.erp-product-options label:hover {
	border-color: #0073aa;
	background: #f0f8ff;
}

.erp-product-options input[type="radio"] {
	margin-right: 8px;
}

.erp-product-options input[type="radio"]:checked + span,
.erp-product-options input[type="radio"]:checked ~ span {
	font-weight: 600;
}

.erp-product-options label:has(input[type="radio"]:checked) {
	border-color: #0073aa;
	background: #e6f3ff;
}

/* Products Grid */
.erp-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	margin-top: 20px;
	margin-bottom: 40px;
}

.erp-product-card {
	background: var(--wp--preset--color--contrast, #fff);
	border: 2px solid #ddd;
	border-radius: 32px;
	overflow: hidden;
	transition: all 0.3s;
	position: relative;
	display: flex;
	flex-direction: column;
}

.erp-product-card:has(input[type="checkbox"]:checked) {
	border-color: #000;
}

.erp-product-card:hover {
	border-color: var(--wp--preset--color--secondary, #00a0d2);
}

.erp-product-card:not(.erp-dates-selected) .erp-select-button {
	pointer-events: none;
	cursor: not-allowed;
	opacity: 0.5;
}

.erp-product-card.erp-product-unavailable {
	opacity: 0.5;
}

.erp-product-card.erp-product-unavailable .erp-select-button {
	pointer-events: none;
	cursor: not-allowed;
}

.erp-product-checkbox {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 0;
	height: 0;
}

.erp-product-content {
	padding: 20px;
	flex: 1;
}

.erp-product-content img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	border-radius: 16px;
	margin-bottom: 15px;
}

.erp-product-info {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.erp-product-info h4 {
	margin: 0 0 10px 0;
	font-size: 18px;
	color: #333;
	background: none;
	padding: 0;
}

.erp-product-desc {
	margin: 0 0 15px 0;
	font-size: 14px;
	color: #666;
	line-height: 1.5;
}

.erp-product-price {
	margin: 10px 0;
	padding: 0;
	background: none;
	border-radius: 0;
}

.erp-price-value {
	font-size: 18px;
	font-weight: 700;
	color: #0073aa;
}

.erp-price-value small {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: #666;
	margin-top: 4px;
}

.erp-discount-info {
	margin-top: 4px;
}

.erp-discount-text {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: #666;
	line-height: 1.4;
}

.erp-product-availability {
	margin-top: 10px;
	padding: 8px;
	border-radius: 4px;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	display: none;
}

.erp-availability-status.available {
	background: #d4edda;
	color: #155724;
}

.erp-availability-status.unavailable {
	background: #f8d7da;
	color: #721c24;
}

.erp-date-checked-info {
	margin-top: 10px;
	padding: 8px;
	background: #d1ecf1;
	color: #0c5460;
	border-radius: 4px;
	font-size: 12px;
	text-align: center;
}

/* Select Button */
.erp-select-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 20px 15px 20px;
	padding: 12px 20px;
	border: 2px solid #ddd;
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
	transition: background-color 0.2s ease;
	font-size: 16px;
	font-family: inherit;
	font-weight: 600;
	line-height: 1.5;
	color: #333;
	text-decoration: none;
	box-sizing: border-box;
}

.erp-select-button:hover {
	border-color: var(--wp--preset--color--secondary, #00a0d2);
	background-color: rgba(0, 160, 210, 0.2);
}

.erp-product-card:has(input[type="checkbox"]:checked) .erp-select-button {
	border-color: var(--wp--preset--color--primary, #0073aa);
	background-color: var(--wp--preset--color--primary, #0073aa);
	color: var(--wp--preset--color--contrast, #fff) !important;
}

.erp-select-button-text {
	pointer-events: none;
}

.erp-select-check-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	display: none;
	pointer-events: none;
}

.erp-product-card:has(input[type="checkbox"]:checked) .erp-select-check-icon {
	display: block;
}

/* More Info Link */
.erp-more-info-link {
	display: block;
	margin: 0 20px 20px 20px;
	padding: 0;
	text-align: center;
	color: #181516;
	text-decoration: underline !important;
	font-size: 16px;
	font-weight: 600;
	transition: color 0.2s ease;
}

.erp-more-info-link:hover {
	color: var(--wp--preset--color--secondary, #005a87);
	text-decoration: underline !important;
}

/* Trailer Features */
.erp-trailer-features {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-bottom: 40px;
	padding: 20px;
	border: 1px solid #D4D4D4;
	border-radius: 16px;
}

/* Bike Features */
.erp-bike-features {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-bottom: 40px;
	padding: 20px;
	border: 1px solid #D4D4D4;
	border-radius: 16px;
}

.erp-feature-item {
	display: flex;
	align-items: center;
	gap: 12px;
}

.erp-feature-icon {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	display: block;
}

.erp-feature-text {
	flex: 1;
	font-size: 16px;
	color: #333;
	line-height: 1.5;
}

/* Summary Section */
.erp-configurator-summary {
	position: sticky;
	top: 140px;
	align-self: flex-start;
}

.erp-summary-content {
	background: var(--wp--preset--color--contrast, #fff);
	border-radius: 16px;
	padding: 20px;
	border: 1px solid #e0e0e0;
}

.erp-summary-title {
	margin: 0 0 20px 0;
	font-size: 20px;
	font-weight: 600;
	color: #333;
}

.erp-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 12px;
	font-size: 14px;
	line-height: 1.5;
}

.erp-summary-row strong {
	font-weight: 600;
	color: #333;
	flex: 1;
	margin-right: 10px;
}

.erp-summary-row span {
	color: #666;
	text-align: right;
	flex: 1;
}

.erp-summary-row.erp-summary-total {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 2px solid #333;
	font-size: 18px;
}

.erp-summary-row.erp-summary-total strong,
.erp-summary-row.erp-summary-total span {
	font-weight: 700;
	color: #333;
	font-size: 18px;
}

/* Deposit mode: reduce font size to match remaining balance */
.erp-summary-row.erp-summary-total.erp-deposit-mode {
	font-size: 14px;
}

.erp-summary-row.erp-summary-total.erp-deposit-mode strong,
.erp-summary-row.erp-summary-total.erp-deposit-mode span {
	font-size: 14px;
}

.erp-summary-divider {
	height: 1px;
	background: #e0e0e0;
	margin: 15px 0;
}

/* Payment Options */
.erp-payment-section {
	margin-top: 40px;
}

.erp-payment-section h2 {
	margin-bottom: 20px;
}

.erp-payment-options {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin: 0;
	width: 100%;
}

.erp-payment-options label {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 12px;
	background: transparent;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s;
	box-sizing: border-box;
}

.erp-payment-options label:hover {
	border-color: var(--wp--preset--color--secondary, #00a0d2);
	background: transparent;
}

.erp-payment-options input[type="radio"] {
	margin-right: 10px;
}

.erp-payment-options label:has(input[type="radio"]:checked) {
	border-color: var(--wp--preset--color--secondary, #00a0d2);
	background: transparent;
}

.erp-payment-info {
	margin-top: 15px;
}

.erp-order-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 15px 20px;
	font-size: 16px;
	font-family: inherit;
	font-weight: 600;
	line-height: 1.5;
	text-align: center;
	text-decoration: none;
	margin-bottom: 15px;
	border-radius: 999px;
	border: none;
	background-color: var(--wp--preset--color--primary, #0073aa);
	color: var(--wp--preset--color--contrast, #fff);
	transition: background-color 0.2s ease;
	box-sizing: border-box;
	cursor: pointer;
	outline: none;
}

.erp-order-button:hover,
.erp-order-button:focus,
.erp-order-button:active,
.erp-order-button:focus-visible {
	background-color: var(--wp--preset--color--secondary, #005a87);
	color: var(--wp--preset--color--contrast, #fff) !important;
	text-decoration: none;
	border: none;
	outline: none;
	box-shadow: none;
}

.erp-order-button:focus {
	outline: none;
	border: none;
}

.erp-order-button-icon {
	width: 6px;
	height: auto;
	display: inline-block;
	flex-shrink: 0;
}

.erp-summary-info {
	margin-top: 15px;
	margin-bottom: 15px;
}

/* Contact Box */
.erp-contact-box {
	padding: 20px;
	border: 1px solid #ddd;
	border-radius: 16px;
	background: transparent;
	text-align: center;
	margin-top: 20px;
}

.erp-contact-box h6 {
	margin: 0 0 10px 0;
	font-size: inherit;
	font-weight: 600;
	color: #333;
}

.erp-contact-phone {
	font-size: 20px;
	font-weight: 600;
	color: var(--wp--preset--color--secondary, #00a0d2);
	margin-bottom: 5px;
}

.erp-contact-hours {
	font-size: 14px;
	color: var(--wp--preset--color--secondary, #00a0d2);
}

/* Validation Message */
.erp-validation-message {
	padding: 15px 20px;
	margin-bottom: 20px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.6;
}

.erp-validation-message.erp-validation-error {
	background: #fff3cd;
	border: 2px solid #ffc107;
	color: #856404;
}

.erp-validation-message.erp-validation-error strong {
	display: block;
	margin-bottom: 10px;
	font-size: 16px;
}

.erp-validation-message.erp-validation-error ul {
	margin: 10px 0 0 0;
	padding-left: 20px;
}

.erp-validation-message.erp-validation-error li {
	margin-bottom: 5px;
}

.erp-validation-message.erp-validation-success {
	background: #d4edda;
	border: 2px solid #28a745;
	color: #155724;
}

/* Responsive */
@media (max-width: 1024px) {
	.erp-configurator {
		flex-direction: column;
	}

	.erp-configurator-summary {
		width: 100%;
		position: static;
		min-width: 0;
	}
}

@media (max-width: 768px) {
	.erp-configurator {
		padding: 10px;
	}

	.erp-date-fields {
		flex-direction: column;
	}

	.erp-products-grid {
		grid-template-columns: 1fr;
	}

	.erp-product-options,
	.erp-payment-options {
		flex-direction: column;
	}

	.erp-product-options label,
	.erp-payment-options label {
		width: 100%;
	}
}

/* Error states */
.erp-price-value .error {
	color: #dc3545;
	font-size: 14px;
}

/* Date validation message */
.erp-date-validation-message {
	margin-top: 15px;
	margin-bottom: 15px;
	padding: 12px 16px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.6;
}

.erp-date-validation-message.erp-date-validation-error {
	background: #fff3cd;
	border: 2px solid #ffc107;
	color: #856404;
}

.erp-date-validation-message .erp-error-text {
	display: block;
	font-weight: 500;
}

/* Loading states */
.erp-product-card.loading {
	opacity: 0.6;
	pointer-events: none;
}

.erp-product-card.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid #0073aa;
	border-top-color: transparent;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

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

/* jQuery UI Datepicker Custom Styling */
.ui-datepicker-header {
	background: var(--wp--preset--color--primary, #0073aa) !important;
}

.ui-datepicker-calendar thead th span {
	color: var(--wp--preset--color--primary, #0073aa) !important;
}

.ui-datepicker-calendar tbody td a {
	color: var(--wp--preset--color--secondary, #00a0d2) !important;
}
