/* =============================================================
   Kinetic Ultra — Reviews Modal
   Design tokens: surface stack, cyan primary, glassmorphism
   ============================================================= */

/* .k-link used on a <button> — strip native button chrome */
button.k-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

/* ---- Overlay ---- */
.k-reviews-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.k-reviews-modal[hidden] {
    display: none;
}

.k-rm__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ---- Panel (glassmorphism) ---- */
.k-rm__panel {
    position: relative;
    z-index: 1;
    background: rgba(19, 19, 25, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(72, 71, 77, 0.12); /* outline_variant @12% */
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: k-rm-in 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes k-rm-in {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ---- Header ---- */
.k-rm__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1.125rem;
    border-bottom: 1px solid rgba(72, 71, 77, 0.12);
    flex-shrink: 0;
}

.k-rm__title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1875rem;
    font-weight: 700;
    color: #f9f5fd;
    margin: 0.25rem 0 0.5rem;
    line-height: 1.25;
}

.k-rm__summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.k-rm__avg {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #f9f5fd;
    line-height: 1;
}

.k-rm__total {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: #acaab1;
}

.k-rm__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    background: #1f1f26;
    border: none;
    color: #acaab1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.k-rm__close:hover {
    background: #25252d;
    color: #f9f5fd;
}

/* ---- Scrollable body ---- */
.k-rm__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #25252d transparent;
}

.k-rm__body::-webkit-scrollbar { width: 4px; }
.k-rm__body::-webkit-scrollbar-thumb { background: #25252d; border-radius: 4px; }

/* ---- State messages ---- */
.k-rm__loading,
.k-rm__empty,
.k-rm__error {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    color: #acaab1;
    text-align: center;
    padding: 3rem 1rem;
}
.k-rm__error { color: #ff716c; }

/* ---- Review list ---- */
.k-rm__list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.k-rm__item {
    background: #131319;
    border-radius: 12px;
    padding: 1.125rem 1.25rem;
    transition: background 0.15s;
}

.k-rm__item:hover {
    background: #19191f;
}

.k-rm__item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.k-rm__meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.k-rm__author {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #f9f5fd;
}

.k-rm__date {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: #76747b;
}

.k-rm__verified {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--k-cyan, #00D4FF);
    background: rgba(0, 212, 255, 0.08);
    border-radius: 4px;
    padding: 2px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.k-rm__content {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: #acaab1;
}

.k-rm__content p { margin: 0 0 0.5em; }
.k-rm__content p:last-child { margin-bottom: 0; }

/* Stars inside modal */
.k-reviews-modal .k-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ---- Pagination ---- */
.k-rm__pagination { margin-top: 0.25rem; }

.k-rm__pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.k-rm__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: 8px;
    border: none;
    background: #1f1f26;
    color: #acaab1;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.k-rm__page:hover {
    background: #25252d;
    color: #f9f5fd;
}

.k-rm__page.is-active {
    background: linear-gradient(135deg, #00D4FF, #7B61FF);
    color: #0a0a0f;
    font-weight: 600;
    cursor: default;
}

.k-rm__page--arrow { color: #76747b; }

.k-rm__page-dots {
    color: #76747b;
    font-size: 0.875rem;
    padding: 0 0.25rem;
    line-height: 36px;
    user-select: none;
}

/* ---- Mobile: bottom sheet ---- */
@media (max-width: 600px) {
    .k-reviews-modal {
        align-items: flex-end;
        padding: 0;
    }

    .k-rm__panel {
        max-height: 92vh;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }
}
