/* WooCommerce Child Category Slider Styles */
.wc-child-category-slider-container {
    padding: 0;
    background: transparent;
    position: relative;
}

.wc-child-category-slider {
    position: relative;
    overflow: hidden;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.slider-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 20px;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10px;
}

.slider-track.center-align {
    justify-content: center;
}

/* Slider Title */
.wc-category-slider-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 25px;
    text-align: left;
    letter-spacing: -0.5px;
}

.category-slide-item {
    flex: 0 0 auto;
    width: 120px;
    text-align: center;
    padding: 10px 5px;
}

.category-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.category-link:hover {
    transform: translateY(-3px);
    text-decoration: none;
    background: transparent;
    border: none;
    box-shadow: none;
}

.category-image {
    width: 90px;
    height: 90px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    background: #ffffff;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

.category-link:hover .category-image {
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.category-image img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: transform 0.3s ease;
    max-width: 70px;
    max-height: 70px;
}

.category-link:hover .category-image img {
    transform: scale(1.05);
}

/* Better placeholder styling */
.category-image img[src*="placeholder"] {
    width: 60%;
    height: 60%;
    opacity: 0.6;
}

/* JB Hi-Fi style image positioning */
.category-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
    border-radius: 50%;
    pointer-events: none;
}

.category-name {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    line-height: 1.3;
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: 0;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.category-link:hover .category-name {
    color: #212529;
}

/* Main navigation buttons removed - only progress bar navigation now */

/* Progress Bar Navigation - Like Reference Image */
.wc-child-category-slider-container .slider-progress-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-top: 20px !important;
    padding: 0 !important;
    gap: 15px !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Remove margin when progress container is hidden to prevent blank space */
.wc-child-category-slider-container .slider-progress-container[style*="display: none"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Fix for empty or minimal content scenarios */
.wc-child-category-slider-container:empty,
.wc-child-category-slider-container .wc-child-category-slider:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* Ensure slider container doesn't take up space when no items */
.wc-child-category-slider-container .slider-track:empty {
    display: none !important;
}

/* Hide entire slider container if no category items */
.wc-child-category-slider-container:not(:has(.category-slide-item)) {
    display: none !important;
}

/* Fallback for browsers that don't support :has() */
.wc-child-category-slider-container .slider-track:empty + .slider-progress-container {
    display: none !important;
}

/* Fix for blank space when slider reaches the end */
.wc-child-category-slider {
    overflow: hidden !important;
    width: 100% !important;
    position: relative !important;
}

.slider-track {
    width: 100% !important;
    min-width: 100% !important;
    position: relative !important;
    /* Ensure track never shows blank space on the right */
    max-width: none !important;
}

/* Critical fix: Ensure the last item is always flush with the right edge */
.slider-track .category-slide-item:last-child {
    margin-right: 0 !important;
}

/* Prevent any gaps or spacing that could cause blank space */
.wc-child-category-slider-container {
    box-sizing: border-box !important;
}

.slider-track {
    box-sizing: border-box !important;
}

/* Reduce excessive spacing on mobile when content is minimal */
@media (max-width: 768px) {
    .wc-child-category-slider-container {
        margin-bottom: 10px !important;
    }
    
    /* If only progress bar is showing without items, hide the whole container */
    .wc-child-category-slider-container .wc-child-category-slider:empty + .slider-progress-container {
        display: none !important;
    }
    
    /* Hide container if slider track has no visible items */
    .wc-child-category-slider-container .slider-track:not(:has(.category-slide-item:visible)) + .slider-progress-container {
        display: none !important;
    }
    
    /* Fallback: if slider track height is very small, hide progress bar */
    .wc-child-category-slider-container .wc-child-category-slider[style*="height: 0"] + .slider-progress-container,
    .wc-child-category-slider-container .slider-track[style*="height: 0"] + .slider-progress-container {
        display: none !important;
    }
}

.wc-child-category-slider-container .slider-progress-bar {
    width: 600px !important;
    height: 6px !important;
    background: #e5e5e5 !important;
    border-radius: 3px !important;
    overflow: visible !important;
    position: relative !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    cursor: pointer !important;
}

.wc-child-category-slider-container .slider-progress-bar:hover {
    background: #d5d5d5 !important;
}

.wc-child-category-slider-container .slider-progress-bar.dragging {
    cursor: grabbing !important;
}

.wc-child-category-slider-container .progress-fill {
    height: 100% !important;
    background: #ffc107 !important;
    border-radius: 3px !important;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    width: 25%;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0%;
    cursor: grab !important;
}

.wc-child-category-slider-container .progress-fill:hover {
    background: #ffb300 !important;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3) !important;
}

.wc-child-category-slider-container .progress-fill:active,
.wc-child-category-slider-container .slider-progress-bar.dragging .progress-fill {
    cursor: grabbing !important;
    background: #ff9800 !important;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4) !important;
}

/* Allow JavaScript to control positioning */

/* Simple Arrow Navigation */
.wc-child-category-slider-container .progress-nav {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #666666 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wc-child-category-slider-container .progress-nav:hover {
    color: #333333 !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.wc-child-category-slider-container .progress-nav:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    color: #cccccc !important;
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

.wc-child-category-slider-container .progress-nav:disabled:hover {
    color: #cccccc !important;
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

.wc-child-category-slider-container .progress-nav.disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    color: #cccccc !important;
    pointer-events: none !important;
}

/* Dynamic sizing based on admin settings - JB Hi-Fi style proportions */
.wc-child-category-slider-container[data-image-size="50"] .category-image {
    width: 50px;
    height: 50px;
}

.wc-child-category-slider-container[data-image-size="50"] .category-slide-item {
    width: 80px;
}

.wc-child-category-slider-container[data-image-size="60"] .category-image {
    width: 60px;
    height: 60px;
}

.wc-child-category-slider-container[data-image-size="60"] .category-slide-item {
    width: 90px;
}

.wc-child-category-slider-container[data-image-size="70"] .category-image {
    width: 70px;
    height: 70px;
}

.wc-child-category-slider-container[data-image-size="70"] .category-slide-item {
    width: 100px;
}

.wc-child-category-slider-container[data-image-size="80"] .category-image {
    width: 80px;
    height: 80px;
}

.wc-child-category-slider-container[data-image-size="80"] .category-slide-item {
    width: 110px;
}

.wc-child-category-slider-container[data-image-size="90"] .category-image {
    width: 90px;
    height: 90px;
}

.wc-child-category-slider-container[data-image-size="90"] .category-slide-item {
    width: 120px;
}

.wc-child-category-slider-container[data-image-size="100"] .category-image {
    width: 100px;
    height: 100px;
}

.wc-child-category-slider-container[data-image-size="100"] .category-slide-item {
    width: 144px;
    height: 161px;
}

@media screen and (min-width: 768px) {

    .wc-child-category-slider-container[data-image-size="100"] .category-slide-item {
        width: 160px;
        height: 161px;
    }

}

.wc-child-category-slider-container[data-image-size="120"] .category-image {
    width: 120px;
    height: 120px;
}

.wc-child-category-slider-container[data-image-size="120"] .category-slide-item {
    width: 150px;
}

.wc-child-category-slider-container[data-image-size="150"] .category-image {
    width: 150px;
    height: 150px;
}

.wc-child-category-slider-container[data-image-size="150"] .category-slide-item {
    width: 180px;
}

.wc-child-category-slider-container[data-image-size="200"] .category-image {
    width: 200px;
    height: 200px;
}

.wc-child-category-slider-container[data-image-size="200"] .category-slide-item {
    width: 230px;
}

/* Responsive Design - Modern clean scaling */
@media (max-width: 1200px) {
    .category-slide-item {
        width: 130px;
        padding: 6px;
    }

    .category-image {
        width: 75px;
        height: 75px;
    }

    .slider-track {
        gap: 20px;
    }

    .wc-category-slider-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
}

@media (max-width: 1024px) {
    .category-slide-item {
        width: 120px;
        padding: 6px;
    }

    .category-image {
        width: 70px;
        height: 70px;
        margin-bottom: 10px;
    }

    .slider-track {
        gap: 18px;
    }

    .category-name {
        font-size: 12px;
    }

    .wc-category-slider-title {
        font-size: 20px;
        margin-bottom: 18px;
    }
}

@media (max-width: 768px) {
    .category-slide-item {
        width: 110px;
        padding: 5px;
    }

    .category-image {
        width: 65px;
        height: 65px;
        margin-bottom: 8px;
    }

    .slider-track {
        gap: 15px;
    }

    .category-name {
        font-size: 11px;
    }

    .wc-category-slider-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .wc-child-category-slider-container .slider-progress-bar {
        width: 320px !important;
    }

    /* Force progress bar to show on mobile when there are more items than visible */
    .wc-child-category-slider-container .slider-progress-container {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 480px) {
    .category-slide-item {
        width: 100px;
        padding: 4px;
    }

    .category-image {
        width: 60px;
        height: 60px;
        margin-bottom: 8px;
    }

    .slider-track {
        gap: 12px;
        padding: 0 5px;
    }

    .category-name {
        font-size: 10px;
        line-height: 1.2;
    }

    .wc-category-slider-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .wc-child-category-slider-container .slider-progress-bar {
        width: 280px !important;
        height: 4px !important;
    }

    .wc-child-category-slider-container .progress-nav {
        width: 28px !important;
        height: 28px !important;
    }

    .wc-child-category-slider-container .progress-nav svg {
        width: 14px !important;
        height: 14px !important;
    }
}

/* Hide scrollbar */
.wc-child-category-slider::-webkit-scrollbar {
    display: none;
}

.wc-child-category-slider {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile touch optimization */
.wc-child-category-slider-container {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: pan-y pinch-zoom;
}

.slider-track {
    touch-action: pan-y pinch-zoom;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure touch events work on mobile even when items fit */
@media (max-width: 768px) {
    .wc-child-category-slider-container {
        overflow: hidden;
    }

    .slider-track {
        cursor: grab;
        cursor: -webkit-grab;
    }

    .slider-track:active {
        cursor: grabbing;
        cursor: -webkit-grabbing;
    }

    /* Make sure links don't interfere with touch sliding */
    .category-link {
        pointer-events: auto;
        -webkit-touch-callout: default;
    }
}

/* Loading state */
.wc-child-category-slider-container.loading {
    opacity: 0.7;
}

.wc-child-category-slider-container.loading .slider-nav {
    pointer-events: none;
}

/* Accessibility improvements */
.category-link:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
    border-radius: 4px;
}

.slider-nav:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Animation for smooth appearance */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-child-category-slider-container {
    animation: slideIn 0.5s ease-out;
}

/* Custom theme compatibility */


.woocommerce .wc-child-category-slider-container .category-link:hover {
    text-decoration: none;
}

/* RTL Support */
.rtl .prev-btn {
    right: 10px;
    left: auto;
}

.rtl .next-btn {
    left: 10px;
    right: auto;
}

.rtl .prev-btn svg {
    transform: rotate(180deg);
}

.rtl .next-btn svg {
    transform: rotate(180deg);
}

/* Duplicate styles removed - using main styles above */