/* static/css/reviews.css */
/*
 * Отзывы: карточки, слайдер, аватары, stats pills, proof-img.
 * Обновлено: layout без overlap-хаков, больше воздуха,
 * чистые inner-wrappers, корректные фоны.
 */

/* ─── Review Card (base for home rail) ────────────────────── */

.review-card {
    min-width: 100%;
    padding: 1.25rem;
    background: white;
    border-radius: 1.5rem;
    border: 1px solid var(--color-border);
    position: relative;
    transition: box-shadow 0.3s ease;
}

@media (min-width: 768px) {
    .review-card {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .review-card {
        padding: 2rem;
        border-radius: 2rem;
    }
}

.review-card:hover {
    box-shadow: var(--shadow-md);
}

/* Gradient border on hover */
.review-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 0%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.review-card:hover::before {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.5) 0%, rgba(139, 92, 246, 0.3) 50%, rgba(13, 148, 136, 0.5) 100%);
    opacity: 1;
}

/* ─── Review Card on full page (/reviews) ─────────────────── */

.review-card--full {
    background: white;
    border-radius: 1.5rem;
    border: 1px solid var(--color-border);
    position: relative;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: visible;
}

@media (min-width: 1024px) {
    .review-card--full {
        border-radius: 1.75rem;
    }
}

.review-card--full:hover {
    box-shadow: 0 8px 30px -8px rgba(17, 24, 39, 0.1);
    border-color: rgba(13, 148, 136, 0.2);
}

/* Gradient border on hover */
.review-card--full::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 0%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.review-card--full:hover::before {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.4) 0%, rgba(139, 92, 246, 0.25) 50%, rgba(13, 148, 136, 0.4) 100%);
    opacity: 1;
}

/* Inner wrapper: padding + flex layout для карточки */
.review-card__inner {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    position: relative;
    z-index: 2;
}

@media (min-width: 768px) {
    .review-card__inner {
        padding: 1.75rem;
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .review-card__inner {
        padding: 2rem;
    }
}

/* Results block inside card */
.review-results {
    background: rgba(249, 250, 251, 0.8);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    margin-top: auto;
}

/* Footer: badges and meta */
.review-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(229, 231, 235, 0.6);
    font-size: 0.75rem;
}

.review-meta-sep {
    color: var(--color-border);
    font-weight: 400;
}

.review-meta-text {
    color: var(--color-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Reviews Controls Card ──────────────────────────────── */

.reviews-controls-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 1.5rem;
    box-shadow: 0 4px 24px -4px rgba(17, 24, 39, 0.06);
}

@media (min-width: 768px) {
    .reviews-controls-card {
        border-radius: 1.75rem;
    }
}

/* ─── Horizontal scroller (mobile) ────────────────────────── */

.reviews-scroller {
    position: relative;
}

.reviews-scroller__inner {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}

.reviews-scroller__inner > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* Edge fade hint (mobile only) */
.reviews-scroller::before,
.reviews-scroller::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.reviews-scroller::before {
    left: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 100%);
}

.reviews-scroller::after {
    right: 0;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 100%);
}

@media (max-width: 767px) {
    .reviews-scroller::before,
    .reviews-scroller::after {
        opacity: 1;
    }
}

/* ─── Home rail layout ───────────────────────────────────── */

.reviews-rail {
    position: relative;
}

/* Edge fade for rail (matches bg-bio-bg) */
.reviews-rail::before,
.reviews-rail::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.reviews-rail::before {
    left: 0;
    background: linear-gradient(90deg, rgba(249, 250, 251, 1) 0%, rgba(249, 250, 251, 0) 100%);
}

.reviews-rail::after {
    right: 0;
    background: linear-gradient(270deg, rgba(249, 250, 251, 1) 0%, rgba(249, 250, 251, 0) 100%);
}

@media (max-width: 767px) {
    .reviews-rail::before,
    .reviews-rail::after {
        opacity: 1;
    }
}

.reviews-slider {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .reviews-slider {
        gap: 18px;
    }
}

.review-card--rail {
    min-width: min(320px, 86vw);
    max-width: 420px;
    padding: 1.1rem;
    border-radius: 1.5rem;
}

