/* PriceList.md lab (t78): comparison — card/product toggles, tray, compare table. Builds on home.css tokens. */

/* toggle on cards (icon) */
.pcard-slot{position:relative}
.pcard-slot .pc__cmp{top:12px;right:12px;width:40px;height:40px}
.pc__cmp{position:absolute;top:18px;right:18px;z-index:2;display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--muted);cursor:pointer;transition:color .15s,border-color .15s,background .15s}
.pc__cmp svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.pc__cmp:hover{color:var(--brand);border-color:var(--brand)}
.pc__cmp[aria-pressed=true]{border-color:var(--brand);background:var(--brand);color:#fff}
.pc__cmp:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
html[data-cview=list] .pc__cmp{top:20px;right:20px}
@media(min-width:900px){html[data-cview=list] .pc__cmp{top:14px;right:14px}html[data-cview=list] .pc__buy{padding-right:40px}}
html[data-cview=table] .pc__cmp{top:50%;right:10px;width:30px;height:30px;transform:translateY(-50%)}
html[data-cview=table] .pc{padding-right:48px}

/* toggle on the product page */
.buy__cmp{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:none;font:inherit;font-size:.86rem;font-weight:600;color:var(--ink);cursor:pointer}
.buy__cmp svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.buy__cmp:hover{border-color:var(--brand);color:var(--brand)}
.buy__cmp[aria-pressed=true]{border-color:var(--brand);background:var(--brand-050);color:var(--brand)}

/* header shortcut */
.hcmp{position:relative}
.hcmp[hidden]{display:none}
.hcmp svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.hcmp b{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--brand);color:#fff;font-size:.68rem;font-weight:800;line-height:18px;text-align:center}

/* tray */
.ctray{position:fixed;left:0;right:0;bottom:0;z-index:60;border-top:1px solid var(--line);background:var(--card);box-shadow:0 -10px 30px -18px rgba(15,23,42,.35);padding-bottom:env(safe-area-inset-bottom)}
.ctray[hidden]{display:none}
.ctray__in{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"cats acts" "list acts";gap:6px 16px;align-items:center;padding-top:8px;padding-bottom:10px}
.ctray__cats{grid-area:cats;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}
.ctray__cat{flex:none;height:28px;padding:0 10px;border:1px solid var(--line);border-radius:999px;background:none;font:inherit;font-size:.78rem;font-weight:600;color:var(--ink-2);cursor:pointer}
.ctray__cat b{margin-left:2px;color:var(--muted)}
.ctray__cat[aria-pressed=true]{border-color:var(--brand);background:var(--brand-050);color:var(--brand)}
.ctray__list{grid-area:list;display:flex;gap:8px;margin:0;padding:0;list-style:none;overflow-x:auto;scrollbar-width:thin}
.ctray__it{position:relative;flex:0 0 200px;min-width:0}
.ctray__it>a{display:flex;align-items:center;gap:8px;height:56px;padding:5px 30px 5px 6px;border:1px solid var(--line);border-radius:10px;background:var(--card)}
.ctray__it>a:hover{border-color:var(--brand)}
.ctray__it img{flex:none;width:44px;height:44px;border-radius:6px;background:#fff;object-fit:contain}
.ctray__it span{display:flex;flex-direction:column;min-width:0;font-size:.78rem;line-height:1.25}
.ctray__it b{overflow:hidden;font-weight:600;white-space:nowrap;text-overflow:ellipsis}
.ctray__it small{overflow:hidden;color:var(--muted);white-space:nowrap;text-overflow:ellipsis}
.ctray__it--empty{flex-basis:120px}
.ctray__it--empty i{display:block;height:56px;border:1px dashed var(--line);border-radius:10px}
.ctray__x{position:absolute;top:4px;right:4px;display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:none;color:var(--muted);cursor:pointer}
.ctray__x:hover{background:var(--tint);color:var(--red)}
.ctray__x svg,.ctray__min svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2}
.ctray__acts{grid-area:acts;display:flex;align-items:center;gap:8px}
.ctray__clear{height:40px;padding:0 10px;border:0;background:none;font:inherit;font-size:.84rem;font-weight:600;color:var(--muted);cursor:pointer}
.ctray__clear:hover{color:var(--red)}
.ctray__go b{margin-left:6px;padding:0 7px;border-radius:999px;background:rgba(255,255,255,.22);font-size:.78rem}
.ctray__go.is-dim{opacity:.75}
.ctray__min{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:8px;background:none;color:var(--ink-2);cursor:pointer}
.ctray.is-min .ctray__list,.ctray.is-min .ctray__clear{display:none}
.ctray.is-min .ctray__in{grid-template-areas:"cats acts";padding-top:6px;padding-bottom:6px}
.ctray__min svg{transition:transform .18s var(--ease)}
.ctray__min[aria-expanded=false] svg{transform:rotate(180deg)}
@media(prefers-reduced-motion:reduce){.ctray__min svg{transition:none}}
html.has-ctray body{padding-bottom:var(--ctray-h,96px)}
@media(max-width:639px){
  .ctray__in{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"cats acts" "list list";gap:6px 8px}
  .ctray__it{flex-basis:150px}
  .ctray__it--empty{flex-basis:56px}
  .ctray__clear{display:none}
  .ctray__go{height:36px;padding:0 12px}
}
.ctoast{position:fixed;left:50%;bottom:calc(var(--ctray-h,0px) + 16px);z-index:70;max-width:min(92vw,460px);padding:10px 14px;border-radius:10px;background:#0f172a;color:#fff;font-size:.86rem;box-shadow:var(--sh-2);transform:translateX(-50%)}
.ctoast[hidden]{display:none}

/* compare page */
.cmp{padding-bottom:40px}
.cmp .crumbs{padding:14px 0 0}
.cmp__head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;margin:0 0 12px}
.cmp__h1{display:flex;align-items:baseline;gap:10px;margin:0;font-size:clamp(1.4rem,3vw,1.9rem);font-weight:800;letter-spacing:-.02em}
.cmp__h1 small{font-size:.5em;font-weight:600;color:var(--muted);letter-spacing:0}
.cmp__tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.cmp__tbtn{height:36px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:var(--card);font:inherit;font-size:.84rem;font-weight:600;color:var(--ink-2);cursor:pointer}
.cmp__tbtn:hover{border-color:var(--brand);color:var(--brand)}
.sw{display:inline-flex;align-items:center;gap:8px;height:36px;padding:0 12px 0 8px;border:1px solid var(--line);border-radius:8px;background:var(--card);font-size:.86rem;font-weight:600;cursor:pointer;user-select:none}
.sw input{position:absolute;opacity:0;pointer-events:none}
.sw__t{position:relative;width:34px;height:20px;border-radius:10px;background:var(--line);transition:background .2s}
.sw__t::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .2s}
.sw input:checked+.sw__t{background:var(--brand)}
.sw input:checked+.sw__t::after{transform:translateX(14px)}
.sw input:focus-visible+.sw__t{outline:2px solid var(--brand);outline-offset:2px}
.cmp__tabs{display:flex;gap:6px;margin:0 0 14px;overflow-x:auto;scrollbar-width:none}
.cmp__tabs a{flex:none;display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 12px;border:1px solid var(--line);border-radius:999px;background:var(--card);font-size:.86rem;font-weight:600;color:var(--ink-2)}
.cmp__tabs a b{color:var(--muted)}
.cmp__tabs a[aria-current]{border-color:var(--brand);background:var(--brand-050);color:var(--brand)}
.cmp__note{margin:0 0 12px;padding:10px 14px;border-radius:10px;background:var(--warm);font-size:.88rem;color:var(--ink-2)}
.cmp__note a{font-weight:600;color:var(--brand)}
.cmp__empty{display:flex;flex-direction:column;align-items:center;gap:10px;max-width:520px;margin:30px auto;padding:30px 20px;border:1px dashed var(--line);border-radius:14px;text-align:center}
.cmp__empty h2{margin:0;font-size:1.2rem}
.cmp__empty p{margin:0;color:var(--muted)}
.cmp__eic svg{width:40px;height:40px;fill:none;stroke:var(--brand);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}

