/* ============================================================ catálogo (loja) */
.cat { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: clamp(24px, 3vw, 44px); align-items: start; padding-bottom: clamp(70px, 10vw, 120px); }
.cat__side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; padding: 4px 4px 20px; }
.cat__sheet-head, .cat__sheet-foot { display: none; }
.cat__groups { display: grid; gap: 22px; }
.fgroup { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; min-width: 0; }
.fgroup legend { font: 800 var(--t-md)/1 var(--f-display); margin-bottom: 8px; padding: 0; }
.fgroup .filters__search { height: 48px; }
.check { --c: var(--ink); position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 8px; margin: 0 -8px; border-radius: 12px; cursor: pointer; transition: background-color .2s; }
.check:hover { background: var(--mist); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--line); color: #fff; transition: background-color .2s, box-shadow .2s, transform .3s var(--spring); }
.check__box .i { width: 15px; height: 15px; stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .3s var(--spring); }
.check input:checked + .check__box { background: var(--c); box-shadow: none; transform: scale(1.05); }
.check input:checked + .check__box .i { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { outline: 3px solid var(--blue); outline-offset: 2px; }
.check--radio .check__box { border-radius: 50%; }
.check--radio input:checked + .check__box { background: none; box-shadow: inset 0 0 0 7px var(--ink); }
.check__t { flex: 1; font-size: var(--t-sm); font-weight: 500; }
.check input:checked ~ .check__t { font-weight: 700; }
.check__n { font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.check--inline { margin: 0; padding: 4px 0; }
.check--inline:hover { background: none; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; font-size: var(--t-sm); }
.switch input { position: absolute; opacity: 0; }
.switch__track { flex: none; width: 46px; height: 28px; border-radius: 28px; padding: 3px; background: var(--line); transition: background-color .25s; }
.switch__dot { display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .2); transition: transform .35s var(--spring); }
.switch input:checked + .switch__track { background: var(--pink); }
.switch input:checked + .switch__track .switch__dot { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--blue); outline-offset: 2px; }
.switch .i { width: 17px; height: 17px; color: var(--pink); vertical-align: -3px; }
.cat__bar { position: sticky; top: 64px; z-index: 15; display: flex; align-items: center; gap: 12px; padding: 12px 0; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.cat__bar .result-count { margin: 0 auto 0 0; font-weight: 700; color: var(--ink-2); }
.cat__tools { display: flex; align-items: center; gap: 10px; }
.cat__open { display: none; }
.cat__count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 22px; font-size: 12px; background: var(--pink); color: #fff; }
.seg--ico .seg__btn { width: 44px; padding: 0; display: grid; place-items: center; }
.seg--ico .i { width: 19px; height: 19px; }
.cat__active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cat__active:empty { margin: 0; }
.chip--on { --c: var(--ink); min-height: 34px; padding: 0 8px 0 14px; background: color-mix(in srgb, var(--c) 12%, var(--paper)); color: color-mix(in srgb, var(--c) 75%, var(--ink)); font-size: var(--t-xs); animation: pop .35s var(--spring); }
.chip--on .i { width: 15px; height: 15px; margin-left: 2px; opacity: .6; }
.chip--on:hover .i { opacity: 1; }
.cat__grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.book-card__desc { display: none; }

/* modo lista */
.cat__grid.is-lista { grid-template-columns: 1fr; gap: 14px; }
.is-lista .book-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: center; padding: 12px; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .25s; }
.is-lista .book-card:hover { box-shadow: inset 0 0 0 2px var(--c); }
.is-lista .book-card__stage { aspect-ratio: 1 / 1.08; padding: 12px; }
.is-lista .book-card__peek { display: none; }
.is-lista .book-card__body { padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "meta buy" "title buy" "desc buy"; gap: 6px 24px; align-items: center; }
.is-lista .book-card__meta { grid-area: meta; }
.is-lista .book-card__title { grid-area: title; font-size: 1.35rem; }
.is-lista .book-card__desc { grid-area: desc; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); font-size: var(--t-sm); max-width: 62ch; }
.is-lista .book-card__buy { grid-area: buy; flex-direction: column; align-items: flex-end; margin: 0; }
.is-lista .price { align-items: flex-end; }

