/* =============================================
   Форма отзыва (sg-review-form)
   ============================================= */
.sg-review-form-wrapper {
    max-width: 640px;
    margin: 24px auto 40px;
    padding: 0 48px;
}

.sg-review-form .form-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sg-review-form .form-group {
    margin: 0;
}

.sg-review-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1a1a2e;
}

.sg-review-form .star {
    color: #e74c3c;
}

.sg-review-form .form-control {
    width: 100%;
    box-sizing: border-box;
}

.sg-review-form textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.sg-review-form .form-footer {
    margin-top: 24px;
}

.sg-review-form .form-footer .btn {
    min-width: 200px;
}

/* Radio buttons */
.sg-review-form__radios {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sg-review-form__radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.sg-review-form__radio-label span {
    position: relative;
    top: -1px;
}

.sg-review-form .sg-review-form__radio-label input[type="radio"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #003baa;
    cursor: pointer;
}

/* Rating stars */
.sg-review-form__stars {
    display: flex;
    gap: 4px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.sg-review-form__star-label {
    cursor: pointer;
    color: #d0d0d0;
    transition: color 0.15s;
}

.sg-review-form__star-label input {
    display: none;
}

.sg-review-form__star-label svg path {
    transition: fill 0.15s, stroke 0.15s;
}

/* Filled: checked and all preceding siblings (row-reverse makes ~ select visually left stars) */
.sg-review-form__star-label:has(input:checked),
.sg-review-form__star-label:has(input:checked) ~ .sg-review-form__star-label {
    color: #5ba7e8;
}

.sg-review-form__star-label:has(input:checked) svg path,
.sg-review-form__star-label:has(input:checked) ~ .sg-review-form__star-label svg path {
    fill: #5ba7e8;
    stroke: #5ba7e8;
}

/* Hover */
.sg-review-form__star-label:hover,
.sg-review-form__star-label:hover ~ .sg-review-form__star-label {
    color: #003baa;
}

.sg-review-form__star-label:hover svg path,
.sg-review-form__star-label:hover ~ .sg-review-form__star-label svg path {
    fill: #003baa;
    stroke: #003baa;
}

/* Field errors */
.sg-review-form__error {
    font-size: 13px;
    color: #e74c3c;
    margin-top: 4px;
    min-height: 0;
}

.sg-review-form .form-group.has-error .form-control,
.sg-review-form .form-group.has-error .inputtext {
    border-color: #e74c3c;
}

/* Alerts */
.sg-review-form__alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.sg-review-form__alert--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.sg-review-form__alert--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
}

/* =============================================
   Попап формы отзыва
   ============================================= */
.sg-review-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.sg-review-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.sg-review-popup__window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    width: 640px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.sg-review-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 16px;
}

.sg-review-popup__title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}

.sg-review-popup__close {
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    padding: 0 4px;
}

.sg-review-popup__close:hover {
    color: #333;
}

.sg-review-popup__body {
    padding: 0 32px 32px;
}

.sg-review-popup .sg-review-form-wrapper {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Photo preview */
.sg-review-form__photo-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.sg-review-form__photo-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

.sg-review-form__photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
