/* Minimal styling for the Bad.no Typesense preview */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1a1a1a;
  background: #f7f7f7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0a2540;
  color: #fff;
  border-bottom: 1px solid #04162a;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 15px;
  white-space: nowrap;
}

.searchbox { flex: 1; }
.searchbox .ais-SearchBox-input {
  width: 100%;
  height: 40px;
  padding: 0 40px; /* room for the theme's search icon (left) and reset button (right) */
  border-radius: 8px;
  border: 1px solid #1c3a5e;
  background: #fff;
  font-size: 15px;
}

.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
}

.sidebar { display: flex; flex-direction: column; gap: 14px; }

.panel {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 14px 16px;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #555;
}

.results { display: flex; flex-direction: column; gap: 12px; }

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #555;
}

#hits .ais-Hits-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.hit-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 120ms ease;
}
.hit-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.hit-link { display: block; color: inherit; }

.hit-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f0f0f0;
  overflow: hidden;
}
.hit-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hit-image-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; color: #aaa; font-size: 12px;
}
.hit-sale {
  position: absolute;
  top: 8px; left: 8px;
  background: #c0392b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.hit-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: #0a2540;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.hit-badge + .hit-badge { top: 30px; }
.hit-badge + .hit-badge + .hit-badge { top: 52px; }
.hit-badge--justin { background: #2563eb; }
.hit-badge--lowstock { background: #d97706; }
.hit-badge--soldout { background: #6b7280; }
.hit-badge[class*="--"]:not([class*="justin"]):not([class*="lowstock"]):not([class*="soldout"]) { background: #c0392b; }

.hit-colors {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.hit-color-chip {
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fafafa;
  color: #444;
}
.hit-color-more {
  font-size: 10px;
  padding: 2px 6px;
  color: #888;
}
.hit-variants {
  font-size: 11px;
  color: #888;
  margin-top: 6px;
}

.hit-body { padding: 10px 12px 14px; }
.hit-vendor {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #888;
  margin-bottom: 4px;
}
.hit-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hit-price { font-size: 14px; color: #0a2540; font-weight: 600; }

.empty {
  background: #fff;
  border: 1px dashed #d0d0d0;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  color: #777;
}

/* InstantSearch fine-tuning */
.ais-HierarchicalMenu-item, .ais-RefinementList-item { margin: 4px 0; }
.ais-HierarchicalMenu-link, .ais-RefinementList-label { font-size: 13px; }
.ais-CurrentRefinements-list { display: flex; flex-wrap: wrap; gap: 6px; }

#pagination { display: flex; justify-content: center; padding: 16px 0; }

.hit-badge--sale { background: #c0392b; }

/* Menu bar and start screen (bad.no's homepage priorities) */
[hidden] { display: none !important; }
.mainnav { background: #fff; border-bottom: 1px solid #e6e6e6; }
.mainnav-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; gap: 4px; overflow-x: auto; }
.mainnav-link { border: 0; background: none; padding: 12px 10px; font-size: 14px; font-weight: 600; color: #0a2540; cursor: pointer; white-space: nowrap; }
.mainnav-link:hover { text-decoration: underline; }

.home { max-width: 1400px; margin: 0 auto; padding: 8px 24px 48px; }
.home-section { margin-top: 28px; }
.home-section h2 { font-size: 20px; margin: 0 0 12px; color: #0a2540; }
.home-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.home-tile { border: 1px solid #e0e0e0; background: #fff; border-radius: 999px; padding: 8px 16px; font-size: 14px; cursor: pointer; color: #1a1a1a; }
.home-tile:hover { border-color: #0a2540; }
.home-tile--campaign { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.home-products { display: grid; grid-auto-flow: column; grid-auto-columns: 180px; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.home-card { display: block; background: #fff; border: 1px solid #e6e6e6; border-radius: 10px; padding: 10px; text-decoration: none; color: inherit; }
.home-card img { width: 100%; aspect-ratio: 1; object-fit: contain; margin-bottom: 8px; }
.home-card-title { font-size: 13px; line-height: 1.35; margin: 2px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.home-group { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.home-group-title { border: 0; background: none; padding: 0; font-size: 15px; font-weight: 700; color: #0a2540; cursor: pointer; margin-bottom: 4px; text-align: left; }
.home-group-link { border: 0; background: none; padding: 0; font-size: 14px; color: #333; cursor: pointer; text-align: left; }
.home-group-link:hover, .home-group-title:hover { text-decoration: underline; }

/* The theme styles each result item as a card too; ours is the only card. */
#hits .ais-Hits-item { padding: 0; border: 0; box-shadow: none; background: transparent; display: block; }
#hits .hit-card { height: 100%; }

/* Collection view: breadcrumb, title, sub-category chips, load more */
#breadcrumb { font-size: 13px; margin-bottom: 6px; }
.page-title { font-size: 26px; margin: 0 0 12px; color: #0a2540; }
.page-title:empty { display: none; }
.subcategories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.subcategories:empty { display: none; }
.subcategory-chip { border: 1px solid #d5d5d5; background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: #1a1a1a; }
.subcategory-chip:hover { border-color: #0a2540; }
#hits .ais-InfiniteHits-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; }
#hits .ais-InfiniteHits-item { padding: 0; border: 0; box-shadow: none; background: transparent; display: block; }
#hits .ais-InfiniteHits-loadMore { display: block; margin: 24px auto 0; }
.hit-badge--label { background: #0a2540; }
/* A filter with nothing to offer in the current view is hidden, as on the storefront. */
.panel:has(.ais-RefinementList--noRefinement) { display: none; }

/* Matched variant: the option the query hit, and its own stock */
.hit-compare { color: #6b7280; font-weight: 400; font-size: 12px; margin-left: 4px; }
.hit-match { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; }
.hit-match-title { background: #eef2f7; color: #0a2540; border-radius: 4px; padding: 2px 6px; }
.hit-stock { font-size: 11px; }
.hit-stock--in { color: #15803d; }
.hit-stock--out { color: #6b7280; }

/* Badges stack in one column; hidden ones take no room */
.hit-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.hit-badges .hit-badge { position: static; margin: 0; }
.hit-card [hidden] { display: none !important; }

/* Variant swatches: the variants' own images, like Shopify's collection cards */
.hit-swatches { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.hit-swatch {
  width: 32px; height: 32px; border-radius: 6px; overflow: hidden; cursor: pointer;
  border: 1px solid #d9dee5; background: #fff; padding: 2px; box-sizing: border-box;
}
.hit-swatch img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hit-swatch:hover { border-color: #0a2540; }
.hit-swatch.is-active { border: 2px solid #0a2540; padding: 1px; }
.hit-swatch:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.hit-swatch-more { font-size: 12px; color: #6b7280; }

/* ------------------------------------------------------------------------
   bad.no look: colours, type and card style taken from bad.no's own search
   page (www.bad.no/search, 22 Nov 2026). Overrides the plainer rules above.
   ------------------------------------------------------------------------ */
:root {
  --bn-ink: #141414;         /* headings, prices */
  --bn-text: #202020;        /* body text */
  --bn-muted: #646464;
  --bn-line: #e5e8ea;
  --bn-navy: #103a4c;        /* logo */
  --bn-teal: #4b7c91;        /* option pills, accents */
  --bn-link: #006d94;
  --bn-band: #e6edf0;        /* title band */
  --bn-sunken: #f5f9fa;      /* search field */
  --bn-pill: #e6ecf0;        /* price pill */
  --bn-sale: #ff6363;        /* discount pill */
  --bn-bar: #161616;         /* category bar */
  --bn-gold: #d4ba62;        /* Merker, Salg, Outlet */
  --bn-deals: #ffbf1b;       /* Superdeals */
  --bn-badge: #303030;       /* Outlet / Nyhet labels */
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--bn-text);
  background: #fff;
}

/* Header: white with the logo, a sunken search field */
.topbar { background: #fff; color: var(--bn-text); border-bottom: 1px solid var(--bn-line); }
.topbar-inner { padding: 18px 24px; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--bn-teal); background: var(--bn-sunken); border: 1px solid var(--bn-line);
  border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}
.searchbox { max-width: 680px; }
.searchbox .ais-SearchBox-form { background: transparent; }
.searchbox .ais-SearchBox-input {
  height: 52px; border-radius: 6px; border: 1px solid var(--bn-line);
  background: var(--bn-sunken); color: var(--bn-text); font-size: 16px; box-shadow: none;
}
.searchbox .ais-SearchBox-input:focus { border-color: var(--bn-teal); outline: none; box-shadow: 0 0 0 3px rgba(75, 124, 145, 0.15); }

/* Category bar: black, gold links, yellow Superdeals */
.mainnav { background: var(--bn-bar); border-bottom: 0; }
.mainnav-inner { gap: 0; }
.mainnav-link { color: #fff; font-weight: 500; font-size: 15px; padding: 18px 13px; }
.mainnav-link:hover { text-decoration: none; color: var(--bn-gold); }
.mainnav-link--gold { color: var(--bn-gold); font-weight: 600; }
.mainnav-link--deals { background: var(--bn-deals); color: var(--bn-ink); font-weight: 600; margin-left: auto; padding: 18px 20px; }
.mainnav-link--deals:hover { color: var(--bn-ink); filter: brightness(0.96); }

/* Title band: breadcrumb, "Søk etter …", count */
.page-band { background: var(--bn-band); }
.page-band-inner { max-width: 1400px; margin: 0 auto; padding: 14px 24px 30px; }
.page-band #breadcrumb { margin-bottom: 18px; }
.page-band .ais-Breadcrumb-link, .page-band .ais-Breadcrumb-item { color: var(--bn-muted); font-size: 14px; }
.page-band .page-title { font-size: 44px; font-weight: 700; letter-spacing: -0.5px; color: var(--bn-ink); margin: 0 0 6px; line-height: 1.1; }
.page-band #stats { font-size: 14px; color: #4a4a4a; }
.page-band .ais-Stats-text { color: inherit; }
@media (max-width: 800px) { .page-band .page-title { font-size: 30px; } }

/* Filters: open sections with a rule between, like the storefront */
.layout { padding-top: 28px; gap: 32px; }
.panel { background: transparent; border: 0; border-top: 1px solid var(--bn-line); border-radius: 0; padding: 16px 0; }
.panel h3 { font-size: 17px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--bn-ink); margin-bottom: 12px; }
.ais-RefinementList-label, .ais-HierarchicalMenu-link { font-size: 14px; color: var(--bn-text); }
.ais-RefinementList-checkbox { accent-color: var(--bn-teal); }
.ais-ToggleRefinement-checkbox { accent-color: var(--bn-teal); }

.results-toolbar { background: transparent; border: 0; padding: 0; justify-content: flex-end; }
.subcategory-chip, .home-tile { border-color: var(--bn-line); }
.subcategory-chip:hover, .home-tile:hover { border-color: var(--bn-teal); }

/* Cards: white, product photo on white, big price in a pill */
.hit-card { border: 1px solid #eef1f3; border-radius: 6px; }
.hit-card:hover { box-shadow: 0 8px 24px rgba(16, 58, 76, 0.08); }
.hit-image { background: #fff; padding: 14px; }
.hit-image img { object-fit: contain; }
.hit-badges { top: 12px; left: 12px; }
.hit-badge { font-size: 13px; font-weight: 600; letter-spacing: 0; padding: 4px 8px; border-radius: 4px; }
.hit-badge--label, .hit-badge[class*="--"]:not([class*="justin"]):not([class*="lowstock"]):not([class*="soldout"]) { background: var(--bn-badge); }
.hit-badge--soldout { background: #8a8f93; }
.hit-body { padding: 4px 16px 16px; display: flex; flex-direction: column; }
.hit-vendor { font-size: 11px; color: var(--bn-muted); order: 2; margin: 10px 0 2px; border-top: 1px solid var(--bn-line); padding-top: 10px; }
.hit-title { font-size: 15px; font-weight: 500; color: var(--bn-ink); line-height: 1.4; order: 3; min-height: 42px; }
.hit-title mark, .hit-title .ais-Highlight-highlighted { background: transparent; color: var(--bn-link); font-style: normal; }
.hit-price { order: 4; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hit-price-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--bn-pill); border-radius: 999px; padding: 6px 8px 6px 16px; }
.hit-price-pill:has(.hit-discount[hidden]) { padding-right: 16px; }
.hit-price-now { font-size: 22px; font-weight: 700; color: var(--bn-ink); letter-spacing: -0.3px; }
.hit-discount { background: var(--bn-sale); color: #fff; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 4px 9px; }
.hit-compare { font-size: 13px; color: var(--bn-muted); margin-left: 0; }
.hit-swatches { order: 1; margin-top: 4px; }
.hit-match { order: 5; margin-top: 10px; }
.hit-match-title { background: var(--bn-teal); color: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 500; }
.hit-stock--in { color: #1f7a4a; }
.hit-variants { order: 6; }

/* Swatches round, as on bad.no's cards, but with the variant's photo */
.hit-swatch { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--bn-line); padding: 3px; }
.hit-swatch img { border-radius: 50%; }
.hit-swatch:hover { border-color: var(--bn-teal); }
.hit-swatch.is-active { border: 2px solid var(--bn-ink); padding: 2px; }
/* bad.no's colour chips: small flat circles, the active one ringed */
.hit-swatch--chip { flex: none; width: 22px; height: 22px; padding: 0; border: 1px solid var(--bn-line); }
.hit-swatch--chip img { object-fit: cover; }
.hit-swatch--chip.is-photo { background: #fff; }
.hit-swatch--chip.is-photo img { object-fit: contain; }
.hit-swatch--chip.is-active { border: 1px solid var(--bn-line); padding: 0; outline: 2px solid var(--bn-ink); outline-offset: 2px; }
.hit-swatch--chip:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.hit-swatches:has(.hit-swatch--chip) { gap: 7px; padding: 5px; flex-wrap: nowrap; overflow: hidden; min-width: 0; }

/* Start screen */
.home-section h2, .home-group-title { color: var(--bn-ink); }
.home-tile--campaign { background: var(--bn-bar); border-color: var(--bn-bar); }
.ais-InfiniteHits-loadMore { background: var(--bn-ink); color: #fff; border: 0; border-radius: 999px; padding: 0 28px; height: 44px; font-weight: 600; }
.ais-InfiniteHits-loadMore--disabled { display: none !important; }
@media (max-width: 700px) {
  .topbar-inner { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .brand-logo { height: 26px; }
  .searchbox { flex-basis: 100%; max-width: none; }
  .searchbox .ais-SearchBox-input { height: 46px; }
  .page-band-inner, .layout { padding-left: 16px; padding-right: 16px; }
}

/* Number the query hit (NRF, NOBB, Varenr., EAN) */
.hit-id { order: 5; margin-top: 8px; font-size: 12px; color: var(--bn-muted); }
.hit-id strong { color: var(--bn-ink); font-weight: 600; background: #fff6d6; padding: 1px 4px; border-radius: 3px; }
/* debug phase only: SKU and variant ID of the variant the card shows (DEBUG_IDS in app.js) */
.hit-debug { order: 7; margin-top: 6px; font: 11px/1.3 ui-monospace, Menlo, monospace; color: #8a5a00; background: #fff8e6; padding: 2px 4px; border-radius: 3px; overflow-wrap: anywhere; }

/* Category shortcuts for a query */
.query-categories { align-items: center; margin-bottom: 4px; }
.query-categories-label { font-size: 13px; color: var(--bn-muted); margin-right: 2px; }

/* Phone filter drawer; hidden on wide screens */
.filter-toggle, .filter-close, .sidebar-head { display: none; }
@media (max-width: 800px) {
  .results-toolbar { justify-content: space-between; }
  .filter-toggle {
    display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px;
    border: 1px solid var(--bn-ink); background: #fff; color: var(--bn-ink); font: inherit; font-weight: 600; cursor: pointer;
  }
  .sidebar { display: none; }
  body.filters-open { overflow: hidden; }
  body.filters-open .sidebar {
    display: flex; position: fixed; inset: 0; z-index: 50; background: #fff; overflow-y: auto;
    padding: 0 16px 88px; gap: 0;
  }
  body.filters-open .sidebar-head {
    display: block; position: sticky; top: 0; background: #fff; padding: 16px 0; font-size: 18px; z-index: 1;
    border-bottom: 1px solid var(--bn-line);
  }
  body.filters-open .filter-close {
    display: block; position: fixed; left: 16px; right: 16px; bottom: 16px; height: 52px; border: 0; border-radius: 999px;
    background: var(--bn-ink); color: #fff; font: inherit; font-weight: 600; font-size: 16px; cursor: pointer;
  }
  /* Two cards per row, as on bad.no's phone layout */
  #hits .ais-InfiniteHits-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hit-image { padding: 8px; }
  .hit-body { padding: 4px 10px 12px; }
  .hit-title { font-size: 13px; min-height: 36px; }
  .hit-price-pill { padding: 4px 6px 4px 10px; gap: 4px; }
  .hit-price-pill:has(.hit-discount[hidden]) { padding-right: 10px; }
  .hit-price-now { font-size: 16px; }
  .hit-discount { font-size: 11px; padding: 3px 6px; }
  .hit-swatch { width: 28px; height: 28px; }
  .hit-swatch--chip { width: 20px; height: 20px; }
  .hit-swatches:has(.hit-swatch--chip) { flex-wrap: wrap; gap: 8px; } /* two narrow cards per row */
  .hit-badge { font-size: 11px; }
}

/* Team announcement band (index.html #announce) */
.announce { background: #eef5f7; border-bottom: 1px solid var(--bn-line); }
.announce-inner { max-width: 1400px; margin: 0 auto; padding: 14px 24px; font-size: 14px; color: var(--bn-ink); }
.announce-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.announce-head strong { font-size: 16px; }
.announce-toggle { border: 0; background: none; color: var(--bn-teal); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 0; }
.announce-lead { margin: 6px 0 10px; color: var(--bn-muted); }
.announce-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.announce-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.announce-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.announce-pills button {
  border: 1px solid var(--bn-teal); background: #fff; color: var(--bn-teal); border-radius: 999px;
  padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.announce-pills button:hover, .announce-pills button:focus-visible { background: var(--bn-teal); color: #fff; outline: none; }
.announce-note { margin: 10px 0 0; font-size: 12px; color: var(--bn-muted); }
.announce-disclaimer { margin: 0 0 10px; padding: 6px 10px; background: #fff8e6; border-left: 3px solid #e0a800; border-radius: 3px; font-size: 13px; }
.announce.is-folded .announce-body { display: none; }
@media (max-width: 700px) { .announce-inner { padding: 12px 16px; } }
