/* ============================================================
   RODOVIÁRIO SEARCH
============================================================ */

#search-panel-rodoviario .search-fields {
    grid-template-columns:
        minmax(180px, 1.4fr) 42px minmax(180px, 1.4fr) minmax(135px, 0.8fr) minmax(135px, 0.8fr) minmax(145px, 0.9fr);
}


/* ============================================================
   BUS CARD
============================================================ */

.bus-card {
    display: grid;

    grid-template-columns:
        minmax(130px, 0.7fr) minmax(350px, 2fr) minmax(170px, 0.8fr);

    align-items: center;

    gap: 28px;

    padding: 22px 24px;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);

    transition: var(--transition);
}

.bus-card:hover {
    transform: translateY(-2px);

    border-color: rgba(20, 120, 212, 0.28);

    box-shadow: var(--shadow-md);
}


/* ============================================================
   COMPANY
============================================================ */

.bus-company {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.bus-company-name {
    color: var(--primary);

    font-size: 14px;
    font-weight: 700;
}

.bus-class {
    color: var(--text-secondary);

    font-size: 11px;
}


/* ============================================================
   ROUTE
============================================================ */

.bus-route {
    display: grid;

    grid-template-columns:
        auto 1fr auto;

    align-items: center;

    gap: 18px;
}

.bus-time {
    color: var(--primary);

    font-size: 19px;
    font-weight: 750;
}

.bus-station {
    display: block;

    max-width: 130px;

    margin-top: 3px;

    color: var(--text-secondary);

    font-size: 10px;
}

.bus-path {
    text-align: center;
}

.bus-duration {
    display: block;

    margin-bottom: 6px;

    color: var(--text-secondary);

    font-size: 10px;
}

.bus-line {
    position: relative;

    height: 1px;

    background: #ccd5df;
}

.bus-line::before,
.bus-line::after {
    content: "";

    position: absolute;

    top: 50%;

    width: 7px;
    height: 7px;

    transform: translateY(-50%);

    border-radius: 50%;

    background: var(--accent);
}

.bus-line::before {
    left: 0;
}

.bus-line::after {
    right: 0;
}


/* ============================================================
   PRICE
============================================================ */

.bus-price {
    text-align: right;
}

.bus-price-value {
    display: block;

    margin-bottom: 10px;

    color: var(--primary);

    font-size: 22px;
    font-weight: 750;
}

.btn-select-bus {
    width: 100%;
    height: 40px;

    color: #ffffff;

    background: var(--accent);

    border-radius: var(--radius-sm);

    font-size: 12px;
    font-weight: 650;

    transition: var(--transition);
}

.btn-select-bus:hover {
    background: var(--accent-hover);
}


/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1100px) {

    #search-panel-rodoviario .search-fields {
        grid-template-columns:
            1fr 42px 1fr 1fr;
    }

}


@media (max-width: 850px) {

    #search-panel-rodoviario .search-fields {
        grid-template-columns: 1fr 1fr;
    }

    #search-panel-rodoviario .swap-container {
        display: none;
    }

    .bus-card {
        grid-template-columns: 1fr;
    }

    .bus-price {
        padding-top: 15px;

        text-align: left;

        border-top: 1px solid var(--border);
    }

}


@media (max-width: 600px) {

    #search-panel-rodoviario .search-fields {
        grid-template-columns: 1fr;
    }

}

/* ============================================================
   RODOVIÁRIO - RESULTADOS
   ============================================================ */

#rodoviario-results {
    width: 100%;
}


/* ============================================================
   CABEÇALHO DOS RESULTADOS
   ============================================================ */

.rodoviario-results-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 22px;
}

