/* Subcategory slider styles */
.subcategory-slider {
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
    margin-bottom: 20px;
    scrollbar-width: none; /* Firefox - hide scrollbar */
    -ms-overflow-style: none; /* IE and Edge - hide scrollbar */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-behavior: smooth; /* Smooth scrolling for modern browsers */
    cursor: grab;
    /* Hide scrollbar for Chrome, Safari and Opera */
    &::-webkit-scrollbar {
        display: none;
    }
}

.subcategory-slider:active {
    cursor: grabbing;
}

.subcategory-item {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #495057;
    user-select: none; /* Prevent text selection during swipe */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE/Edge */
}

.subcategory-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.subcategory-item.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.subcategory-slider-container {
    position: relative;
}

.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.scroll-button:hover {
    opacity: 1;
    background-color: #f8f9fa;
}

.scroll-button.left {
    left: 0;
}

.scroll-button.right {
    right: 0;
}

.scroll-button.hidden {
    display: none;
}

/* Touch swipe indicator */
.swipe-indicator {
    text-align: center;
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

@media (max-width: 1024px) {
    .swipe-indicator {
        display: block;
    }

    /* Make scroll buttons more prominent on touch devices */
    .scroll-button {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(5px);
    }
}

/* Animation for scroll buttons when they appear */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-50%) scale(0.8); }
    to { opacity: 0.8; transform: translateY(-50%) scale(1); }
}

.scroll-button:not(.hidden) {
    animation: fadeIn 0.3s ease;
}
