/* ============================================
   LAVISH REVIEWS - Custom Review System
   For lavish.ba - Sunčane naočale
   ============================================ */

/* CSS Variables */
:root {
    --lavish-star-color: #F5A623;
    --lavish-star-empty: #D8D8D8;
    --lavish-text-primary: #1a1a1a;
    --lavish-text-secondary: #666666;
    --lavish-text-light: #999999;
    --lavish-border: #e5e5e5;
    --lavish-bg: #ffffff;
    --lavish-bg-light: #f7f7f7;
    --lavish-bg-card: #f9f9f9;
    --lavish-accent: #1a1a1a;
    --lavish-success: #4CAF50;
    --lavish-error: #e74c3c;
    --lavish-radius: 8px;
    --lavish-radius-lg: 12px;
    --lavish-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --lavish-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --lavish-transition: 0.2s ease;
}

/* ============================================
   INLINE REVIEWS (Shortcode) - Compact
   ============================================ */

.lavish-reviews-inline {
    padding: 16px 0;
    max-width: 100%;
}

/* Header row */
.lavish-reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
    border-bottom: 1px solid var(--lavish-border);
    margin-bottom: 10px;
    transition: opacity var(--lavish-transition);
}

.lavish-reviews-header:hover {
    opacity: 0.7;
}

.lavish-reviews-header-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--lavish-text-primary);
}

.lavish-reviews-header-arrow {
    color: var(--lavish-text-secondary);
}

/* Average rating */
.lavish-reviews-average {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.lavish-rating-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--lavish-text-primary);
    line-height: 1;
}

/* Stars */
.lavish-star {
    font-size: 16px;
    line-height: 1;
}

.lavish-star-full {
    color: var(--lavish-star-color);
}

.lavish-star-half {
    color: var(--lavish-star-color);
    position: relative;
}

.lavish-star-empty {
    color: var(--lavish-star-empty);
}

.lavish-stars-small .lavish-star {
    font-size: 13px;
}

/* Horizontal scroll */
.lavish-reviews-scroll-container {
    position: relative;
    margin: 0 -4px;
}

.lavish-reviews-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px;
    scrollbar-width: none;
}

.lavish-reviews-scroll::-webkit-scrollbar {
    display: none;
}

/* Review Card - Compact */
.lavish-review-card {
    flex: 0 0 220px;
    min-width: 220px;
    background: var(--lavish-bg-card);
    border-radius: var(--lavish-radius);
    padding: 12px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: box-shadow var(--lavish-transition);
    border: 1px solid var(--lavish-border);
}

.lavish-review-card:hover {
    box-shadow: var(--lavish-shadow);
}

.lavish-review-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lavish-review-date {
    font-size: 11px;
    color: var(--lavish-text-light);
}

.lavish-review-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--lavish-text-primary);
    line-height: 1.3;
}

.lavish-review-card-text {
    font-size: 12px;
    color: var(--lavish-text-secondary);
    line-height: 1.4;
}

.lavish-review-card-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.lavish-review-author {
    font-size: 12px;
    font-weight: 500;
    color: var(--lavish-text-primary);
}

.lavish-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--lavish-text-light);
}

.lavish-verified-badge svg {
    width: 13px;
    height: 13px;
}

/* No reviews */
.lavish-no-reviews {
    text-align: center;
    padding: 24px 16px;
    color: var(--lavish-text-secondary);
}

.lavish-btn-write-first {
    background: var(--lavish-accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--lavish-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
    transition: opacity var(--lavish-transition);
}

.lavish-btn-write-first:hover {
    opacity: 0.8;
}

/* ============================================
   POPUP BASE STYLES
   ============================================ */

.lavish-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lavish-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lavish-popup-container {
    background: var(--lavish-bg);
    border-radius: var(--lavish-radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--lavish-shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.lavish-popup-overlay.active .lavish-popup-container {
    transform: translateY(0);
}

.lavish-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--lavish-border);
    flex-shrink: 0;
}

.lavish-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--lavish-text-primary);
}

.lavish-popup-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--lavish-text-secondary);
    transition: color var(--lavish-transition);
    line-height: 1;
}

.lavish-popup-close:hover {
    color: var(--lavish-text-primary);
}

.lavish-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

