/* Buscador de motos — barra de cuatro desplegables + botón, como el diseño. */

.ams-bm {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: stretch;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

.ams-bm--sombra { box-shadow: 0 24px 60px rgba(22, 23, 26, .13); }

/* el encabezado sólo existe en la variante móvil del diseño */
.ams-bm__titulo { display: none; }

.ams-bm__campo {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 20px 24px;
    cursor: pointer;
    min-width: 0;
}

.ams-bm__campo + .ams-bm__campo { border-left: 1px solid #ECEEF3; }

.ams-bm__label {
    font-family: "Barlow Condensed", "Barlow", sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #16171A;
    line-height: 1.2;
}

/* el desplegable se disfraza de texto: la flecha la pinta el ::after del campo */
.ams-bm__select {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    padding: 0 18px 0 0;
    margin: 0;
    width: 100%;
    font-family: "Barlow", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #8A8F99;
    cursor: pointer;
    text-overflow: ellipsis;

    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238A8F99' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}

.ams-bm__select:focus-visible {
    outline: 2px solid #F0500A;
    outline-offset: 3px;
    border-radius: 2px;
}

.ams-bm__submit {
    border: 0;
    cursor: pointer;
    background: #F0500A;
    color: #fff;
    font-family: "Barlow Condensed", "Barlow", sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 0 40px;
    transition: background .2s ease;
    white-space: nowrap;
}

.ams-bm__submit:hover { background: #16171A; }

.ams-bm__submit:focus-visible {
    outline: 2px solid #16171A;
    outline-offset: -4px;
}

/* Tablet: dos por fila y el botón a lo ancho */
@media (max-width: 1024px) {
    .ams-bm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ams-bm__campo + .ams-bm__campo { border-left: 0; }
    .ams-bm__campo:nth-child(even) { border-left: 1px solid #ECEEF3; }
    .ams-bm__campo:nth-child(n+3) { border-top: 1px solid #ECEEF3; }
    .ams-bm__submit { grid-column: 1 / -1; padding: 16px 40px; }
}

/* Móvil: el diseño cambia de barra a tarjeta con rejilla 2×2 */
@media (max-width: 640px) {
    .ams-bm {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 20px;
        box-shadow: 0 14px 34px rgba(22, 23, 26, .1);
    }

    .ams-bm__titulo {
        display: block;
        grid-column: 1 / -1;
        margin: 0 0 4px;
        font-family: "Barlow Condensed", "Barlow", sans-serif;
        font-size: 20px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: #16171A;
    }

    .ams-bm__campo {
        border: 1px solid #E2E5EC;
        border-radius: 4px;
        padding: 12px 14px;
        gap: 3px;
    }

    /* fuera las separaciones de la versión de escritorio */
    .ams-bm__campo + .ams-bm__campo,
    .ams-bm__campo:nth-child(even),
    .ams-bm__campo:nth-child(n+3) {
        border: 1px solid #E2E5EC;
    }

    .ams-bm__label { font-size: 10px; letter-spacing: .16em; color: #8A8F99; }
    .ams-bm__select { font-size: 14px; color: #3E434C; }

    .ams-bm__submit {
        grid-column: 1 / -1;
        margin-top: 2px;
        padding: 15px 30px;
        font-size: 18px;
        border-radius: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ams-bm__submit { transition: none; }
}
