/* Smartio — "Your browsing history" + "also viewed" rows. Self-contained
   .sbh-* classes and tokens so the rows look the same on every page. */

.sbh-mount, .sbh-pdp-slot, .sbh-page {
  --sbh-navy: #0d4877;
  --sbh-teal: #61afcc;
  --sbh-teal-light: #7bd0ca;
  --sbh-ink: #111827;
  --sbh-ink-soft: #556b85;
  --sbh-ink-faint: #8a9bb0;
  --sbh-surface: #ffffff;
  --sbh-tint: #f7f9fb;
  --sbh-border: #e3e9f0;
  --sbh-border-strong: #c9d4e1;
  --sbh-shadow: 0 10px 24px -12px rgba(13, 72, 119, .25);
  --sbh-radius: 14px;
  --sbh-font: var(--font-brand, 'D-DIN Exp', 'D-DINExp', system-ui, sans-serif);
  font-family: var(--sbh-font);
  color: var(--sbh-ink);
}
html.theme-dark .sbh-mount, html.theme-dark .sbh-pdp-slot, html.theme-dark .sbh-page {
  --sbh-ink: #e9eef5;
  --sbh-ink-soft: #9fb0c4;
  --sbh-ink-faint: #6e8198;
  --sbh-surface: #18222f;
  --sbh-tint: #1d2937;
  --sbh-border: #243245;
  --sbh-border-strong: #33465e;
  --sbh-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6);
}
.sbh-mount[hidden], .sbh-pdp-slot[hidden] { display: none !important; }

/* Bottom-of-page block */
.sbh-mount { display: block; padding: 8px 0 40px; }
.sbh-inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
.sbh-row + .sbh-row { margin-top: 34px; }
.sbh-mount .sbh-row:first-child { padding-top: 30px; border-top: 1px solid var(--sbh-border); }

/* PDP slot sits inside the PDP grid, under Frequently Bought Together */
.sbh-pdp-slot { grid-column: 1 / -1; margin: 6px 0 4px; min-width: 0; }

.sbh-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.sbh-title { font-family: var(--sbh-font); font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--sbh-ink); margin: 0; }
.sbh-link { font-size: 14px; font-weight: 600; color: var(--sbh-navy); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.sbh-link:hover { color: var(--sbh-teal); }
html.theme-dark .sbh-link { color: var(--sbh-teal-light); }

/* Horizontal scroller */
.sbh-track-wrap { position: relative; }
.sbh-track {
  display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  padding: 4px 2px 12px; scrollbar-width: thin;
}
.sbh-track::-webkit-scrollbar { height: 6px; }
.sbh-track::-webkit-scrollbar-thumb { background: var(--sbh-border-strong); border-radius: 6px; }
.sbh-arrow {
  position: absolute; top: 38%; z-index: 4; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--sbh-border-strong); background: var(--sbh-surface); color: var(--sbh-ink);
  box-shadow: var(--sbh-shadow); display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: opacity .15s ease;
}
.sbh-arrow svg { width: 18px; height: 18px; }
.sbh-arrow.prev { left: -14px; }
.sbh-arrow.next { right: -14px; }
.sbh-arrow[disabled] { opacity: 0; pointer-events: none; }
@media (hover: none), (max-width: 768px) { .sbh-arrow { display: none; } }

