/* Hodnocení zákazníků (.ratings-in) – blok šablony Paxio Merkur na HP i detailu.
   Obsah plní merkur.js z /cache/hodnoceni-obchodu/, carousel přidává hodnoceni.js. */

.ratings .ratings-in {
    --hz-text: #24242e;
    --hz-muted: #74747f;
    --hz-border: #ebebf0;
    --hz-star: #f5a524;
    padding-top: 56px;
    padding-bottom: 56px;
}

/* Hlavička: velké skóre vlevo, nadpis + počet a odkaz vedle */
.ratings .r-top {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.ratings .r-number {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.ratings .r-number:empty {
    display: none;
}

.ratings .r-number .rate-average {
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    color: var(--color-primary);
    font-size: 56px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

.ratings .r-nadpis {
    width: auto;
    min-width: 0;
}

.ratings .r-nadpis h4 {
    margin: 0 0 4px;
    color: var(--hz-text);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.ratings .r-nadpis > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    color: var(--hz-muted);
    font-size: 14px;
    line-height: 1.5;
}

.ratings .r-nadpis .stars-label {
    font-size: inherit;
    line-height: inherit;
}

/* Tečka šablony za počtem → oddělovač „·" */
.ratings .r-nadpis > div > span::after {
    content: "·";
    margin: 0 8px;
}

.ratings .r-nadpis > div > span:empty::after {
    content: none;
}

.ratings .r-nadpis > div > a {
    margin-left: 0;
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ratings .r-nadpis > div > a:hover {
    text-decoration: none;
}

/* Karty */
.ratings .r-bottom .votes-wrap {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    margin: 0;
}

.ratings .r-bottom .vote-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    width: auto;
    height: auto;
    visibility: visible;
    margin: 0;
    padding: 56px 24px 24px !important;
    background: #fff;
    border: 1px solid var(--hz-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
}

.ratings .r-bottom .vote-wrap:nth-child(n+5) {
    display: none;
}

.ratings .r-bottom .stars {
    top: 24px;
    left: 24px;
}

.ratings .r-bottom .stars span {
    width: 18px;
    height: 16px;
}

.ratings .r-bottom .stars span::before {
    font-size: 16px;
    line-height: 16px;
}

.ratings .r-bottom .stars .star.star-on::before,
.ratings .r-bottom .stars .star.star-half::before {
    color: var(--hz-star);
}

/* Citace: kurzíva v uvozovkách, max. 3 řádky – karty mají stejnou výšku podle
   nejdelší ze všech (i neviditelných v carouselu), víc řádků = prázdné karty */
.ratings .r-bottom .vote-content {
    order: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--hz-text);
    font-size: 15px;
    font-style: italic;
    line-height: 1.65;
}

/* Šablona text odsazuje bílými znaky – float zahodí mezeru za „,
   záporný okraj (šířka mezery) tu před " */
.ratings .r-bottom .vote-content::before {
    content: "„";
    float: left;
}

.ratings .r-bottom .vote-content::after {
    content: "\201C";
    margin-left: -.26em;
}

/* Jméno a datum dole, zarovnané napříč kartami */
.ratings .r-bottom .vote-header {
    order: 2;
    display: block;
    width: 100%;
    margin-top: auto;
    padding-top: 20px;
}

.ratings .r-bottom .vote-header::before,
.ratings .r-bottom .vote-pic {
    display: none;
}

.ratings .r-bottom .vote-name {
    margin: 0 0 2px;
    color: var(--hz-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.ratings .r-bottom .vote-time {
    margin: 0;
    color: var(--hz-muted);
    font-size: 13px;
    line-height: 1.4;
}

/* Tablet: 2 × 2 (šablona jinak od 3. karty schovává) */
@media screen and (max-width: 991px) {
    .ratings .r-bottom .votes-wrap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ratings .r-bottom .vote-wrap {
        width: auto;
    }

    .ratings .r-bottom .vote-wrap:nth-child(n+3) {
        visibility: visible;
        height: auto;
        padding: 56px 24px 24px !important;
    }

    .ratings .r-bottom .vote-wrap:nth-child(n+5) {
        display: none;
    }
}

/* Mobil: posouvání prstem, další karta vykukuje. Šablona (five-only) vkládá
   4 karty, strop 8 je jen pojistka. */
@media screen and (max-width: 767px) {
    .ratings .ratings-in {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .ratings .r-top {
        gap: 16px;
        margin-bottom: 24px;
    }

    .ratings .r-number .rate-average {
        font-size: 44px;
    }

    .ratings .r-nadpis h4 {
        font-size: 19px;
    }

    .ratings .r-bottom .votes-wrap {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 82%;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 12px;
        overscroll-behavior-x: contain;
        /* záporný okraj = karty jedou až ke kraji displeje; padding drží stín */
        margin: -4px -12px 0;
        padding: 4px 12px 16px;
        scrollbar-width: none;
    }

    .ratings .r-bottom .votes-wrap::-webkit-scrollbar {
        display: none;
    }

    .ratings .r-bottom .vote-wrap,
    .ratings .r-bottom .vote-wrap:first-child,
    .ratings .r-bottom .vote-wrap:nth-child(n+3),
    .ratings .r-bottom .vote-wrap:nth-child(n+5) {
        display: flex;
        width: auto;
        margin: 0;
        padding: 52px 20px 20px !important;
        scroll-snap-align: start;
    }

    .ratings .r-bottom .vote-wrap:nth-child(n+9) {
        display: none;
    }

    .ratings .r-bottom .stars {
        top: 20px;
        left: 20px;
    }

    .ratings .r-bottom .vote-content {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        width: auto !important;
    }

    .ratings .r-bottom .vote-header {
        display: block !important;
        width: 100% !important;
        padding-top: 16px;
    }

    .ratings .r-nadpis > div {
        display: flex;
    }
}

/* ===== Carousel (hodnoceni.js) =====
   Bez JS zůstává mřížka výše se 4 kartami ze šablony. */

.ratings .r-bottom .hz-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 60px) / 4);
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 4px;
    overscroll-behavior-x: contain;
    /* padding drží stín karet uvnitř posuvného kontejneru */
    margin: -4px -4px 0;
    padding: 4px 4px 16px;
    scrollbar-width: none;
}

.ratings .r-bottom .hz-track::-webkit-scrollbar {
    display: none;
}

/* Přebíjí schovávání karet nth-child ze šablony i z mřížky výše */
.ratings .r-bottom .hz-track > .vote-wrap.vote-wrap {
    display: flex;
    visibility: visible;
    height: auto;
    width: auto;
    margin: 0;
    padding: 56px 24px 24px !important;
    scroll-snap-align: start;
}

/* JS text ořezává, mezeru před " tu není co kompenzovat */
.ratings .r-bottom .hz-track .vote-content::after {
    margin-left: 0;
}

.ratings .hz-nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
}

.ratings .hz-nav[hidden] {
    display: none;
}

.ratings .hz-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #fff;
    border: 1px solid var(--hz-border);
    border-radius: 50%;
    color: var(--hz-text);
    cursor: pointer;
    transition: border-color .2s, color .2s, opacity .2s;
}

.ratings .hz-nav-btn:hover:not(:disabled),
.ratings .hz-nav-btn:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.ratings .hz-nav-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.ratings .hz-nav-btn:disabled {
    opacity: .35;
    cursor: default;
}

@media screen and (max-width: 991px) {
    .ratings .r-bottom .hz-track {
        grid-auto-columns: calc((100% - 20px) / 2);
    }
}

/* Mobil: šipky pryč, posouvá se prstem */
@media screen and (max-width: 767px) {
    .ratings .hz-nav {
        display: none;
    }

    .ratings .r-bottom .hz-track {
        grid-auto-columns: 82%;
        gap: 12px;
        scroll-padding: 0 12px;
        margin: -4px -12px 0;
        padding: 4px 12px 16px;
    }

    .ratings .r-bottom .hz-track > .vote-wrap.vote-wrap {
        padding: 52px 20px 20px !important;
    }
}
