/* Spacenter Mega Menu – i stil med usspa.com: versala menyord, vit panel med stor
   textlista till vänster och liggande produktkort till höger.
   Allt prefixat med .scm så att Uncode-temat inte påverkas. */
.scm {
  --scm-navy: #0e3750;
  --scm-blue: #659ed4;
  --scm-ink: #111a22;
  --scm-text: #3a4752;
  --scm-muted: #5b6874;
  --scm-gray: #f3f4f6;
  --scm-gray-2: #e9ecef;
  --scm-line: #d9dee3;
  --scm-font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --scm-top: 84px;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--scm-font);
}
.scm *, .scm *::before, .scm *::after { box-sizing: border-box; }
.scm ul { list-style: none; margin: 0; padding: 0; }
.scm a { text-decoration: none; }
.scm small, .scm b { margin: 0; } /* Uncode ger small 18 px marginal */
/* Rester från tidigare version (om en gammal kombinerad stilfil ligger kvar i cachen) */
.scm .scm-top + .scm-top::before { content: none; display: none; }
.scm .scm-pill { background: none !important; border-radius: 0; padding: 0; }

/* ---------- Huvudnivå: versaler, luftigt, ingen ram ---------- */
.scm-top { position: static; display: flex; align-items: center; flex: 0 0 auto; width: auto; margin: 0; padding: 0 12px; }
.scm-pill { display: inline-flex; align-items: center; height: 44px; position: relative; }
.scm-pill::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px;
  background: var(--scm-blue); transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.scm-top.is-open > .scm-pill::after, .scm-pill:hover::after { transform: scaleX(1); }
.scm .scm-top-link {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.scm .scm-toggle {
  display: grid; place-items: center;
  width: 18px; height: 28px;
  margin: 0 0 0 4px; padding: 0;
  border: 0; border-radius: 4px;
  background: none;
  color: #fff;
  cursor: pointer;
}
.scm-toggle svg { width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: rotate .15s; }
.scm-top.is-open .scm-toggle svg { rotate: 180deg; }
.scm .scm-top-link[aria-current="page"] { color: #cfe3f5; }
.scm .scm-top-link:focus-visible, .scm .scm-toggle:focus-visible { outline: 2px solid var(--scm-blue); outline-offset: 3px; border-radius: 2px; }

/* ---------- Megapanel ---------- */
.scm-panel {
  position: fixed;
  top: var(--scm-top);
  left: 0; right: 0;
  z-index: 9999;
  max-height: calc(100vh - var(--scm-top));
  overflow-y: auto;
  background: #fff;
  border-top: 1px solid var(--scm-line);
  box-shadow: 0 24px 40px rgba(17, 26, 34, .12);
  opacity: 0; visibility: hidden;
  translate: 0 -6px;
  transition: opacity .16s ease, translate .16s ease, visibility 0s linear .16s;
}
.scm-top.is-open > .scm-panel { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; }
.scm-panel-in {
  max-width: 1420px;
  margin: 0 auto;
  padding: 44px 40px 56px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}

.scm-list li { border-bottom: 1px solid var(--scm-line); }
.scm-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 2px;
  color: var(--scm-ink);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .01em;
}
.scm-list a svg { flex: none; width: 7px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: translate .15s; }
.scm-list a:hover { color: var(--scm-navy); }
.scm-list a:hover svg { translate: 3px 0; }
.scm-list .scm-strong a { font-size: 22px; font-weight: 700; padding-top: 6px; }
.scm-list .scm-divider { margin-top: 26px; padding-top: 0; border-top: 0; } /* luft mellan grupper; raden ovanför har redan sin linje */
.scm-list a[aria-current="page"] span { color: var(--scm-navy); font-weight: 600; }

.scm-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 32px;
  align-content: start;
}
.scm .scm-card {
  display: flex; align-items: center; gap: 18px;
  min-height: 116px;
  padding: 14px 14px 14px 16px;
  border-radius: 8px;
  background: var(--scm-gray);
  color: var(--scm-ink);
  transition: background .15s;
}
.scm .scm-card:hover { background: var(--scm-gray-2); }
.scm-card-img { flex: none; display: grid; place-items: center; width: 76px; height: 76px; }
.scm-card-img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: scale .2s; }
.scm .scm-card:hover .scm-card-img img { scale: 1.05; }
.scm-card-txt { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.scm-card-txt b { font-size: 19px; font-weight: 600; line-height: 1.15; letter-spacing: .01em; }
.scm-card-txt small {
  color: var(--scm-muted);
  font-size: 12px; font-weight: 500; line-height: 1.45;
  letter-spacing: .1em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.scm-list a:focus-visible, .scm .scm-card:focus-visible, .scm-drop a:focus-visible { outline: 2px solid var(--scm-blue); outline-offset: 2px; border-radius: 6px; }

/* ---------- Enkel rullgardin (Boka service, Support) ---------- */
.scm-simple { position: relative; }
.scm-drop {
  position: absolute;
  top: calc(100% + 10px); right: 0;
  z-index: 9999;
  min-width: 240px;
  padding: 12px;
  background: #fff;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 16px 36px rgba(14, 55, 80, .18);
  opacity: 0; visibility: hidden; translate: 0 -4px;
  transition: opacity .15s, translate .15s, visibility 0s linear .15s;
}
.scm-drop::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* hover-brygga */
.scm-top.is-open > .scm-drop { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; }
.scm-drop a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--scm-text); font-size: 16px; }
.scm-drop a:hover { background: var(--scm-gray); color: var(--scm-ink); }

