/**
 * Estilos para el carrusel de categorías POI (scroll horizontal y flechas).
 * Funciona en desktop, tablet y móvil cuando los botones no caben en una línea.
 */

.globalroute-category-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 20px 0 10px;
    padding-left: 4px;
    padding-right: 4px;
    box-sizing: border-box;
    overflow: hidden;
}

.globalroute-category-scroll {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-left: 6px;
    padding-right: 6px;
    /* Ocultar barra de scroll horizontal (scroll sigue funcionando con dedo/flechas) */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.globalroute-category-scroll::-webkit-scrollbar {
    display: none;
    height: 0;
}

.globalroute-category-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.globalroute-category-arrow:hover {
    background-color: rgba(0, 94, 254, 0.1);
}

.globalroute-category-arrow:active {
    background-color: rgba(0, 94, 254, 0.2);
}

.globalroute-category-arrow img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Cuando la fila está dentro del scroll, usa ancho según contenido para permitir scroll */
.globalroute-category-wrapper .globalroute-category-scroll .globalroute-category-row {
    width: max-content !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    justify-content: flex-start !important;
}

/* Ocultar flechas cuando no hay overflow (se controla con JS) */
.globalroute-category-arrow.globalroute-category-arrow-hidden {
    visibility: hidden;
    pointer-events: none;
}

/* Móvil: ocupar más ancho disponible y mejores touch targets */
@media (max-width: 599px) {
    /* Wrapper ocupa todo el ancho disponible con separación simétrica de 6px en cada borde */
    #globalroute-container .globalroute-header-container .globalroute-category-wrapper {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        gap: 2px !important;
        box-sizing: border-box;
    }

    /* Zona de scroll: ampliar espacio horizontal para los botones de categoría */
    .globalroute-category-scroll {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        overflow-y: hidden;
    }

    /* Reservar espacio fijo para las flechas < > (no se encogen) */
    .globalroute-category-arrow-left,
    .globalroute-category-arrow-right {
        flex: 0 0 44px !important;
        width: 44px !important;
        min-width: 44px !important;
    }

    /* Mantener fila horizontal dentro del scroll en móvil */
    .globalroute-category-wrapper .globalroute-category-scroll .globalroute-category-row {
        flex-direction: row !important;
        width: max-content !important;
        max-width: none !important;
        gap: 10px !important;
        min-height: 48px !important;
    }

    /* Botones de categoría más anchos horizontalmente en móvil */
    .globalroute-category-wrapper .globalroute-category-scroll .globalroute-category-row > .globalroute-category-btn2 {
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        min-width: 172px !important;
        width: auto !important;
        max-width: none !important;
        padding: 12px 18px !important;
    }

    /* Flechas más grandes en móvil para mejor uso táctil (mín. 44px recomendado) */
    .globalroute-category-arrow {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .globalroute-category-arrow img {
        width: 28px;
        height: 28px;
    }
}
