/* ---------- Grunnleggende layout ---------- */
:root {
  --topbar-z: 2000;
  --dropdown-z: 4100;
  --modal-z: 9999;
  --menu-overlay-z: 3000;
  --menu-z: 3001;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f2f2f2;
  margin: 0;
  padding: 30px;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 {
  color: #e60012;
  margin-bottom: 20px;
}

/* ---------- Tabeller ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

th, td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
}

th {
  background-color: #e60012;
  color: white;
  font-weight: normal;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

.sortable:hover {
  text-decoration: underline;
}

/* ---------- Lenker ---------- */
a {
  color: #e60012;
  text-decoration: none;
  font-weight: bold;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Bilder (presist scope) ---------- */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

table img,
.autocomplete-item img {
  max-height: 60px;
}

.main-image img,
.details-grid img,
.modal-content img,
#modalBody img {
  max-height: none;
}

#runningMario { max-height: none; border-radius: 0; }
#nintendoLogo { max-height: none; height: 120px; width: auto; }

/* ---------- Skjemaer ---------- */
form {
  max-width: 600px;
  background: white;
  padding: 20px;
  margin: auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* ---------- Knapper ---------- */
button,
input[type="submit"] {
  background-color: #e60012;
  color: white;
  padding: 10px 20px;
  margin-top: 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
  background-color: #cc000f;
}

/* ---------- Søkeboks & autofullfør ---------- */
.search-container {
  max-width: 500px;
  margin: 20px auto;
  text-align: center;
  position: relative;
}

#searchInput {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.search-container button,
.search-row button {
  padding: 10px 16px;
  font-size: 1em;
  background-color: #e60012;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 10px;
  white-space: nowrap;
}

.search-container button:hover,
.search-row button:hover {
  background-color: #c00;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input[type="text"] {
  flex: 1;
  padding: 10px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ---------- Autofullfør-resultater ---------- */
.autocomplete-box {
  position: absolute;
  top: calc(100% + 6px);      /* <-- flytt litt ned */
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  z-index: var(--dropdown-z); /* <-- høyere enn topbar-innhold */
  max-height: 250px;
  overflow-y: auto;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-radius: 0 0 4px 4px;
}

/* Når autocomplete ligger i sticky topbar: gi litt ekstra safe-area margin */
.topbar .autocomplete-box {
  top: calc(100% + 6px + env(safe-area-inset-top));
}

.autocomplete-box.show {
  display: block;
  opacity: 1;
  pointer-events: all;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  font-size: 0.95em;
  border-bottom: 1px solid #eee;
  background-color: white;
}

.autocomplete-item:hover {
  background-color: #f9f9f9;
}

.autocomplete-item img {
  width: 40px;
  height: auto;
  border-radius: 4px;
}

.thumb {
  flex-shrink: 0;
}

.no-thumb {
  width: 40px;
  height: 40px;
  background-color: #ddd;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 1.2em;
}

.text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.text small {
  color: #666;
}

/* ---------- Samlingssider ---------- */
.collection-page {
  max-width: 96rem;
  margin: 0 auto;
  padding: 0 .75rem;
  width: 100%;
  box-sizing: border-box;
}

.collection-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.collection-page-title {
  margin: 0;
  color: #111827;
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 800;
}

.collection-page-sub {
  color: #6b7280;
  margin-top: .25rem;
}

.collection-page-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.collection-page-metrics span {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: .78rem;
  font-weight: 700;
  padding: .3rem .65rem;
}

.collection-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

.collection-sidebar {
  position: sticky;
  top: 8.5rem;
  z-index: 20;
}

.collection-filter-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 1rem;
}

.collection-filter-title {
  color: #111827;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .04em;
  margin-bottom: .8rem;
  text-transform: uppercase;
}

.collection-filter-form {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  max-width: none;
  margin: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
}

.collection-filter-field {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.collection-filter-field label {
  color: #6b7280;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  margin: 0;
  text-transform: uppercase;
}

.collection-filter-field select {
  height: 2.25rem;
  margin: 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: .82rem;
  font-weight: 700;
  padding: 0 2rem 0 .65rem;
}

.collection-filter-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  margin-top: .2rem;
}

.collection-filter-submit,
.collection-filter-reset {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-size: .82rem;
  font-weight: 800;
  height: 2.25rem;
  justify-content: center;
  padding: 0 .85rem;
}

.collection-filter-submit {
  background: #dc2626;
  border: 1px solid #dc2626;
  color: #fff;
  margin: 0;
}

.collection-filter-submit:hover {
  background: #b91c1c;
}

.collection-filter-reset {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
  text-decoration: none;
}

.collection-results {
  min-width: 0;
  width: 100%;
}

.collection-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.collection-card-grid.is-magazines {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.collection-card-grid.is-magazines .collection-card-title {
  min-height: 3.75em;
}

.collection-card-grid.is-magazines .collection-card-flags {
  margin-top: auto;
}

.collection-card {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  overflow: hidden;
}

.collection-card:hover {
  border-color: #fca5a5;
  box-shadow: 0 10px 26px rgba(230,0,18,.1);
}

.collection-card-media {
  background: linear-gradient(180deg,#f9fafb,#f3f4f6);
  display: grid;
  height: 210px;
  padding: .8rem;
  place-items: center;
}

.collection-card-media img {
  max-height: 190px;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.collection-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .55rem;
  padding: .9rem;
}

.collection-card-title {
  color: #b91c1c;
  font-size: .98rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.collection-card-title:hover {
  text-decoration: underline;
}

.collection-card-meta {
  color: #6b7280;
  font-size: .78rem;
  font-weight: 700;
}

.collection-card-flags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.collection-card-flag {
  align-items: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #374151;
  display: inline-flex;
  font-size: .72rem;
  font-weight: 800;
  gap: .25rem;
  padding: .22rem .5rem;
}

.collection-card-price {
  background: #fef2f2;
  border-color: #fecaca;
  color: #111827;
}

.collection-card-text {
  color: #374151;
  font-size: .82rem;
  line-height: 1.4;
  margin-top: auto;
}

.collection-list {
  display: grid;
  gap: 1rem;
}

.collection-list-card {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
  overflow: hidden;
}

.collection-list-media {
  height: 172px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
}

.collection-list-media img {
  max-height: 160px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.collection-list-placeholder {
  width: 100%;
  height: 100%;
  min-height: 72px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg,#f8fafc,#fee2e2);
  border: 1px dashed #fca5a5;
  color: #991b1b;
  font-weight: 900;
  letter-spacing: .08em;
}

.collection-list-body {
  padding: 1rem;
}

.collection-list-title {
  color: #b91c1c;
  font-size: 1.18rem;
  line-height: 1.2;
  font-weight: 800;
}

.collection-list-title:hover {
  text-decoration: underline;
}

.collection-list-meta {
  color: #4b5563;
  font-size: .92rem;
  margin-top: .35rem;
}

.collection-list-text {
  color: #374151;
  font-size: .92rem;
  line-height: 1.45;
  margin-top: .7rem;
}

.collection-mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .7rem 0 0;
}

.collection-mini-stat {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 999px;
  padding: .25rem .55rem;
  font-size: .75rem;
  font-weight: 700;
  color: #374151;
}

/* ---------- Modal ---------- */
.modal {
  display: none;
  position: fixed;
  z-index: var(--modal-z);
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  padding: calc(16px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.modal-content {
  background-color: #fff;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 800px;
  border-radius: 8px;
  max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: hidden;
  box-sizing: border-box;
}

.close {
  color: #aaa;
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

#modalBody {
  font-family: 'Inter', system-ui, sans-serif;
  background: #fff;
  padding: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 92px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

/* ---------- Detalj-visning ---------- */
.main-container {
  max-width: 800px;
  margin: auto;
}

.main-image {
  text-align: center;
  margin-bottom: 20px;
}

.main-image img {
  max-width: 100%;
  max-height: 350px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  object-fit: contain;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.details-grid p {
  margin: 0;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 6px;
}

.details-box {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin-bottom: 20px;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
}

.details-box h3 {
  margin-top: 0;
  font-size: 1.2em;
}

/* ---------- Admin-lenker ---------- */
.admin-links {
  text-align: center;
  margin-top: 30px;
}

.admin-links a {
  margin: 0 10px;
  color: #c00;
  text-decoration: none;
  font-weight: bold;
}

.admin-links a:hover {
  text-decoration: underline;
}

/* ---------- Mario / varsler ---------- */
#runningMario {
  display: block;
  margin: 0 auto;
  width: 200px;
  height: auto;
  margin-bottom: -10px;
  pointer-events: none;
}

./* =========================================================
   Finn-varsel som ikon i topbar (med badge)
   ========================================================= */

.finn-icon-link{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0,0,0,0.04);
  text-decoration: none;
}

.finn-icon-link:hover{
  background: rgba(0,0,0,0.08);
  text-decoration: none;
}

.finn-icon{
  font-size: 18px;
  line-height: 1;
}

.finn-badge{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #e60012;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

/* Når vi bruker badge inne i mobil-lenke (inline) */
.finn-badge.inline{
  position: static;
  top: auto;
  right: auto;
  margin-left: 8px;
  height: 18px;
}

/* Mobilmeny-lenke (valgfritt) */
.finn-mobile-link{
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

@media (min-width: 641px) and (max-width: 1024px) {
  .collection-page {
    max-width: 72rem;
  }

  .collection-layout {
    grid-template-columns: 1fr;
  }

  .collection-sidebar {
    position: static;
  }

  .collection-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

  .collection-filter-actions {
    grid-template-columns: 1fr 1fr;
    margin-top: 1.05rem;
  }
}

/* ---------- Mobiltilpasning ---------- */
@media (max-width: 640px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
  }

  h1 {
    font-size: 1.4em;
    margin-bottom: 16px;
    text-align: center;
  }

  table {
    font-size: 0.85em;
  }

  th, td {
    padding: 8px;
  }

  .search-row {
    flex-direction: column;
    gap: 6px;
  }

  .search-container {
    padding: 0 10px;
  }

  .search-container button {
    width: 100%;
  }

  .collection-page {
    padding: 0 .5rem;
  }

  .collection-page-header {
    align-items: flex-start;
    margin: .9rem 0;
  }

  .collection-page-title {
    font-size: 1.45rem;
  }

  .collection-layout {
    display: block;
  }

  .collection-sidebar {
    margin-bottom: 1rem;
    position: static;
  }

  .collection-filter-card {
    padding: .85rem;
  }

  .collection-filter-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
  }

  .collection-filter-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .collection-card-grid {
    grid-template-columns: 1fr;
  }

  .collection-card-grid.is-magazines .collection-card-title {
    min-height: 0;
  }

  .collection-card-media {
    height: 132px;
  }

  .collection-card-media img {
    max-height: 124px;
  }

  .collection-card-body {
    padding: .85rem;
  }

  .collection-list-media {
    height: 132px;
  }

  .collection-list-media img {
    max-height: 124px;
  }

  .collection-list-body {
    padding: .85rem;
  }

  .modal-content {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 12px;
    border-radius: 14px;
    border-color: rgba(0,0,0,.16);
  }

  #modalBody {
    padding: 6px;
    max-height: calc(100vh - 64px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .admin-links {
    font-size: 0.9em;
  }

  .main-image img {
    max-height: 200px;
  }

  center h1 a img:first-child {
    display: none;
  }

  center p a {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    margin: 6px;
  }
}

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Skru av "kort"-stilen på små skjemaer inne i tabeller */
td form,
th form {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  display: inline !important;
}

/* Sørg for at knappen ser riktig ut */
td form button,
td form input[type="submit"] {
  background-color: #e60012;
  color: #fff;
  padding: 8px 14px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
td form button:hover,
td form input[type="submit"]:hover {
  background-color: #cc000f;
}

/* =========================================================
   UX: Sticky toppbar + burger-meny på mobil
   ========================================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--topbar-z);
  background: #ffffff;
  border-bottom: 3px solid #e60012;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);

  /* Full width (bryter ut av body padding) */
  margin: -30px -30px 0 -30px;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@media (max-width: 640px){
  body {
    padding-top: var(--mobile-topbar-height, 104px);
  }

  .topbar{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    margin: 0;
  }
}

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

/* Logo */
.topbar-logo img#nintendoLogo {
  height: 44px;
  width: auto;
  border-radius: 0;
  filter: saturate(1.05);
}

/* Desktop lenker */
.topbar-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.95em;
  line-height: 1;
}

.topbar-links a {
  color: #111;
  font-weight: 700;
  text-decoration: none;
}

.topbar-links a:hover {
  text-decoration: underline;
}

.topbar-links .sep {
  color: rgba(0,0,0,0.35);
  font-weight: 600;
}

.profile-menu-link {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
}

.profile-menu-avatar {
  display: block;
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  flex: 0 0 28px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 50%;
  background: #f3f4f6;
  object-fit: cover;
}

.profile-menu-fallback {
  display: grid;
  place-items: center;
  font-size: 14px;
}

/* Søk i toppbar */
.topbar-search {
  position: relative;
  margin-left: auto;
  width: min(640px, 100%);
  flex: 1 1 420px;
}

.topbar-search form {
  max-width: none;
  background: transparent;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

.topbar-search .search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topbar-search #searchInput {
  height: 42px;
  padding: 9px 12px;
  font-size: 1em;
  border: 2px solid rgba(230,0,18,0.26);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.topbar-search #searchInput:focus {
  outline: none;
  border-color: rgba(230,0,18,0.55);
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
}

.topbar-search button {
  height: 42px;
  padding: 8px 14px;
  margin-top: 0 !important;
  background-color: #e60012;
  border-radius: 10px;
  white-space: nowrap;
}

.topbar-search .autocomplete-box {
  border-radius: 10px;
  border-top: 1px solid #ddd;
  overflow: hidden;
}

.topbar-search .autocomplete-item {
  align-items: flex-start;
}

.topbar-search .autocomplete-item .text strong {
  color: #111827;
}

.topbar-search .autocomplete-item .text small {
  color: #4b5563;
  line-height: 1.35;
}
.topbar-search button:hover {
  background-color: #cc000f;
}

/* Burger-knapp */
.burger-btn {
  display: none; /* vises kun på mobil */
  width: 44px;
  height: 40px;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;

  position: relative;
  z-index: 3005;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.burger-btn span {
  display: block;
  height: 3px;
  width: 22px;
  margin: 4px auto;
  background: #111;
  border-radius: 3px;
}

/* Mobil meny */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: var(--menu-overlay-z);
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 86vw);
  height: 100%;
  background: #fff;
  z-index: var(--menu-z);
  transform: translateX(-110%);
  transition: transform .18s ease;
  box-shadow: 10px 0 30px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-header {
  padding: 14px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-title {
  font-weight: 800;
  color: #111;
}

.mobile-menu-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #111;
}

.mobile-menu-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu-body a {
  padding: 10px 10px;
  border-radius: 10px;
  background: #f6f6f6;
  color: #111;
  font-weight: 800;
  text-decoration: none;
}

.mobile-menu-body a:hover {
  background: #eee;
}

.mobile-menu-divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 8px 0;
}

/* Aktiv kategori – basert på data-page */
.grid a.flex.flex-col.items-center {
  padding: 10px 14px;
  border-radius: 12px;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.grid a.flex.flex-col.items-center:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

body[data-page="index"]       .grid a[href="/index.php"],
body[data-page="consoles"]    .grid a[href="/pages/consoles/consoles.php"],
body[data-page="magazines"]   .grid a[href="/pages/magazines/magazines.php"],
body[data-page="accessories"] .grid a[href="/pages/accessories/accessories.php"] {
  background: #fff;
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
  outline: 2px solid rgba(230,0,18,0.35);
}

body[data-page="index"]       .grid a[href="/index.php"] span,
body[data-page="consoles"]    .grid a[href="/pages/consoles/consoles.php"] span,
body[data-page="magazines"]   .grid a[href="/pages/magazines/magazines.php"] span,
body[data-page="accessories"] .grid a[href="/pages/accessories/accessories.php"] span {
  color: #e60012;
}

/* Desktop/mobil toggles */
.desktop-only { display: flex; }

/* Mobil: burger på, desktop-lenker av, søk full bredde */
@media (max-width: 640px) {
  .burger-btn { display: inline-block; }
  .desktop-only { display: none; }

  body > .grid {
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  .topbar,
  .topbar-inner,
  .topbar-search,
  .topbar-search form,
  .topbar-search .search-row {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .topbar-inner {
    padding: 10px 10px;
    gap: 10px;
  }

  .topbar-logo img#nintendoLogo {
    height: 40px;
  }

  .topbar-search {
    flex: 1 1 100%;
    margin-left: 0;
    width: 100%;
  }

  /* På mobil vil vi ikke ha kolonne-input her; hold den inline */
  .topbar-search .search-row {
    flex-direction: row;
  }

  .topbar-search button {
    flex: 0 0 auto;
    width: auto;
  }

  .topbar-search #searchInput {
    min-width: 0;
  }
}

/* Når meny er åpen: hindre scrolling bak */
body.menu-open {
  overflow: hidden;
}

/* Når overlay er hidden skal den ikke fange touch i noen webviews */
.mobile-menu-overlay[hidden]{
  display: none !important;
}

/* =========================================================
   FIX: Hurtigfilter/dropdowns i header under sticky banner
   (bruk denne klassen på hurtigfilter-container om du har den)
   ========================================================= */

/* Sticky hurtigfilter UNDER toppbaren */

.quick-filter {
  position: sticky;
  top: 65px;            /* desktop */
  z-index: 1500;
  background: transparent;
  border-bottom: 1px solid transparent;
  margin: .2rem -30px .75rem;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, backdrop-filter .18s ease;
}

.quick-filter.is-stuck {
  background: rgba(255,255,255,.94);
  border-bottom-color: #e5e7eb;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
  .quick-filter {
    top: 115px;         /* mobil */
    margin: .1rem 0 .65rem;
  }
}

/* ===== Aktiv konsoll-chip basert på scroll ===== */
:target {
  scroll-margin-top: 140px; /* matcher sticky offset */
}

/* Default */
.console-chip {
  background-color: #e60012;
  transition: all .15s ease;
}

/* Når SNES er i view → marker SNES-chip */
#nes:target ~ .quick-filter a[href="#nes"],
#snes:target ~ .quick-filter a[href="#snes"],
#n64:target ~ .quick-filter a[href="#n64"],
#gc:target ~ .quick-filter a[href="#gc"],
#wii:target ~ .quick-filter a[href="#wii"],
#wii-u:target ~ .quick-filter a[href="#wii-u"],
#switch:target ~ .quick-filter a[href="#switch"],
#gb:target ~ .quick-filter a[href="#gb"],
#ds:target ~ .quick-filter a[href="#ds"] {
  background-color: #111;
  box-shadow: 0 0 0 3px rgba(230,0,18,.35);
  transform: translateY(-1px);
}

/* Aktiv konsoll-chip (overstyr tailwind bg-red-600 osv) */
.console-chip.active {
  background: #ffffff !important;
  color: #e60012 !important;
  border: 2px solid #e60012 !important;
  box-shadow: 0 0 0 3px rgba(230, 0, 18, .18) !important;
}

/* === Finn badge i topbar === */
.topbar,
.topbar-inner,
.topbar-links {
  overflow: visible !important; /* hindrer at badge blir klippet */
}

.finn-icon-link{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.finn-icon{
  display: inline-block;
  line-height: 1;
}

.finn-badge{
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e60012;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
  z-index: 10;
}

/* Mobil-badge (inne i lenke, ikke absolute) */
.finn-badge.inline{
  position: static;
  top: auto;
  right: auto;
  margin-left: auto;
  box-shadow: none;
}
