.package-review-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.package-review-average {
    text-align: right;
}

.average-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.stars-display {
    --rating: 0;
    --percent: calc(var(--rating) / 5 * 100%);
    position: relative;
    display: inline-block;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 3px;
    color: #d7d7d7;
}

.stars-display::before {
    content: "\2605\2605\2605\2605\2605";
}

.stars-display::after {
    content: "\2605\2605\2605\2605\2605";
    color: #ff9900;
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--percent);
    overflow: hidden;
    white-space: nowrap;
}

.review-card {
    position: relative;
    margin: 0 0 26px;
    padding: 8px 0 24px;
    border-bottom: 1px solid #e7e7e7;
}

.review-card.last {
    margin-bottom: 0;
}

.review-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.review-card-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.review-card-avatar {
    width: 54px !important;
    min-width: 54px;
    height: 54px !important;
    border-radius: 50% !important;
    position: static !important;
    border: 0 !important;
    margin: 0 !important;
    object-fit: cover;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}

.review-card-name {
    margin: 0 0 2px !important;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
}

.review-card-subline {
    color: #666;
    font-size: 14px;
    line-height: 1.3;
}

.review-card-menu {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0;
}

.review-card-menu span {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #555;
}

.review-card-rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.review-card-stars {
    display: inline-flex;
    gap: 1px;
    font-size: 19px;
    line-height: 1;
    color: #d4d4d4;
}

.review-card-stars .is-filled {
    color: #f5a000;
}

.review-card-date {
    color: #666;
    font-size: 14px;
}

.review-card-message-wrap {
    margin-bottom: 14px;
}

.review-card-message {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.review-card-message-wrap.is-collapsed .review-card-message {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-more-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    margin-top: 4px;
    color: #315efb;
    font-weight: 600;
}

.review-gallery {
    position: relative;
    margin-bottom: 12px;
}

.review-gallery-track {
    display: flex !important;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 2px 0 10px;
    scrollbar-width: none;
}

.review-gallery-track::-webkit-scrollbar {
    display: none;
}

.review-photo-trigger {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    float: none !important;
    border: 0 !important;
    background: transparent;
    padding: 0;
    margin: 0 !important;
    flex: 0 0 auto;
    cursor: pointer;
    box-shadow: none !important;
}

.review-media-thumb {
    position: static !important;
    left: auto !important;
    top: auto !important;
    float: none !important;
    width: 118px !important;
    min-width: 118px !important;
    height: 118px !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    display: block !important;
    border-radius: 14px !important;
    object-fit: cover !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.review-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.review-gallery-nav span {
    font-size: 28px;
    line-height: 1;
    margin-top: -2px;
}

.review-gallery-prev {
    left: -16px;
}

.review-gallery-next {
    right: -16px;
}

.review-gallery-nav.is-hidden {
    display: none;
}

.review-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
    margin-bottom: 16px;
}

.review-action-icon {
    font-size: 24px;
    line-height: 1;
}

.review-action-count {
    font-size: 15px;
    margin-right: 8px;
}

.review-owner-reply {
    display: flex;
    gap: 14px;
    padding: 14px 0 0 18px;
    margin-left: 16px;
    border-left: 2px solid #d9d9d9;
}

.review-owner-avatar {
    width: 40px;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #315efb;
    background: #e9f0ff;
}

.review-owner-body strong {
    display: block;
    font-size: 18px;
    margin-bottom: 3px;
}

.review-owner-body strong span {
    font-weight: 400;
    color: #666;
}

.review-owner-date {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.review-owner-body p {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
}

.review-empty-state {
    padding: 18px;
    border-radius: 14px;
    background: #f8f9fa;
    color: #555;
}

.review-modal-content {
    border-radius: 20px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

#packageReviewModal .modal-body {
    padding: 24px;
    overflow-y: auto;
}

.review-flip-card {
    perspective: 1200px;
}

.review-flip-card-inner {
    position: relative;
    min-height: 1px;
    transform-style: preserve-3d;
}

.review-face {
    width: 100%;
    backface-visibility: hidden;
    transition: opacity 0.35s ease, transform 0.7s ease;
}

.review-front-face {
    position: relative;
    opacity: 1;
    transform: rotateY(0deg);
}

.review-back-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: rotateY(-180deg);
}

.review-flip-card.is-flipped .review-front-face {
    opacity: 0;
    pointer-events: none;
    transform: rotateY(180deg);
}

.review-flip-card.is-flipped .review-back-face {
    opacity: 1;
    pointer-events: auto;
    transform: rotateY(0deg);
}

.review-success-box {
    width: 100%;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff6ef, #ffffff);
    padding: 32px;
}

.review-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.review-full-width {
    grid-column: 1 / -1;
}

.review-star-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.star-pick {
    border: 0;
    background: transparent;
    color: #a9b0b7;
    font-size: 42px;
    line-height: 1;
    padding: 0;
}

.star-pick.active,
.star-pick.hovered {
    color: #ff9900;
}

.review-message-box {
    min-height: 150px;
}

.review-form-actions {
    margin-top: 20px;
}

.review-error {
    display: block;
    margin-top: 6px;
    color: #dc3545;
    min-height: 18px;
}

.review-upload-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #6c757d;
}

.review-selected-files {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.review-upload-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.review-upload-preview img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
}

.review-photo-modal-content {
    background: #050505;
    border-radius: 18px;
    overflow: hidden;
}

.review-photo-modal-content .modal-header {
    border-bottom: 0;
    color: #fff;
}

.review-photo-modal-body {
    padding: 0 16px 20px;
    text-align: center;
}

.review-photo-preview-image {
    max-width: 100%;
    max-height: 82vh;
    width: auto;
    height: auto;
    border-radius: 14px;
}

#packageReviewModal {
    z-index: 200000 !important;
}

#packageReviewModal.show {
    display: block;
}

#packageReviewModal .modal-dialog {
    z-index: 200001;
}

#reviewPhotoPreviewModal {
    z-index: 200002 !important;
}

#reviewPhotoPreviewModal .modal-dialog {
    z-index: 200003;
}

.modal-backdrop.show {
    z-index: 199999 !important;
}

@media (max-width: 991px) {
    .review-gallery-prev {
        left: 6px;
    }

    .review-gallery-next {
        right: 6px;
    }
}

@media (max-width: 767px) {
    .review-field-grid {
        grid-template-columns: 1fr;
    }

    .review-modal-content {
        max-height: calc(100vh - 20px);
    }

    #packageReviewModal .modal-body {
        padding: 18px;
    }

    .review-success-box {
        min-height: 320px;
        padding: 24px;
    }

    .review-card-name {
        font-size: 22px;
    }

    .review-media-thumb {
        width: 96px !important;
        min-width: 96px !important;
        height: 96px !important;
    }

    .review-gallery-nav {
        width: 34px;
        height: 34px;
    }

    .review-owner-reply {
        margin-left: 0;
        padding-left: 12px;
    }
}