.lavish-popup-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--lavish-border);
    flex-shrink: 0;
}

/* ============================================
   REVIEWS POPUP
   ============================================ */

/* Stats */
.lavish-popup-stats {
    background: var(--lavish-bg-light);
    border-radius: var(--lavish-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.lavish-popup-stats-title {
    font-size: 14px;
    color: var(--lavish-text-primary);
    margin-bottom: 16px;
}

.lavish-popup-stats-title strong {
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}

/* Distribution bars */
.lavish-distribution {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.lavish-dist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: opacity var(--lavish-transition);
}

.lavish-dist-row:hover {
    opacity: 0.7;
}

.lavish-dist-stars {
    font-size: 12px;
    color: var(--lavish-star-color);
    min-width: 70px;
    letter-spacing: 1px;
}

.lavish-dist-bar {
    flex: 1;
    height: 8px;
    background: var(--lavish-border);
    border-radius: 4px;
    overflow: hidden;
}

.lavish-dist-bar-fill {
    height: 100%;
    background: var(--lavish-star-color);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.lavish-dist-count {
    font-size: 13px;
    color: var(--lavish-text-secondary);
    min-width: 30px;
    text-align: right;
}

.lavish-popup-overall {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--lavish-border);
    font-size: 14px;
    color: var(--lavish-text-secondary);
}

.lavish-popup-overall strong {
    font-size: 18px;
    color: var(--lavish-text-primary);
}

/* Filter buttons */
.lavish-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lavish-filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--lavish-border);
    background: var(--lavish-bg);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--lavish-transition);
    color: var(--lavish-text-secondary);
    font-weight: 500;
}

.lavish-filter-btn:hover {
    border-color: var(--lavish-text-secondary);
}

.lavish-filter-btn.active {
    background: var(--lavish-accent);
    color: #fff;
    border-color: var(--lavish-accent);
}

/* Sort row */
.lavish-sort-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--lavish-text-secondary);
}

.lavish-sort-select {
    border: 1px solid var(--lavish-border);
    border-radius: var(--lavish-radius);
    padding: 6px 12px;
    font-size: 13px;
    background: var(--lavish-bg);
    cursor: pointer;
    color: var(--lavish-text-primary);
}

/* Reviews list in popup */
.lavish-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lavish-review-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--lavish-border);
}

.lavish-review-item:last-child {
    border-bottom: none;
}

.lavish-review-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.lavish-review-item-stars {
    font-size: 16px;
    color: var(--lavish-star-color);
}

.lavish-review-item-date {
    font-size: 12px;
    color: var(--lavish-text-light);
}

.lavish-review-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--lavish-text-primary);
    margin-bottom: 4px;
}

.lavish-review-item-content {
    font-size: 14px;
    color: var(--lavish-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* Meta fields (Shipping, Fit, Recommended) */
.lavish-review-item-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.lavish-review-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.lavish-review-meta-label {
    color: var(--lavish-text-secondary);
}

.lavish-review-meta-value {
    color: var(--lavish-text-primary);
    font-weight: 500;
}

/* Author + verified */
.lavish-review-item-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lavish-review-item-author {
    font-size: 13px;
    font-weight: 500;
    color: var(--lavish-text-primary);
}

/* Loading */
.lavish-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--lavish-text-light);
    font-size: 14px;
}

/* Load more */
.lavish-load-more-container {
    text-align: center;
    padding: 16px 0;
}

.lavish-btn-load-more {
    background: none;
    border: 1.5px solid var(--lavish-border);
    padding: 10px 24px;
    border-radius: var(--lavish-radius);
    cursor: pointer;
    font-size: 14px;
    color: var(--lavish-text-secondary);
    transition: all var(--lavish-transition);
}

.lavish-btn-load-more:hover {
    border-color: var(--lavish-text-primary);
    color: var(--lavish-text-primary);
}

/* Write Review button in popup footer */
.lavish-btn-write-review {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--lavish-accent);
    color: #fff;
    border: none;
    border-radius: var(--lavish-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity var(--lavish-transition);
}

.lavish-btn-write-review:hover {
    opacity: 0.85;
}

/* ============================================
   WRITE REVIEW POPUP
   ============================================ */

.lavish-write-container {
    max-width: 500px;
}

