/* Travel Calculator by SGR - Frontend widget (theme-isolated) */
/* Reset theme inheritance so plugin styles are not overridden */
.tc-fare-calculator.tc-sgr-isolated,
.tc-fare-calculator.tc-sgr-isolated * {
	box-sizing: border-box;
}
.tc-fare-calculator.tc-sgr-isolated input,
.tc-fare-calculator.tc-sgr-isolated button,
.tc-fare-calculator.tc-sgr-isolated select {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	margin: 0;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}
.tc-fare-calculator.tc-sgr-isolated button {
	cursor: pointer;
}
.tc-fare-calculator.tc-sgr-isolated select {
	background-image: none;
}

.tc-fare-calculator.tc-sgr-isolated {
	--tc-bg: #f5f5f5;
	--tc-calendar-bg: #ffffff;
	--tc-calendar-text: #1f2937;
	--tc-tab-color: #f59e0b;
	--tc-hover-bg: #fef3c7;
	--tc-button-bg: #ea580c;
	--tc-button-hover: #c2410c;
	--tc-button-text: #ffffff;
	--tc-text-color: #1f2937;
	--tc-placeholder-color: #9ca3af;
	--tc-dropdown-bg: #ffffff;
	--tc-dropdown-text: #1f2937;
	--tc-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
	--tc-font-size: 15px;
	background: var(--tc-bg) !important;
	color: var(--tc-text-color);
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	padding: 24px;
	max-width: 100%;
	font-family: var(--tc-font-family);
	font-size: var(--tc-font-size);
}

.tc-fare-calculator.tc-sgr-isolated .tc-fare-tabs {
	display: flex;
	gap: 0;
	margin-bottom: 20px;
	border-bottom: 2px solid #e5e7eb;
}

.tc-fare-calculator.tc-sgr-isolated .tc-tab {
	flex: 1;
	padding: 14px 18px;
	border: none;
	background: transparent;
	color: var(--tc-text-color);
	font-size: inherit;
	font-weight: 600;
	cursor: pointer;
	position: relative;
	transition: color 0.2s, background 0.2s;
	border-radius: 6px 6px 0 0;
}

.tc-fare-calculator.tc-sgr-isolated .tc-tab:hover {
	color: #1f2937;
	background: var(--tc-hover-bg);
}

.tc-fare-calculator.tc-sgr-isolated .tc-tab.tc-tab-active {
	color: #1f2937;
	background: var(--tc-hover-bg);
}

.tc-fare-calculator.tc-sgr-isolated .tc-tab.tc-tab-active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 3px;
	background: var(--tc-tab-color);
	border-radius: 3px 3px 0 0;
}

.tc-fare-calculator.tc-sgr-isolated .tc-fare-form .tc-field {
	margin-bottom: 18px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-fare-form .tc-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: var(--tc-text-color);
	margin-bottom: 6px;
	text-transform: uppercase;
}

.tc-fare-calculator.tc-sgr-isolated .tc-fare-form .tc-input {
	width: 100%;
	padding: 12px 14px;
	font-size: 1em;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	box-sizing: border-box;
	background: var(--tc-bg) !important;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.tc-fare-calculator.tc-sgr-isolated .tc-fare-form .tc-input:focus {
	outline: none;
	border-color: var(--tc-tab-color);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc-tab-color) 25%, transparent);
}

.tc-fare-calculator.tc-sgr-isolated .tc-fare-form .tc-input::placeholder {
	color: var(--tc-placeholder-color);
}

/* Autocomplete */
.tc-fare-calculator.tc-sgr-isolated .tc-autocomplete {
	position: relative;
}

.tc-fare-calculator.tc-sgr-isolated .tc-suggestions {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 100;
	background: var(--tc-dropdown-bg) !important;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	max-height: 220px;
	overflow-y: auto;
	margin-top: 4px;
	display: none;
}

.tc-fare-calculator.tc-sgr-isolated .tc-suggestion-item {
	padding: 10px 14px;
	cursor: pointer;
	font-size: 14px;
	color: var(--tc-dropdown-text);
	border-bottom: 1px solid #f3f4f6;
}

.tc-fare-calculator.tc-sgr-isolated .tc-suggestion-item:last-child {
	border-bottom: none;
}

.tc-fare-calculator.tc-sgr-isolated .tc-suggestion-item:hover {
	background: var(--tc-hover-bg);
}

