/**
 * Category Sub-Navigation Bar
 * Slim horizontal text-link bar for product pages.
 * Scroll arrows + fade edges when categories overflow.
 */

.category-sub-nav {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

/* Wrapper holds arrows + list */
.category-sub-nav__wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

/* Fade edges — only when overflowing */
.category-sub-nav__wrapper.has-overflow::before,
.category-sub-nav__wrapper.has-overflow::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.2s ease;
}

.category-sub-nav__wrapper.has-overflow::before {
    left: 0;
    background: linear-gradient(to right, #fff 0%, transparent 100%);
}

.category-sub-nav__wrapper.has-overflow::after {
    right: 0;
    background: linear-gradient(to left, #fff 0%, transparent 100%);
}

/* Hide fade on the side we've scrolled to the edge of */
.category-sub-nav__wrapper.at-start::before {
    opacity: 0;
}

.category-sub-nav__wrapper.at-end::after {
    opacity: 0;
}

/* Scroll arrows */
.category-sub-nav__arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-20%);
    z-index: 2;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: color 0.2s ease, border-color 0.2s ease;
    padding: 0;
    line-height: 1;
}

.category-sub-nav__arrow:hover {
    color: var(--primary-color, #3498db);
    border-color: var(--primary-color, #3498db);
}

.category-sub-nav__arrow--left {
    left: -14px;
}

.category-sub-nav__arrow--right {
    right: -14px;
}

/* List */
.category-sub-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex: 1;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-sub-nav__list::-webkit-scrollbar {
    display: none;
}

.category-sub-nav__item {
    flex-shrink: 0;
}

.category-sub-nav__link {
    display: block;
    padding: 18px 16px 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.category-sub-nav__link:hover {
    color: var(--primary-color, #3498db);
    border-bottom-color: var(--primary-color, #3498db);
    text-decoration: none;
}

.category-sub-nav__link--active {
    color: var(--primary-color, #3498db);
    border-bottom-color: var(--primary-color, #3498db);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .category-sub-nav__list {
        justify-content: flex-start;
    }

    .category-sub-nav__link {
        padding: 18px 14px 2px;
        font-size: 0.85rem;
    }

    .category-sub-nav__arrow {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .category-sub-nav__link {
        padding: 18px 12px 2px;
        font-size: 0.82rem;
    }
}