@media (min-width: 640px) {
    .review-card--rail {
        min-width: 360px;
        padding: 1.25rem;
    }
}

@media (min-width: 768px) {
    .review-card--rail {
        min-width: 420px;
        padding: 1.5rem;
    }
}

/* Clamp review text (home rail) */
.review-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 5;
}

@media (min-width: 768px) {
    .review-text {
        -webkit-line-clamp: 6;
    }
}

.review-footer {
    margin-top: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.review-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(17, 24, 39, 0.78);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.review-more:hover {
    color: var(--color-primary);
}

.review-more i {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.review-more:hover i {
    transform: translateX(2px);
}

/* ─── Stats Pills ─────────────────────────────────────────── */

.reviews-stats-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.625rem;
}

.reviews-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: white;
    border: 1px solid var(--color-border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reviews-stat-pill:hover {
    border-color: rgba(13, 148, 136, 0.3);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.08);
}

.reviews-stat-pill__icon {
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reviews-stat-pill__icon i {
    width: 0.875rem;
    height: 0.875rem;
}

.reviews-stat-pill__icon--teal {
    background: rgba(13, 148, 136, 0.1);
    color: var(--color-primary);
}

.reviews-stat-pill__icon--amber {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.reviews-stat-pill__icon--purple {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.reviews-stat-pill__stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    margin-left: 0.125rem;
}

.reviews-stat-pill__stars i {
    width: 0.75rem;
    height: 0.75rem;
}

/* ─── Proof Image Thumbnail ───────────────────────────────── */

.review-proof {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(13, 148, 136, 0.05);
    border: 1px solid rgba(13, 148, 136, 0.15);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.review-proof:hover {
    background: rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.3);
}

.review-proof__thumb {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    object-fit: cover;
    border: 1px solid rgba(13, 148, 136, 0.2);
}

/* ─── Product Badge System ─────────────────────────────────── */

.review-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.6;
}

.review-badge--nad-plus {
    background: rgba(13, 148, 136, 0.1);
    color: var(--color-primary);
}

.review-badge--finecode {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.review-badge--neoreservo {
    background: rgba(6, 182, 212, 0.1);
    color: #0e7490;
}

.review-badge--stack {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: var(--color-primary);
}

.review-badge--igen {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

/* ─── Gradient CTA Block ──────────────────────────────────── */

.review-cta-share {
    position: relative;
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    border: 1px solid rgba(13, 148, 136, 0.12);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

@media (min-width: 768px) {
    .review-cta-share {
        padding: 2rem 2.5rem;
        border-radius: 1.75rem;
    }
}

.review-cta-share:hover {
    border-color: rgba(13, 148, 136, 0.25);
}

.review-cta-share::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ─── Avatar System ───────────────────────────────────────── */

.review-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
    .review-avatar {
        width: 3.5rem;
        height: 3.5rem;
    }
}

.avatar-stack {
    position: relative;
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .avatar-stack {
        width: 3.5rem;
        height: 3.5rem;
    }
}

.avatar-stack .review-avatar {
    width: 100%;
    height: 100%;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-fallback span {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 13px;
}

@media (min-width: 768px) {
    .avatar-fallback span {
        font-size: 15px;
    }
}

/* 6 color variants */
.avatar-fallback--1 { background: var(--avatar-color-1); }
.avatar-fallback--1 span { color: var(--avatar-text-1); }

.avatar-fallback--2 { background: var(--avatar-color-2); }
.avatar-fallback--2 span { color: var(--avatar-text-2); }

.avatar-fallback--3 { background: var(--avatar-color-3); }
.avatar-fallback--3 span { color: var(--avatar-text-3); }

.avatar-fallback--4 { background: var(--avatar-color-4); }
.avatar-fallback--4 span { color: var(--avatar-text-4); }

.avatar-fallback--5 { background: var(--avatar-color-5); }
.avatar-fallback--5 span { color: var(--avatar-text-5); }

.avatar-fallback--6 { background: var(--avatar-color-6); }
.avatar-fallback--6 span { color: var(--avatar-text-6); }