:root {
    --blue:       #2413FC;
    --blue-dark:  #1C0FCD;
    --blue-deep:  #1409a8;
    --orange:     #FF4D2E;
    --orange-hover: #e63e20;
    --bg:         #F0F2F8;
    --card-bg:    #ffffff;
    --text-dark:  #1a1a2e;
    --text-mid:   #555577;
    --text-light: #9999bb;
    --price-color: #1a1a2e;
    --success:    #2ecc71;
    --error-bg:   #fff0ee;
    --error-text: #c0392b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.app-wrapper {
    width: 100%;
    max-width: 420px;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

/* ── HERO ── */
.hero {
    background: var(--blue);
    border-radius: 0 0 36px 36px;
    padding: 16px 28px 52px;
    position: relative;
    overflow: hidden;
}

.deco-stars {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.deco-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.blob-orange {
    width: 120px; height: 120px;
    background: #F6A800;
    opacity: 0.85;
    bottom: -30px; right: -20px;
}

.blob-orange-sm {
    width: 55px; height: 55px;
    background: #FF4D2E;
    opacity: 0.7;
    bottom: 30px; right: 80px;
}

/* Botones superiores del hero */
.hero-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.hero-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    padding: 0;
    width: 38px;
    backdrop-filter: blur(4px);
}

.hero-btn:hover {
    background: rgba(255,255,255,0.28);
    transform: scale(1.08);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 48px;
}

.hero-logo img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    margin-bottom: 10px;
}

.hero h1 {
    font-size: 2.4em;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1;
}

.hero-subtitle {
    font-size: 0.9em;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    margin-top: 4px;
    line-height: 1.4;
    max-width: 260px;
}

/* ── FORM CARD ── */
.form-card {
    background: var(--card-bg);
    margin: -24px 16px 0;
    border-radius: 24px;
    padding: 24px 20px 20px;
    box-shadow: 0 8px 32px rgba(36,19,252,0.10);
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Input group estilo app de transporte */
.input-group {
    background: #F7F8FF;
    border-radius: 16px;
    padding: 14px 16px;
    border: 1.5px solid #E8EAFF;
}

.input-group label {
    font-size: 0.72em;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.input-group input[type="text"] {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Nunito', sans-serif;
    font-size: 1em;
    font-weight: 700;
    color: var(--text-dark);
    padding: 4px 0;
    outline: none;
}

.input-group input[type="text"]::placeholder {
    color: var(--text-light);
    font-weight: 600;
}

.input-divider {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0 6px 4px;
}

.input-divider span {
    flex: 1;
    height: 1px;
    background: #E8EAFF;
}

/* Botones */
button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 16px;
    font-family: 'Nunito', sans-serif;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#usarUbicacion {
    background: #EEF0FF;
    color: var(--blue);
}

#usarUbicacion:hover {
    background: #E0E3FF;
    transform: translateY(-1px);
}

#usarUbicacion:disabled {
    background: #f0f0f0;
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

#btnCalcular {
    background: var(--orange);
    color: #ffffff;
    font-size: 1.05em;
    box-shadow: 0 6px 20px rgba(255,77,46,0.35);
}

#btnCalcular:hover {
    background: var(--orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,77,46,0.45);
}

#btnCalcular:disabled {
    background: var(--text-light);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-swap {
    min-width: 28px;
    width: 28px;
    height: 28px;
    background: #ECEEFF;
    border: 1.5px solid #C8CCFF;
    border-radius: 50%;
    color: #2413FC;
    font-size: 14px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.2s;
    user-select: none;
}

.btn-swap:hover {
    background: #D8DCFF;
    transform: rotate(180deg);
}

/* ── RESULTADOS ── */
.resultados {
    padding: 20px 16px 0;
}

.resultados h2 {
    font-size: 1em;
    font-weight: 900;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    margin-top: 20px;
}

.resultados h2:first-child {
    margin-top: 0;
}

.route-info {
    background: var(--blue);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 4px;
    box-shadow: 0 4px 16px rgba(36,19,252,0.18);
}

.route-stat {
    text-align: center;
    color: white;
}

.route-stat .stat-value {
    font-size: 1.8em;
    font-weight: 900;
    line-height: 1;
}

.route-stat .stat-unit {
    font-size: 0.8em;
    font-weight: 700;
    opacity: 0.8;
}

.route-stat .stat-label {
    font-size: 0.72em;
    opacity: 0.65;
    margin-top: 2px;
}

.route-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.25);
}

.map-container {
    margin: 12px 0;
    height: 220px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.embedded-map {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── TARIFA CARDS ── */
.tarifa-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 16px 18px;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(36,19,252,0.07);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.btn-abrir-app {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    text-decoration: none;
    transition: transform 0.15s, opacity 0.15s;
    opacity: 0.9;
}

.btn-abrir-app:hover,
.btn-abrir-app:active {
    transform: scale(1.1);
    opacity: 1;
}

.tarifa-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.3em;
}

.tarifa-body {
    flex: 1;
}

.tarifa-body h3 {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--text-mid);
    margin-bottom: 2px;
}

