/* ==========================================================================
   WooCommerce Category Slider — Frontend Styles
   ========================================================================== */

/* CSS custom properties (defaults — overridden by inline dynamic CSS) */
:root {
    --wccs-font-size: 14px;
    --wccs-font-weight: 600;
    --wccs-text-align: center;
    --wccs-item-gap: 16px;
    --wccs-padding: 20px;
    --wccs-radius: 12px;
    --wccs-transition: 0.3s ease;
    --wccs-arrow-size: 40px;
    --wccs-overlay-color: rgba(0, 0, 0, 0.18);
    --wccs-accent: #1a1a1a;
}

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */
.wccs-slider-wrapper {
    position: relative;
    padding: var(--wccs-padding) 0;
    margin-bottom: 32px;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Swiper overrides
   -------------------------------------------------------------------------- */
.wccs-swiper {
    overflow: visible;
    padding: 0 var(--wccs-arrow-size);
}

.wccs-swiper .swiper-wrapper {
    align-items: flex-start;
}

/* --------------------------------------------------------------------------
   Slide & card
   -------------------------------------------------------------------------- */
.wccs-slide {
    height: auto !important;
}

.wccs-cat-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--wccs-accent);
    gap: 10px;
    transition: transform var(--wccs-transition);
    will-change: transform;
    outline-offset: 4px;
}

.wccs-cat-link:hover,
.wccs-cat-link:focus-visible {
    transform: translateY(-4px);
    text-decoration: none;
    color: var(--wccs-accent);
}

/* --------------------------------------------------------------------------
   Image wrapper
   -------------------------------------------------------------------------- */
.wccs-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--wccs-radius);
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow var(--wccs-transition);
}

.wccs-cat-link:hover .wccs-img-wrap,
.wccs-cat-link:focus-visible .wccs-img-wrap {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.wccs-cat-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.wccs-cat-link:hover .wccs-cat-img {
    transform: scale(1.07);
}

/* Placeholder */
.wccs-cat-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f0f0f0;
}

.wccs-cat-img--placeholder svg {
    width: 60%;
    height: 60%;
}

/* Overlay */
.wccs-img-overlay {
    position: absolute;
    inset: 0;
    background: var(--wccs-overlay-color);
    opacity: 0;
    transition: opacity var(--wccs-transition);
    border-radius: inherit;
}

.wccs-cat-link:hover .wccs-img-overlay,
.wccs-cat-link:focus-visible .wccs-img-overlay {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Category text
   -------------------------------------------------------------------------- */
.wccs-cat-name {
    display: block;
    font-size: var(--wccs-font-size);
    font-weight: var(--wccs-font-weight);
    text-align: var(--wccs-text-align);
    line-height: 1.3;
    width: 100%;
    color: inherit;
    transition: color var(--wccs-transition);
    word-break: break-word;
    hyphens: auto;
}

.wccs-cat-link:hover .wccs-cat-name,
.wccs-cat-link:focus-visible .wccs-cat-name {
    color: #0073aa;
}

.wccs-cat-count {
    display: block;
    font-size: calc(var(--wccs-font-size) - 2px);
    font-weight: 400;
    color: #888;
    text-align: var(--wccs-text-align);
    width: 100%;
    margin-top: -6px;
}

/* --------------------------------------------------------------------------
   Navigation Arrows
   -------------------------------------------------------------------------- */
.wccs-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: var(--wccs-arrow-size);
    height: var(--wccs-arrow-size);
    border-radius: 50%;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background var(--wccs-transition), box-shadow var(--wccs-transition), color var(--wccs-transition), opacity var(--wccs-transition);
    padding: 0;
}

.wccs-arrow:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.wccs-arrow:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.wccs-arrow--prev { left: 0; }
.wccs-arrow--next { right: 0; }

.wccs-arrow svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Disabled state */
.wccs-arrow.swiper-button-disabled,
.wccs-arrow[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Scrollbar (subtle)
   -------------------------------------------------------------------------- */
.swiper-scrollbar {
    display: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
    .wccs-swiper {
        padding: 0 calc(var(--wccs-arrow-size) + 4px);
    }
}

@media (max-width: 767px) {
    :root {
        --wccs-arrow-size: 32px;
    }

    .wccs-cat-name {
        font-size: calc(var(--wccs-font-size) - 1px);
    }

    .wccs-arrow svg {
        width: 14px;
        height: 14px;
    }
}

/* --------------------------------------------------------------------------
   Theme compatibility helpers
   -------------------------------------------------------------------------- */

/* Astra / Flatsome / Storefront — reset any conflicting link styles */
.wccs-cat-link,
.wccs-cat-link:hover,
.wccs-cat-link:active,
.wccs-cat-link:visited {
    box-shadow: none;
}

/* Elementor — prevent its column overflow from clipping the slider */
.elementor-widget-container .wccs-slider-wrapper {
    overflow: visible;
}
