/**
 *  2026 ALGO-FACTORY.COM
 *
 *  @author        Algo Factory <contact@algo-factory.com>
 *  @copyright     Copyright (c) 2026 Algo Factory
 *  @license       You are just allowed to modify this copy for your own use.
 *
 *  "Google" display theme - native Google reviews look.
 *  All selectors are namespaced with .afgrg to avoid any collision
 *  with the classic theme stylesheet (front.css) or the shop theme.
 */

.afgrg {
    --afgrg-text: #202124;
    --afgrg-muted: #5f6368;
    --afgrg-star: #fbbc04;
    --afgrg-star-off: #dadce0;
    --afgrg-border: #dadce0;
    --afgrg-blue: #1a73e8;
    color: var(--afgrg-text);
    font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

#afgrgContainer {
    max-width: 1140px;
    margin: 0 auto;
    padding: 24px 12px;
}

/* ---------- Stars (inline SVG) ---------- */
.afgrg-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.afgrg-stars svg {
    width: 1em;
    height: 1em;
    flex: none;
    fill: var(--afgrg-star);
}

.afgrg-stars svg.afgrg-star-empty {
    fill: var(--afgrg-star-off);
}

.afgrg-stars svg.afgrg-star-half .afgrg-star-bg {
    fill: var(--afgrg-star-off);
}

.afgrg-stars svg.afgrg-star-half .afgrg-star-fg {
    fill: var(--afgrg-star);
    clip-path: inset(0 50% 0 0);
}

/* ---------- Summary block ---------- */
.afgrg-summary-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 28px;
    margin-bottom: 24px;
}

.afgrg-note {
    display: flex;
    align-items: center;
    gap: 14px;
}

.afgrg-big-rating {
    font-size: 52px;
    font-weight: 400;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.afgrg-note-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.afgrg-note-meta .afgrg-stars {
    font-size: 20px;
}

.afgrg-count {
    color: var(--afgrg-muted);
    font-size: 14px;
    text-decoration: none;
}

.afgrg-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--afgrg-muted);
}

.afgrg-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

.afgrg-btn,
.afgrg-btn:visited {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 24px;
    padding: 9px 20px;
    border: 1px solid var(--afgrg-border);
    color: var(--afgrg-blue);
    background: #fff;
    transition: background .15s;
}

.afgrg-btn:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: var(--afgrg-blue);
}

.afgrg-btn.afgrg-btn-primary,
.afgrg-btn.afgrg-btn-primary:visited {
    background: var(--afgrg-blue);
    border-color: var(--afgrg-blue);
    color: #fff;
}

.afgrg-btn.afgrg-btn-primary:hover {
    background: #1765cc;
    color: #fff;
}

/* ---------- Review card ---------- */
.afgrg-card {
    background: #fff;
    border: 1px solid var(--afgrg-border);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow .15s;
}

.afgrg-card:hover {
    box-shadow: 0 1px 6px rgba(60, 64, 67, .18);
}

.afgrg-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.afgrg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex: none;
    object-fit: cover;
}

.afgrg-avatar-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
}

.afgrg-author {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.afgrg-author a,
.afgrg-author a:visited {
    color: var(--afgrg-text);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afgrg-author a:hover {
    text-decoration: underline;
    color: var(--afgrg-text);
}

.afgrg-date {
    color: var(--afgrg-muted);
    font-size: 12px;
}

.afgrg-card-head .afgrg-glogo {
    margin-left: auto;
    flex: none;
}

.afgrg-card .afgrg-stars {
    font-size: 15px;
}

.afgrg-text {
    font-size: 14px;
    color: var(--afgrg-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.afgrg-text.afgrg-open {
    display: block;
}

.afgrg-more {
    align-self: flex-start;
    background: none;
    border: 0;
    padding: 0;
    color: var(--afgrg-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
}

.afgrg-more:hover {
    color: var(--afgrg-text);
}

/* ---------- Carousel (native scroll snap, no slick needed) ---------- */
.afgrg-layout {
    display: flex;
    align-items: center;
    gap: 28px;
}

.afgrg-side {
    flex: 0 0 260px;
}

.afgrg-side .afgrg-summary-inner {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0;
}

.afgrg-side .afgrg-actions {
    margin-left: 0;
}

.afgrg-main {
    flex: 1;
    min-width: 0;
}

.afgrg-carousel {
    position: relative;
}

.afgrg-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(300px, 82%);
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px;
    margin: -4px;
    scrollbar-width: none;
}

.afgrg-track::-webkit-scrollbar {
    display: none;
}

.afgrg-track > .afgrg-card {
    scroll-snap-align: start;
}

.afgrg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--afgrg-border);
    color: var(--afgrg-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(60, 64, 67, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.afgrg-nav:hover {
    color: var(--afgrg-text);
}

.afgrg-prev {
    left: -14px;
}

.afgrg-next {
    right: -14px;
}

/* ---------- Grid and list ---------- */
.afgrg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.afgrg-grid.afgrg-list {
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
}

/* ---------- Floating badge ---------- */
.afgrg-float {
    position: fixed;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--afgrg-border);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(60, 64, 67, .22);
    padding: 12px 16px;
}

.afgrg-float.bottom-right {
    bottom: 16px;
    right: 16px;
}

.afgrg-float.bottom-left {
    bottom: 16px;
    left: 16px;
}

.afgrg-float.top-right {
    top: 16px;
    right: 16px;
}

.afgrg-float.top-left {
    top: 16px;
    left: 16px;
}

.afgrg-float-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.afgrg-float-rating {
    font-size: 26px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.afgrg-float-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.afgrg-float-col .afgrg-stars {
    font-size: 13px;
}

.afgrg-float-col .afgrg-count {
    font-size: 12px;
}

.afgrg-float-col .afgrg-count:hover {
    text-decoration: underline;
}

.afgrg-float-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--afgrg-border);
    background: #fff;
    color: var(--afgrg-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
    .afgrg-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .afgrg-side {
        flex: none;
    }

    .afgrg-summary-inner {
        gap: 14px;
    }

    .afgrg-actions {
        margin-left: 0;
    }

    .afgrg-nav {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .afgrg-card,
    .afgrg-btn {
        transition: none;
    }

    .afgrg-track {
        scroll-behavior: auto;
    }
}
