/* ── Roller.pk Daraz Reviews Widget ── */

.rp-dr-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.rp-dr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #fff8f0;
    border: 1px solid #ffe0c0;
    border-radius: 10px;
    padding: 18px 24px;
    margin-bottom: 28px;
}
.rp-dr-header-stars {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rp-dr-big-stars {
    font-size: 28px;
    color: #f5a623;
    letter-spacing: 2px;
}
.rp-dr-big-count {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}
.rp-dr-header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #666;
    font-size: 14px;
}
.rp-dr-daraz-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #F85606;
    color: #fff !important;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: opacity .15s;
}
.rp-dr-daraz-link:hover { opacity: .85; }

/* Homepage header variant */
.rp-dr-header-home {
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e8 100%);
    border-color: #f5a623;
}
.rp-dr-header-home .rp-dr-big-count {
    font-size: 18px;
}

/* Grid */
.rp-dr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

/* Card */
.rp-dr-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.rp-dr-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
}

/* Card top row */
.rp-dr-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}
.rp-dr-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
}
.rp-dr-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.rp-dr-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
    font-size: 16px;
}
.rp-dr-meta {
    flex: 1;
    min-width: 0;
}
.rp-dr-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}
.rp-dr-date {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.rp-dr-stars {
    flex-shrink: 0;
    font-size: 16px;
    letter-spacing: 1px;
}
.rp-dr-stars .filled { color: #f5a623; }
.rp-dr-stars .empty  { color: #ddd; }

/* Content */
.rp-dr-content {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    flex: 1;
}

/* Images */
.rp-dr-images {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.rp-dr-img-link {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.rp-dr-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s;
}
.rp-dr-img-link:hover img { transform: scale(1.06); }

/* Card footer */
.rp-dr-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.rp-dr-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #F85606 !important;
    text-decoration: none;
    font-weight: 600;
    opacity: .8;
}
.rp-dr-badge:hover { opacity: 1; }

/* Bottom link */
.rp-dr-footer-link {
    text-align: center;
    padding: 8px 0 20px;
}
.rp-dr-footer-link a {
    color: #F85606;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}
.rp-dr-footer-link a:hover { text-decoration: underline; }

/* ── Lightbox ── */
.rp-dr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rp-dr-lightbox-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.88);
    cursor: pointer;
}
.rp-dr-lightbox-img {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    object-fit: contain;
}
.rp-dr-lightbox-close,
.rp-dr-lightbox-prev,
.rp-dr-lightbox-next {
    position: absolute;
    z-index: 2;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    padding: 0;
}
.rp-dr-lightbox-close { top: 16px; right: 16px; font-size: 24px; }
.rp-dr-lightbox-prev  { left: 16px; }
.rp-dr-lightbox-next  { right: 16px; }
.rp-dr-lightbox-close:hover,
.rp-dr-lightbox-prev:hover,
.rp-dr-lightbox-next:hover { background: rgba(255,255,255,.3); }

/* Tab reviews grid — slightly tighter than shortcode grid */
.rp-dr-tab-grid {
    margin-top: 32px;
}

/* Responsive */
@media (max-width: 600px) {
    .rp-dr-grid { grid-template-columns: 1fr; }
    .rp-dr-header { flex-direction: column; align-items: flex-start; }
    .rp-dr-big-count { font-size: 16px; }
    .rp-dr-lightbox-prev { left: 8px; }
    .rp-dr-summary { flex-direction: column; align-items: flex-start; gap: 20px; }
    .rp-dr-summary-action { margin-left: 0; width: 100%; }
    .rp-dr-write-btn { width: 100%; }
    .rp-dr-lightbox-next { right: 8px; }
}

/* ── Tab wrapper ── */
.rp-dr-tab-wrap {
    max-width: 100%;
    padding: 28px 0 0;
}

/* ── Summary Row ── */
.rp-dr-summary {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    padding-bottom: 28px;
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 0;
}
.rp-dr-summary-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 120px;
}
.rp-dr-summary-avg {
    font-size: 48px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}
.rp-dr-summary-stars {
    font-size: 22px;
    letter-spacing: 2px;
}
.rp-dr-summary-stars .filled { color: #f5a623; }
.rp-dr-summary-stars .empty  { color: #ddd; }
.rp-dr-summary-based {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

/* Bar chart */
.rp-dr-summary-bars {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rp-dr-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #555;
}
.rp-dr-bar-label {
    width: 30px;
    flex-shrink: 0;
    text-align: right;
}
.rp-dr-bar-track {
    flex: 1;
    height: 10px;
    background: #ebebeb;
    border-radius: 6px;
    overflow: hidden;
}
.rp-dr-bar-fill {
    height: 100%;
    background: #f5a623;
    border-radius: 6px;
    transition: width .4s;
}
.rp-dr-bar-count {
    width: 20px;
    flex-shrink: 0;
    color: #888;
}

/* Write a review button */
.rp-dr-summary-action {
    margin-left: auto;
    flex-shrink: 0;
}
.rp-dr-write-btn {
    background: #3bb54a;
    color: #fff;
    border: none;
    padding: 13px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    white-space: nowrap;
}
.rp-dr-write-btn:hover { opacity: .88; }

/* ── Review Form (hidden panel) ── */
.rp-dr-form-wrap {
    padding: 28px;
    background: #f9f9f9;
    border-bottom: 1px solid #e8e8e8;
    max-width: 600px;
    margin: 0 auto 32px;
}
.rp-dr-form-title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
}
.rp-dr-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    justify-content: center;
}
.rp-dr-cancel-btn {
    background: transparent;
    color: #555;
    border: 1px solid #ccc;
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s;
}
.rp-dr-cancel-btn:hover { border-color: #999; }

/* ── Native Review Submission Form ── */
.rp-dr-submit-note {
    font-size: 13px;
    color: #666;
    margin: 0 0 20px;
    text-align: center;
}
.rp-dr-field {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rp-dr-field label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}
.rp-dr-field input[type="text"],
.rp-dr-field textarea {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .2s;
}
.rp-dr-field input[type="text"]:focus,
.rp-dr-field textarea:focus {
    border-color: #F85606;
    outline: none;
}
.rp-dr-file-input { font-size: 13px; }

/* Star picker */
.rp-dr-star-pick { margin-bottom: 18px; }
.rp-dr-star-pick label { font-size: 13px; font-weight: 600; color: #333; display: block; margin-bottom: 8px; }
.rp-dr-star-row { display: flex; gap: 6px; }
.rp-dr-sp-star {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: color .15s, transform .15s;
    line-height: 1;
}
.rp-dr-sp-star.active,
.rp-dr-sp-star.hover { color: #f5a623; }
.rp-dr-sp-star:hover { transform: scale(1.15); }

.rp-dr-submit-btn {
    background: #F85606;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    margin-top: 4px;
}
.rp-dr-submit-btn:hover { opacity: .88; }
.rp-dr-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

.rp-dr-submit-status {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
}
.rp-dr-submit-status.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.rp-dr-submit-status.error   { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }

/* ── Marquee / Auto-scroll Reviews ── */

.rp-dr-marquee-section {
    padding: 32px 0 40px;
    background: #fff8f0;
    border-top: 1px solid #ffe0c0;
    border-bottom: 1px solid #ffe0c0;
    overflow: hidden;
}

/* Header row */
.rp-dr-marquee-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 24px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.rp-dr-mq-stars {
    font-size: 22px;
    color: #f5a623;
    letter-spacing: 2px;
    flex-shrink: 0;
}
.rp-dr-mq-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}
.rp-dr-mq-count {
    font-size: 13px;
    color: #888;
    margin-left: 4px;
}
.rp-dr-mq-daraz-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #F85606;
    color: #fff !important;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: opacity .15s;
    flex-shrink: 0;
}
.rp-dr-mq-daraz-link:hover { opacity: .85; }
.rp-dr-d-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #fff;
    color: #F85606;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
}

/* Scrolling track */
.rp-dr-marquee-outer {
    overflow: hidden;
    width: 100%;
    /* Fade edges */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 6%, black 94%, transparent 100%);
}
.rp-dr-marquee-track {
    display: flex;
    gap: 16px;
    width: max-content;
    animation: rp-dr-scroll linear infinite;
    /* duration set inline per instance */
}
.rp-dr-marquee-track:hover {
    animation-play-state: paused;
}

@keyframes rp-dr-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Individual marquee card */
.rp-dr-mq-card {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: box-shadow .2s;
}
.rp-dr-mq-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.13);
}

