/**
 * Wiamshop - Customer Reviews Carousel Styles
 * Strictly scoped to .sc-reviews-section to preserve existing functional classes, IDs, data attributes, and carousel behavior.
 */

.sc-reviews-section {
    margin: 72px auto 0;
    box-sizing: border-box;
    position: relative;
    direction: rtl;
    text-align: right;
}

.sc-reviews-section+.faq {
    margin-top: 75px;
}

/* Header & Title */
.sc-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    gap: 16px;
}

.sc-reviews-title-wrap {
    flex: 1;
}

.sc-reviews-title {
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 900;
    color: var(--forest-950, #031a0f);
    margin: 0 0 6px;
    line-height: 1.25;
    letter-spacing: -0.5px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.sc-reviews-subtitle {
    font-size: 16px;
    color: var(--muted, #5e7267);
    margin: 0;
    font-weight: 600;
}

/* Navigation Arrow Buttons */
.sc-reviews-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sc-carousel-arrow {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border, rgba(96, 214, 0, 0.24));
    box-shadow: 0 2px 8px rgba(3, 26, 15, 0.08);
    color: var(--forest-900, #062617);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
    margin: 0;
}

.sc-carousel-arrow:hover:not(:disabled) {
    background: var(--lime-100, #eefce6);
    border-color: var(--lime-500, #60d600);
    color: var(--forest-900, #062617);
    box-shadow: 0 4px 14px rgba(96, 214, 0, 0.3);
    transform: translateY(-2px);
}

.sc-carousel-arrow:focus-visible {
    outline: 3px solid var(--lime-500, #60d600);
    outline-offset: 3px;
}

.sc-carousel-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.sc-carousel-arrow svg {
    display: block;
    stroke: currentColor;
}

/* Viewport and Track */
.sc-carousel-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
    touch-action: pan-y;
    padding: 10px 4px 20px;
    box-sizing: border-box;
}

.sc-carousel-viewport:focus-visible {
    outline: 3px solid var(--lime-500, #60d600);
    outline-offset: 4px;
    border-radius: 20px;
}

.sc-carousel-track {
    display: flex;
    gap: 22px;
    transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    direction: rtl;
}

/* Review Cards - Wiamshop Antigravity Glassmorphism */
.sc-review-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--glass-border, rgba(96, 214, 0, 0.24));
    border-radius: 22px;
    box-shadow: 0 10px 30px -4px rgba(3, 26, 15, 0.06);
    padding: 22px 20px 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: var(--transition-spring, all 0.3s cubic-bezier(0.16, 1, 0.3, 1));
    flex: 0 0 calc((100% - 3 * 22px) / 4);
    width: calc((100% - 3 * 22px) / 4);
    min-height: 220px;
    position: relative;
}

.sc-review-card:hover {
    transform: translateY(-8px);
    border-color: rgba(96, 214, 0, 0.5);
    box-shadow: 0 20px 45px -8px rgba(3, 26, 15, 0.14), 0 0 25px rgba(96, 214, 0, 0.22);
}

/* When total cards fit without scrolling (e.g. 1, 2, or 3 cards on desktop), do not stretch */
.sc-reviews-section.no-overflow .sc-carousel-track {
    justify-content: flex-start;
}

.sc-review-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--forest-950, #031a0f);
    margin: 0 0 2px;
    display: block;
    line-height: 1.35;
    font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
}

.sc-review-city {
    font-size: 13px;
    color: var(--muted, #5e7267);
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.sc-review-stars {
    color: #f59e0b;
    font-size: 15px;
    letter-spacing: 2px;
    margin: 2px 0 12px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.sc-stars-filled {
    color: #f59e0b;
}

.sc-stars-empty {
    color: rgba(12, 66, 41, 0.15);
}

.sc-review-text-wrap {
    margin-bottom: 14px;
    flex-grow: 1;
}

.sc-review-text {
    font-size: 14.5px;
    line-height: 1.7;
    color: #384d41;
    margin: 0;
    word-break: break-word;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

/* Collapsible excerpt */
.sc-review-text-wrap.is-collapsible .sc-review-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sc-review-text-wrap.is-collapsible.is-expanded .sc-review-text {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.sc-review-toggle {
    background: none;
    border: none;
    color: var(--forest-700, #0f5434);
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    padding: 6px 0 0;
    display: inline-block;
    font-family: inherit;
    transition: color 0.2s ease;
}

.sc-review-toggle:hover {
    color: var(--lime-600, #146e42);
    text-decoration: underline;
}

.sc-review-toggle:focus-visible {
    outline: 2px solid var(--lime-500, #60d600);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Customer Photo (Strictly Non-Interactive, 4:3 Aspect Ratio) */
.sc-review-photo-frame {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    overflow: hidden;
    background: #eaf1ec;
    margin-top: auto;
    border: 1px solid rgba(12, 66, 41, 0.1);
    position: relative;
    pointer-events: none;
    user-select: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sc-review-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    cursor: default !important;
    transition: transform 0.4s ease;
}

.sc-review-card:hover .sc-review-photo {
    transform: scale(1.05);
}

/* Pagination Dots */
.sc-reviews-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    min-height: 14px;
}

.sc-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(12, 66, 41, 0.2);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: all 250ms ease;
}

.sc-dot:hover:not(.active) {
    background: rgba(12, 66, 41, 0.4);
}

.sc-dot.active {
    background: var(--lime-500, #60d600);
    width: 24px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(96, 214, 0, 0.4);
}

.sc-dot:focus-visible {
    outline: 3px solid var(--lime-500, #60d600);
    outline-offset: 3px;
}

/* Hidden controls when not needed */
.sc-reviews-section.no-overflow .sc-reviews-nav,
.sc-reviews-section.no-overflow .sc-reviews-dots {
    display: none !important;
}

/* Screen reader only utility */
.sc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive: Tablet (768px – 1199px) -> 3 visible cards */
@media (max-width: 1199px) and (min-width: 768px) {
    .sc-carousel-track {
        gap: 18px;
    }

    .sc-review-card {
        flex: 0 0 calc((100% - 2 * 18px) / 3);
        width: calc((100% - 2 * 18px) / 3);
    }
}

/* Responsive: Mobile (< 768px) -> 1 visible card + small glimpse of next card (approx 88%) */
@media (max-width: 767px) {
    .sc-reviews-section {
        margin-top: 56px;
    }

    .sc-reviews-title {
        font-size: 24px;
    }

    .sc-reviews-subtitle {
        font-size: 14px;
    }

    .sc-carousel-track {
        gap: 14px;
    }

    .sc-review-card {
        flex: 0 0 88%;
        width: 88%;
        padding: 18px;
        border-radius: 18px;
    }

    /* Single review on mobile: clean full width without empty gap */
    .sc-reviews-section.single-item .sc-review-card {
        flex: 0 0 100%;
        width: 100%;
    }

    .sc-carousel-arrow {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .sc-carousel-track {
        transition: none !important;
    }

    .sc-dot {
        transition: none !important;
    }
}