/* === Общие настройки === */
.ar-container,
.ar-form-wrapper,
.ar-reviews-list,
.ar-stats,
.ar-review-item {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
}

.ar-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1280px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 28px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
}

.ar-reviews-list {
    flex: 2;
    min-width: 0;
}

.ar-form-sidebar {
    flex: 1;
    position: sticky;
    top: 30px;
    align-self: flex-start;
    background-color: #ffffff;
    padding: 0;
    height: fit-content;
}

/* ===== СТАТИСТИКА ===== */
.ar-stats {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #edf2f7;
}
.ar-stats h3 {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0 0 20px 0;
    color: #1e293b;
}
.ar-stats-main {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.ar-stats-rating {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.ar-rating-number {
    font-size: 2.5rem;
    font-weight: 500;
    color: #0f172a;
}
.ar-stats-rating .ar-stars {
    color: #f5b342;
    font-size: 1rem;
    letter-spacing: 2px;
    display: inline-flex;
    align-items: center;
}
.ar-recommend {
    background-color: #ecfdf3;
    padding: 6px 16px;
    border-radius: 40px;
    color: #0e6245;
    font-size: 0.95rem;
    border: 1px solid #d1f0e0;
}
.ar-stats-distribution {
    max-width: 350px;
}
.ar-distribution-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}
.ar-distribution-label {
    min-width: 90px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.ar-distribution-label i {
    color: #f5b342;
    font-size: 1rem;
}
.ar-distribution-bar {
    flex: 1;
    height: 6px;
    background-color: #e9eef3;
    border-radius: 12px;
    overflow: hidden;
}
.ar-distribution-fill {
    height: 100%;
    background-color: #f5b342;
}
.ar-distribution-percent {
    width: 45px;
    color: #64748b;
    text-align: right;
}

/* ===== КАРТОЧКИ ОТЗЫВОВ ===== */
.ar-reviews-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ar-review-item {
    border-bottom: 1px solid #edf2f7;
    padding: 24px 0;
}
.ar-review-item:first-of-type {
    padding-top: 0;
}
.ar-review-item:last-child {
    border-bottom: none;
}

/* Заголовок: имя слева, мета-блок справа (десктоп) */
.ar-review-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 12px;
}

.ar-review-author {
    font-weight: 500;
    font-size: 1rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.ar-review-meta {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    flex-shrink: 0;
    white-space: nowrap;
}

.ar-review-date {
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
}

.ar-review-rating {
    color: #f5b342 !important;
    font-size: 1rem !important;
    letter-spacing: 2px;
    display: inline-flex !important;
    align-items: center;
    line-height: 1;
}

.ar-review-text {
    line-height: 1.6;
    color: #334155;
    margin: 12px 0 16px;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.ar-review-image img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
}

/* ===== ФОРМА ===== */
.ar-form-wrapper {
    background: #ffffff;
    border-radius: 24px;
}
.ar-form-wrapper h3 {
    margin: 0 0 28px 0;
    font-size: 1.4rem;
    font-weight: 500;
    color: #1e293b;
}
.ar-form-group {
    margin-bottom: 24px;
}
.ar-form-group label {
    display: block;
    font-weight: 400;
    margin-bottom: 6px;
    color: #475569;
    font-size: 0.9rem;
    text-transform: uppercase;
}
.ar-form-group .required {
    color: #e05a5a;
}
.ar-form-group input[type="text"],
.ar-form-group input[type="email"],
.ar-form-group textarea {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    background: transparent;
    outline: none;
}
.ar-form-group input:focus,
.ar-form-group textarea:focus {
    border-bottom-color: #f5b342;
    box-shadow: 0 2px 0 0 #f5b342;
}
.ar-stars-input {
    display: flex;
    gap: 6px;
    font-size: 1.6rem;
    cursor: pointer;
    margin-top: 8px;
}
.ar-stars-input .ar-star {
    color: #cbd5e1;
}
.ar-stars-input .ar-star.fas {
    color: #f5b342;
}
.ar-file-input {
    position: relative;
}
.ar-file-input input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 2;
}
.ar-file-custom {
    display: inline-block;
    background-color: #f8fafc;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 0.9rem;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.ar-file-input:hover .ar-file-custom {
    background-color: #f1f5f9;
}
.ar-image-preview img {
    max-width: 70px;
    max-height: 70px;
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid #edf2f7;
}
.ar-submit-btn {
    background-color: #f5b342;
    color: #1e293b;
    border: none;
    padding: 14px 24px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
}
.ar-submit-btn:hover {
    background-color: #e09f30;
}
.ar-form-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
}
.ar-form-message.success {
    background-color: #e9f7ef;
    color: #1e7b4c;
}
.ar-form-message.error {
    background-color: #fee9e9;
    color: #b53b3b;
}