.rodoviario-results-eyebrow {
    display: block;

    margin-bottom: 4px;

    color: var(--accent);

    font-size: 11px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.rodoviario-results-header h2 {
    margin: 0;

    color: var(--primary);

    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.rodoviario-results-header p {
    margin: 5px 0 0;

    color: var(--text-muted);

    font-size: 13px;
}


/* ============================================================
   ORDENAÇÃO
   ============================================================ */

.rodoviario-results-sort {
    display: flex;
    flex-direction: column;

    gap: 6px;

    min-width: 190px;
}

.rodoviario-results-sort label {
    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;
}

.rodoviario-results-sort select {
    width: 100%;
    height: 42px;

    padding: 0 36px 0 13px;

    border: 1px solid #d7e1eb;
    border-radius: 9px;

    background: #ffffff;

    color: var(--text);

    font: inherit;
    font-size: 13px;

    outline: none;
    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.rodoviario-results-sort select:hover {
    border-color: #c4d2df;
}

.rodoviario-results-sort select:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(22, 131, 229, 0.10);
}


/* ============================================================
   LISTA
   ============================================================ */

.rodoviario-results-list {
    display: flex;
    flex-direction: column;

    gap: 14px;

    width: 100%;
}


/* ============================================================
   CARD DA VIAGEM
   ============================================================ */

.rodoviario-card {
    width: 100%;

    overflow: hidden;

    border: 1px solid #e0e7ef;
    border-radius: 15px;

    background: #ffffff;

    box-shadow:
        0 4px 12px rgba(5, 35, 61, 0.035),
        0 12px 30px rgba(5, 35, 61, 0.025);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.rodoviario-card:hover {
    transform: translateY(-2px);

    border-color: #bddcf7;

    box-shadow:
        0 7px 18px rgba(5, 35, 61, 0.06),
        0 18px 38px rgba(5, 35, 61, 0.05);
}


/* ============================================================
   CONTEÚDO PRINCIPAL
   ============================================================ */

.rodoviario-card-main {
    display: grid;

    grid-template-columns:
        190px minmax(0, 1fr) 175px;

    align-items: center;

    gap: 26px;

    min-height: 145px;

    padding: 22px 24px;
}


/* ============================================================
   VIAÇÃO
   ============================================================ */

.rodoviario-company {
    display: flex;
    align-items: center;

    gap: 13px;

    min-width: 0;
}

.rodoviario-company-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    border-radius: 12px;

    background: #edf7ff;

    color: var(--accent);
}

.rodoviario-company-logo i {
    font-size: 21px;
}

.rodoviario-company>div:last-child {
    display: flex;
    flex-direction: column;

    min-width: 0;

    gap: 4px;
}

.rodoviario-company strong {
    overflow: hidden;

    color: var(--primary);

    font-size: 14px;
    font-weight: 800;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.rodoviario-company span {
    color: #77889a;

    font-size: 10px;
    font-weight: 600;
}


/* ============================================================
   ROTA
   ============================================================ */

.rodoviario-route {
    display: grid;

    grid-template-columns:
        minmax(85px, auto) minmax(160px, 1fr) minmax(85px, auto);

    align-items: center;

    gap: 18px;

    min-width: 0;
}


/* ============================================================
   ORIGEM / DESTINO
   ============================================================ */

.rodoviario-route-point {
    display: flex;
    flex-direction: column;

    gap: 5px;

    min-width: 0;
}

.rodoviario-route-point strong {
    color: var(--primary);

    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.rodoviario-route-point span {
    overflow: hidden;

    color: #66788a;

    font-size: 11px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.rodoviario-route-arrival {
    text-align: right;
}


/* ============================================================
   LINHA DA VIAGEM
   ============================================================ */

.rodoviario-route-line {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 5px;

    min-width: 0;

    text-align: center;
}

.rodoviario-route-line>span {
    color: #758698;

    font-size: 10px;
    font-weight: 700;
}

.rodoviario-route-line>div {
    display: flex;
    align-items: center;

    width: 100%;
}

.rodoviario-route-line>div>span {
    display: block;

    height: 1px;

    flex: 1;

    background: #cbd8e4;
}

.rodoviario-route-line>div>i {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    margin: 0 8px;

    flex: 0 0 28px;

    border: 1px solid #cfe4f7;
    border-radius: 50%;

    background: #f1f8fe;

    color: var(--accent);

    font-size: 11px;
}

.rodoviario-route-line small {
    color: #7f8e9d;

    font-size: 9px;
    font-weight: 600;
}


/* ============================================================
   PREÇO
   ============================================================ */

.rodoviario-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    min-width: 0;

    padding-left: 22px;

    border-left: 1px solid #edf1f5;
}

.rodoviario-price>span {
    margin-bottom: 3px;

    color: #8492a1;

    font-size: 9px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rodoviario-price>strong {
    color: var(--primary);

    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.rodoviario-price>small {
    margin-top: 3px;

    color: #7c8c9d;

    font-size: 9px;
}


/* ============================================================
   BOTÃO SELECIONAR
   ============================================================ */

.rodoviario-select-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 120px;
    height: 39px;

    margin-top: 12px;
    padding: 0 15px;

    border: 0;
    border-radius: 8px;

    background: var(--accent);

    color: #ffffff;

    font: inherit;
    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.rodoviario-select-button:hover {
    transform: translateY(-1px);

    background: var(--accent-hover);

    box-shadow:
        0 6px 14px rgba(22, 131, 229, 0.20);
}

.rodoviario-select-button:active {
    transform: translateY(0);
}


/* ============================================================
   LOADING
   ============================================================ */

.rodoviario-loading {
    align-items: center;

    gap: 15px;

    margin-bottom: 18px;
    padding: 20px;

    border: 1px solid #e0e7ef;
    border-radius: 13px;

    background: #ffffff;
}

.rodoviario-loading:not([hidden]) {
    display: flex;
}

.rodoviario-loading>div:last-child {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.rodoviario-loading strong {
    color: var(--primary);

    font-size: 13px;
}

.rodoviario-loading span {
    color: var(--text-muted);

    font-size: 11px;
}


/* ============================================================
   SPINNER
   ============================================================ */

.rodoviario-loading-spinner {
    width: 27px;
    height: 27px;

    flex: 0 0 27px;

    border: 3px solid #e4edf5;
    border-top-color: var(--accent);
    border-radius: 50%;

    animation:
        rodoviario-spinner 0.7s linear infinite;
}

@keyframes rodoviario-spinner {

    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   SEM RESULTADOS
   ============================================================ */

.rodoviario-empty-results {
    padding: 46px 24px;

    border: 1px dashed #ccd8e5;
    border-radius: 15px;

    background: #ffffff;

    text-align: center;
}

.rodoviario-empty-results i {
    margin-bottom: 12px;

    color: #9aaabc;

    font-size: 32px;
}

.rodoviario-empty-results h3 {
    margin: 0 0 6px;

    color: var(--primary);

    font-size: 18px;
    font-weight: 800;
}

.rodoviario-empty-results p {
    margin: 0;

    color: var(--text-muted);

    font-size: 12px;
}


/* ============================================================
   RESPONSIVO - TABLET
   ============================================================ */

@media (max-width: 1000px) {

    .rodoviario-card-main {
        grid-template-columns:
            160px minmax(0, 1fr) 155px;

        gap: 18px;

        padding: 20px;
    }

    .rodoviario-route {
        gap: 12px;
    }

    .rodoviario-route-point strong {
        font-size: 19px;
    }

    .rodoviario-price {
        padding-left: 16px;
    }

    .rodoviario-price>strong {
        font-size: 19px;
    }
}


/* ============================================================
   RESPONSIVO - MOBILE / TABLET PEQUENO
   ============================================================ */

@media (max-width: 760px) {

    .rodoviario-results-header {
        align-items: stretch;
        flex-direction: column;

        gap: 14px;
    }

    .rodoviario-results-sort {
        width: 100%;
    }

    .rodoviario-card-main {
        grid-template-columns: 1fr;

        gap: 20px;

        min-height: auto;

        padding: 20px;
    }

    .rodoviario-company {
        padding-bottom: 16px;

        border-bottom: 1px solid #edf1f5;
    }

    .rodoviario-route {
        grid-template-columns:
            minmax(70px, auto) minmax(100px, 1fr) minmax(70px, auto);
    }

    .rodoviario-price {
        align-items: flex-start;

        padding-top: 16px;
        padding-left: 0;

        border-top: 1px solid #edf1f5;
        border-left: 0;
    }

    .rodoviario-select-button {
        width: 100%;
    }
}


/* ============================================================
   RESPONSIVO - MOBILE
   ============================================================ */

@media (max-width: 520px) {

    .rodoviario-results-header h2 {
        font-size: 21px;
    }

    .rodoviario-card-main {
        padding: 18px;
    }

    .rodoviario-route {
        grid-template-columns:
            62px minmax(80px, 1fr) 62px;

        gap: 8px;
    }

    .rodoviario-route-point strong {
        font-size: 17px;
    }

    .rodoviario-route-point span {
        font-size: 9px;
    }

    .rodoviario-route-line>div>i {
        width: 24px;
        height: 24px;

        margin: 0 5px;

        flex-basis: 24px;

        font-size: 9px;
    }

    .rodoviario-route-line>span,
    .rodoviario-route-line small {
        font-size: 8px;
    }

    .rodoviario-price>strong {
        font-size: 20px;
    }
}