/* Date & time row – refined design with icons */
.tc-fare-calculator.tc-sgr-isolated .tc-row-datetime {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-wrap {
	position: relative;
	display: block;
	border-radius: 10px;
	overflow: hidden;
	transition: box-shadow 0.2s, border-color 0.2s;
}

/* Allow date picker dropdown to show outside the wrap */
.tc-fare-calculator.tc-sgr-isolated .tc-input-wrap-date,
.tc-fare-calculator.tc-sgr-isolated .tc-field-time {
	overflow: visible;
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-wrap-date {
	background: color-mix(in srgb, var(--tc-tab-color) 12%, var(--tc-bg)) !important;
	border: 1px solid color-mix(in srgb, var(--tc-tab-color) 35%, transparent);
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-wrap:focus-within {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc-tab-color) 25%, transparent);
	outline: none;
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-wrap-date:focus-within {
	border-color: var(--tc-tab-color);
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-wrap .tc-input {
	margin: 0;
	border: none;
	background: transparent !important;
	padding: 14px 48px 14px 16px;
	font-size: 15px;
	font-weight: 500;
	color: var(--tc-text-color) !important;
	min-height: 48px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-wrap .tc-input:focus {
	box-shadow: none;
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-wrap .tc-input::placeholder {
	color: var(--tc-placeholder-color);
}

/* Custom date picker dropdown – uses theme accent (--tc-tab-color); background from Style → Calendar background color */
.tc-fare-calculator.tc-sgr-isolated .tc-date-picker {
	display: none;
	position: absolute;
	left: 0;
	top: 100%;
	margin-top: 6px;
	z-index: 9999;
	background: var(--tc-calendar-bg) !important;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
	border: 1px solid #e5e7eb;
	min-width: 280px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-row-datetime {
	overflow: visible;
}

.tc-fare-calculator.tc-sgr-isolated .tc-return-wrap {
	margin-top: 16px;
	overflow: visible;
}

.tc-fare-calculator.tc-sgr-isolated .tc-date-picker.tc-open {
	display: block;
}

/* Time: native dropdowns (Hour, Min, AM/PM) */
.tc-fare-calculator.tc-sgr-isolated .tc-time-selects {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	background: color-mix(in srgb, var(--tc-tab-color) 6%, var(--tc-bg));
	border: 1px solid #e4e4e7;
	border-radius: 10px;
	padding: 8px 12px;
}
.tc-fare-calculator.tc-sgr-isolated .tc-time-selects .tc-input {
	min-width: 0;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.4;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: var(--tc-dropdown-bg) !important;
	color: var(--tc-dropdown-text) !important;
	cursor: pointer;
}
.tc-fare-calculator.tc-sgr-isolated .tc-time-selects .tc-time-hour,
.tc-fare-calculator.tc-sgr-isolated .tc-time-selects .tc-return-time-hour {
	width: 4.5em;
}
.tc-fare-calculator.tc-sgr-isolated .tc-time-selects .tc-time-min,
.tc-fare-calculator.tc-sgr-isolated .tc-time-selects .tc-return-time-min {
	width: 4.5em;
}
.tc-fare-calculator.tc-sgr-isolated .tc-time-selects .tc-time-ampm,
.tc-fare-calculator.tc-sgr-isolated .tc-time-selects .tc-return-time-ampm {
	width: 5em;
}
.tc-fare-calculator.tc-sgr-isolated .tc-return-time-selects .tc-input {
	width: auto;
}

/* Calendar */
.tc-fare-calculator.tc-sgr-isolated .tc-calendar {
	padding: 16px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-month-year {
	font-size: 15px;
	font-weight: 600;
	color: var(--tc-calendar-text);
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-nav {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-nav button {
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px 8px;
	font-size: 12px;
	color: var(--tc-calendar-text);
	line-height: 1.2;
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-nav button:hover {
	color: var(--tc-tab-color);
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-dow {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	color: var(--tc-calendar-text);
	margin-bottom: 8px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-cal-day {
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent !important;
	cursor: pointer;
	font-size: 13px;
	color: var(--tc-calendar-text) !important;
	border-radius: 6px;
	padding: 0;
}

.tc-fare-calculator.tc-sgr-isolated .tc-cal-day:hover {
	background: var(--tc-hover-bg) !important;
	color: var(--tc-tab-color) !important;
}

.tc-fare-calculator.tc-sgr-isolated .tc-cal-day.tc-cal-other {
	color: var(--tc-calendar-text) !important;
	opacity: 0.7;
}

.tc-fare-calculator.tc-sgr-isolated .tc-cal-day.tc-cal-disabled {
	opacity: 0.45;
	color: var(--tc-calendar-text) !important;
	cursor: not-allowed;
	pointer-events: none;
}

.tc-fare-calculator.tc-sgr-isolated .tc-cal-day.tc-cal-disabled:hover {
	background: transparent !important;
	color: var(--tc-calendar-text) !important;
}

.tc-fare-calculator.tc-sgr-isolated .tc-cal-day.tc-cal-selected {
	background: var(--tc-tab-color) !important;
	color: #fff !important;
}

.tc-fare-calculator.tc-sgr-isolated .tc-cal-day.tc-cal-today:not(.tc-cal-selected) {
	background: var(--tc-hover-bg) !important;
	color: var(--tc-tab-color) !important;
	font-weight: 600;
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-footer {
	display: flex;
	justify-content: space-between;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e5e7eb;
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-footer button {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 14px;
	color: var(--tc-calendar-text);
	font-weight: 500;
	padding: 0;
}

.tc-fare-calculator.tc-sgr-isolated .tc-calendar-footer button:hover {
	color: var(--tc-tab-color);
	text-decoration: underline;
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	color: var(--tc-text-color);
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-wrap-date .tc-input-icon {
	color: var(--tc-tab-color);
}

.tc-fare-calculator.tc-sgr-isolated .tc-input-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

@media (max-width: 480px) {
	.tc-fare-calculator.tc-sgr-isolated .tc-row-datetime {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

/* Vehicles */
.tc-fare-calculator.tc-sgr-isolated .tc-vehicles-wrap {
	margin-top: 8px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicle-card {
	margin: 0;
	cursor: pointer;
	display: block;
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicle-card input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicle-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 14px 10px;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	background: var(--tc-bg) !important;
	transition: border-color 0.2s, background 0.2s;
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicle-card:hover .tc-vehicle-inner {
	border-color: var(--tc-tab-color);
	background: var(--tc-hover-bg) !important;
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicle-card.tc-vehicle-selected .tc-vehicle-inner {
	border-color: var(--tc-tab-color);
	background: var(--tc-hover-bg) !important;
	box-shadow: 0 0 0 1px var(--tc-tab-color);
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicle-img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 8px;
	display: block;
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicle-noimg {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e5e7eb;
	font-size: 32px;
	color: #9ca3af;
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicle-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--tc-text-color);
	text-align: center;
	line-height: 1.3;
	margin-bottom: 4px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-vehicle-price {
	font-size: 12px;
	color: var(--tc-text-color);
	font-weight: 500;
}

.tc-fare-calculator.tc-sgr-isolated .tc-no-vehicles {
	color: var(--tc-text-color);
	font-size: 14px;
	margin: 0;
	padding: 12px 0;
}

/* Estimated Fare – above the button */
.tc-fare-calculator.tc-sgr-isolated .tc-result-wrap {
	margin-bottom: 20px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-result-card {
	background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
	border: 1px solid #86efac;
	border-radius: 12px;
	padding: 20px 24px;
	box-shadow: 0 2px 12px rgba(34, 197, 94, 0.12);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.tc-fare-calculator.tc-sgr-isolated .tc-result-label {
	font-size: 11px;
	font-weight: 700;
	color: #166534;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.tc-fare-calculator.tc-sgr-isolated .tc-result-amount {
	font-size: 32px;
	font-weight: 800;
	color: #15803d;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.tc-fare-calculator.tc-sgr-isolated .tc-result-detail {
	font-size: 13px;
	color: #15803d;
	opacity: 0.9;
}

.tc-fare-calculator.tc-sgr-isolated .tc-result-note {
	font-size: 12px;
	color: var(--tc-text-color);
	margin: 10px 0 0 0;
	padding-top: 12px;
	border-top: 1px solid rgba(34, 197, 94, 0.25);
	line-height: 1.4;
}

/* Calculate button */
.tc-fare-calculator.tc-sgr-isolated .tc-actions {
	margin-top: 0;
}

.tc-fare-calculator.tc-sgr-isolated .tc-btn-calculate {
	width: 100%;
	padding: 16px 24px;
	font-size: 16px;
	font-weight: 600;
	color: var(--tc-button-text) !important;
	background: var(--tc-button-bg) !important;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tc-fare-calculator.tc-sgr-isolated .tc-btn-calculate:hover {
	background: var(--tc-button-hover) !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tc-fare-calculator.tc-sgr-isolated .tc-btn-calculate:disabled.tc-loading {
	opacity: 0.85;
	cursor: wait;
}

.tc-fare-calculator.tc-sgr-isolated .tc-btn-calculate .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}