.cmpt{--c0:210px;--cw:230px;position:relative;overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--card);outline:none}
.cmpt:focus-visible{box-shadow:0 0 0 2px var(--brand)}
.cmpt__t{width:max(100%,calc(var(--c0) + var(--n) * var(--cw)));border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:.88rem}
.cmpt__t col,.cmpt__t th,.cmpt__t td{min-width:0}
.cmpt__t thead td:first-child,.cmpt__t tbody th[scope=row]{width:var(--c0)}
.cmpt__t th,.cmpt__t td{padding:10px 14px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;overflow-wrap:anywhere}
.cmpt__t tbody td+td,.cmpt__t thead th+th,.cmpt__t tbody th+td,.cmpt__t thead td+th{border-left:1px solid var(--line)}
.cmpt__t tbody th[scope=row],.cmpt__c0{position:sticky;left:0;z-index:2;background:var(--card);font-weight:500;color:var(--muted);box-shadow:1px 0 0 var(--line)}
.cmpt__t tbody tr:not(.cmpt__g):hover td,.cmpt__t tbody tr:not(.cmpt__g):hover th[scope=row]{background:var(--tint)}
.cmpt__g th{padding:14px 14px 8px;background:var(--card);font-size:.78rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--ink)}
.cmpt__g th span{position:sticky;left:14px}
.cmpt__p{position:relative;font-weight:400}
.cmpt__p>*{display:block}
.cmpt__x{position:absolute;top:8px;right:8px;display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:8px;background:none;color:var(--muted);cursor:pointer}
.cmpt__x:hover{background:var(--tint);color:var(--red)}
.cmpt__x svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2}
.cmpt__img{display:grid!important;place-items:center;width:120px;height:120px;margin:0 auto 8px;border-radius:10px;background:#fff}
.cmpt__img img{width:104px;height:104px;object-fit:contain}
.cmpt__name{font-weight:700;line-height:1.3;color:var(--ink)}
.cmpt__name:hover{color:var(--brand)}
.cmpt__var{margin-top:2px;font-size:.8rem;color:var(--muted)}
.cmpt__price{margin-top:6px;font-variant-numeric:tabular-nums}
.cmpt__price small{font-size:.76rem;color:var(--muted)}
.cmpt__price b{font-size:1.1rem;font-weight:800}
.cmpt__price em{font-style:normal;font-weight:600;color:var(--muted)}
.cmpt__p .pc__pre{display:inline-block;margin-top:4px}
.cmpt__num{font-variant-numeric:tabular-nums}
.cmpt__sub{display:block;color:var(--muted);font-variant-numeric:tabular-nums}
.cmpt__na{color:var(--muted)}
.cmpt__shop{display:block;font-weight:600}
.cmpt__go{display:inline-flex;align-items:center;height:32px;margin-top:6px;padding:0 10px;border-radius:8px;background:var(--brand);color:#fff;font-size:.8rem;font-weight:600;white-space:nowrap}
.cmpt__go:hover{background:var(--brand-600)}
.cmpt__t td.is-best{background:var(--green-bg);color:var(--green);font-weight:700}
.cmpt__t tbody tr:hover td.is-best{background:var(--green-bg)}
.cmpt__t td.is-best::before{content:"▲ ";font-size:.7em}
.cmpt__hint[hidden]{display:none}
.cmpt__hint{display:block;font-size:.78rem;font-weight:500;color:var(--muted)}
.cmp--diff tr[data-same]{display:none}

/* compact sticky header */
.cmph{position:sticky;top:var(--hdr-h,64px);z-index:30;height:0;overflow:visible;pointer-events:none}
.cmph__track{--c0:210px;--cw:230px;overflow:hidden;border:1px solid var(--line);border-radius:0 0 10px 10px;background:var(--card);box-shadow:var(--sh-2);opacity:0;transform:translateY(-6px);transition:opacity .15s,transform .15s}
.cmph.is-on{pointer-events:auto}
.cmph.is-on .cmph__track{opacity:1;transform:none}
.cmph__row{display:flex;width:max(100%,calc(var(--c0) + var(--n) * var(--cw)))}
.cmph__c0{flex:0 0 var(--c0);position:sticky;left:0;padding:8px 14px;background:var(--card);font-size:.78rem;font-weight:700;color:var(--muted)}
.cmph__c{flex:1 0 var(--cw);display:flex;align-items:center;gap:8px;min-width:0;padding:6px 12px;border-left:1px solid var(--line)}
.cmph__c img{flex:none;width:36px;height:36px;border-radius:6px;background:#fff;object-fit:contain}
.cmph__c>span{display:flex;flex-direction:column;min-width:0;font-size:.78rem;line-height:1.25}
.cmph__c b{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.cmph__c small{color:var(--muted);font-variant-numeric:tabular-nums}
@media(max-width:639px){
  .cmpt,.cmph__track{--c0:112px;--cw:158px}
  .cmpt__t{font-size:.82rem}
  .cmpt__t th,.cmpt__t td{padding:8px 10px}
  .cmpt__img{width:84px;height:84px}
  .cmpt__img img{width:74px;height:74px}
  .cmpt__price b{font-size:1rem}
  .cmpt__g th span{left:10px}
  .cmph__c img{display:none}
  .cmpt__gp{display:none}
  .cmph__c0{padding:8px 10px}
}
