/* ============================================================
   VLK Google Reviews Summary – Frontend v2.1
   Trustindex-style compact bar + hover popup
   ============================================================ */

/* ---- Wrapper: the single hover zone ---- */
.vlk-grs-wrapper {
    position:    relative;
    display:     inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1;
    /* High z-index so popup always floats above theme content */
    z-index:     9999;
}

/* ============================================================
   BAR  (div acting as button – click opens write-review)
   ============================================================ */
.vlk-grs-bar {
    display:         inline-flex;
    align-items:     center;
    gap:             8px;
    height:          40px;
    padding:         0 12px 0 10px;
    background:      #ffffff;
    border:          1px solid #dadce0;
    border-radius:   4px;
    cursor:          pointer;
    white-space:     nowrap;
    transition:      box-shadow 0.2s ease, transform 0.18s ease;
    box-shadow:      0 1px 3px rgba(0,0,0,.08);
    /* Reset any theme <a> styles that might leak in */
    text-decoration: none;
    color:           inherit;
    user-select:     none;
}
.vlk-grs-bar:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.14);
    transform:  translateY(-1px);
}

/* Google logo */
.vlk-grs-logo-wrap {
    display:     flex;
    align-items: center;
    flex-shrink: 0;
}
.vlk-grs-logo {
    width:   62px;
    height:  auto;
    display: block;
}

/* Stars row inside bar */
.vlk-grs-bar-stars {
    display:     flex;
    align-items: center;
    flex-shrink: 0;
}
.vlk-grs-stars {
    display:     inline-flex;
    align-items: center;
}

/* Score */
.vlk-grs-bar-score {
    font-size:   14px;
    font-weight: 600;
    color:       #202124;
    flex-shrink: 0;
}

/* Count */
.vlk-grs-bar-count {
    font-size:  13px;
    color:      #5f6368;
    flex-shrink: 0;
}

/* Chevron */
.vlk-grs-chevron {
    display:       inline-block;
    width:         7px;
    height:        7px;
    border-right:  2px solid #5f6368;
    border-bottom: 2px solid #5f6368;
    transform:     rotate(-45deg) translateY(1px);
    flex-shrink:   0;
    transition:    transform 0.25s ease;
    margin-left:   2px;
}
/* Rotate chevron when popup is open */
.vlk-grs-wrapper:hover .vlk-grs-chevron {
    transform: rotate(45deg) translateY(-1px);
}

/* ============================================================
   POPUP
   IMPORTANT: starts as display:none – JS sets display:block
   then adds --visible class for the CSS fade/slide transition.
   ============================================================ */
.vlk-grs-popup {
    display:       none;   /* JS will set display:block first */
    opacity:       0;
    position:      absolute;
    top:           100%;   /* flush against bottom of bar – NO gap */
    left:          0;
    width:         320px;
    max-height:    520px;
    padding-bottom: 10px;
    overflow-y:    auto;
    background:    #f8faf9;
    border:        1px solid #dadce0;
    border-top:    none;   /* merge visually with bar */
    border-radius: 0 0 10px 10px;
    box-shadow:    0 8px 28px rgba(0,0,0,.18);
    z-index:       99999;  /* above everything */
    transform:     translateY(-4px);
    transition:    opacity 0.2s ease, transform 0.2s ease;
    scrollbar-width: thin;
    scrollbar-color: #dadce0 transparent;
}
.vlk-grs-popup--visible {
    opacity:   1;
    transform: translateY(0);
}
.vlk-grs-popup::-webkit-scrollbar       { width: 4px; }
.vlk-grs-popup::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 2px; }

/* Popup header */
.vlk-grs-popup-header {
    display:       flex;
    align-items:   center;
    gap:           6px;
    padding:       11px 14px 10px;
    border-bottom: 1px solid #e8eaed;
    background:    #fff;
    flex-wrap:     wrap;
}
.vlk-grs-popup-avg {
    font-size:   20px;
    font-weight: 700;
    color:       #202124;
}
.vlk-grs-popup-total {
    font-size:  12px;
    color:      #5f6368;
    margin-left: auto;
}

/* Individual review row */
.vlk-grs-review-item {
    display:       flex;
    gap:           10px;
    align-items:   flex-start;
    padding:       10px 14px;
    border-bottom: 1px solid #eef0f2;
    background:    transparent;
}
.vlk-grs-review-item:last-of-type { border-bottom: none; }

