/**
 * Transegovia API — Frontend Styles
 *
 * All custom classes prefixed with .tseg- to avoid conflicts.
 * Quote form uses native Elementor classes for visual consistency.
 * Compatible with Hello Elementor child theme.
 *
 * @package Transegovia
 */

/* ─── Base Widget ─────────────────────────────────────────── */



/* ─── Autocomplete (used inside Elementor form fields) ────── */

.tseg-autocomplete-wrap {
	position: relative;
}

.tseg-autocomplete-list {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 100;
	margin: 2px 0 0 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	max-height: 240px;
	overflow-y: auto;
	display: none;
}

.tseg-autocomplete-list.tseg-active {
	display: block;
}

.tseg-autocomplete-list li {
	padding: 0.55rem 0.75rem;
	cursor: pointer;
	font-size: 0.93em;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.15s;
}

.tseg-autocomplete-list li:last-child {
	border-bottom: none;
}

.tseg-autocomplete-list li:hover,
.tseg-autocomplete-list li.tseg-highlighted {
	background: #f0f7fc;
}

.tseg-autocomplete-list li.tseg-no-results {
	color: #999;
	font-style: italic;
	cursor: default;
	pointer-events: none;
}

/* ─── Field Spinner (inside autocomplete inputs) ─────────── */

.tseg-field-spinner {
	display: none;
	position: absolute;
	right: 10px;
	top: 50%;
	margin-top: -8px;
	width: 16px;
	height: 16px;
	border: 2px solid #ddd;
	border-top-color: #DC5912;
	border-radius: 50%;
	animation: tseg-spin 0.7s linear infinite;
	pointer-events: none;
}

.tseg-field-spinner[aria-hidden="false"] {
	display: inline-block;
}

/* ─── Autocomplete Validation ─────────────────────────────── */

.tseg-autocomplete-wrap--invalid input {
	border-color: #e53e3e;
}

.tseg-field-hint {
	display: block;
	font-size: 0.82em;
	color: #e53e3e;
	margin-top: 4px;
	line-height: 1.3;
}

/* ─── Quote Form: Elementor Button Overrides (Orange) ─────── */

#tseg-submit-wrap #tseg-quote-submit {
	width: 100%;
}


.tseg-widget .elementor-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	color: #fff;
	background: #DC5912;
	font-size: 16px;
	font-weight: 600;
	border: none;
	border-radius: 15px;
	padding: 10px 16px;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.2s;
	overflow: hidden;
}

.tseg-widget .elementor-button::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(234, 95, 33, 1) 0%, rgba(245, 157, 36, 1) 100%);
	clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
	transition: clip-path 0.5s cubic-bezier(0.0, 0.0, 0.2, 1);
	z-index: 0;
	border-radius: 16px;
}

.tseg-widget .elementor-button:hover::before {
	clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.tseg-widget .elementor-button .elementor-button-content-wrapper {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.tseg-widget .elementor-button .elementor-button-icon {
	display: inline-flex;
	align-items: center;
}

.tseg-widget .elementor-button .elementor-button-icon svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.tseg-widget .elementor-button .elementor-button-icon svg path {
	fill: #fff;
}


.tseg-widget .elementor-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.tseg-result__actions  #tseg-reset-btn:hover {
    background-color: #DC5912;
 
    border: 2px solid #DC5912;
}


.tseg-result__actions #tseg-reset-btn .elementor-button-text{
       color: #DC5912;
}

.tseg-result__actions #tseg-reset-btn:hover .elementor-button-text {
    color: #fff;
}

/* ─── Loading ─────────────────────────────────────────────── */

.tseg-loading {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 1rem;
	color: #666;
	font-size: 0.93em;
}

.tseg-loading[aria-hidden="false"] {
	display: flex;
}

.tseg-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2.5px solid #ddd;
	border-top-color: #DC5912;
	border-radius: 50%;
	animation: tseg-spin 0.7s linear infinite;
}

@keyframes tseg-spin {
	to { transform: rotate(360deg); }
}

/* ─── Messages ────────────────────────────────────────────── */

.tseg-message {
	display: none;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-size: 0.93em;
}

.tseg-message[aria-hidden="false"] {
	display: block;
}

