/**
 * Vivaia Testimonial Slider - Frontend Styles
 *
 * @package Vivaia_Testimonial_Slider
 */

/* -------------------------------
   Wrapper
   ------------------------------- */
.vivaia-tsw-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* -------------------------------
   Desktop/Tablet: CSS Grid
   ------------------------------- */
.vivaia-tsw-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Hide carousel on desktop by default */
.vivaia-tsw-carousel {
    display: none !important;
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .vivaia-tsw-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* -------------------------------
   Desktop Carousel Mode
   (when JS adds vivaia-tsw-slider-active)
   ------------------------------- */
.vivaia-tsw-slider-active .vivaia-tsw-grid {
    display: none;
}

.vivaia-tsw-slider-active .vivaia-tsw-carousel {
    display: block !important;
}

/* Desktop stage padding reset */
.vivaia-tsw-slider-active .owl-carousel .owl-stage {
    padding-left: 0 !important;
}

/* Desktop nav arrows */
.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    padding: 0;
    margin: 0;
}

.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-nav button.owl-prev,
.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-nav button.owl-next {
    pointer-events: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    font-size: 18px;
    line-height: 40px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    padding: 0 !important;
    margin: 0;
}

.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-nav button.owl-prev:hover,
.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-nav button.owl-next:hover {
    background: rgba(0, 0, 0, 0.7) !important;
}

.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-nav .disabled {
    display: none;
}

/* Desktop dots */
.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-dots {
    text-align: center;
    margin-top: 20px;
    padding: 0;
}

.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-dot {
    display: inline-block;
    width: 30px;
    height: 3px;
    margin: 0 4px;
    background: #ddd;
    border-radius: 2px;
    border: none;
    padding: 0;
    transition: background 0.3s ease;
    cursor: pointer;
}

.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-dot.active {
    background: #333;
}

.vivaia-tsw-slider-active .vivaia-tsw-carousel .owl-dot:hover {
    background: #999;
}

/* -------------------------------
   Mobile: Carousel
   ------------------------------- */
@media (max-width: 767px) {
    /* Hide grid on mobile */
    .vivaia-tsw-grid {
        display: none;
    }

    /* Show carousel on mobile */
    .vivaia-tsw-carousel {
        display: block !important;
    }

    /* Remove left padding for peek effect */
    .vivaia-tsw-carousel .owl-stage {
        padding-left: 0px !important;
    }

    /* Fix: Allow overflow for Elementor widget containers */
    .elementor-widget-vivaia_testimonial_slider .elementor-widget-container {
        overflow: visible !important;
    }

    .elementor-widget-vivaia_testimonial_slider {
        overflow: visible !important;
    }

    .vivaia-tsw-wrapper {
        overflow: visible !important;
    }

    /* Owl Carousel dots */
    .vivaia-tsw-carousel .owl-dots {
        text-align: center;
        margin-top: 20px;
        padding: 0;
    }

    .vivaia-tsw-carousel .owl-dot {
        display: inline-block;
        width: 30px;
        height: 3px;
        margin: 0 4px;
        background: #ddd;
        border-radius: 2px;
        border: none;
        padding: 0;
        transition: background 0.3s ease;
        cursor: pointer;
    }

    .vivaia-tsw-carousel .owl-dot.active {
        background: #333;
    }

    .vivaia-tsw-carousel .owl-dot:hover {
        background: #999;
    }
}

/* -------------------------------
   Testimonial Card
   ------------------------------- */
.vivaia-tsw-card {
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* -------------------------------
   Product Image Section
   ------------------------------- */
.vivaia-tsw-image-wrap {
    position: relative !important;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden !important;
    background: transparent;
    display: block !important;
}

.vivaia-tsw-product-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

a.vivaia-tsw-product-link {
    color: inherit;
}

.vivaia-tsw-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vivaia-tsw-product-link:hover .vivaia-tsw-image {
    transform: scale(1.05);
}

/* -------------------------------
   Product Name Overlay
   ------------------------------- */
.vivaia-tsw-product-name {
    position: absolute !important;
    bottom: 15px !important;
    left: 15px !important;
    color: #fff !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    z-index: 2 !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    letter-spacing: 0.5px;
}

/* -------------------------------
   Testimonial Content Section
   ------------------------------- */
.vivaia-tsw-content {
    background: #f8f8f8;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
}

.vivaia-tsw-text {
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    margin: 0 0 15px 0;
    flex: 1;
}

.vivaia-tsw-customer {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

/* -------------------------------
   Star Rating
   ------------------------------- */
.vivaia-tsw-card .vivaia-tsw-stars,
.vivaia-tsw-wrapper .vivaia-tsw-stars {
    display: flex !important;
    gap: 2px !important;
    position: relative !important;
    overflow: visible !important;
    width: auto !important;
    height: auto !important;
    min-height: 20px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.vivaia-tsw-card .vivaia-tsw-stars:before,
.vivaia-tsw-card .vivaia-tsw-stars:after,
.vivaia-tsw-wrapper .vivaia-tsw-stars:before,
.vivaia-tsw-wrapper .vivaia-tsw-stars:after {
    content: none !important;
    display: none !important;
}

.vivaia-tsw-card .vivaia-tsw-stars .vivaia-tsw-star,
.vivaia-tsw-wrapper .vivaia-tsw-stars .vivaia-tsw-star {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    min-width: 16px !important;
    min-height: 16px !important;
    font-size: 16px !important;
    line-height: 1 !important;
    font-family: Arial, sans-serif !important;
    color: rgb(128, 76, 26) !important;
    position: relative !important;
    z-index: 1000 !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    overflow: visible !important;
    clip-path: none !important;
    text-indent: 0 !important;
}

.vivaia-tsw-card .vivaia-tsw-stars .vivaia-tsw-star--filled,
.vivaia-tsw-wrapper .vivaia-tsw-stars .vivaia-tsw-star--filled {
    color: rgb(128, 76, 26) !important;
}

.vivaia-tsw-card .vivaia-tsw-stars .vivaia-tsw-star--empty,
.vivaia-tsw-wrapper .vivaia-tsw-stars .vivaia-tsw-star--empty {
    color: #ddd !important;
}

/* -------------------------------
   Accessibility
   ------------------------------- */
a.vivaia-tsw-product-link:focus {
    outline: 2px solid #0095f6;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .vivaia-tsw-image {
        transition: none !important;
    }
}

/* -------------------------------
   Print Styles
   ------------------------------- */
@media print {
    .vivaia-tsw-wrapper {
        display: none;
    }
}
