/* Love San Bernardino — Avaliações (estrelas, bloco da ficha, folha de avaliação, barra de ações).
   Usa os tokens --lsb-* de lsb27.css (com valores de reserva). Mobile primeiro. */

:root {
    --lsbr-star: var(--lsb-sun, #f6b042);
    --lsbr-star-off: #ddd3c0;
    --lsbr-ink: var(--lsb-ink, #17283a);
    --lsbr-ink2: var(--lsb-ink-2, #3f5266);
    --lsbr-line: var(--lsb-line, #ece2d2);
    --lsbr-lake: var(--lsb-lake-800, #12466a);
    --lsbr-lake-50: var(--lsb-lake-50, #f2f8fc);
    --lsbr-leaf: var(--lsb-leaf, #1c8a57);
    --lsbr-coral: var(--lsb-coral, #d6471f);
    --lsbr-row: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 24'%3E%3Cg%3E%3Cpath id='s' d='M12 2.6l2.86 5.8 6.4.93-4.63 4.51 1.09 6.37L12 17.2l-5.72 3.01 1.09-6.37L2.74 9.33l6.4-.93L12 2.6z'/%3E%3Cpath transform='translate(24)' d='M12 2.6l2.86 5.8 6.4.93-4.63 4.51 1.09 6.37L12 17.2l-5.72 3.01 1.09-6.37L2.74 9.33l6.4-.93L12 2.6z'/%3E%3Cpath transform='translate(48)' d='M12 2.6l2.86 5.8 6.4.93-4.63 4.51 1.09 6.37L12 17.2l-5.72 3.01 1.09-6.37L2.74 9.33l6.4-.93L12 2.6z'/%3E%3Cpath transform='translate(72)' d='M12 2.6l2.86 5.8 6.4.93-4.63 4.51 1.09 6.37L12 17.2l-5.72 3.01 1.09-6.37L2.74 9.33l6.4-.93L12 2.6z'/%3E%3Cpath transform='translate(96)' d='M12 2.6l2.86 5.8 6.4.93-4.63 4.51 1.09 6.37L12 17.2l-5.72 3.01 1.09-6.37L2.74 9.33l6.4-.93L12 2.6z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Estrelas somente leitura (preenchimento exato por máscara) ---------- */
.lsb-stars {
    --s: 1.15rem;
    display: inline-block;
    flex: none;
    width: calc(var(--s) * 5);
    height: var(--s);
    background: linear-gradient(90deg, var(--lsbr-star) var(--lsb-pct, 0%), var(--lsbr-star-off) var(--lsb-pct, 0%));
    -webkit-mask: var(--lsbr-row) center / 100% 100% no-repeat;
    mask: var(--lsbr-row) center / 100% 100% no-repeat;
    vertical-align: middle;
}
.lsb-stars--sm { --s: .95rem; }
.lsb-stars--lg { --s: 1.7rem; }

/* ---------- Selo nos cards: ★ 4,7 (23) ---------- */
body.lsb27 .place-card-home7__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lsb-rate-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 11px; border-radius: 999px;
    background: #fff6e4; color: #7a4600;
    font: 700 .82rem/1.3 var(--lsb-font-body, system-ui, sans-serif);
    font-variant-numeric: lining-nums tabular-nums;
    white-space: nowrap;
}
.lsb-rate-badge__star { color: #e29a1f; font-size: .95em; }
.lsb-rate-badge strong { font-weight: 800; }
.lsb-rate-badge__n { font-weight: 500; opacity: .75; }
.lsb-rate-badge--few .lsb-rate-badge__n { opacity: .6; }

/* ---------- Mini avaliação junto ao título da ficha ---------- */
.lsb-rate-mini {
    display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin: 2px 0 10px; padding: 6px 12px 6px 10px; border-radius: 999px;
    background: #fff6e4; color: #7a4600; text-decoration: none;
    font: 600 .95rem/1.3 var(--lsb-font-body, system-ui, sans-serif);
    min-height: 44px;
}
.lsb-rate-mini:hover { background: #ffecc6; color: #5c3500; }
.lsb-rate-mini [hidden] { display: none; }
.lsb-rate-mini__full { display: inline-flex; align-items: center; gap: 6px; }
.lsb-rate-mini strong { font-weight: 800; }
.lsb-rate-mini span { font-weight: 500; }

/* ---------- Estrelas clicáveis ---------- */
.lsb-pick { display: flex; gap: 4px; justify-content: center; margin: 4px 0; }
.lsb-pick__star {
    display: grid; place-items: center;
    width: 52px; height: 52px; padding: 0; margin: 0;
    border: 0; border-radius: 14px; background: transparent; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .14s ease;
}
.lsb-pick__star svg { width: 38px; height: 38px; fill: var(--lsbr-star-off); stroke: none; transition: fill .12s ease, transform .18s cubic-bezier(.3, 1.6, .5, 1); }
.lsb-pick__star.is-on svg { fill: var(--lsbr-star); }
.lsb-pick__star:hover svg { transform: scale(1.12); }
.lsb-pick__star:active { transform: scale(.94); }
.lsb-pick__star:focus-visible { outline: 3px solid var(--lsbr-lake); outline-offset: 2px; }
.lsb-pick__star.is-pop svg { animation: lsbr-pop .42s cubic-bezier(.3, 1.6, .5, 1); }
.lsb-pick--xl { gap: 6px; }
.lsb-pick--xl .lsb-pick__star { width: 58px; height: 58px; border-radius: 16px; }
.lsb-pick--xl .lsb-pick__star svg { width: 46px; height: 46px; }
.lsb-pick.is-busy { opacity: .6; pointer-events: none; }
@keyframes lsbr-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* O atributo hidden precisa vencer qualquer display definido abaixo. */
.lsb-rate [hidden], .lsb-sheet [hidden], .lsb-rate-mini [hidden] { display: none !important; }

/* ---------- Bloco de avaliações da ficha ---------- */
.lsb-rate {
    margin: 24px 0; padding: clamp(18px, 4vw, 32px);
    background: #fff; border: 1px solid var(--lsbr-line); border-radius: 26px;
    box-shadow: 0 1px 2px rgba(12, 53, 80, .05), 0 10px 28px rgba(12, 53, 80, .07);
    color: var(--lsbr-ink); scroll-margin-top: 90px;
}
.lsb-rate__title { margin: 0 0 14px; font-size: clamp(1.4rem, 3.4vw, 1.8rem); }
.lsb-rate__summary { display: grid; gap: 18px 36px; align-items: center; margin-bottom: 20px; }
.lsb-rate__score { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.lsb-rate__num { font: 600 3.4rem/1 var(--lsb-font-display, Georgia, serif); color: var(--lsbr-lake); font-variant-numeric: lining-nums; }
.lsb-rate__count { color: var(--lsbr-ink2); font-size: .98rem; }
.lsb-rate__empty { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 18px; background: #fff6e4; color: #6b4300; }
.lsb-rate__empty strong { font-size: 1.1rem; }
.lsb-rate__bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.lsb-rate__bars li { display: grid; grid-template-columns: 2.6rem 1fr 2.4rem; align-items: center; gap: 10px; font-size: .9rem; color: var(--lsbr-ink2); font-variant-numeric: tabular-nums; }
.lsb-rate__bar { display: block; height: 10px; border-radius: 99px; background: #f1e9d9; overflow: hidden; }
.lsb-rate__bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f6b042, #e29a1f); transition: width .5s ease; }
.lsb-rate__bar-n { text-align: right; }
.lsb-rate__cta { display: grid; justify-items: center; gap: 8px; padding: 18px 12px; border-radius: 20px; background: var(--lsbr-lake-50); text-align: center; }
.lsb-rate__cta-t { margin: 0; font-weight: 700; color: var(--lsbr-ink); }
.lsb-rate__mine { margin: 0; color: var(--lsbr-ink2); font-size: .95rem; }
.lsb-rate__btn { margin-top: 4px; }
.lsb-rate__btn svg { width: 20px; height: 20px; fill: currentColor; }
.lsb-rate__sub { margin: 22px 0 10px; font-size: 1rem; }
.lsb-link { background: none; border: 0; padding: 4px 6px; min-height: 44px; color: var(--lsbr-lake); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

.lsb-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lsb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--lsbr-lake-50); border: 1px solid #d6e7f2; color: var(--lsbr-lake); font-size: .9rem; font-weight: 600; }
.lsb-chip b { font-weight: 800; color: #7a4600; }
.lsb-chips--sm .lsb-chip { padding: 3px 10px; font-size: .8125rem; }

.lsb-reviews { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
.lsb-review { padding: 16px 18px; border: 1px solid var(--lsbr-line); border-radius: 18px; background: #fffdf9; }
.lsb-review__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 6px; }
.lsb-review__who { font-weight: 700; }
.lsb-review__date { margin-left: auto; color: #5f7083; font-size: .875rem; }
.lsb-review__text { margin: 0 0 8px; line-height: 1.65; overflow-wrap: anywhere; }
.lsb-rate__nocomments { margin: 18px 0 0; color: var(--lsbr-ink2); }
.lsb-rate__comments > .lsb-btn { margin-top: 16px; }

.lsb-btn--ghost { background: transparent; color: var(--lsbr-lake); border-color: var(--lsbr-lake); }
.lsb-btn--ghost:hover { background: var(--lsbr-lake); color: #fff; }

@media (min-width: 640px) {
    .lsb-rate__summary { grid-template-columns: auto 1fr; }
    .lsb-rate__summary.is-empty { grid-template-columns: 1fr; }
}

/* ---------- Folha de avaliação (bottom sheet no celular / modal no desktop) ---------- */
html.lsb-sheet-open { overflow: hidden; }
.lsb-sheet { position: fixed; inset: 0; z-index: 10200; display: flex; align-items: flex-end; justify-content: center; }
.lsb-sheet[hidden] { display: none; }
.lsb-sheet__backdrop { position: absolute; inset: 0; background: rgba(8, 40, 61, .58); animation: lsbr-fade .2s ease both; }
.lsb-sheet__panel {
    position: relative; width: 100%; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: 14px 20px calc(24px + env(safe-area-inset-bottom));
    background: #fff; border-radius: 26px 26px 0 0; text-align: center;
    box-shadow: 0 -12px 50px rgba(8, 40, 61, .35);
    animation: lsbr-up .28s cubic-bezier(.2, .8, .2, 1) both; outline: none;
}
.lsb-sheet__panel.is-dragging { animation: none; transition: none; }
.lsb-sheet__grab { display: block; width: 44px; height: 5px; margin: 0 auto 10px; border-radius: 9px; background: #d6cdbb; touch-action: none; }
.lsb-sheet__x { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: transparent; color: var(--lsbr-ink2); cursor: pointer; }
.lsb-sheet__x svg { width: 22px; height: 22px; }
.lsb-sheet__x:hover { background: var(--lsbr-lake-50); }
.lsb-sheet__x:focus-visible, .lsb-sheet__panel button:focus-visible, .lsb-sheet__panel a:focus-visible { outline: 3px solid var(--lsbr-lake); outline-offset: 2px; }
.lsb-sheet__place { margin: 18px 40px 2px; font-weight: 700; color: var(--lsbr-ink2); overflow-wrap: anywhere; }
.lsb-sheet__title { margin: 0 0 4px; font-size: clamp(1.6rem, 6vw, 2rem); color: var(--lsbr-ink); }
.lsb-sheet__sub { margin: 0 0 10px; color: var(--lsbr-ink2); }
.lsb-sheet__stars-label { min-height: 1.6em; margin: 4px 0 6px; font: 600 1.15rem/1.4 var(--lsb-font-display, Georgia, serif); color: var(--lsbr-lake); }
.lsb-sheet__ts { display: flex; justify-content: center; }
.lsb-sheet__ts:empty { display: none; }
.lsb-sheet__err { margin: 6px 0 0; padding: 10px 14px; border-radius: 12px; background: #ffe5dc; color: #8f2a0c; font-weight: 600; }
.lsb-sheet__err[hidden] { display: none; }

.lsb-sheet__more { margin-top: 8px; text-align: left; animation: lsbr-fade .3s ease both; }
.lsb-sheet__more[hidden] { display: none; }
.lsb-sheet__ok { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: #e6f6ee; color: #11623c; font-weight: 700; text-align: center; }
.lsb-sheet__ok svg { width: 22px; height: 22px; flex: none; }
.lsb-sheet__more-t { margin: 8px 0 10px; font-size: 1.1rem; }
.lsb-sheet__tags { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.lsb-sheet__tags legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: .95rem; color: var(--lsbr-ink2); }
.lsb-chips--pick { gap: 8px; }
.lsb-chip-pick { position: relative; cursor: pointer; }
.lsb-chip-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lsb-chip-pick span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid #cfe1ee; background: #fff; color: var(--lsbr-lake); font-weight: 600; font-size: .95rem; transition: background .12s, color .12s, border-color .12s; }
.lsb-chip-pick input:checked + span { background: var(--lsbr-lake); border-color: var(--lsbr-lake); color: #fff; }
.lsb-chip-pick input:focus-visible + span { outline: 3px solid var(--lsbr-lake); outline-offset: 2px; }
.lsb-sheet__field { position: relative; display: block; margin-bottom: 10px; }
.lsb-sheet__field textarea, .lsb-sheet__input {
    width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1.5px solid #cfe1ee; border-radius: 14px;
    font: 400 1rem/1.5 var(--lsb-font-body, system-ui, sans-serif); color: var(--lsbr-ink); background: #fff; resize: vertical; min-height: 54px;
}
.lsb-sheet__field textarea { min-height: 92px; padding-bottom: 28px; }
.lsb-sheet__field textarea:focus, .lsb-sheet__input:focus { outline: 3px solid rgba(58, 139, 184, .35); border-color: var(--lsbr-lake); }
.lsb-sheet__count { position: absolute; right: 12px; bottom: 8px; font-size: .8125rem; color: #5f7083; font-variant-numeric: tabular-nums; }
.lsb-sheet__note { margin: 8px 0 0; color: #5f7083; font-size: .875rem; }
.lsb-sheet__done { margin: 10px 0; padding: 12px 14px; border-radius: 14px; background: var(--lsbr-lake-50); color: var(--lsbr-lake); font-weight: 600; text-align: center; }
.lsb-sheet__done[hidden], [data-sheet-fields][hidden] { display: none; }
.lsb-sheet__actions { display: grid; gap: 10px; margin-top: 16px; }
.lsb-sheet__actions .lsb-btn { width: 100%; justify-content: center; }
.lsb-sheet__actions [hidden] { display: none; }
.lsb-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@keyframes lsbr-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes lsbr-fade { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 721px) {
    .lsb-sheet { align-items: center; padding: 24px; }
    .lsb-sheet__panel { width: 100%; max-width: 500px; border-radius: 26px; padding: 22px 28px 28px; animation: lsbr-zoom .22s cubic-bezier(.2, .8, .2, 1) both; box-shadow: 0 30px 80px rgba(8, 40, 61, .4); }
    .lsb-sheet__grab { display: none; }
    .lsb-sheet__place { margin-top: 8px; }
    .lsb-sheet__actions { grid-template-columns: 1fr 1fr; }
    .lsb-sheet__actions [data-sheet-send] { grid-column: 1 / -1; }
}
@keyframes lsbr-zoom { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Barra de ações fixa da ficha (só celular) ---------- */
.lsb-actionbar, .lsb-actionbar-spacer { display: none; }
@media (max-width: 720px) {
    .lsb-actionbar {
        display: flex; gap: 4px; position: fixed; z-index: 890;
        left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom));
        padding: 5px; border-radius: 20px; background: rgba(255, 255, 255, .98);
        box-shadow: 0 6px 26px rgba(12, 53, 80, .22); border: 1px solid var(--lsbr-line);
    }
    .lsb-actionbar__a {
        flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        min-height: 54px; padding: 6px 2px; border: 0; border-radius: 15px; background: transparent; color: var(--lsbr-lake);
        font: 700 .8125rem/1.1 var(--lsb-font-body, system-ui, sans-serif); text-decoration: none; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .lsb-actionbar__a:active { background: var(--lsbr-lake-50); }
    .lsb-actionbar__a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .lsb-actionbar__a--wa { color: #11623c; }
    .lsb-actionbar__a--rate { background: var(--lsbr-star); color: #3d2600; }
    .lsb-actionbar__a--rate:active { background: #e29a1f; }
    .lsb-actionbar-spacer { display: block; height: 84px; }
    .lsb-pick--xl .lsb-pick__star { width: 56px; }
}
@media (max-width: 360px) {
    .lsb-pick--xl .lsb-pick__star { width: 50px; height: 54px; }
    .lsb-pick--xl .lsb-pick__star svg { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .lsb-sheet__panel, .lsb-sheet__backdrop, .lsb-sheet__more, .lsb-pick__star svg, .lsb-pick__star.is-pop svg, .lsb-rate__bar i { animation: none !important; transition: none !important; }
}