/* Hero image — top of card, tall */
.rp-dr-mq-card-img {
    width: 100%;
    height: 220px;
    overflow: hidden;
    flex-shrink: 0;
}
.rp-dr-mq-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.rp-dr-mq-card:hover .rp-dr-mq-card-img img {
    transform: scale(1.04);
}

/* Body below image */
.rp-dr-mq-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}

/* Stars */
.rp-dr-mq-card-stars { font-size: 15px; letter-spacing: 1px; }
.rp-dr-mq-card-stars .f { color: #f5a623; }
.rp-dr-mq-card-stars .e { color: #ddd; }

/* Review text — clamp to 3 lines */
.rp-dr-mq-card-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: #444;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Footer */
.rp-dr-mq-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f5f5f5;
    padding-top: 8px;
    margin-top: auto;
    font-size: 11px;
    gap: 6px;
}
.rp-dr-mq-product {
    color: #F85606;
    font-weight: 700;
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.rp-dr-mq-date {
    color: #bbb;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .rp-dr-marquee-header { flex-direction: column; align-items: flex-start; }
    .rp-dr-mq-daraz-link  { margin-left: 0; }
    .rp-dr-mq-card        { width: 200px; }
    .rp-dr-mq-card-img    { height: 180px; }
}

/* Lightbox link wrapper in marquee — must not break image layout */
.rp-dr-mq-card-img a.rp-dr-img-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}
.rp-dr-mq-card-img a.rp-dr-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.rp-dr-mq-card:hover .rp-dr-mq-card-img a.rp-dr-img-link img {
    transform: scale(1.04);
}
