/* ── Review images: base (upload preview + inline fallback) ── */
.wc-review-images,
#wc-rai-preview {
    margin-top: 8px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Thumbnail defaults ── */
.wc-review-image,
.wc-rai-thumb img {
    border-radius: 6px;
    width: 150px;
    height: 150px !important;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.wc-review-image:hover,
.wc-rai-thumb img:hover {
    cursor: pointer;
    opacity: 0.85;
}

/* ── AliExpress-style review row layout ── */
/* Each review: flex row — text left, images right */
li.review .comment_container {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 20px;
}

/* Text block fills remaining space */
li.review .comment_container .comment-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Images panel on the right — fixed width, wraps into grid */
li.review .comment_container > .wc-review-images {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    width: 316px;   /* fits 2 × 150px thumbnails + gap */
    align-content: flex-start;
    margin-top: 0;
}

/* Mobile: stack images below text */
@media (max-width: 600px) {
    li.review .comment_container {
        flex-direction: column !important;
    }

    li.review .comment_container > .wc-review-images {
        width: 100%;
        flex-direction: row;
    }
}

/* ── Lightbox ── */
.wc-ri-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    cursor: zoom-out;
}

.wc-ri-lightbox-image {
    max-width: 95%;
    max-height: 95%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.wc-ri-lightbox-fade-in  { animation: wcRiFadeIn  0.2s ease-out forwards; }
.wc-ri-lightbox-fade-out { animation: wcRiFadeOut 0.2s ease-in  forwards; }
.wc-ri-lightbox-zoom-in  { animation: wcRiZoomIn  0.25s ease-out forwards; }

@keyframes wcRiFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes wcRiFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes wcRiZoomIn  { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Upload form ── */
.wc-rai-thumb {
    position: relative;
}

.remove-rai {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.remove-rai:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.wc-rai-upload-box input[type="file"] {
    display: none;
}

.wc-rai-upload-box {
    width: 120px;
    height: 120px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.wc-rai-upload-box:hover {
    border-color: #888;
}

.wc-rai-upload-text {
    font-size: 40px;
    color: #aaa;
    line-height: 1;
    user-select: none;
}

/* ── Load-more button ── */
.wcri-load-more {
    display: block;
    margin: 20px auto 0;
    padding: 10px 28px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.wcri-load-more:hover {
    border-color: #555;
    color: #222;
}