/* Card */
.sbh-card {
  position: relative; flex: 0 0 200px; scroll-snap-align: start;
  display: flex; flex-direction: column; background: var(--sbh-surface);
  border: 1px solid var(--sbh-border); border-radius: var(--sbh-radius); overflow: hidden;
  transition: transform .18s ease, box-shadow .2s ease, border-color .18s ease;
}
.sbh-card:hover { transform: translateY(-3px); box-shadow: var(--sbh-shadow); border-color: var(--sbh-border-strong); }
.sbh-img { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--sbh-tint); border-bottom: 1px solid var(--sbh-border); }
.sbh-img img { width: 100%; height: 100%; object-fit: contain; padding: 12px; display: block; }
.sbh-card.is-oos .sbh-img img { opacity: .5; filter: grayscale(.4); }
.sbh-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 10.5px; font-weight: 800; letter-spacing: .03em;
  padding: 4px 8px; border-radius: 999px; background: var(--sbh-teal-light); color: #062a34;
}
.sbh-badge.oos { background: #556b85; color: #fff; }
.sbh-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.sbh-brand { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--sbh-ink-soft); }
.sbh-name { font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--sbh-ink); }
.sbh-name a { color: inherit; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sbh-name a:hover { color: var(--sbh-teal); }
.sbh-rating { font-size: 12px; color: var(--sbh-ink-soft); display: flex; align-items: center; gap: 4px; }
.sbh-rating .star { color: #f5a623; }
.sbh-rating .muted { color: var(--sbh-ink-faint); }
.sbh-prices { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-top: 1px; }
.sbh-price { font-size: 16px; font-weight: 800; color: var(--sbh-navy); font-variant-numeric: tabular-nums; }
html.theme-dark .sbh-price { color: var(--sbh-teal-light); }
.sbh-from { font-size: 11.5px; font-weight: 600; color: var(--sbh-ink-soft); }
.sbh-was { font-size: 12.5px; color: var(--sbh-ink-faint); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.sbh-foot { margin-top: auto; padding-top: 8px; display: flex; gap: 6px; }
.sbh-add, .sbh-view {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 9px 10px; border-radius: 10px; font-size: 13px; font-weight: 700;
  text-decoration: none; cursor: pointer; font-family: inherit; line-height: 1.1;
}
.sbh-add { background: var(--sbh-navy); color: #fff; border: 0; }
.sbh-add:hover { background: var(--sbh-teal); color: #fff; }
.sbh-add.added { background: #1f9d6b; color: #fff; }
.sbh-add.loading { opacity: .7; }
.sbh-add svg { width: 13px; height: 13px; flex-shrink: 0; }
.sbh-add + .added_to_cart { display: none; }
.sbh-view { background: transparent; color: var(--sbh-navy); border: 1.5px solid var(--sbh-border-strong); }
.sbh-view:hover { border-color: var(--sbh-navy); color: var(--sbh-navy); }
html.theme-dark .sbh-view { color: var(--sbh-teal-light); }
html.theme-dark .sbh-add { background: #1a6099; }

/* Remove button (history page only) */
.sbh-remove {
  position: absolute; top: 8px; right: 8px; z-index: 3; min-height: 32px; padding: 6px 11px;
  border-radius: 999px; border: 1px solid var(--sbh-border-strong); background: var(--sbh-surface);
  color: var(--sbh-ink-soft); font: 700 12px/1 var(--sbh-font); cursor: pointer;
}
.sbh-remove:hover { color: #b42318; border-color: #b42318; }

/* /browsing-history/ page */
.sbh-page { max-width: 1200px; margin: 0 auto; padding: 28px 48px 56px; }
.sbh-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.sbh-page-title { font-family: var(--sbh-font); font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; color: var(--sbh-ink); margin: 0 0 6px; }
.sbh-page-sub { font-size: 15px; color: var(--sbh-ink-soft); max-width: 640px; margin: 0; line-height: 1.55; }
.sbh-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.sbh-btn {
  min-height: 42px; padding: 10px 16px; border-radius: 10px; font: 700 14px/1 var(--sbh-font); cursor: pointer;
  border: 1.5px solid var(--sbh-border-strong); background: var(--sbh-surface); color: var(--sbh-ink);
}
.sbh-btn:hover { border-color: var(--sbh-navy); }
.sbh-btn[aria-pressed="true"] { background: var(--sbh-navy); border-color: var(--sbh-navy); color: #fff; }
.sbh-note {
  margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--sbh-tint);
  border: 1px solid var(--sbh-border); font-size: 14px; color: var(--sbh-ink-soft);
}
.sbh-day { margin-top: 30px; }
.sbh-day-title { font-family: var(--sbh-font); font-size: 18px; font-weight: 700; color: var(--sbh-ink); margin: 0 0 12px; }
.sbh-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.sbh-grid .sbh-card { flex: none; }
.sbh-empty { margin-top: 26px; padding: 34px 24px; text-align: center; border: 1px dashed var(--sbh-border-strong); border-radius: var(--sbh-radius); background: var(--sbh-surface); }
.sbh-empty p { margin: 0 0 14px; color: var(--sbh-ink-soft); font-size: 15px; }
.sbh-empty a { display: inline-flex; align-items: center; min-height: 42px; padding: 10px 18px; border-radius: 10px; background: var(--sbh-navy); color: #fff; font-weight: 700; text-decoration: none; }
.sbh-page-after { margin-top: 44px; }
.sbh-skeleton { margin-top: 26px; height: 300px; border-radius: var(--sbh-radius); background: linear-gradient(90deg, var(--sbh-tint), var(--sbh-surface), var(--sbh-tint)); background-size: 200% 100%; animation: sbh-shimmer 1.4s linear infinite; }
@keyframes sbh-shimmer { to { background-position: -200% 0; } }

@media (max-width: 1024px) { .sbh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .sbh-inner { padding: 0 24px; } .sbh-page { padding: 24px 24px 48px; } .sbh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .sbh-inner { padding: 0 16px; }
  .sbh-mount { padding-bottom: 28px; }
  .sbh-title { font-size: 18px; }
  .sbh-track { margin: 0 -16px; padding: 4px 16px 10px; gap: 10px; scroll-padding-left: 16px; }
  .sbh-card { flex-basis: 42%; min-width: 150px; }
  .sbh-name { font-size: 13px; }
  .sbh-price { font-size: 15px; }
  .sbh-pdp-slot .sbh-row { padding: 0 var(--pad, 16px); }
  .sbh-page { padding: 18px 16px 40px; }
  .sbh-page-title { font-size: 26px; }
  .sbh-tools { width: 100%; }
  .sbh-btn { flex: 1; }
  .sbh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .sbh-card, .sbh-card:hover { transition: none; transform: none; }
  .sbh-skeleton { animation: none; }
}
