/* =====================================================
   BASE CONTAINER STYLES
   ===================================================== */
.ecb-cat-buttons {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

/* =====================================================
   LAYOUT: HORIZONTAL SCROLL
   ===================================================== */
.ecb-cat-buttons.ecb-layout-horizontal-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.ecb-cat-buttons.ecb-layout-horizontal-scroll .ecb-cat-button {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* =====================================================
   LAYOUT: WRAP
   ===================================================== */
.ecb-cat-buttons.ecb-layout-wrap {
    flex-wrap: wrap;
}

.ecb-cat-buttons.ecb-layout-wrap .ecb-cat-button {
    flex: 0 0 auto;
}

/* =====================================================
   LAYOUT: GRID
   ===================================================== */
.ecb-cat-buttons.ecb-layout-grid {
    display: grid;
}

/* =====================================================
   LAYOUT: VERTICAL
   ===================================================== */
.ecb-cat-buttons.ecb-layout-vertical {
    flex-direction: column;
}

.ecb-cat-buttons.ecb-layout-vertical .ecb-cat-button {
    width: 100%;
}

/* =====================================================
   BUTTON BASE STYLES
   ===================================================== */
.ecb-cat-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
    white-space: nowrap;
}

/* Remove default link styles */
.ecb-cat-button:focus {
    outline: 2px solid;
    outline-offset: 2px;
}

/* =====================================================
   COUNT STYLES
   ===================================================== */
.ecb-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.ecb-cat-button:hover .ecb-count {
    opacity: 1;
}

/* Badge style for count */
.ecb-count.ecb-count-badge {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    opacity: 1;
}

/* =====================================================
   SCROLLBAR STYLES
   ===================================================== */
.ecb-cat-buttons::-webkit-scrollbar {
    height: 6px;
}

.ecb-cat-buttons::-webkit-scrollbar-track {
    background: transparent;
}

.ecb-cat-buttons::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.ecb-cat-buttons::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Hide scrollbar option */
.ecb-cat-buttons.ecb-hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.ecb-cat-buttons.ecb-hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =====================================================
   RESPONSIVE UTILITIES
   ===================================================== */
@media (max-width: 768px) {
    .ecb-cat-button {
        font-size: 14px;
    }
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
.ecb-cat-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ecb-cat-button,
    .ecb-count,
    .ecb-cat-buttons {
        transition: none;
        scroll-behavior: auto;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .ecb-cat-buttons {
        display: block;
        overflow: visible;
    }
    
    .ecb-cat-button {
        display: inline-block;
        margin: 5px;
        page-break-inside: avoid;
    }
}

/* =====================================================
   RTL SUPPORT
   ===================================================== */
[dir="rtl"] .ecb-cat-buttons.ecb-layout-horizontal-scroll {
    direction: rtl;
}

[dir="rtl"] .ecb-count {
    margin-left: 0;
    margin-right: 6px;
}
