/*
 * Motor nativo Alpebus · Croquis 0.5.6
 * Independiente de otros sistemas. Diseño propio de vehículo, conductor, puertas y pasillo.
 */
.alpebus-native-seat-content {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    float: none !important;
    margin: 0 !important;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
 * Leyenda: deliberadamente compacta y en una sola línea.
 * ----------------------------------------------------------------------- */
.alpebus-native-seat-legend {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-start;
    gap: 4px 8px;
    width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    clear: both;
    margin: 3px 0 10px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap;
}

.alpebus-native-seat-legend .alpebus-seat-legend-title {
    display: inline !important;
    flex: 0 0 auto;
    margin: 0 !important;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
}

.alpebus-native-legend-item {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 3px;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 10px;
    line-height: 1;
}

.alpebus-native-legend-icon {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 11px;
    border: 1.5px solid #3f9d4a;
    border-radius: 4px 4px 3px 3px;
    background: #fff;
    box-sizing: border-box;
}

.alpebus-native-legend-icon::after {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: -4px;
    height: 4px;
    border: 1.5px solid currentColor;
    border-top: 0;
    border-radius: 0 0 3px 3px;
}

.alpebus-native-legend-icon.is-available {
    color: #3f9d4a;
    border-color: #3f9d4a;
}

.alpebus-native-legend-icon.is-selected {
    color: #d87814;
    border-color: #d87814;
    background: #ffe2bd;
}

.alpebus-native-legend-icon.is-reserved {
    color: #8d949b;
    border-color: #8d949b;
    background: #e8eaed;
}

/* --------------------------------------------------------------------------
 * Carrocería del autobús
 * ----------------------------------------------------------------------- */
.alpebus-native-bus-shell {
    width: min(100%, 470px);
    margin: 8px auto 12px;
    overflow: hidden;
    border: 1px solid #cfd3d7;
    border-radius: 28px 28px 18px 18px;
    background: #f4f5f6;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

.alpebus-native-bus-front {
    position: relative;
    display: grid;
    grid-template-columns: 92px 1fr 92px;
    align-items: end;
    min-height: 88px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid #d9dcdf;
    background: linear-gradient(180deg, #fff 0%, #eef0f2 100%);
    box-sizing: border-box;
}

/* Línea suave de parabrisas: orienta sin recurrir a iconos de volante. */
.alpebus-native-bus-front::before {
    content: '';
    position: absolute;
    top: 11px;
    left: 18px;
    right: 18px;
    height: 9px;
    border-radius: 999px 999px 5px 5px;
    background: #d8dde1;
}

.alpebus-native-driver-zone,
.alpebus-native-front-door {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    color: #626a71;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.alpebus-native-driver-zone { justify-self: start; }
.alpebus-native-front-door { justify-self: end; }

/* Asiento neutro del conductor: evita el volante decorativo y mantiene una
 * referencia física coherente con los asientos del propio vehículo. */
.alpebus-native-driver-seat {
    position: relative;
    display: block;
    width: 30px;
    height: 25px;
    border: 2px solid #747c83;
    border-radius: 8px 8px 5px 5px;
    background: #fff;
    box-sizing: border-box;
}

.alpebus-native-driver-seat::before {
    content: '';
    position: absolute;
    left: 5px;
    right: 5px;
    top: 5px;
    height: 2px;
    border-radius: 10px;
    background: #c8cdd1;
}

.alpebus-native-driver-seat::after {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: -7px;
    height: 7px;
    border: 2px solid #747c83;
    border-top: 0;
    border-radius: 0 0 5px 5px;
    box-sizing: border-box;
}

.alpebus-native-front-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    min-height: 58px;
    color: #444b52;
    text-align: center;
}

.alpebus-native-front-copy strong {
    font-size: 12px;
    line-height: 1.1;
}

.alpebus-native-direction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: #777e84;
}

.alpebus-native-direction b {
    font-size: 15px;
    line-height: 1;
    color: #4c545b;
}

.alpebus-native-front-aisle {
    display: inline-block;
    margin-top: 1px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(120,128,136,.08);
    color: #8a9095;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
 * Parrilla de asientos
 * ----------------------------------------------------------------------- */
.alpebus-native-seat-map {
    --alpebus-seat-columns: 5;
    display: grid !important;
    grid-template-columns: repeat(var(--alpebus-seat-columns), minmax(0, 1fr));
    gap: 8px 7px;
    float: none !important;
    clear: both;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 18px 15px 22px !important;
    background:
        linear-gradient(90deg, transparent 0%, transparent 47.5%, rgba(120,128,136,.06) 47.5%, rgba(120,128,136,.06) 52.5%, transparent 52.5%, transparent 100%),
        #f4f5f6 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box;
}

.alpebus-native-seat,
.alpebus-native-cell {
    min-width: 0;
    min-height: 50px;
    margin: 0 !important;
    padding: 3px !important;
    box-sizing: border-box;
}

.alpebus-native-seat {
    position: relative;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100% !important;
    float: none !important;
    border: 1px solid transparent !important;
    border-radius: 9px;
    background: transparent !important;
    color: #202428;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background .16s ease, border-color .16s ease, transform .12s ease, opacity .16s ease;
}

.alpebus-native-seat:hover:not(.disable):not(.alpebus-held-other),
.alpebus-native-seat:focus-visible:not(.disable):not(.alpebus-held-other) {
    background: rgba(63, 157, 74, 0.08) !important;
    border-color: rgba(63, 157, 74, 0.42) !important;
    outline: none;
    transform: translateY(-1px);
}

.alpebus-native-seat-icon {
    position: relative;
    display: block !important;
    width: 34px !important;
    height: 27px !important;
    min-width: 34px;
    margin: 0 !important;
    border: 2px solid #3f9d4a;
    border-radius: 8px 8px 5px 5px;
    background: #fff;
    text-indent: -9999px;
    box-sizing: border-box;
    box-shadow: inset 0 -4px 0 rgba(63, 157, 74, 0.05);
}

.alpebus-native-seat-icon::before {
    content: '';
    position: absolute;
    left: 5px;
    right: 5px;
    top: 5px;
    height: 2px;
    border-radius: 10px;
    background: rgba(63, 157, 74, 0.22);
}

.alpebus-native-seat-icon::after {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: -7px;
    height: 7px;
    border: 2px solid #3f9d4a;
    border-top: 0;
    border-radius: 0 0 5px 5px;
    box-sizing: border-box;
}

.alpebus-native-seat .alpebus-native-seat-number {
    float: none !important;
    height: auto !important;
    line-height: 1.15 !important;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 700;
    color: inherit;
}

.alpebus-native-seat .alpebus-native-seat-label {
    display: none !important;
}

/* Seleccionado por el usuario actual. */
.alpebus-native-seat.active {
    border-color: #d87814 !important;
    background: #fff5e8 !important;
}

.alpebus-native-seat.active .alpebus-native-seat-icon,
.alpebus-native-seat.active .alpebus-native-seat-icon::after {
    border-color: #d87814;
}

.alpebus-native-seat.active .alpebus-native-seat-icon {
    background: #ffe2bd;
    box-shadow: inset 0 -4px 0 rgba(216, 120, 20, 0.08);
}

.alpebus-native-seat.active .alpebus-native-seat-icon::before {
    background: rgba(216, 120, 20, 0.24);
}

/* Vendido o retenido por otra sesión. */
.alpebus-native-seat.disable,
.alpebus-native-seat.alpebus-held-other {
    cursor: not-allowed !important;
    opacity: 0.72;
}

.alpebus-native-seat.disable .alpebus-native-seat-icon,
.alpebus-native-seat.disable .alpebus-native-seat-icon::after,
.alpebus-native-seat.alpebus-held-other .alpebus-native-seat-icon,
.alpebus-native-seat.alpebus-held-other .alpebus-native-seat-icon::after {
    border-color: #8d949b;
}

.alpebus-native-seat.disable .alpebus-native-seat-icon,
.alpebus-native-seat.alpebus-held-other .alpebus-native-seat-icon {
    background: #e8eaed;
    box-shadow: inset 0 -4px 0 rgba(80, 86, 92, 0.05);
}

.alpebus-native-seat.disable .alpebus-native-seat-icon::before,
.alpebus-native-seat.alpebus-held-other .alpebus-native-seat-icon::before {
    background: rgba(80, 86, 92, 0.16);
}

/* --------------------------------------------------------------------------
 * Celdas especiales: pasillo, puerta y conductor configurable
 * ----------------------------------------------------------------------- */
.alpebus-native-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.alpebus-native-cell-aisle {
    position: relative;
    pointer-events: none;
}

.alpebus-native-aisle-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 30px;
    color: #b2b7bc;
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
    opacity: 0.78;
}

.alpebus-native-cell-driver,
.alpebus-native-cell-door {
    color: #73777c;
    text-align: center;
}

.alpebus-native-grid-driver,
.alpebus-native-door-icon {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 38px;
    min-height: 42px;
}

.alpebus-native-grid-driver .alpebus-native-driver-seat {
    width: 24px;
    height: 21px;
    border-width: 2px;
}

.alpebus-native-grid-driver small,
.alpebus-native-door-icon small {
    font-size: 8px;
    line-height: 1;
}

.alpebus-native-door-icon > i {
    position: relative;
    display: block;
    width: 24px;
    height: 34px;
    border: 2px solid #7d858c;
    border-radius: 4px;
    box-sizing: border-box;
}

.alpebus-native-door-icon > i::before {
    content: '';
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 50%;
    width: 1px;
    background: #a2a8ad;
}

.alpebus-native-door-icon > i::after {
    content: '';
    position: absolute;
    right: 3px;
    top: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #7d858c;
}

.alpebus-native-special {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Parte trasera: cierra visualmente la carrocería. */
.alpebus-native-bus-rear {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px 8px;
    border-top: 1px solid #dde0e3;
    background: #eceeef;
    color: #858b90;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
 * 0.5.6 · Ajustes finos de frontal y leyenda.
 * - Leyenda realmente en una sola línea, incluso dentro del flujo de compra.
 * - Conductor centrado sobre el bloque de las columnas 1 y 2.
 * - Puerta delantera alineada con la columna del asiento 3 (columna 5).
 * ----------------------------------------------------------------------- */
.alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px 7px !important;
    width: max-content !important;
    max-width: 100% !important;
    margin: 2px 0 10px !important;
    padding: 5px 7px !important;
    white-space: nowrap !important;
}

.alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend .alpebus-seat-legend-title {
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
    font-size: 9px !important;
    line-height: 1 !important;
}

.alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend .alpebus-native-legend-item {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 3px !important;
    width: auto !important;
    min-width: 0 !important;
}

.alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend .alpebus-native-legend-label {
    display: inline !important;
    margin: 0 !important;
    font-size: 9px !important;
    line-height: 1 !important;
}

.alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend .alpebus-native-legend-icon {
    flex: 0 0 auto;
    width: 12px !important;
    height: 9px !important;
}

/* El frontal utiliza la misma retícula de cinco columnas que el croquis.
   Así los elementos se perciben alineados con las plazas reales. */
.alpebus-native-bus-front {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 7px;
    padding-left: 15px;
    padding-right: 15px;
}

.alpebus-native-driver-zone {
    grid-column: 1 / span 2;
    justify-self: stretch;
    align-self: end;
}

.alpebus-native-front-copy {
    grid-column: 3;
    justify-self: stretch;
    align-self: end;
}

.alpebus-native-front-door {
    grid-column: 5;
    justify-self: stretch;
    align-self: end;
}

/* --------------------------------------------------------------------------
 * Móvil
 * ----------------------------------------------------------------------- */
@media (max-width: 767px) {
    .alpebus-native-seat-legend {
        gap: 3px 5px;
    }

    .alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend {
        gap: 3px 5px !important;
        padding: 4px 5px !important;
    }

    .alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend .alpebus-seat-legend-title,
    .alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend .alpebus-native-legend-label {
        font-size: 8.5px !important;
    }

    .alpebus-native-seat-legend .alpebus-seat-legend-title,
    .alpebus-native-legend-item {
        font-size: 9px;
    }

    .alpebus-native-legend-icon {
        width: 12px;
        height: 10px;
    }

    .alpebus-native-bus-shell {
        width: 100%;
        border-radius: 22px 22px 15px 15px;
    }

    .alpebus-native-bus-front {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        column-gap: 4px;
        min-height: 78px;
        padding: 12px 7px 8px;
    }

    .alpebus-native-driver-zone,
    .alpebus-native-front-door {
        min-height: 50px;
        font-size: 8px;
    }

    .alpebus-native-driver-seat {
        width: 26px;
        height: 22px;
    }

    .alpebus-native-front-copy strong {
        font-size: 12px;
    }

    .alpebus-native-direction {
        font-size: 9px;
    }

    .alpebus-native-seat-map {
        gap: 7px 4px;
        padding: 15px 7px 18px !important;
    }

    .alpebus-native-seat,
    .alpebus-native-cell {
        min-height: 45px;
        padding-left: 1px !important;
        padding-right: 1px !important;
    }

    .alpebus-native-seat-icon {
        width: 29px !important;
        min-width: 29px;
        height: 24px !important;
        border-radius: 7px 7px 5px 5px;
    }

    .alpebus-native-seat .alpebus-native-seat-number {
        font-size: 11px;
    }

    .alpebus-native-aisle-arrow {
        width: 18px;
        font-size: 16px;
    }

    .alpebus-native-door-icon > i {
        width: 20px;
        height: 30px;
    }
}

@media (max-width: 390px) {
    .alpebus-native-bus-front {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        column-gap: 2px;
        padding-left: 5px;
        padding-right: 5px;
    }

    .alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend {
        gap: 2px 4px !important;
        padding: 4px !important;
    }

    .alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend .alpebus-seat-legend-title,
    .alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend .alpebus-native-legend-label {
        font-size: 8px !important;
    }

    .alpebus-seat-step .alpebus-native-seat-legend.alpebus-seat-legend .alpebus-native-legend-icon {
        width: 11px !important;
        height: 8px !important;
    }

    .alpebus-native-front-copy strong {
        font-size: 11px;
    }

    .alpebus-native-direction {
        font-size: 8px;
    }

    .alpebus-native-seat-map {
        gap: 6px 2px;
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
}


/* 0.9.4 · El mapa de asientos también se adapta en móviles que piden vista escritorio */
@media (pointer: coarse) and (max-width: 1100px) {
    .alpebus-native-seat-shell,
    .alpebus-native-seat-content,
    .alpebus-native-seat-map {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .alpebus-native-seat-map {
        gap: 7px 4px !important;
        padding: 15px 7px 18px !important;
    }

    .alpebus-native-seat,
    .alpebus-native-cell {
        min-height: 45px !important;
        padding-left: 1px !important;
        padding-right: 1px !important;
    }

    .alpebus-native-seat-icon {
        width: 29px !important;
        min-width: 29px !important;
        height: 24px !important;
    }

    .alpebus-native-seat .alpebus-native-seat-number {
        font-size: 11px !important;
    }
}


/* ==========================================================
   0.12.19 · ASIENTOS EN PALETA ALPE
========================================================== */

.alpebus-native-legend-icon.is-available{
    color:#2b9644 !important;
    border-color:#2b9644 !important;
}
.alpebus-native-legend-icon.is-selected{
    color:#176b31 !important;
    border-color:#176b31 !important;
    background:#dff2e3 !important;
}

.alpebus-native-seat:hover:not(.disable):not(.alpebus-held-other),
.alpebus-native-seat:focus-visible:not(.disable):not(.alpebus-held-other){
    background:rgba(43,150,68,.08) !important;
    border-color:rgba(43,150,68,.42) !important;
}

.alpebus-native-seat-icon,
.alpebus-native-seat-icon::after{
    border-color:#2b9644 !important;
}
.alpebus-native-seat-icon{
    box-shadow:inset 0 -4px 0 rgba(43,150,68,.05) !important;
}
.alpebus-native-seat-icon::before{
    background:rgba(43,150,68,.22) !important;
}

.alpebus-native-seat.active{
    border-color:#176b31 !important;
    background:#edf7ef !important;
}
.alpebus-native-seat.active .alpebus-native-seat-icon,
.alpebus-native-seat.active .alpebus-native-seat-icon::after{
    border-color:#176b31 !important;
}
.alpebus-native-seat.active .alpebus-native-seat-icon{
    background:#cfead5 !important;
    box-shadow:inset 0 -4px 0 rgba(23,107,49,.08) !important;
}
.alpebus-native-seat.active .alpebus-native-seat-icon::before{
    background:rgba(23,107,49,.25) !important;
}

/* Vendidos/bloqueados siguen grises para no confundirse con disponibles */
.alpebus-native-seat.disable .alpebus-native-seat-icon,
.alpebus-native-seat.disable .alpebus-native-seat-icon::after,
.alpebus-native-seat.alpebus-held-other .alpebus-native-seat-icon,
.alpebus-native-seat.alpebus-held-other .alpebus-native-seat-icon::after{
    border-color:#8d949b !important;
}
