/* ============================================================
   PDP reviews (#ulasan on /produk/{slug}). Started 2026-10-02 as a
   mobile-only redesign, extended to desktop the same day per user
   request: base rules below apply at every width (dark rating
   summary with breakdown bars, filter chips, review cards with
   initial avatars); the >= 768px block at the end adds the two-column
   layout. #ulasan in every selector so these outrank the page's
   inline styles in products/show.php.
   ============================================================ */

/* ---------- Section card ---------- */
.pdp-shopee #ulasan {
    margin-top: 12px !important;
    padding: 1.15rem 1.1rem 1.2rem !important;
    border: 1px solid #eef0f3 !important;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 28px -20px rgba(15, 23, 42, 0.35);
}

.pdp-shopee #ulasan .section-header {
    margin-bottom: 14px !important;
}

.pdp-shopee #ulasan .pdp-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px !important;
    padding: 0;
    border: 0;
    color: #0f172a;
    font-family: var(--font-family);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: none;
}

.pdp-shopee #ulasan .pdp-heading::before,
.pdp-shopee #ulasan .pdp-heading::after {
    display: none;
}

/* ---------- Summary: dark card, avg left, bars right ---------- */
.pdp-shopee #ulasan .pdp-shp-review-summary {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 14px 18px;
    margin: 0;
    padding: 16px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 0 16px 32px -18px rgba(15, 23, 42, 0.6);
}

.pdp-shopee #ulasan .pdp-shp-review-summary::after {
    content: '';
    position: absolute;
    top: -70px;
    left: -50px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 235, 0, 0.2), transparent);
    pointer-events: none;
}

.pdp-shopee #ulasan .pdp-shp-review-summary > .d-flex {
    position: relative;
    z-index: 1;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 4px !important;
}

.pdp-shopee #ulasan .review-avg-number {
    color: #ffeb00;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.pdp-shopee #ulasan .pdp-shp-review-summary .review-stars {
    font-size: 0.72rem;
    letter-spacing: 1px;
}

.pdp-shopee #ulasan .pdp-shp-review-summary .text-secondary {
    color: #94a3b8 !important;
    font-size: 0.72rem;
}

.pdp-shopee #ulasan .review-bars {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pdp-shopee #ulasan .review-bar-row {
    display: grid;
    grid-template-columns: 26px 1fr 16px;
    align-items: center;
    gap: 8px;
}

.pdp-shopee #ulasan .review-bar-label {
    color: #cbd5e1;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.pdp-shopee #ulasan .review-bar-label i {
    color: #fbbf24;
    font-size: 0.6rem;
}

.pdp-shopee #ulasan .review-bar-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.pdp-shopee #ulasan .review-bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #facc15, #ffeb00);
}

.pdp-shopee #ulasan .review-bar-count {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: right;
}

/* ---------- Filter chips: one swipeable row ---------- */
.pdp-shopee #ulasan .review-filter-chips {
    grid-column: 1 / -1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 -16px;
    padding: 12px 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    scrollbar-width: none;
}

.pdp-shopee #ulasan .review-filter-chips::-webkit-scrollbar {
    display: none;
}

.pdp-shopee #ulasan .review-filter-chip {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 700;
}

.pdp-shopee #ulasan .review-filter-chip i {
    color: #fbbf24;
}

.pdp-shopee #ulasan .review-filter-chip.is-active {
    border-color: #ffeb00;
    background: #ffeb00;
    color: #0f172a;
}

.pdp-shopee #ulasan .review-filter-chip.is-active i {
    color: #0f172a;
}

/* ---------- Review cards ---------- */
.pdp-shopee #ulasan .review-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdp-shopee #ulasan .review-item {
    margin: 0;
    padding: 14px;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: none;
}

.pdp-shopee #ulasan .review-item > .d-flex {
    flex-wrap: nowrap !important;
    margin-bottom: 8px !important;
}

.pdp-shopee #ulasan .review-avatar {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: hsl(var(--av-h, 45), 85%, 90%);
    color: hsl(var(--av-h, 45), 55%, 28%);
    font-size: 0.85rem;
    font-weight: 800;
}

.pdp-shopee #ulasan .review-item strong {
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
}

.pdp-shopee #ulasan .review-item > .d-flex > .text-secondary {
    flex-shrink: 0;
    color: #94a3b8 !important;
    font-size: 0.7rem;
}