/* Индикатор загрузки */
.ar-load-more-trigger {
    height: 30px;
    margin: 20px 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><circle cx="50" cy="50" fill="none" stroke="%23f5b342" stroke-width="8" r="35" stroke-dasharray="164.93361431346415 56.97787143782138"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"/></circle></svg>') no-repeat center;
    background-size: 30px;
}

/* ===== АДАПТИВНОСТЬ (МОБИЛЬНЫЕ УСТРОЙСТВА) ===== */
@media (max-width: 768px) {
    .ar-container {
        flex-direction: column;
        padding: 24px;
        gap: 30px;
    }
    .ar-form-sidebar {
        position: static;
        width: 100%;
    }
    .ar-stats-main {
        flex-direction: column;
        align-items: flex-start;
    }
    /* Заголовок карточки: имя сверху, мета-блок на всю ширину */
    .ar-review-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    .ar-review-meta {
        width: 100%;
        display: flex;
        justify-content: space-between; /* дата слева, звёзды справа */
        align-items: center;
        gap: 8px;
        flex-wrap: wrap; /* если совсем не влезают, перенесутся */
        white-space: normal; /* разрешаем перенос, если потребуется */
    }
    .ar-review-date,
    .ar-review-rating {
        white-space: nowrap; /* но дата и звёзды стараемся сохранить в одну строку */
    }
    .ar-distribution-row {
        gap: 16px;
    }
    .ar-distribution-label {
        min-width: 70px;
    }
}
/* Все предыдущие стили остаются, добавляем в конец: */

/* Ответы на отзывы */
.ar-replies {
    margin: 15px 0 10px 30px;
    padding-left: 15px;
    border-left: 3px solid #f5b342;
}
.ar-reply-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9fafc;
    border-radius: 8px;
}
.ar-reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}
.ar-reply-author {
    font-weight: 500;
    color: #1e293b;
}
.ar-reply-date {
    color: #94a3b8;
}
.ar-reply-text {
    line-height: 1.5;
    color: #334155;
}

/* Форма ответа */
.ar-reply-form-container {
    margin-top: 10px;
}
.ar-reply-toggle {
    background: none;
    border: 1px solid #f5b342;
    color: #f5b342;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: all 0.2s;
}
.ar-reply-toggle:hover {
    background: #f5b342;
    color: #1e293b;
}
.ar-reply-form {
    margin-top: 10px;
}
.ar-reply-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    resize: vertical;
    min-height: 80px;
}
.ar-reply-submit {
    background-color: #f5b342;
    color: #1e293b;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 5px;
}
.ar-reply-submit:hover {
    background-color: #e09f30;
}
.ar-reply-message {
    margin-top: 10px;
    font-size: 0.9rem;
}
.ar-reply-message .success {
    color: #1e7b4c;
}
.ar-reply-message .error {
    color: #b53b3b;
}

/* Мобильная форма (скрыта на десктопах) */
.ar-mobile-form {
    display: none;
}

/* На мобильных показываем мобильную форму и скрываем правую колонку с формой */
@media (max-width: 768px) {
    .ar-mobile-form {
        display: block;
        margin-bottom: 30px;
    }
    .ar-form-sidebar {
        display: none; /* скрываем правую форму на мобильных, чтобы не дублировать */
    }
}