/* --- Estructura General --- */
.jes-search-container {
    max-width: 950px;
    margin: 0 auto;
    font-family: inherit, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.jes-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    position: relative;
    align-items: end; /* Alinea los inputs abajo */
}

.jes-group {
    display: flex;
    flex-direction: column;
}

.jes-group.relative {
    position: relative;
}

.jes-group label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jes-group input[type="text"],
.jes-group input[type="date"],
.jes-group input[type="number"],
.jes-group select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.jes-group input:focus, 
.jes-group select:focus {
    border-color: #bfa15f;
    outline: none;
}

/* --- Autocomplete Dropdown --- */
.jes-suggestions {
    position: absolute;
    top: 72px; /* Ajustar según altura del input */
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    border-radius: 0 0 4px 4px;
}

.jes-suggestions li {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.jes-suggestions li:hover {
    background-color: #f7f9fa;
    color: #000;
}

.jes-suggestions strong {
    color: #bfa15f; /* Dorado corporativo */
    font-weight: 700;
}

/* --- Toggle Vuelo de Vuelta --- */
.jes-toggle-row {
    grid-column: 1 / -1; /* Ocupa todo el ancho */
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.jes-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.jes-toggle-checkbox {
    margin-right: 8px !important;
    width: 18px !important;
    height: 18px !important;
    accent-color: #bfa15f;
    cursor: pointer;
}

/* Campo oculto de fecha vuelta */
.jes-return-group-date {
    display: none; /* Oculto por defecto, JS lo muestra con Round Trip */
}

/* --- Caja de Estimación --- */
.jes-estimation-box {
    margin-top: 25px;
    padding: 20px;
    background: #fdfdfd;
    border-left: 5px solid #bfa15f;
    display: none;
    border-radius: 4px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.jes-route-info {
    font-size: 0.85em;
    color: #777;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.jes-price-row {
    font-size: 1.1em;
    color: #333;
    margin: 0;
    text-align: center;
}

.jes-price-display {
    font-weight: 700;
    color: #bfa15f;
    font-size: 1.4em;
    margin-left: 10px;
}

/* --- Animación: trayectoria curva del avión --- */
.jes-flight-path-anim {
    position: relative;
    width: 220px;
    height: 50px;
    margin: 4px auto 8px;
}

.jes-flight-path-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.jes-flight-path-line {
    stroke: #ddd;
}

.jes-flight-plane {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 18px;
    line-height: 1;
    offset-path: path('M10,50 Q100,-10 190,50');
    offset-rotate: 90deg;
    animation: jes-fly-path 2.8s ease-in-out infinite;
}

@keyframes jes-fly-path {
    0%   { offset-distance: 0%;   opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .jes-flight-plane { animation: none; offset-distance: 50%; opacity: 1; }
}

/* --- Botón Buscar --- */
.jes-btn-search {
    margin-top: 25px;
    width: 100%;
    padding: 16px;
    border: none;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: #d1d1d1;
    cursor: not-allowed;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

.jes-btn-search.jes-btn-active {
    background-color: #002244; /* Azul oscuro */
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.jes-btn-search.jes-btn-active:hover {
    background-color: #bfa15f; /* Dorado */
    transform: translateY(-2px);
}
/* --- Empty Legs: tabla --- */
.jes-empty-legs-container {
    margin-top: 40px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.jes-el-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.jes-el-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.jes-el-search {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 220px;
    font-size: 0.95em;
}

.jes-el-sort {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    background: #fff;
}

.jes-el-table-wrap {
    overflow-x: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

.jes-el-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
    min-width: 640px;
}

.jes-el-table thead th {
    text-align: left;
    background: #fafafa;
    color: #777;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.jes-el-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f2f2f2;
    color: #333;
    vertical-align: middle;
}

.jes-el-table tbody tr:hover {
    background: #fdfaf4;
}

.jes-el-route-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.jes-route-arrow {
    color: #ccc;
    font-size: 1.1em;
    margin: 4px 0;
}

.jes-el-route-arrow {
    color: #ccc;
    font-size: 1.1em;
}

.jes-el-price-cell {
    color: #bfa15f;
    font-weight: 800;
    white-space: nowrap;
}

.jes-el-btn,
.jes-el-btn-sm {
    display: inline-block;
    text-align: center;
    background: #333;
    color: #fff;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.3s;
    white-space: nowrap;
}

.jes-el-btn { display: block; }

.jes-el-btn:hover,
.jes-el-btn-sm:hover {
    background: #bfa15f;
    color: #fff;
}

.jes-el-no-results {
    text-align: center;
    padding: 20px;
    color: #777;
    margin: 0;
}

@media (max-width: 640px) {
    .jes-el-toolbar { flex-direction: column; align-items: stretch; }
    .jes-el-search, .jes-el-sort { flex: 1; min-width: 0; }
}

/* --- Bloque Gutenberg: Calculadora de ruta --- */
.jes-route-calc-block {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
}

.jes-route-calc-type-badge {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.jes-route-calc-route {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 12px;
}

.jes-route-calc-airport {
    line-height: 1.3;
    font-weight: 700;
}

.jes-route-calc-meta {
    font-size: 0.85em;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.jes-route-calc-distance,
.jes-route-calc-time {
    line-height: 1.6;
}

.jes-route-calc-price {
    font-size: 1.6em;
    font-weight: 800;
    color: #bfa15f;
}

.jes-disclaimer {
    font-size: 0.75em;
    color: #999;
    margin-top: 8px;
    margin-bottom: 14px;
}

.jes-route-calc-cta {
    display: inline-block;
    max-width: 280px;
    margin: 0 auto;
}

.jes-block-placeholder {
    padding: 20px;
    border: 1px dashed #ccc;
    color: #777;
    text-align: center;
    border-radius: 6px;
}

.jes-el-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 20px;
    color: #777;
}

.jes-optional { font-weight: 400; opacity: .6; font-size: .85em; }
