/* ── Fixed side tab ── */
#fdo-reviews-tab {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9990;
    cursor: pointer;
    display: flex;
    align-items: center;
}
#fdo-reviews-tab span {
    display: block;
    background: #ff3600;
    color: #fff;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 16px 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    border-radius: 6px 0 0 6px;
    box-shadow: 2px 0 8px rgba(0,0,0,0.18);
    transition: background 0.2s;
    text-transform: uppercase;
    white-space: nowrap;
}
#fdo-reviews-tab:hover span { background: #d42f00; }

/* ── Backdrop ── */
#fdo-reviews-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9991;
    backdrop-filter: blur(1px);
}

/* ── Side panel ── */
#fdo-reviews-panel {
    position: fixed;
    left: -560px;
    top: 0;
    width: 550px;
    max-width: 96vw;
    height: 100vh;
    background: #f8f9fb;
    z-index: 9992;
    overflow-y: auto;
    transition: left 0.32s cubic-bezier(.4,0,.2,1);
    box-shadow: 6px 0 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
}
#fdo-reviews-panel.open { left: 0; }

/* panel header */
.fdo-rp-header {
    padding: 22px 24px 18px;
    background: #fff;
    border-bottom: 1px solid #eaecf0;
    flex-shrink: 0;
    position: relative;
}
.fdo-rp-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.fdo-rp-close-btn:hover { background: #f3f4f6; color: #111; }

.fdo-rp-title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0 30px 16px 0;
    letter-spacing: -0.2px;
}

/* summary + write button row */
.fdo-rp-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* summary block */
.fdo-rp-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 10px 14px;
}
.fdo-rp-avg {
    font-size: 42px;
    font-weight: 800;
    color: #15803d;
    line-height: 1;
    letter-spacing: -1px;
}
.fdo-rp-summary-right { flex: 1; }
.fdo-rp-summary-stars {
    color: #f59e0b;
    font-size: 18px;
    letter-spacing: 2px;
    line-height: 1;
    margin-bottom: 4px;
}
.fdo-rp-summary-count {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* write review button */
.fdo-rp-write-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(37,99,235,0.3);
    white-space: nowrap;
    line-height: 1.4;
}
.fdo-rp-write-btn:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(37,99,235,0.4);
    transform: translateY(-1px);
}
.fdo-rp-write-btn:active { transform: translateY(0); }
.fdo-rp-write-btn svg { flex-shrink: 0; }

/* panel loader */
#fdo-rp-loader {
    display: none;
    text-align: center;
    padding: 50px 20px;
    flex: 1;
}
.fdo-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e5e7eb;
    border-top-color: #2e7d32;
    border-radius: 50%;
    animation: fdo-spin 0.75s linear infinite;
    margin: 0 auto 14px;
}
@keyframes fdo-spin { to { transform: rotate(360deg); } }
#fdo-rp-loader p { font-size: 13px; color: #9ca3af; margin: 0; }

/* panel reviews list */
.fdo-rp-body { padding: 12px 0 24px; flex: 1; }

.fdo-rp-review-item {
    display: flex;
    gap: 13px;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s;
}
.fdo-rp-review-item:first-child { border-top: 1px solid #f0f2f5; }
.fdo-rp-review-item:hover { background: #fafbff; }

.fdo-rp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.fdo-rp-review-body { flex: 1; min-width: 0; }
.fdo-rp-reviewer-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3px;
}
.fdo-rp-reviewer-name {
    font-weight: 600;
    font-size: 13.5px;
    color: #111827;
}
.fdo-rp-review-date {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    margin-left: 8px;
}
.fdo-rp-review-stars {
    color: #f59e0b;
    font-size: 13px;
    letter-spacing: 1px;
    margin-bottom: 6px;
    line-height: 1;
}
.fdo-rp-review-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
}
.fdo-rp-verified {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}
.fdo-rp-empty {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
    font-size: 14px;
}
.fdo-rp-empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* section divider inside panel */
.fdo-rp-section-label {
    padding: 10px 24px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: #f8f9fb;
}

/* ── Load more ── */
#fdo-rp-load-more-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 24px 28px;
}
#fdo-rp-load-more-wrap::before,
#fdo-rp-load-more-wrap::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e9ecf0;
}
.fdo-rp-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: #f3f4f6;
    border: none;
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
    letter-spacing: 0.1px;
}
.fdo-rp-load-more-btn:hover {
    background: #eff6ff;
    color: #2563eb;
}
.fdo-lm-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}
.fdo-rp-load-more-btn:hover .fdo-lm-chevron {
    transform: translateY(2px);
}
.fdo-rp-load-more-spin {
    display: flex;
    justify-content: center;
    padding: 6px 0;
    width: 100%;
}
.fdo-rp-load-more-spin::after {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #2e7d32;
    border-radius: 50%;
    animation: fdo-spin 0.75s linear infinite;
}

/* ── Write a Review Modal ── */
#fdo-write-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}
#fdo-write-modal.open { display: flex; }
.fdo-wm-box {
    background: #fff;
    border-radius: 14px;
    width: 580px;
    max-width: 95vw;
    max-height: 94vh;
    overflow-y: auto;
    padding: 36px 36px 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}
.fdo-wm-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.fdo-wm-close:hover { background: #f3f4f6; color: #111; }
.fdo-wm-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}
.fdo-wm-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 24px;
}
.fdo-wm-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.fdo-wm-required { color: #ef4444; }
.fdo-wm-field { margin-bottom: 18px; }
.fdo-wm-input {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 13px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
    background: #fafafa;
    color: #111;
}
.fdo-wm-input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.fdo-wm-row { display: flex; gap: 14px; }
.fdo-wm-row .fdo-wm-field { flex: 1; }

.fdo-wm-stars-wrap { display: flex; gap: 6px; margin-bottom: 4px; }
.fdo-wm-star {
    font-size: 32px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.1s, transform 0.1s;
    line-height: 1;
    user-select: none;
}
.fdo-wm-star.hovered,
.fdo-wm-star.selected { color: #f59e0b; }
.fdo-wm-star:hover    { transform: scale(1.2); }
.fdo-wm-err { display: none; font-size: 12px; color: #ef4444; margin-top: 5px; }
.fdo-wm-char-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
    min-height: 18px;
}
.fdo-wm-char-counter {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 8px;
}
.fdo-wm-char-num { font-weight: 600; transition: color 0.2s; }
.fdo-wm-char-sep { color: #d1d5db; }
.fdo-wm-char-hint { color: #9ca3af; }
.fdo-wm-err-box {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #b91c1c;
    margin-bottom: 16px;
}
.fdo-wm-divider { border: none; border-top: 1px solid #f3f4f6; margin: 4px 0 18px; }
.fdo-wm-submit {
    width: 100%;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px 0;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.fdo-wm-submit:hover    { background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%); box-shadow: 0 4px 14px rgba(37,99,235,0.4); }
.fdo-wm-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.fdo-wm-success {
    display: none;
    text-align: center;
    padding: 24px 0 12px;
}
.fdo-wm-success-icon {
    width: 64px;
    height: 64px;
    background: #f0fdf4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 30px;
    color: #16a34a;
}
.fdo-wm-success h4 { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 8px; }
.fdo-wm-success p  { font-size: 14px; color: #6b7280; line-height: 1.55; margin-bottom: 20px; }
.fdo-wm-success-close {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.fdo-wm-success-close:hover { background: #1d4ed8; }