/* ---------- Sökfält och direktförslag ---------- */
.scm-search-li { flex: 0 1 300px; margin: 0 0 0 20px; padding: 0; }
.scm-search { position: relative; display: flex; align-items: center; margin: 0; }
.scm .scm-search input {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 52px 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--scm-ink);
  font-family: var(--scm-font);
  font-size: 15px;
  box-shadow: inset 0 1px 3px rgba(14, 55, 80, .12);
  -webkit-appearance: none;
  appearance: none;
}
.scm .scm-search input::placeholder { color: #8a97a3; }
.scm .scm-search input:focus { outline: none; border-color: var(--scm-blue); box-shadow: 0 0 0 3px rgba(101, 158, 212, .35); }
.scm .scm-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.scm .scm-search button {
  position: absolute; right: 4px; top: 4px;
  width: 36px; height: 36px;
  margin: 0; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--scm-blue);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
.scm .scm-search button:hover { background: #3f7fbd; }
.scm-search button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.scm-results {
  position: fixed;
  top: var(--scm-top);
  left: 0; right: 0;
  z-index: 9998;
  max-height: calc(100vh - var(--scm-top));
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 24px 48px rgba(14, 55, 80, .18);
}
.scm-results-in { max-width: 1320px; margin: 0 auto; padding: 24px 36px 28px; }
.scm-results-h { margin: 0 0 12px; color: var(--scm-ink); font-size: 18px; font-weight: 600; }
.scm-results-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.scm-results-cats a {
  padding: 8px 14px;
  border: 1px solid var(--scm-line);
  border-radius: 999px;
  color: var(--scm-navy);
  font-size: 14px;
  font-weight: 500;
}
.scm-results-cats a:hover { border-color: var(--scm-blue); background: var(--scm-gray); }
.scm-results-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.scm .scm-hit {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px;
  border: 1px solid var(--scm-line);
  border-radius: 10px;
  color: var(--scm-ink);
  transition: border-color .15s, box-shadow .15s;
}
.scm .scm-hit:hover { border-color: #b9cde0; box-shadow: 0 6px 18px rgba(14, 55, 80, .1); }
.scm-hit-img { display: block; aspect-ratio: 1; }
.scm-hit-img img { width: 100%; height: 100%; object-fit: contain; }
.scm-hit-name {
  font-size: 14px; font-weight: 500; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.scm-hit-price { margin-top: auto; color: var(--scm-navy); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.scm-results-msg { margin: 0 0 8px; color: var(--scm-text); font-size: 15px; }
.scm .scm-results-all { display: inline-block; margin-top: 20px; color: var(--scm-navy); font-size: 15px; font-weight: 600; }
.scm .scm-results-all:hover { color: #3f7fbd; }
.scm .scm-hit:focus-visible, .scm-results-cats a:focus-visible, .scm .scm-results-all:focus-visible { outline: 2px solid var(--scm-blue); outline-offset: 2px; }

@media (max-width: 1500px) {
  .scm-search-li { flex-basis: 240px; margin-left: 14px; }
}
/* Smalare skärmar: bara en rund sökknapp som fälls ut till ett fält. */
@media (min-width: 960px) and (max-width: 1279px) {
  .scm-search-li { position: relative; flex: 0 0 44px; height: 44px; margin-left: 10px; }
  .scm-search { position: absolute; right: 0; top: 0; width: 44px; z-index: 2; transition: width .2s ease; }
  .scm .scm-search input { padding: 0; border: 0; background: rgba(255, 255, 255, .14); box-shadow: none; cursor: pointer; color: transparent; }
  .scm .scm-search input::placeholder { color: transparent; }
  .scm-search:focus-within, .scm-search.is-active { width: min(340px, 60vw); }
  .scm-search:focus-within input, .scm-search.is-active input { padding: 0 52px 0 18px; background: #fff; color: var(--scm-ink); cursor: text; }
  .scm-search:focus-within input::placeholder { color: #8a97a3; }
  .scm-results-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


@media (max-width: 1280px) {
  .scm-panel-in { grid-template-columns: 280px minmax(0, 1fr); gap: 40px; padding: 36px 28px 44px; }
  .scm-list a { font-size: 18px; padding: 15px 2px; }
  .scm-list .scm-strong a { font-size: 20px; }
  .scm-cards { gap: 12px 18px; }
  .scm-card-img { width: 72px; height: 72px; }
  .scm-card-txt b { font-size: 18px; }
  .scm-top { padding: 0 8px; }
  .scm .scm-top-link { font-size: 13px; }
}

/* ---------- Mobil (inne i Uncodes mobilmeny) ---------- */
@media (max-width: 959px) {
  .scm { display: block; padding: 6px 20px 18px; }
  .scm-top { flex-wrap: wrap; padding: 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
  .scm-pill { width: 100%; height: auto; }
  .scm-pill::after { display: none; }
  .scm .scm-top-link { flex: 1; padding: 16px 2px; font-size: 16px; color: #fff; }
  .scm .scm-toggle { width: 48px; height: 48px; color: #fff; }
  .scm-toggle svg { width: 13px; height: 13px; }
  .scm-panel, .scm-drop {
    position: static;
    flex-basis: 100%;
    display: none;
    max-height: none;
    opacity: 1; visibility: visible; translate: none;
    margin: 0 0 14px;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    transition: none;
  }
  .scm-top.is-open > .scm-panel, .scm-top.is-open > .scm-drop { display: block; }
  .scm-panel-in { display: block; padding: 6px 16px 16px; }
  .scm-list { margin-bottom: 14px; }
  .scm-list a { font-size: 16px; padding: 13px 0; }
  .scm-list .scm-strong a { font-size: 17px; padding-top: 10px; }
  .scm-list .scm-divider { margin-top: 12px; }
  .scm-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .scm .scm-card { min-height: 0; gap: 14px; padding: 10px 12px; }
  .scm-card-img { width: 56px; height: 56px; }
  .scm-card-txt { gap: 4px; }
  .scm-card-txt b { font-size: 16px; }
  .scm-card-txt small { font-size: 11px; }
}

@media (max-width: 959px) {
  .scm { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; height: auto; }
  .scm-search-li { display: block; flex: none; order: -1; margin: 8px 0 12px; border: 0 !important; }
  .scm-results { position: static; max-height: none; margin-top: 10px; border-radius: 14px; box-shadow: none; }
  .scm-results-in { padding: 16px; }
  .scm-results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .scm .scm-hit { padding: 10px; }
  .scm-hit-price { font-size: 15px; }
}

/* Smala datorskärmar: tätare huvudmeny och två kortkolumner (ligger sist så att den vinner). */
@media (min-width: 960px) and (max-width: 1150px) {
  .scm .scm-top-link { font-size: 12px; letter-spacing: .05em; }
  .scm-top { padding: 0 5px; }
  .scm .scm-toggle { width: 14px; margin-left: 2px; }
  .scm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .scm *, .scm *::before, .scm *::after { transition: none !important; }
}