.vlk-grs-review-avatar {
    width:         40px;
    height:        40px;
    border-radius: 50%;
    object-fit:    cover;
    flex-shrink:   0;
    border:        1px solid #e8eaed;
}

.vlk-grs-review-body   { flex: 1; min-width: 0; }
.vlk-grs-review-top-row {
    display:       flex;
    align-items:   baseline;
    gap:           6px;
    flex-wrap:     wrap;
    margin-bottom: 2px;
}
.vlk-grs-review-author {
    font-size:     13px;
    font-weight:   600;
    color:         #202124;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
    max-width:     145px;
}
.vlk-grs-review-date {
    font-size:   11px;
    color:       #9aa0a6;
    margin-left: auto;
    flex-shrink: 0;
}
.vlk-grs-review-stars-row {
    display:       flex;
    align-items:   center;
    margin-bottom: 3px;
}
.vlk-grs-review-text {
    font-size:              12px;
    line-height:            1.5;
    color:                  #3c4043;
    margin:                 0;
    display:                -webkit-box;
    -webkit-line-clamp:     3;
    -webkit-box-orient:     vertical;
    overflow:               hidden;
}

/* Popup footer */
.vlk-grs-popup-footer {
    padding:       9px 14px;
    text-align:    center;
    border-top:    1px solid #e8eaed;
    background:    #fff;
    border-radius: 0 0 10px 10px;
}
.vlk-grs-popup-footer a {
    font-size:       13px;
    font-weight:     600;
    color:           #1a73e8;
    text-decoration: none;
}
.vlk-grs-popup-footer a:hover {
    text-decoration: underline;
    color:           #1558b0;
}

/* ============================================================
   KARUSSELL-MODUS
   ============================================================ */
.vlk-grs-wrapper--carousel {
    display: block;
    width:   100%;
    z-index: auto;
}
.vlk-grs-wrapper--carousel .vlk-grs-bar { display: inline-flex; }
.vlk-grs-wrapper--carousel .vlk-grs-chevron { display: none; }

.vlk-grs-carousel {
    position:   relative;
    margin-top: 14px;
    padding:    0 22px;
}
.vlk-grs-car-track {
    display:                 flex;
    gap:                     14px;
    overflow-x:              auto;
    scroll-snap-type:        x mandatory;
    scroll-behavior:         smooth;
    scrollbar-width:         none;
    -webkit-overflow-scrolling: touch;
    padding:                 4px 2px 8px;
}
.vlk-grs-car-track::-webkit-scrollbar { display: none; }
.vlk-grs-car-track:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }

.vlk-grs-car-card {
    flex:             0 0 calc((100% - 28px) / 3);
    min-width:        240px;
    scroll-snap-align: start;
    box-sizing:       border-box;
    padding:          14px;
    background:       #fff;
    border:           1px solid #dadce0;
    border-radius:    8px;
    box-shadow:       0 1px 3px rgba(0,0,0,.08);
}
@media (max-width: 767px) {
    .vlk-grs-car-card { flex-basis: 85%; }
}
.vlk-grs-car-head {
    display:       flex;
    align-items:   center;
    gap:           10px;
    margin-bottom: 8px;
}
.vlk-grs-car-head .vlk-grs-review-author { display: block; max-width: 100%; }
.vlk-grs-car-date { display: block; margin-left: 0; margin-top: 2px; }
.vlk-grs-car-text {
    margin:      8px 0 0;
    font-size:   13px;
    line-height: 1.5;
    color:       #3c4043;
    display:     -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow:    hidden;
}
.vlk-grs-car-btn {
    position:      absolute;
    top:           50%;
    transform:     translateY(-50%);
    width:         34px;
    height:        34px;
    padding:       0;
    border:        1px solid #dadce0;
    border-radius: 50%;
    background:    #fff;
    color:         #202124;
    font-size:     22px;
    line-height:   30px;
    cursor:        pointer;
    box-shadow:    0 2px 6px rgba(0,0,0,.15);
    z-index:       2;
}
.vlk-grs-car-btn:hover { background: #f1f3f4; }
.vlk-grs-car-prev { left: -4px; }
.vlk-grs-car-next { right: -4px; }
.vlk-grs-car-footer { margin-top: 8px; text-align: center; }
.vlk-grs-car-footer a { font-size: 13px; font-weight: 600; color: #1a73e8; text-decoration: none; }
.vlk-grs-car-footer a:hover { text-decoration: underline; }
