/**
 * C4mulo5 – WooCommerce Kategorie-Karussell
 *
 * Wrappt das WC-product_categories-Shortcode-Output in einen c4m5-slider.
 * Unterstützt zwei Layouts: carousel (Slider) und grid (statisches Gitter).
 */

.c4mulo5-wc-category-carousel { padding: 60px 0; }

/* ::before/::after Reset */
.c4mulo5-wc-category-carousel::before,
.c4mulo5-wc-category-carousel::after,
.c4m5-wccc-slot::before,
.c4m5-wccc-slot::after {
    display: none !important;
    content: none !important;
}

.c4mulo5-wc-category-carousel .c4m5-wccc-headline {
    margin: 0 0 8px;
    color: #1d2327;
    font-weight: 700;
}
.c4mulo5-wc-category-carousel .c4m5-wccc-subheadline {
    margin: 0 0 32px;
    color: #6b7280;
}

/* Original WC-Grid im Slot ausblenden sobald wir transformiert haben */
.c4mulo5-wc-category-carousel.c4m5-wccc-layout-carousel .c4m5-wccc-slot > ul.products {
    display: none !important;
}

/* Im Grid-Modus: WC-Standard-Grid sichtbar lassen */
.c4mulo5-wc-category-carousel.c4m5-wccc-layout-grid .c4m5-wccc-slot > ul.products {
    display: flex !important;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.c4mulo5-wc-category-carousel.c4m5-wccc-layout-grid .c4m5-wccc-slot li.product-category {
    float: none !important;
    width: calc(25% - 15px) !important;
    margin: 0 !important;
}
@media (max-width: 1024px) {
    .c4mulo5-wc-category-carousel.c4m5-wccc-layout-grid .c4m5-wccc-slot li.product-category {
        width: calc(33.333% - 14px) !important;
    }
}
@media (max-width: 768px) {
    .c4mulo5-wc-category-carousel.c4m5-wccc-layout-grid .c4m5-wccc-slot li.product-category {
        width: calc(50% - 10px) !important;
    }
}
@media (max-width: 480px) {
    .c4mulo5-wc-category-carousel.c4m5-wccc-layout-grid .c4m5-wccc-slot li.product-category {
        width: 100% !important;
    }
}

/* Kategorie-Kachel innerhalb Slider */
.c4mulo5-wc-category-carousel .c4m5-slider__slide li.product-category,
.c4mulo5-wc-category-carousel li.product-category {
    list-style: none !important;
    background: #ffffff;
    border: 1px solid #e5ebf0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    padding: 0 !important;
}
.c4mulo5-wc-category-carousel li.product-category:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    border-color: #29aae4;
}
.c4mulo5-wc-category-carousel li.product-category a {
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.c4mulo5-wc-category-carousel li.product-category img {
    width: 100% !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    margin: 0 !important;
}
.c4mulo5-wc-category-carousel li.product-category h2,
.c4mulo5-wc-category-carousel li.product-category .woocommerce-loop-category__title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    padding: 14px 16px 4px !important;
    margin: 0 !important;
    color: #1d2327 !important;
    line-height: 1.3 !important;
}
.c4mulo5-wc-category-carousel li.product-category .count {
    padding: 0 16px 14px !important;
    margin: 0 !important;
    color: #6b7280 !important;
    font-size: 0.8rem !important;
    background: transparent !important;
}

/* Hover-Overlay-Stil */
.c4mulo5-wc-category-carousel.c4m5-wccc-style-overlay li.product-category {
    position: relative;
}
.c4mulo5-wc-category-carousel.c4m5-wccc-style-overlay li.product-category img {
    aspect-ratio: 1 / 1;
}
.c4mulo5-wc-category-carousel.c4m5-wccc-style-overlay li.product-category a {
    position: relative;
}
.c4mulo5-wc-category-carousel.c4m5-wccc-style-overlay li.product-category a::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(26, 84, 144, 0.85) 100%);
    z-index: 2;
    transition: background 0.3s ease;
    pointer-events: none;
}
.c4mulo5-wc-category-carousel.c4m5-wccc-style-overlay li.product-category:hover a::before {
    background: linear-gradient(to bottom, rgba(26, 84, 144, 0.4) 0%, rgba(26, 84, 144, 0.95) 100%);
}
.c4mulo5-wc-category-carousel.c4m5-wccc-style-overlay li.product-category h2 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    color: #ffffff !important;
    padding: 16px !important;
    margin: 0 !important;
}
.c4mulo5-wc-category-carousel.c4m5-wccc-style-overlay li.product-category .count {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1a5490 !important;
    padding: 4px 10px !important;
    border-radius: 999px !important;
    font-size: 0.7rem !important;
    font-weight: 700;
}

/* Kompakt-Stil */
.c4mulo5-wc-category-carousel.c4m5-wccc-style-compact li.product-category img {
    aspect-ratio: 1 / 1;
    padding: 16px;
    object-fit: contain;
    background: #f5f7fa;
}
.c4mulo5-wc-category-carousel.c4m5-wccc-style-compact li.product-category h2 {
    text-align: center;
    font-size: 0.9rem !important;
    padding: 10px 12px 4px !important;
}
.c4mulo5-wc-category-carousel.c4m5-wccc-style-compact li.product-category .count {
    text-align: center;
    padding: 0 12px 12px !important;
}

/* „Alle ansehen"-Link unter dem Slider */
.c4m5-wccc-view-all {
    text-align: center;
    margin-top: 24px;
}
.c4m5-wccc-view-all a {
    display: inline-block;
    padding: 10px 28px;
    background: transparent;
    color: #1a5490;
    border: 2px solid #1a5490;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}
.c4m5-wccc-view-all a:hover {
    background: #1a5490;
    color: #ffffff !important;
}