/* Stars sit under the name, aligned with the text not the avatar */
.pdp-shopee #ulasan .review-item .review-stars {
    margin: 0 0 6px !important;
    font-size: 0.72rem;
    letter-spacing: 1px;
}

.pdp-shopee #ulasan .review-item p {
    margin: 0 !important;
    color: #334155;
    font-size: 0.88rem;
    line-height: 1.55;
}

.pdp-shopee #ulasan .review-item .review-photo {
    margin-top: 10px;
    border-radius: 12px;
}

/* ---------- "Lihat Semua Ulasan" ---------- */
.pdp-shopee #ulasan [data-review-expand-wrap] {
    margin-top: 12px !important;
}

.pdp-shopee #ulasan [data-review-expand-btn] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 12px -6px rgba(15, 23, 42, 0.2);
}

.pdp-shopee #ulasan .review-empty {
    padding: 1.5rem 1rem !important;
    border: 1px dashed #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

/* ---------- Desktop / tablet: two columns ----------
   Left: title + dark summary card (sticky while scrolling the list).
   Right: review cards in a 2-column grid, "Lihat Semua" under them. */
@media (min-width: 768px) {
    .pdp-shopee #ulasan {
        display: grid;
        grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
        column-gap: 2rem;
        align-items: start;
        margin-top: 1.5rem !important;
        padding: 1.75rem !important;
        border-radius: 24px;
    }

    .pdp-shopee #ulasan > .section-header {
        grid-column: 1;
        grid-row: 1 / span 4;
        position: sticky;
        top: 100px;
    }

    .pdp-shopee #ulasan > :not(.section-header) {
        grid-column: 2;
    }

    /* app.css gives .section-header "margin: 0 auto", which centers
       (and shrinks) it inside the grid column. */
    .pdp-shopee #ulasan > .section-header {
        margin: 0 !important;
        padding: 0 !important;
        text-align: left !important;
    }

    .pdp-shopee #ulasan .pdp-heading {
        justify-content: flex-start;
        font-size: 1.2rem;
        text-align: left;
        margin-bottom: 16px !important;
    }

    /* Summary stacks vertically in the narrow left column */
    .pdp-shopee #ulasan .pdp-shp-review-summary {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
    }

    .pdp-shopee #ulasan .pdp-shp-review-summary > .d-flex {
        flex-direction: row;
        align-items: center !important;
        gap: 14px !important;
    }

    .pdp-shopee #ulasan .review-avg-number {
        font-size: 3.2rem;
    }

    .pdp-shopee #ulasan .review-bar-row {
        grid-template-columns: 30px 1fr 22px;
    }

    .pdp-shopee #ulasan .review-filter-chips {
        flex-wrap: wrap;
        margin: 0;
        padding: 14px 0 0;
        overflow: visible;
    }

    .pdp-shopee #ulasan .review-filter-chip {
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s;
    }

    .pdp-shopee #ulasan .review-filter-chip:not(.is-active):hover {
        border-color: rgba(255, 255, 255, 0.4);
        background: rgba(255, 255, 255, 0.06);
    }

    /* Review cards grid */
    .pdp-shopee #ulasan .review-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        align-items: start;
    }

    .pdp-shopee #ulasan .review-list:not(.is-expanded) [data-review-collapsed] {
        display: none;
    }

    .pdp-shopee #ulasan .review-item {
        padding: 18px;
        border-radius: 18px;
        background: #ffffff;
        border: 1px solid #eef0f3;
        box-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.35);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .pdp-shopee #ulasan .review-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 32px -20px rgba(15, 23, 42, 0.45);
    }

    .pdp-shopee #ulasan .review-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }

    .pdp-shopee #ulasan .review-item p {
        font-size: 0.92rem;
    }

    .pdp-shopee #ulasan [data-review-expand-wrap] {
        margin-top: 16px !important;
        text-align: left !important;
    }

    .pdp-shopee #ulasan [data-review-expand-btn] {
        width: auto;
        padding: 10px 22px;
        cursor: pointer;
    }

    .pdp-shopee #ulasan [data-review-expand-btn]:hover {
        border-color: #0f172a;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .pdp-shopee #ulasan {
        grid-template-columns: minmax(0, 1fr);
    }

    .pdp-shopee #ulasan > .section-header {
        position: static;
        grid-row: auto;
        margin-bottom: 1.25rem !important;
    }

    .pdp-shopee #ulasan > :not(.section-header) {
        grid-column: 1;
    }
}
