/**
 * 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;
    /* 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) {
    /* Extender el bloque de categorías hasta los bordes de la pantalla, compensando el padding del header */
    #globalroute-container .globalroute-header-container .globalroute-category-wrapper {
        width: calc(100% + 28px) !important;
        margin-left: -12px !important;
        margin-right: -16px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        box-sizing: border-box;
    }

    .globalroute-category-scroll {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        overflow-y: hidden;
    }

    /* 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: 8px !important;
        min-height: 48px !important;
    }

    /* Botones con ancho optimizado para ocupar más espacio 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: 160px !important;
        width: auto !important;
        max-width: none !important;
        padding: 12px 20px !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;
    }
}
