/**
 * Bricks Child Category Nav Styles
 * Version: 1.3.0
 */

/* =============================================
   Container
============================================= */
.bccn-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.bccn-nav--images-top {
    align-items: flex-end;
}

/* Horizontal scroll mode */
.bccn-nav[style*="nowrap"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 8px;
}

/* =============================================
   Pill Base Styles
============================================= */
.bccn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Image position variants */
.bccn-pill--img-top {
    flex-direction: column;
    text-align: center;
    padding: 12px 16px;
    border-radius: 12px;
}

.bccn-pill--img-right {
    flex-direction: row-reverse;
}

/* =============================================
   Pill States
============================================= */
.bccn-pill:hover {
    background-color: #f5f5f5;
    color: #000000;
    text-decoration: none;
    border-color: #d0d0d0;
}

.bccn-pill.active {
    background-color: #333333;
    color: #ffffff;
    border-color: #333333;
    font-weight: 600;
}

.bccn-pill.active:hover {
    background-color: #444444;
    color: #ffffff;
}

/* =============================================
   Pill Inner Elements
============================================= */
.bccn-pill__name {
    display: inline;
}

.bccn-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.bccn-pill--img-top .bccn-img {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
}

.bccn-count {
    font-size: 0.8em;
    color: #888888;
    margin-left: 2px;
}

.bccn-count sub {
    font-size: 0.75em;
    vertical-align: baseline;
}

.bccn-pill.active .bccn-count {
    color: rgba(255, 255, 255, 0.75);
}

/* =============================================
   No Entries Fallback Text
============================================= */
.bccn-no-entries {
    display: inline-block;
    padding: 10px 0;
    color: #666666;
    font-size: 14px;
    font-style: italic;
}

/* =============================================
   AJAX Loading States
============================================= */
.bccn-nav.bccn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.bccn-nav.bccn-loading .bccn-pill {
    cursor: wait;
}

/* Target element loading state */
.bccn-ajax-loading {
    position: relative;
    min-height: 200px;
    pointer-events: none;
}

.bccn-ajax-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.bccn-ajax-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e0e0e0;
    border-top-color: #333333;
    border-radius: 50%;
    animation: bccn-spinner 0.8s linear infinite;
    z-index: 11;
}

@keyframes bccn-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Fade in animation for loaded content */
.bccn-ajax-loaded {
    animation: bccn-fadeIn 0.3s ease-out;
}

@keyframes bccn-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* =============================================
   Mobile Responsive
============================================= */
@media (max-width: 767px) {
    .bccn-nav {
        gap: 8px;
    }

    .bccn-pill {
        padding: 8px 16px;
        font-size: 13px;
    }

    .bccn-img {
        width: 20px;
        height: 20px;
    }

    .bccn-pill--img-top .bccn-img {
        width: 28px;
        height: 28px;
    }
}

/* =============================================
   Builder Preview Indicator (optional)
============================================= */
.bccn-nav--preview {
    /* Optional: Add a subtle indicator in builder */
}