.tseg-message--error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.tseg-message--success {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

/* ─── Results ─────────────────────────────────────────────── */

.tseg-result {
	display: none;
	margin-top: 1.5rem;
	padding: 1.25rem;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

.tseg-result[aria-hidden="false"] {
	display: block;
}

.tseg-result__title {
	margin: 0 0 1rem 0;
	font-size: 1.1em;
	font-weight: 700;
	color: #1e293b;
}

.tseg-result__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 0.75rem 0;
	border-bottom: 2px solid #e2e8f0;
	margin-bottom: 0.75rem;
}

.tseg-result__label {
	font-weight: 600;
	color: #475569;
}

.tseg-result__value {
	font-size: 1.5em;
	font-weight: 700;
	color: #DC5912;
}

.tseg-result__breakdown {
	font-size: 0.9em;
	color: #64748b;
	margin-bottom: 1.25rem;
}

.tseg-result__breakdown-item {
	display: flex;
	justify-content: space-between;
	padding: 0.3rem 0;
}

/* ─── Result Action Buttons ───────────────────────────────── */

.tseg-result__actions {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap; 
	margin-top: 1.25rem;
}

.tseg-result__actions .tseg-btn-whatsapp {
	background: #25D366;
}

.tseg-result__actions .tseg-btn-whatsapp::before {
	background: linear-gradient(90deg, #25D366 0%, #128C7E 100%);
}

.tseg-result__actions .tseg-btn-reset {
	background: transparent;
	color: #DC5912;
	border: 2px solid #DC5912;
}

.tseg-result__actions .tseg-btn-reset::before {
	background: linear-gradient(90deg, rgba(234, 95, 33, 0.08) 0%, rgba(245, 157, 36, 0.08) 100%);
}

.tseg-result__actions .tseg-btn-reset:hover {
	color: #fff;
}

.tseg-result__actions .tseg-btn-reset:hover::before {
	background: linear-gradient(90deg, rgba(234, 95, 33, 1) 0%, rgba(245, 157, 36, 1) 100%);
}

/* ─── Tracking Info Grid ──────────────────────────────────── */

.tseg-info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.tseg-info-item {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.tseg-info-label {
	font-size: 0.85em;
	font-weight: 600;
	color: #64748b;
}

.tseg-info-value {
	color: #1e293b;
	font-weight: 500;
}

/* ─── Parties (Sender/Recipient) ──────────────────────────── */

.tseg-parties {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.tseg-party {
	padding: 0.75rem;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
}

.tseg-party__title {
	margin: 0 0 0.5rem 0;
	font-size: 0.95em;
	font-weight: 700;
	color: #334155;
}

.tseg-party__details {
	font-size: 0.88em;
	color: #475569;
	line-height: 1.6;
}

.tseg-party__row {
	display: flex;
	gap: 0.25rem;
}

.tseg-party__row-label {
	font-weight: 600;
	min-width: 65px;
}

/* ─── Tables ──────────────────────────────────────────────── */

.tseg-section {
	margin-bottom: 1.25rem;
}

.tseg-section__title {
	margin: 0 0 0.5rem 0;
	font-size: 0.95em;
	font-weight: 700;
	color: #334155;
}

.tseg-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.tseg-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88em;
}

.tseg-table th,
.tseg-table td {
	padding: 0.5rem 0.6rem;
	text-align: left;
	border-bottom: 1px solid #e2e8f0;
}

.tseg-table th {
	background: #f1f5f9;
	font-weight: 700;
	color: #475569;
	font-size: 0.9em;
	white-space: nowrap;
}

.tseg-table tbody tr:hover {
	background: #f8fafc;
}

.tseg-table tfoot td {
	font-weight: 700;
	border-top: 2px solid #cbd5e1;
}

/* ─── Timeline Photos/Signatures ─────────────────────────── */

.tseg-timeline-photo {
	display: inline-block;
	max-width: 60px;
	max-height: 60px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #e2e8f0;
	vertical-align: middle;
	cursor: pointer;
	transition: opacity 0.15s;
}

.tseg-timeline-photo:hover {
	opacity: 0.8;
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
	.tseg-parties {
		grid-template-columns: 1fr;
	}

	.tseg-info-grid {
		grid-template-columns: 1fr;
	}

	.tseg-result__total {
		flex-direction: column;
		gap: 0.25rem;
	}

	.tseg-table {
		font-size: 0.82em;
	}

  	.tseg-btn-whatsapp, #tseg-reset-btn  {
		width: 100%;
	}
}
