/* ── History page: recently viewed + search history ──────────────── */
.hs-page { padding-bottom: 72px; }
.hs-hero { padding: 6px 0 22px; }
.hs-hero h1 { font: 400 clamp(34px, 5vw, 52px)/1.05 'LXGW Marker Gothic', 'Syne', sans-serif; -webkit-text-stroke: .024em currentColor; margin: 0; }
.hs-hero p { margin: 10px 0 0; max-width: 560px; font: 500 15.5px/1.6 var(--kx-font-b, Lato, sans-serif); color: #6d6a65; }

/* tabs */
.hs-tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 99px; background: #fff; border: 1px solid var(--kx-line, rgba(17,17,17,.1)); margin-bottom: 14px; max-width: 100%; overflow-x: auto; }
.hs-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; min-height: 44px; border: 0; border-radius: 99px; background: none; font: 800 14px var(--kx-font-b, Lato, sans-serif); color: #5f5b53; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.hs-tab em { font-style: normal; font: 800 11.5px var(--kx-font-b, Lato, sans-serif); min-width: 22px; padding: 2px 7px; border-radius: 99px; background: rgba(17,17,17,.08); text-align: center; }
.hs-tab[aria-selected="true"] { background: #111; color: #fff; }
.hs-tab[aria-selected="true"] em { background: var(--kx-brand, #f0c33c); color: #111; }
.hs-tab:focus-visible { outline: 3px solid rgba(240,195,60,.9); outline-offset: 2px; }

.hs-note { margin: 0 0 18px; font: 600 13px var(--kx-font-b, Lato, sans-serif); color: #7b776f; }
.hs-note a { color: #111; text-decoration: underline; text-underline-offset: 3px; }

/* toolbar */
.hs-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0 18px; }
.hs-bar > p { margin: 0; font: 700 14px var(--kx-font-b, Lato, sans-serif); color: #4a463f; }
.hs-bar-wrap { flex-wrap: wrap; justify-content: flex-start; }
.hs-clear { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; min-height: 42px; border-radius: 99px; border: 1.5px solid rgba(179,38,30,.35); background: #fff; color: #b3261e; font: 800 13px var(--kx-font-b, Lato, sans-serif); cursor: pointer; transition: background .15s, border-color .15s; }
.hs-clear:hover { background: #fdf0ef; border-color: #b3261e; }
.hs-clear[hidden] { display: none; }
.hs-clear .kx-icon { width: 15px; height: 15px; }

.hs-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font: 700 13.5px var(--kx-font-b, Lato, sans-serif); user-select: none; }
.hs-switch input { position: absolute; opacity: 0; pointer-events: none; }
.hs-switch i { width: 42px; height: 24px; border-radius: 24px; background: #d8d4cb; position: relative; flex-shrink: 0; transition: background .15s; }
.hs-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.hs-switch input:checked + i { background: #111; }
.hs-switch input:checked + i::after { transform: translateX(18px); }
.hs-switch input:focus-visible + i { outline: 3px solid rgba(240,195,60,.9); outline-offset: 2px; }
.hs-filter input { width: min(280px, 100%); padding: 10px 16px; min-height: 42px; border: 1.5px solid rgba(17,17,17,.14); border-radius: 99px; background: #fff; font: 500 14px var(--kx-font-b, Lato, sans-serif); outline: none; }
.hs-filter input:focus { border-color: #111; box-shadow: 0 0 0 4px rgba(17,17,17,.07); }

/* day groups */
.hs-day { margin: 26px 0 12px; font: 800 12px var(--kx-font-b, Lato, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: #8a867e; display: flex; align-items: center; gap: 12px; }
.hs-day::after { content: ''; flex: 1; height: 1px; background: var(--kx-line, rgba(17,17,17,.1)); }
.hs-day:first-child { margin-top: 4px; }

/* viewed products */
.hs-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hs-cell .kc { width: 100%; }
.hs-when { font: 600 12px var(--kx-font-b, Lato, sans-serif); color: #8a867e; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hs-rm { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; min-height: 36px; border-radius: 99px; border: 1px solid var(--kx-line, rgba(17,17,17,.12)); background: #fff; font: 800 12px var(--kx-font-b, Lato, sans-serif); color: #5f5b53; cursor: pointer; transition: all .15s; }
.hs-rm:hover { background: #fdf0ef; color: #b3261e; border-color: rgba(179,38,30,.35); }
.hs-rm .kx-icon { width: 13px; height: 13px; }
.hs-gone { aspect-ratio: 4 / 5; border-radius: 18px; border: 1.5px dashed rgba(17,17,17,.2); background: #faf9f6; display: grid; place-content: center; text-align: center; padding: 16px; color: #8a867e; font: 700 13px var(--kx-font-b, Lato, sans-serif); }
.hs-gone .kx-icon { width: 24px; height: 24px; margin: 0 auto 8px; }

/* search rows */
.hs-rows { display: grid; gap: 10px; }
.hs-row { display: flex; align-items: stretch; gap: 8px; }
.hs-q { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 14px 18px; min-height: 58px; border-radius: 16px; background: #fff; border: 1px solid var(--kx-line, rgba(17,17,17,.1)); color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.hs-q:hover { border-color: #111; box-shadow: 0 8px 22px rgba(17,17,17,.08); transform: translateY(-1px); }
.hs-q .kx-icon { width: 19px; height: 19px; color: #8a867e; flex-shrink: 0; }
.hs-q b { font: 800 15px var(--kx-font-b, Lato, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.hs-q small { font: 600 12px var(--kx-font-b, Lato, sans-serif); color: #8a867e; white-space: nowrap; flex-shrink: 0; }
.hs-x { width: 58px; flex-shrink: 0; border-radius: 16px; border: 1px solid var(--kx-line, rgba(17,17,17,.1)); background: #fff; display: grid; place-items: center; cursor: pointer; color: #8a867e; transition: all .15s; }
.hs-x:hover { background: #fdf0ef; color: #b3261e; border-color: rgba(179,38,30,.35); }
.hs-x .kx-icon { width: 18px; height: 18px; }

/* empty */
.hs-empty { text-align: center; padding: 56px 20px; border-radius: 24px; border: 1.5px dashed rgba(17,17,17,.2); background: #fff; }
.hs-empty .kx-icon { width: 34px; height: 34px; color: #b5b0a6; margin: 0 auto 12px; }
.hs-empty h2 { margin: 0 0 6px; font: 400 24px 'LXGW Marker Gothic', 'Syne', sans-serif; -webkit-text-stroke: .02em currentColor; }
.hs-empty p { margin: 0 auto 18px; max-width: 380px; font: 500 14.5px/1.6 var(--kx-font-b, Lato, sans-serif); color: #6d6a65; }

/* confirm + undo */
.hs-modal { position: fixed; inset: 0; z-index: 9000; background: rgba(17,17,17,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.hs-modal[hidden] { display: none; }
.hs-modal-box { width: min(420px, 100%); background: #fff; border-radius: 24px; padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: hsPop .2s ease-out; }
.hs-modal-box h2 { margin: 0 0 8px; font: 400 24px 'LXGW Marker Gothic', 'Syne', sans-serif; -webkit-text-stroke: .02em currentColor; }
.hs-modal-box p { margin: 0 0 20px; font: 500 14.5px/1.6 var(--kx-font-b, Lato, sans-serif); color: #6d6a65; }
.hs-modal-act { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes hsPop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.hs-undo { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 9100; display: flex; align-items: center; gap: 16px; padding: 12px 14px 12px 20px; border-radius: 99px; background: #111; color: #fff; font: 700 14px var(--kx-font-b, Lato, sans-serif); box-shadow: 0 18px 50px rgba(0,0,0,.35); max-width: calc(100vw - 24px); }
.hs-undo[hidden] { display: none; }
.hs-undo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-undo button { border: 0; border-radius: 99px; background: var(--kx-brand, #f0c33c); color: #111; padding: 8px 16px; min-height: 36px; font: 800 13px var(--kx-font-b, Lato, sans-serif); cursor: pointer; }

@media (max-width: 640px) {
  .hs-tab { padding: 10px 14px; font-size: 13px; }
  .hs-bar { flex-wrap: wrap; }
  .hs-filter { flex: 1 1 100%; order: 3; }
  .hs-filter input { width: 100%; }
  .hs-q { padding: 12px 14px; gap: 10px; }
  .hs-q small { display: none; }
  .hs-x { width: 52px; }
  body.kx-has-tabbar .hs-undo { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .hs-modal-box { animation: none; } }

/* breadcrumb (same look as the shop page) */
.hs-page .sh-crumbs { display: flex; align-items: center; gap: 8px; padding: 18px 0 10px; font: 600 13px var(--kx-font-b, Lato, sans-serif); color: #8a867e; }
.hs-page .sh-crumbs a { color: #8a867e; }
.hs-page .sh-crumbs a:hover { color: #111; }
.hs-page .sh-crumbs i { width: 5px; height: 5px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); opacity: .6; }
.hs-page .sh-crumbs span { color: #111; font-weight: 800; }