.lavish-write-product-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--lavish-bg-light);
    border-radius: var(--lavish-radius);
    margin-bottom: 20px;
}

.lavish-write-product-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

.lavish-write-product-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lavish-write-product-details strong {
    font-size: 15px;
    color: var(--lavish-text-primary);
}

.lavish-write-product-price {
    font-size: 14px;
    color: var(--lavish-text-secondary);
}

/* Form - Fixed spacing */
.lavish-form-group {
    margin-bottom: 18px;
}

.lavish-form-group:last-of-type {
    margin-bottom: 0;
}

.lavish-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--lavish-text-primary);
    margin-bottom: 6px;
}

.lavish-form-group input[type="text"],
.lavish-form-group input[type="email"],
.lavish-form-group select,
.lavish-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--lavish-border);
    border-radius: var(--lavish-radius);
    font-size: 14px;
    color: var(--lavish-text-primary);
    background: var(--lavish-bg);
    transition: border-color var(--lavish-transition);
    font-family: inherit;
    box-sizing: border-box;
}

.lavish-form-group input:focus,
.lavish-form-group select:focus,
.lavish-form-group textarea:focus {
    outline: none;
    border-color: var(--lavish-accent);
}

.lavish-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.lavish-form-hint {
    font-size: 12px;
    color: var(--lavish-text-light);
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.4;
}

.lavish-form-error {
    display: none;
    font-size: 12px;
    color: var(--lavish-error);
    margin-top: 4px;
}

.lavish-form-error.visible {
    display: block;
}

/* Radio group - better spacing */
.lavish-radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.lavish-radio-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.lavish-radio-btn input {
    display: none;
}

.lavish-radio-btn span {
    padding: 6px 14px;
    border: 1.5px solid var(--lavish-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--lavish-text-secondary);
    transition: all var(--lavish-transition);
    white-space: nowrap;
}

.lavish-radio-btn input:checked + span {
    background: var(--lavish-accent);
    color: #fff;
    border-color: var(--lavish-accent);
}

.lavish-radio-btn:hover span {
    border-color: var(--lavish-text-secondary);
}

/* Form message */
.lavish-form-message {
    padding: 12px 16px;
    border-radius: var(--lavish-radius);
    font-size: 14px;
    margin-top: 16px;
}

.lavish-form-message.success {
    background: #f0f9f0;
    color: var(--lavish-success);
    border: 1px solid var(--lavish-success);
}

.lavish-form-message.error {
    background: #fef0f0;
    color: var(--lavish-error);
    border: 1px solid var(--lavish-error);
}

/* Write popup footer */
.lavish-write-footer {
    display: flex;
    gap: 12px;
}

.lavish-btn-submit {
    flex: 1;
    padding: 14px;
    background: var(--lavish-accent);
    color: #fff;
    border: none;
    border-radius: var(--lavish-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--lavish-transition);
}

.lavish-btn-submit:hover {
    opacity: 0.85;
}

.lavish-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lavish-btn-cancel {
    flex: 1;
    padding: 14px;
    background: var(--lavish-bg-light);
    color: var(--lavish-text-primary);
    border: 1px solid var(--lavish-border);
    border-radius: var(--lavish-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--lavish-transition);
}

.lavish-btn-cancel:hover {
    background: var(--lavish-border);
}

/* ============================================
   RESPONSIVE - Mobile bottom sheet
   ============================================ */

@media (max-width: 768px) {
    .lavish-popup-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .lavish-popup-container {
        max-height: 92vh;
        border-radius: var(--lavish-radius-lg) var(--lavish-radius-lg) 0 0;
        max-width: 100%;
    }

    .lavish-review-card {
        flex: 0 0 200px;
        min-width: 200px;
    }

    .lavish-popup-body {
        padding: 16px;
    }

    .lavish-popup-header {
        padding: 16px;
    }

    .lavish-popup-footer {
        padding: 12px 16px;
    }

    .lavish-form-group {
        margin-bottom: 14px;
    }
}

@media (max-width: 480px) {
    .lavish-review-card {
        flex: 0 0 180px;
        min-width: 180px;
    }

    .lavish-filters {
        gap: 6px;
    }

    .lavish-filter-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* ============================================
   BODY SCROLL LOCK
   ============================================ */

body.lavish-popup-open {
    overflow: hidden;
}