.tarifa-body .price {
    font-size: 1.5em;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1.1;
}

.tarifa-body .price-range-label {
    font-size: 0.72em;
    font-weight: 700;
    color: var(--text-light);
    margin-top: 1px;
}

.tarifa-body .tarifa-minima {
    font-size: 0.72em;
    color: var(--text-light);
    margin-top: 3px;
}

/* Separator entre secciones de resultados */
.results-separator {
    height: 1px;
    background: #E8EAFF;
    margin: 8px 0 16px;
}

/* Mensaje de carga */
.loading-msg {
    text-align: center;
    color: var(--blue);
    font-weight: 700;
    padding: 24px 0;
    font-size: 1em;
}

/* Mensaje de error */
.error-msg {
    background: var(--error-bg);
    color: var(--error-text);
    border-radius: 16px;
    padding: 16px 18px;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.5;
}

/* ── BOTÓN COMPARTIR ── */
.btn-compartir {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 8px 16px 0;
    padding: 14px;
    background: #EEF0FF;
    color: var(--blue);
    border: none;
    border-radius: 16px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-compartir:hover {
    background: #E0E3FF;
    transform: translateY(-1px);
}

.btn-compartir:active {
    transform: translateY(0);
}

/* ── FOOTER ── */
.note {
    font-size: 0.72em;
    color: var(--text-light);
    margin: 20px 16px 8px;
    line-height: 1.6;
    text-align: center;
}

.footer-text {
    text-align: center;
    font-size: 0.78em;
    color: var(--text-light);
    padding: 12px 16px 28px;
    font-weight: 600;
}

/* ── AUTOCOMPLETE DROPDOWN ── */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: -16px;
    right: -16px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(36,19,252,0.15);
    z-index: 100;
    overflow: hidden;
    border: 1.5px solid #E8EAFF;
}

.autocomplete-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-dark);
    transition: background 0.15s;
    border-bottom: 1px solid #F0F2F8;
    line-height: 1.4;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item:active {
    background: #F0F2FF;
}

.autocomplete-icon {
    color: var(--blue);
    font-size: 0.9em;
    margin-top: 2px;
    flex-shrink: 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Fila nombre + etiqueta contextual */
.tarifa-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.tarifa-header-row h3 {
    margin: 0;
}

/* Etiqueta contextual por app */
.etiqueta-contextual {
    font-size: 0.68em;
    font-weight: 700;
    color: #555;
    background: #F2F3FF;
    border: 1px solid #DDE0FF;
    border-radius: 20px;
    padding: 2px 9px;
    white-space: nowrap;
    line-height: 1.6;
}


    .hero {
        padding: 40px 22px 48px;
    }
    .hero h1 {
        font-size: 2em;
    }
}

/* ── GOOGLE PLACES AUTOCOMPLETE — Estilo TarifApp ── */

/* Contenedor del dropdown */
.pac-container {
    font-family: 'Nunito', sans-serif !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(36,19,252,0.13) !important;
    background: #ffffff !important;
    margin-top: 6px !important;
    padding: 6px !important;
    z-index: 9999 !important;
    overflow: hidden !important;
}

/* Quitar el logo de Google (requerido solo en modo "no branding", 
   con la API normal debe mantenerse — lo movemos al fondo discretamente) */
.pac-logo::after {
    padding: 4px 10px 4px !important;
    opacity: 0.5 !important;
}

/* Cada sugerencia */
.pac-item {
    font-family: 'Nunito', sans-serif !important;
    padding: 10px 12px !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: #1a1a2e !important;
    font-size: 0.88em !important;
    line-height: 1.3 !important;
    transition: background 0.15s !important;
}

.pac-item:hover,
.pac-item-selected {
    background: #EEF0FF !important;
}

/* Ícono de pin de Google → reemplazar visualmente */
.pac-icon {
    width: 18px !important;
    height: 18px !important;
    background-image: none !important;
    background-color: #2413FC !important;
    border-radius: 50% !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

.pac-icon::after {
    content: '' !important;
    position: absolute !important;
    inset: 3px !important;
    background: white !important;
    border-radius: 50% !important;
}

/* Texto principal de la sugerencia */
.pac-item-query {
    font-family: 'Nunito', sans-serif !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    font-size: 1em !important;
}

/* Texto secundario (ciudad, país) */
.pac-item span:last-child {
    color: #9999bb !important;
    font-size: 0.9em !important;
    font-weight: 400 !important;
}

/* Texto resaltado mientras se escribe */
.pac-matched {
    color: #2413FC !important;
    font-weight: 900 !important;
}

