/**
 * Heureka Reviews Carousel - Splide Integration
 * Version: 4.1.0
 * Uses unified review card design
 */

/* ==========================================================================
   Carousel Container
   ========================================================================== */

.heureka-reviews__carousel {
    overflow: hidden;
}

.heureka-reviews {
    display: grid !important;
    grid-template-columns: 28.75em 1fr;
    align-items: center !important;
    gap: var(--space-m, 24px);
}

.heureka-reviews-badge a {
    pointer-events: none;
}

.heureka-reviews-badge a img {
    width: 100%;
    object-fit: contain;
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel {
    height: 100%;
    overflow-x: auto;
}

.heureka-reviews__left-side {
    padding-bottom: 4rem;
    height: 100%;
}

.heureka-reviews__left-side * {
    height: 100%;
}


/* ==========================================================================
   Pre-init Layout (CLS prevention)
   The server renders a plain <ul> which Splide later replaces. These rules
   mirror the final Splide geometry (perPage/gap/track padding per breakpoint)
   so the page does not shift when the carousel initializes. After init the
   .amtc-carousel-list markup is gone, so they stop applying automatically.
   The JS fallback carousel overrides them with inline styles.
   ========================================================================== */

.heurekaShopReviewsCarousel .amtc-carousel-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 22px;
    overflow: hidden;
    padding: 12px 4px 70px 4px;
    margin: 0;
    list-style: none;
}

.heurekaShopReviewsCarousel[data-pagination="false"] .amtc-carousel-list {
    padding-bottom: 0;
}

.heurekaShopReviewsCarousel .amtc-carousel-item {
    flex: 0 0 calc((100% - 44px) / 3);
    min-width: 0;
}

@media (max-width: 1200px) {
    .heurekaShopReviewsCarousel .amtc-carousel-list { gap: 20px; }
    .heurekaShopReviewsCarousel .amtc-carousel-item { flex-basis: calc((100% - 40px) / 3); }
}

@media (max-width: 992px) {
    .heurekaShopReviewsCarousel .amtc-carousel-list { gap: 16px; }
    .heurekaShopReviewsCarousel .amtc-carousel-item { flex-basis: calc((100% - 16px) / 2); }
}

@media (max-width: 576px) {
    .heurekaShopReviewsCarousel .amtc-carousel-list { gap: 12px; }
    .heurekaShopReviewsCarousel .amtc-carousel-item { flex-basis: 100%; }
}


/* ==========================================================================
   Splide Overrides
   ========================================================================== */

.heurekaShopReviewsCarousel .splide__track {
    padding: 12px 4px 70px 4px;
}

/* No bottom padding when pagination is disabled (the 70px space is only for dots) */
.heurekaShopReviewsCarousel.amtc-no-pagination .splide__track {
    padding-bottom: 0;
}

.heurekaShopReviewsCarousel .splide__list {
    align-items: stretch;
}

.heurekaShopReviewsCarousel .splide__slide {
    height: auto !important;
}

/* Pagination dots */
.heurekaShopReviewsCarousel .splide__pagination {
    bottom: 20px;
    gap: 8px;
}

.heurekaShopReviewsCarousel .splide__pagination li {
    line-height: 1;
}

.heurekaShopReviewsCarousel .splide__pagination button,
.heurekaShopReviewsCarousel .splide__pagination__page {
    width: 12px;
    height: 12px;
    background: var(--amtc-primary-ultra-light, var(--primary-ultra-light, #e8f5e9)) !important;
    transform: none !important;
    margin: 0 !important;
    opacity: 1 !important;
    border: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.heurekaShopReviewsCarousel .splide__pagination button.is-active,
.heurekaShopReviewsCarousel .splide__pagination__page.is-active {
    background: var(--amtc-primary, var(--primary, #69a81d)) !important;
    transform: scale(1.15) !important;
}


/* Review card styles live in ametica-reviews-global.css
   (.amtc-review-card--carousel modifier - do not duplicate here) */


/* ==========================================================================
   Scrollbar Styling
   ========================================================================== */

.heureka-reviews__carousel .heurekaShopReviewsCarousel::-webkit-scrollbar {
    height: 6px;
    border-radius: var(--radius-m, 8px);
    background: var(--shade-light, #f0f0f0);
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel::-webkit-scrollbar-thumb {
    background: var(--amtc-primary, var(--primary, #69a81d));
    border-radius: var(--radius-m, 8px);
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel::-webkit-scrollbar-track {
    border-radius: var(--radius-m, 8px);
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
    .heureka-reviews {
        grid-template-columns: 1fr;
    }

    body .heureka-reviews__left-side {
        align-items: unset !important;
        padding-bottom: 0 !important;
    }

    body .heureka-reviews__left-side img {
        height: 115px;
        width: auto !important;
        margin-right: auto !important;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 550px) {
    body .heureka-reviews__left-side img {
        height: 100% !important;
        width: 100% !important;
    }
}


/* ==========================================================================
   Legacy Support (for old templates)
   ========================================================================== */

/* Card-like slide styling only for legacy markup - new markup renders
   .amtc-review-card inside the slide which draws its own card frame */
.heureka-reviews__carousel .heurekaShopReviewsCarousel ul > .splide__slide:not(:has(.amtc-review-card)) {
    margin-right: 1rem;
    padding: var(--space-m, 20px);
    border-radius: var(--radius-m, 12px);
    height: 100%;
    opacity: 1;
    transition: ease-in-out 0.1s;
    overflow: hidden;
    border: 1px solid var(--amtc-border-color, var(--shade-light, #e5e5e5));
    background: white;
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-text {
    margin: 0 !important;
    margin-top: var(--space-m, 16px) !important;
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-text div {
    overflow: auto;
    height: 72px;
    padding-right: 0.5rem;
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-author {
    font-size: var(--text-m, 14px);
    font-weight: 700;
    line-height: 1.2;
    margin-top: var(--space-xs, 8px) !important;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating {
    height: 15px;
    width: 79px;
    position: relative;
    overflow: hidden;
    background-color: #fff;
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-image: url(/wp-content/uploads/2025/05/ratings-stars.svg);
    margin: 0;
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating {
    right: unset;
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating span {
    display: none;
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating::before {
    content: none;
}

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating {
    background-position: 0 0;
    position: absolute;
    top: 0;
}

/* Star rating width classes */
.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-0,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-0 { width: 0%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-5,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-5 { width: 10%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-10,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-10 { width: 20%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-15,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-15 { width: 30%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-20,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-20 { width: 40%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-25,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-25 { width: 50%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-30,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-30 { width: 60%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-35,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-35 { width: 70%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-40,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-40 { width: 80%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-45,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-45 { width: 90%; }

.heureka-reviews__carousel .heurekaShopReviewsCarousel .vc-rating-stars-rating-50,
.heureka-reviews__carousel .heurekaShopReviewsCarousel .star-rating-50 { width: 100%; }

/* ==========================================================================
   View All Reviews Button
   ========================================================================== */

/* Button itself reuses .amtc-badge-view-all-button from ametica-reviews-global.css */
.amtc-carousel-view-all {
    margin-top: 16px;
    text-align: center;
}