/* produto: descrição, nota, avaliações */
.product__desc { color: var(--ink-2); font-size: var(--t-lg); line-height: 1.55; max-width: 56ch; }
.stars { --v: 0%; position: relative; display: inline-grid; flex: none; }
.stars__base, .stars__fill { grid-area: 1 / 1; display: inline-flex; gap: 2px; }
.stars .i { width: 18px; height: 18px; }
.stars__base { color: var(--line); }
.stars__base .i, .stars__fill .i { fill: currentColor; }
.stars__fill { color: var(--sun); clip-path: inset(0 calc(100% - var(--v)) 0 0); }
.stars--lg .i { width: 30px; height: 30px; }
.stars-line { display: inline-flex; align-items: center; gap: 10px; font-size: var(--t-sm); color: var(--ink-2); text-decoration: none; justify-self: start; }
.stars-line:hover span { text-decoration: underline; }
.reviews { padding: 0 0 clamp(56px, 8vw, 90px); }
.reviews__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.reviews__empty { display: flex; align-items: center; gap: 18px; padding: 24px; border-radius: var(--r-lg); background: var(--mist); color: var(--ink-2); }
.reviews__empty strong { color: var(--ink); font-family: var(--f-display); font-size: var(--t-lg); }
.reviews__empty img { width: 70px; height: auto; animation: float 3s ease-in-out infinite; }
.reviews__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.review { padding: 20px; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1.5px var(--line); display: grid; gap: 10px; align-content: start; }
.review__head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.review__head small { display: block; color: var(--ink-3); font-size: var(--t-xs); }
.review h3 { font-size: var(--t-lg); }
.review p { color: var(--ink-2); }
.review time { font-size: var(--t-xs); color: var(--ink-3); }
.avatar { --c: var(--blue); display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 14px 14px 14px 5px; font: 800 1.1rem/1 var(--f-display); color: #fff; background: var(--c); flex: none; }

/* usuário no topo */
.tool--user { position: relative; }
.tool--user.is-logged > .i { display: none; }
.tool__avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px 11px 11px 4px; font: 800 .95rem/1 var(--f-display); color: #fff; background: linear-gradient(135deg, var(--blue), var(--grape)); }

/* 404 e checkout: entrar */
.notfound { display: grid; justify-items: center; text-align: center; gap: 14px; padding: clamp(50px, 8vw, 100px) 0 clamp(80px, 10vw, 130px); }
.notfound__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.ck-login { padding: 14px 18px; border-radius: var(--r-md); background: color-mix(in srgb, var(--blue) 9%, var(--paper)); font-size: var(--t-sm); color: var(--ink-2); }
.ck-login a { font-weight: 700; color: var(--ink); }

@media (max-width: 1080px) {
  .cat { grid-template-columns: 1fr; }
  .cat__open { display: inline-flex; }
  .cat__side {
    position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; top: auto; max-height: 86vh; padding: 0;
    display: flex; flex-direction: column; background: var(--paper); border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: 0 -30px 60px -30px rgb(var(--shadow-c) / .5); transform: translateY(105%); transition: transform .5s var(--spring), visibility 0s .5s; visibility: hidden;
  }
  .cat.is-sheet .cat__side { transform: none; visibility: visible; transition: transform .5s var(--spring); }
  .cat.is-sheet::before { content: ""; position: fixed; inset: 0; z-index: 79; background: rgb(23 18 48 / .45); backdrop-filter: blur(3px); }
  .cat__sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px 22px; }
  .cat__sheet-head h2 { font-size: var(--t-xl); }
  .cat__groups { flex: 1; overflow-y: auto; padding: 8px 22px 20px; }
  .cat__sheet-foot { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); }
}
@media (max-width: 560px) {
  .cat__bar { flex-wrap: wrap; }
  .cat__bar .result-count { order: 3; width: 100%; font-size: var(--t-xs); }
  .cat__tools { margin-left: auto; }
  .cat__tools .select select { padding-left: 14px; max-width: 150px; }
  .is-lista .book-card { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 8px; }
  .is-lista .book-card__body { grid-template-columns: 1fr; grid-template-areas: "meta" "title" "buy"; }
  .is-lista .book-card__desc { display: none; }
  .is-lista .book-card__buy { flex-direction: row; justify-content: space-between; align-items: center; }
  .is-lista .book-card__title { font-size: 1.05rem; }
}
.is-hide { display: none !important; }
