/* ══════════════════════════════════
   Roso Category Bar — style.css
══════════════════════════════════ */
.rosocb-wrap * { box-sizing: border-box; }
.rosocb-wrap { direction: rtl; }

/* Container for alignment */
.rosocb-container {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

/* Outer: [חץ-שמאל] [viewport] [חץ-ימין] */
.rosocb-outer {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

/* Arrows */
.rosocb-arrow {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    aspect-ratio: 1 / 1 !important;
    box-sizing: border-box !important;
    border-radius: 50%;
    border: 1.5px solid #ddd !important;
    background: #fff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555 !important;
    transition: all 0.2s;
    box-shadow: 0 1px 5px rgba(0,0,0,.08);
    padding: 0 !important;
    z-index: 5;
}
.rosocb-arrow svg { width: 10px !important; height: 10px !important; }
.rosocb-arrow:hover {
    background: #111 !important;
    border-color: #111 !important;
    color: #fff !important;
}
.rosocb-arrow svg { pointer-events: none; }
.rosocb-arrow:focus, .rosocb-arrow:active {
    outline: none !important;
    box-shadow: none !important;
}
.rosocb-arrow-disabled {
    opacity: 0.25 !important;
    pointer-events: none !important;
    cursor: default !important;
}

/* Viewport — overflow hidden, JS sets width */
.rosocb-viewport {
    overflow: hidden;
    min-width: 0;
    touch-action: pan-y;
}
/* במצב "רשת + תמיד קרוסלה בטלפון" הגלילה האופקית היא גלילה טבעית של הדפדפן (overflow-x:auto),
   ולכן צריך לאפשר גם מחוות מגע אופקיות — אחרת touch-action:pan-y חוסם את הגלילה באצבע */
@media (max-width: 768px) {
    .rosocb-grid-mode.rosocb-mobile-carousel .rosocb-viewport {
        touch-action: pan-x pan-y;
    }
}

/* Track — always LTR so items flow right→left visually in RTL page */
.rosocb-track {
    display: flex;
    flex-direction: row;
    gap: 16px;
    direction: ltr;
    padding: 6px 2px;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

/* Item */
.rosocb-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    width: 110px;
}

/* ── Grid mode (no carousel) ── */
.rosocb-grid-mode .rosocb-viewport { overflow: visible !important; width: 100% !important; }
.rosocb-grid-mode .rosocb-outer { width: 100%; display: flex; }
.rosocb-grid-mode .rosocb-track {
    flex-wrap: wrap;
    direction: rtl;
    transform: none !important;
    justify-content: center;
    width: 100%;
}
.rosocb-grid-mode .rosocb-item { width: auto !important; flex: 0 0 auto; }

/* Force horizontal scroll on mobile even in grid mode */
@media (max-width: 768px) {
    .rosocb-grid-mode.rosocb-mobile-carousel .rosocb-viewport {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .rosocb-grid-mode.rosocb-mobile-carousel .rosocb-viewport::-webkit-scrollbar { display: none; }
    .rosocb-grid-mode.rosocb-mobile-carousel .rosocb-track {
        flex-wrap: nowrap;
        /* justify-content:center על תוכן שגולש גורם בדפדפנים רבים לכך שאי-אפשר לגלול
           ולהגיע לקצה אחד של התוכן (הפריטים "נתקעים" בלתי-נגישים) — flex-start פותר את זה */
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
    }
    .rosocb-grid-mode.rosocb-mobile-carousel .rosocb-item { scroll-snap-align: start; }
}

/* Circle */
.rosocb-img {
    width: 110px;
    height: 110px;
    border-radius: 50% !important;
    border: 2px solid #ddd8cc;
    box-shadow: 0 0 0 1px #fff inset;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.rosocb-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block;
    padding: 0;
    transition: transform 0.3s;
}
.rosocb-item:hover .rosocb-img {
    border-color: #888;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.rosocb-item:hover .rosocb-img img { transform: scale(1.06); }
.rosocb-item.active .rosocb-img { border-color: #111; border-width: 2.5px; }
.rosocb-img-all { background: #f0f0f0; }

/* Label */
.rosocb-name {
    font-size: 13px;
    color: #444;
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
    transition: color 0.2s;
}
.rosocb-item.active .rosocb-name { color: #111; font-weight: 700; }
.rosocb-item:hover .rosocb-name  { color: #111; }

/* Mobile */
@media (max-width: 768px) {
    .rosocb-name  { font-size: 11px; }
    .rosocb-track { gap: 8px; }
    .rosocb-arrow { width: 28px; height: 28px; }
    .rosocb-outer { gap: 4px; }
}

/* ── Loading indicator when archive is filtering ── */
.rosoa-wrap.rosoa-filtering { opacity: 0.5; pointer-events: none; transition: opacity 0.2s; }

/* Empty circle when category has no image */
.rosocb-img-empty {
    background: #f0f0f0;
}
.rosocb-img-empty img { display: none; }
