/**
 * Vivaia Testimonial Showcase - Frontend Styles
 *
 * @package Vivaia_Testimonial_Showcase
 */

/* Main container */
.vivaia-testimonial-showcase {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* -------------------------------
   Desktop: Grid Layout (4 columns)
   ------------------------------- */
@media (min-width: 768px) {
    .testimonial-grid.desktop-only {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    /* Hide mobile carousel on desktop */
    .testimonial-carousel.mobile-only {
        display: none !important;
    }
}

/* -------------------------------
   Mobile: Carousel with 2-Column Slides
   ------------------------------- */
@media (max-width: 767px) {
    /* Hide desktop grid on mobile */
    .testimonial-grid.desktop-only {
        display: none;
    }

    /* Show mobile carousel */
    .testimonial-carousel.mobile-only {
        display: block;
    }

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

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

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

    .vivaia-testimonial-showcase {
        overflow: visible !important;
    }

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

    .testimonial-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;
    }

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

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

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

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

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

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

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

/* -------------------------------
   Product Name Overlay
   ------------------------------- */
.product-name-overlay {
    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
   ------------------------------- */
.testimonial-content {
    background: #f8f8f8;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
}

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

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

/* -------------------------------
   Star Rating
   ------------------------------- */
/* Custom testimonial stars - avoiding conflicts with theme's .star-rating class */
.testimonial-card .testimonial-stars,
.vivaia-testimonial-showcase .testimonial-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;
}

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

.testimonial-card .testimonial-stars .star,
.vivaia-testimonial-showcase .testimonial-stars .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; /* VIVAIA brand star color */
    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;
}

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

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

/* Mobile Slider Styling - REMOVED (now using dual structure with 2-column grid slides) */

/* -------------------------------
   Responsive Adjustments
   ------------------------------- */

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

/* Desktop: 4 columns (default) */
@media (min-width: 992px) {
    .testimonial-grid.desktop-only {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Large desktop: maintain 4 columns */
@media (min-width: 1200px) {
    .testimonial-grid.desktop-only {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

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

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

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