/* ================================================================
   CandyCode WooCommerce Category Slider v2.1 — Frontend CSS
   NOTE: Container size/spacing/colors are set via inline dynamic CSS.
         This file only sets structural/base styles.
   CSS Classes: cc-slider-container / cc-slider-wrapper /
                cc-slider-item / cc-active
   ================================================================ */

/* ── Outer Container ─────────────────────────────────────────── */
.cc-slider-container {
    /* border-radius, height, padding, margin, background, box-shadow
       → all injected dynamically from admin settings */
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
}

/* ── Scrollable Row ──────────────────────────────────────────── */
.cc-slider-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0;
    height: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;

    /* Hide scrollbar — all browsers */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cc-slider-wrapper::-webkit-scrollbar {
    display: none;
}

/* ── Single Item ─────────────────────────────────────────────── */
.cc-slider-item {
    /* flex-basis set dynamically: calc(100% / N) */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    padding: 4px 2px 8px;
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s ease;
    min-width: 0;
}

.cc-slider-item:hover {
    text-decoration: none;
    opacity: 0.78;
}

.cc-slider-item:active {
    transform: scale(0.93);
    opacity: 0.6;
}

/* ── Icon Wrapper ────────────────────────────────────────────── */
.cc-item-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

/* ── Icon Image (size set dynamically) ──────────────────────── */
.cc-slider-item img {
    object-fit: contain;
    display: block;
    /* width/height set via dynamic CSS */
}

/* ── Icon Fallback ───────────────────────────────────────────── */
.cc-icon-fallback {
    /* font-size set dynamically to match icon_size */
    line-height: 1;
    display: block;
}

/* ── Label Text ──────────────────────────────────────────────── */
.cc-slider-item span {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    /* color set dynamically */
}

/* ── Active State ────────────────────────────────────────────── */
.cc-active span {
    /* font-weight + color set dynamically */
}

/* Active underline — Blinkit exact: 18px × 2px */
.cc-active::after {
    content: "";
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 2px;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    /* background set dynamically */
}

/* ── Badge ───────────────────────────────────────────────────── */
.cc-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ff6b00;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 10px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
}

/* ── Very small screens ──────────────────────────────────────── */
@media (max-width: 360px) {
    .cc-slider-item span {
        font-size: 10px;
    }
}
