/* =========================================================
   LAZLO – STÄDAD & DOKUMENTERAD CSS (HELA FILEN) – UPDATE
   ---------------------------------------------------------
   ÄNDRINGAR I DENNA VERSION (viktigast):
   - Kategoriknappar vänsterställda: .category-quicklinks (justify-content + text-align)
   - Tips-badges vänsterställda: .add-ad-tip (justify-content + text-align)
   - Intro-block vänsterställt: .index-intro, .intro-block (text-align)
   - XMAS-baren: text vänsterställd (tog bort all text-centering i freebar)
   ========================================================= */


/* =========================================================
   [1] DESIGN TOKENS / CSS-VARIABLER
   ========================================================= */
:root {
  --bg-page: #f3f5f7;
  --text-main: #222;
  --card-bg: #fff;
  --border-main: rgba(11, 58, 94, 0.08);

  --brand: #0b3a5e;            /* Lazlo 2.0-blå */
  --brand-2: #1e88e5;          /* CTA-blå */
  --danger: #b52020;
  --muted: #666;

  --green-1: #0f5f2f;          /* Alla (grön) */
  --green-2: #22a35a;

  --red-1: #7a0c0c;            /* Köpes (röd) */
  --red-2: #c5162e;

  --blue-1: #0b3a5e;           /* Säljes (blå) */
  --blue-2: #0f5fa0;

  --radius-card: 12px;
  --radius-pill: 999px;
  --radius-input: 10px;

  --shadow-card: 0 10px 26px rgba(11, 58, 94, 0.06);
}


/* =========================================================
   [2] RESET / BASREGLER
   ========================================================= */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  padding-top: 80px; /* plats för fixed header */

  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

h2 { margin-top: 0; font-size: 20px; }


/* =========================================================
   [3] LAYOUT: HEADER / NAV / CONTAINER / FOOTER
   ========================================================= */

/* Header (glass) */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  background: rgba(11, 58, 94, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);

  color: #fff;
  padding: 6px 20px 8px;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;

  max-width: 1100px;
  margin: 0 auto;

  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Header logo */
.header-logo {
  width: 220px;
  height: 66px;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-right: 10px;
  flex: 0 0 auto;
}

.header-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;

  border-radius: 4px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  line-height: 1.1;
}

.logo-text h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
}

.logo-text h1 a { color: #fff; text-decoration: none; }

.logo-slogan {
  font-size: 13px;
  margin: 2px 0 0;
  opacity: 0.85;
  letter-spacing: 0.3px;
}

/* Legacy om .logo finns kvar */
.logo a {
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
}

.header-sub {
  margin: 3px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

/* Nav */
.main-nav {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.main-nav a {
  color: #fff;
  text-decoration: none;

  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0);
}

.main-nav a:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
}

/* FIX: Top-bar ska stapla innehåll och vänsterställa */
.top-bar{
  flex-direction: column;
  align-items: flex-start;
}

.top-bar > *{
  width: 100%;
}

/* Add-ad knappar + badges */
.add-ad-actions,
.add-ad-tip{
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  text-align: left;
}

/* Container */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 15px;
}

/* Footer */
footer {
  margin-top: 30px;
  background: var(--brand);
  color: #fff;
  padding: 12px 0;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-inner a { color: #fff; text-decoration: underline; }


/* =========================================================
   [4] KOMPONENTER: CARD / FORM / BUTTONS / MESSAGES
   ========================================================= */

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 15px 18px;
  margin-bottom: 15px;

  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-main);
}

/* Form */
form .field { margin-bottom: 12px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 8px 10px;

  border-radius: var(--radius-input);
  border: 1px solid #ccd3dd;

  font-size: 14px;
  background: #fff;

  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: rgba(0, 140, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 140, 255, 0.12);
}

textarea { min-height: 80px; resize: vertical; }
input[type="file"] { font-size: 13px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: none;

  background: var(--brand);
  color: #fff;

  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;

  transition: transform 0.08s ease, filter 0.18s ease;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }

.btn-secondary { background: #4b5b6b; }
.btn-danger { background: var(--danger); }
.btn-primary { background: var(--brand-2); color: #fff; }

/* Messages */
.message {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}

.message-success {
  background: #e6f6e9;
  color: #205528;
  border: 1px solid #b6dfc0;
}

.message-error {
  background: #ffe6e6;
  color: #7b1010;
  border: 1px solid #f3b1b1;
}


/* =========================================================
   [5] INDEX-INTRO
   ========================================================= */
/* UPDATE: vänsterställ istället för center */
.index-intro,
.intro-block {
  text-align: left;
  margin: 0 auto 12px;
}

.index-intro p,
.intro-block p {
  max-width: 900px;
  margin: 8px 0;           /* UPDATE: inte auto (som centrerar block visuellt) */
  line-height: 1.5;
  color: #444;
}

/* Kategoriraden */
/* UPDATE: vänsterställ */
.category-quicklinks {
  display: flex;
  justify-content: flex-start;  /* UPDATE */
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;

  margin: 10px 0 14px;          /* UPDATE: inte auto */
  text-align: left;             /* UPDATE */

  color: var(--brand);
  font-size: 13px;
}

.category-quicklinks a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 10px;
  border-radius: var(--radius-pill);

  text-decoration: none;
  font-weight: 800;

  position: relative;
  isolation: isolate;

  background: linear-gradient(135deg, #eaf4ff, #dcedff 55%, #eaf4ff);
  border: 1px solid rgba(11, 58, 94, 0.18);
  color: var(--brand);

  box-shadow:
    0 10px 22px rgba(11, 58, 94, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);

  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.category-quicklinks a::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  z-index: -1;

  background: radial-gradient(900px 80px at 30% 0%, rgba(255, 255, 255, 0.85), transparent 60%);
  opacity: 1;
}

.category-quicklinks a:hover {
  filter: brightness(1.03);
  border-color: rgba(11, 58, 94, 0.28);
  box-shadow:
    0 14px 30px rgba(11, 58, 94, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.category-quicklinks a:active { transform: translateY(1px); }

.category-quicklinks a.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2) 55%, var(--brand));
  box-shadow:
    0 14px 34px rgba(11, 58, 94, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  text-decoration: none;
}

.category-quicklinks a.active::before {
  background: radial-gradient(900px 80px at 30% 0%, rgba(255, 255, 255, 0.30), transparent 60%);
}


/* =========================================================
   [6] ADD-AD BOX
   ========================================================= */
.add-ad-box { margin-bottom: 16px; }

/* En rad på desktop, wrap på mobil */
.add-ad-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: nowrap;
  margin-left: 0;
}

.type-quicklinks {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

/* Filterknappar */
.type-quicklinks a.btn.btn-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 14px;
  border-radius: var(--radius-pill);

  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.3px;
  text-decoration: none;

  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);

  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;

  position: relative;
  isolation: isolate;
}

.type-quicklinks a.btn.btn-filter:hover { filter: brightness(1.05); }
.type-quicklinks a.btn.btn-filter:active { transform: translateY(1px); }

/* 🟢 ALLA */
.type-quicklinks a.btn.btn-filter:not([href*="ad_type="]) {
  background: linear-gradient(135deg, var(--green-1), var(--green-2) 55%, var(--green-1));
}

/* 🔵 SÄLJES */
.type-quicklinks a.btn.btn-filter[href*="ad_type=saljes"] {
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2) 55%, var(--blue-1));
}

/* 🔴 KÖPES */
.type-quicklinks a.btn.btn-filter[href*="ad_type=kopes"] {
  background: linear-gradient(135deg, var(--red-1), var(--red-2) 55%, var(--red-1));
}

/* Active glow */
.type-quicklinks a.btn.btn-filter.active::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  z-index: -1;

  background: rgba(255, 255, 255, 0.35);
  filter: blur(6px);
  opacity: 0.6;
}

/* CTA i raden (ligger efter typknappar) */
.add-ad-actions .btn-primary {
  white-space: nowrap;

  position: relative;
  isolation: isolate;

  background: linear-gradient(135deg, var(--brand-2), #4bb1ff 55%, var(--brand-2));
  border: 1px solid rgba(255, 255, 255, 0.18);

  box-shadow:
    0 12px 28px rgba(30, 136, 229, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);

  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.add-ad-actions .btn-primary::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  z-index: -1;

  background: radial-gradient(900px 80px at 30% 0%, rgba(255, 255, 255, 0.55), transparent 60%);
  opacity: 0.95;
}

.add-ad-actions .btn-primary:hover {
  filter: brightness(1.04);
  box-shadow:
    0 16px 34px rgba(30, 136, 229, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.add-ad-actions .btn-primary:active { transform: translateY(1px); }

/* Tipsrad */
/* UPDATE: vänsterställ */
.add-ad-tip {
  display: flex;
  justify-content: flex-start;   /* UPDATE */
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;

  text-align: left;              /* UPDATE */
  margin-top: 10px;
}

.add-ad-tip .gfm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 12px;
  border-radius: var(--radius-pill);

  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;

  position: relative;
  isolation: isolate;

  color: #0b3a5e;
  border: 1px solid rgba(11, 58, 94, 0.18);

  box-shadow:
    0 10px 22px rgba(11, 58, 94, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.70);

  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.add-ad-tip .gfm-badge::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  z-index: -1;

  background: radial-gradient(900px 70px at 30% 0%, rgba(255, 255, 255, 0.90), transparent 60%);
  opacity: 1;
}

.add-ad-tip .gfm-badge:hover {
  filter: brightness(1.03);
  border-color: rgba(11, 58, 94, 0.28);
  box-shadow:
    0 14px 30px rgba(11, 58, 94, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.80);
}

.add-ad-tip .gfm-badge:active { transform: translateY(1px); }

.add-ad-tip #openAdTips.gfm-badge {
  background: linear-gradient(135deg, #eaf4ff, #dcedff 55%, #eaf4ff);
}

.add-ad-tip .gfm-badge[data-open-survey="1"] {
  background: linear-gradient(135deg, #eaf9f0, #d7f3e3 55%, #eaf9f0);
  border-color: rgba(15, 95, 47, 0.22);
}

.add-ad-tip a.gfm-badge[href*="gofund.me"] {
  background: linear-gradient(135deg, #fff0f0, #ffe0e6 55%, #fff0f0);
  border-color: rgba(122, 12, 12, 0.18);
}


/* =========================================================
   [7] LISTNINGAR / ANNONSER (stack-version)
   ========================================================= */
.listing-list { list-style: none; padding: 0; margin: 0; }

.listing-item {
  display: flex;
  gap: 16px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  align-items: flex-start;
}

.listing-item:not(:last-child) { border-bottom: 1px solid #dce2e8; }

.listing-thumb {
  position: relative;
  overflow: visible;

  width: 140px;
  height: 96px;
  border-radius: 12px;

  background: #eaf0f6;
  border: 1px solid rgba(11, 58, 94, 0.14);
  box-shadow: 0 12px 26px rgba(11, 58, 94, 0.16);
}

.listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  padding: 0;
  background: transparent;
  display: block;

  position: relative;
  z-index: 5;
  border-radius: 12px;

  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.listing-thumb.has-multiple {
  margin-right: 18px;
  margin-bottom: 18px;
}

.listing-thumb.has-multiple::before,
.listing-thumb.has-multiple::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;

  background:
    radial-gradient(120% 90% at 50% 45%,
      rgba(255, 255, 255, 0.88),
      rgba(0, 0, 0, 0.14) 70%,
      rgba(0, 0, 0, 0.26) 100%),
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.75),
      rgba(255, 255, 255, 0.10) 45%,
      rgba(0, 0, 0, 0.14) 100%),
    radial-gradient(circle at 20% 25%,
      rgba(255, 255, 255, 0.45) 0 1px,
      transparent 1px 4px),
    radial-gradient(circle at 70% 60%,
      rgba(0, 0, 0, 0.22) 0 1px,
      transparent 1px 5px),
    radial-gradient(circle at 85% 35%,
      rgba(0, 0, 0, 0.18) 0 1px,
      transparent 1px 6px),
    linear-gradient(135deg,
      #f6f9ff,
      #d2e2f4 55%,
      #f6f9ff);

  background-blend-mode: multiply, screen, overlay, overlay, overlay, normal;

  border: 1px solid rgba(11, 58, 94, 0.32);

  box-shadow:
    0 14px 30px rgba(11, 58, 94, 0.30),
    inset 0 0 0 2px rgba(255, 255, 255, 0.55);

  transition: transform 0.18s ease, opacity 0.18s ease;
}

.listing-thumb.has-multiple::after {
  transform: translate(9px, 9px) rotate(-1deg);
  z-index: 3;
  opacity: 0.98;
}

.listing-thumb.has-multiple::before {
  transform: translate(18px, 18px) rotate(-2deg);
  z-index: 2;
  opacity: 0.92;
}

/* Hover */
.listing-item:hover .listing-thumb {
  box-shadow: 0 16px 34px rgba(11, 58, 94, 0.22);
  transform: translateY(-1px);
  transition: transform 0.12s ease, box-shadow 0.18s ease;
}

.listing-item:hover .listing-thumb.has-multiple::after {
  transform: translate(11px, 11px) rotate(-1deg);
}

.listing-item:hover .listing-thumb.has-multiple::before {
  transform: translate(22px, 22px) rotate(-2deg);
}

/* Text */
.listing-info h3 { margin: 0 0 4px; font-size: 16px; }
.listing-meta { font-size: 12px; color: var(--muted); }
.price { font-weight: 800; font-size: 15px; margin-top: 4px; }




/* === 2026: Rutnät/kort-läge för annonser (mobil: lista, desktop: grid) === */
/* Beskrivningen blir max 2 rader i listningen så fler annonser får plats */
.listing-info p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 6px 0 0;
}
@media (min-width: 900px) {
  .listing-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .listing-item {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    margin: 0;
    border: 1px solid rgba(11, 58, 94, 0.14);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(11, 58, 94, 0.10);
    transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }

  .listing-item:not(:last-child) { border-bottom: none; }

  .listing-thumb {
    width: 100%;
    height: 180px;
    border-radius: 14px;
  }

  .listing-thumb img {
    border-radius: 14px;
  }

  .listing-meta {
    font-size: 12px;
    line-height: 1.35;
  }

  .price {
    margin-top: 8px;
    font-size: 16px;
  }

  .listing-item:hover {
    transform: translateY(-2px);
    border-color: rgba(11, 58, 94, 0.22);
    box-shadow: 0 14px 34px rgba(11, 58, 94, 0.16);
  }
}
@media (min-width: 1250px) {
  .listing-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* =========================================================
   [8] FILTER / SÖK / AVANCERAT
   ========================================================= */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.top-bar a { font-size: 13px; }

.search-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
}

details .advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.slider-field { grid-column: 1 / -1; }

.range-wrapper {
  position: relative;
  height: 36px;
  margin-top: 6px;
}

.range-wrapper input[type="range"] {
  position: absolute;
  left: 0;
  top: 8px;
  width: 100%;
  pointer-events: none;
}

.range-wrapper input[type="range"]::-webkit-slider-thumb { pointer-events: auto; }
.range-wrapper input[type="range"]::-moz-range-thumb { pointer-events: auto; }

.range-values {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 26px;
  color: #444;
}

.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid #ccd3dd;

  background: #f7fafc;
  font-size: 13px;
  font-weight: 700;

  cursor: pointer;
  user-select: none;
}

.radio-group input[type="radio"] { width: 16px; height: 16px; margin: 0; }

.radio-group label:has(input[type="radio"]:checked) {
  border-color: var(--brand);
  background: #eaf2fb;
}


/* =========================================================
   [9] GALLERY + LIGHTBOX
   ========================================================= */
.ad-gallery {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.ad-gallery a { display: inline-block; }

.ad-gallery img {
  max-width: 200px;
  max-height: 150px;

  border-radius: 10px;
  border: 1px solid #dde3ea;

  object-fit: contain;
  background: #f0f3f8;
  padding: 6px;
}

#lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);

  display: none;
  align-items: center;
  justify-content: center;

  z-index: 2000;
}

#lightbox-overlay.is-visible { display: flex; }

#lightbox-overlay img,
#lightbox-image {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  background: #fff;
}


/* =========================================================
   [10] PAGINATION
   ========================================================= */
.pagination {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  justify-content: center;
}

.pagination a,
.pagination span {
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid #ccd3dd;
  text-decoration: none;

  background: #fff;
  color: var(--brand);
}

.pagination a:hover { background: #f0f3f8; }

.pagination span.current,
.pagination .current {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 800;
}


/* =========================================================
   [11] POPUPS (standard)
   ========================================================= */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;

  padding: 1rem;
  background: rgba(0, 0, 0, 0.75);

  justify-content: center;
  align-items: center;

  z-index: 9999;
}

.popup-window {
  background: #111;
  border: 3px solid #c00000;
  color: #fff;

  width: 90%;
  max-width: 600px;
  max-height: 90vh;

  padding: 20px;
  border-radius: 10px;

  box-shadow: 0 0 25px #c00000;
  animation: popupFade 0.25s ease-out;

  overflow-y: auto;
}

.popup-header {
  font-size: 20px;
  font-weight: 700;
  color: #ff4444;

  border-bottom: 2px solid #c00000;
  padding-bottom: 6px;
  margin-bottom: 12px;

  text-transform: uppercase;
  letter-spacing: 1px;
}

.popup-close {
  float: right;
  cursor: pointer;
  font-size: 26px;
  color: #a10630;
  background: transparent;
  border: 0;
}

.popup-content ul { margin-left: 18px; }
.popup-content h3 { color: #ff6666; margin-top: 15px; }

@keyframes popupFade {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}


/* =========================================================
   [12] SIDANNONSER (layout)
   ========================================================= */
.layout-with-sideads {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.main-column { flex: 1 1 auto; min-width: 0; }

.side-ads {
  width: 220px;
  flex-shrink: 0;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-ad-box {
  background: #fff;
  border: 1px solid #d0dde8;
  border-radius: 10px;

  padding: 10px;
  font-size: 13px;

  box-shadow: var(--shadow-card);
}

.side-ad-box a { text-decoration: none; color: inherit; display: block; }

.side-ad-empty {
  background: #f5f7fb;
  border-style: dashed;
  text-align: center;
}

.side-ad-image { margin-bottom: 6px; text-align: center; }
.side-ad-image img { max-width: 100%; height: auto; margin: 0 auto; }

.side-ad-text strong { font-size: 14px; color: #123a5e; }
.side-ad-text span { font-size: 12px; color: #555; }


/* =========================================================
   [13] SEKTIONSTEXTER
   ========================================================= */
.section-heading { font-size: 16px; margin: 0 0 4px; }

.section-intro {
  font-size: 12px;
  color: #555;
  margin: 0 0 6px;
  line-height: 1.4;
}


/* =========================================================
   [14] SPECIAL: AdTips popup (blå variant)
   ========================================================= */
#adTipsOverlay .popup-window {
  background: var(--brand) !important;
  border: 3px solid #fff !important;
  color: #fff;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
}

#adTipsOverlay .popup-header {
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
}

#adTipsOverlay .popup-close { color: #a10630; }
#adTipsOverlay .popup-content h3 { color: #fff; }
#adTipsOverlay .popup-content a { color: #ffeb3b; }


/* =========================================================
   [15] SPECIAL: Survey popup (grön variant)
   ========================================================= */
#surveyOverlay .popup-window-survey {
  background: var(--green-1) !important;
  border: 3px solid #ffd400 !important;
  color: #ffe36a !important;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}


/* =========================================================
   [16] BADGES: KÖPES / SÄLJES + taggar
   ========================================================= */
.ad-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.ad-type-badge {
  position: relative;
  display: inline-flex;
  align-items: center;

  padding: 6px 14px;
  border-radius: var(--radius-pill);

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;

  color: #fff;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  isolation: isolate;
}

/* SÄLJES */
.ad-type-badge.badge-saljes,
.ad-type-badge.badge-säljes,
.ad-type-badge.saljes,
.ad-type-badge.type-saljes,
.ad-type-badge.type-säljes {
  background: linear-gradient(135deg, var(--blue-1), var(--blue-2) 55%, var(--blue-1));
}

.ad-type-badge.badge-saljes::after,
.ad-type-badge.badge-säljes::after,
.ad-type-badge.saljes::after,
.ad-type-badge.type-saljes::after,
.ad-type-badge.type-säljes::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  z-index: -1;

  background: linear-gradient(
    135deg,
    rgba(0, 140, 255, 0.6),
    rgba(255, 255, 255, 0.3),
    rgba(0, 140, 255, 0.6)
  );
  filter: blur(6px);
  opacity: 0.45;
}

/* KÖPES */
.ad-type-badge.badge-kopes,
.ad-type-badge.badge-köpes,
.ad-type-badge.kopes,
.ad-type-badge.köpes,
.ad-type-badge.type-kopes,
.ad-type-badge.type-köpes {
  background: linear-gradient(135deg, var(--red-1), var(--red-2) 55%, var(--red-1));
}

.ad-type-badge.badge-kopes::after,
.ad-type-badge.badge-köpes::after,
.ad-type-badge.kopes::after,
.ad-type-badge.köpes::after,
.ad-type-badge.type-kopes::after,
.ad-type-badge.type-köpes::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  z-index: -1;

  background: linear-gradient(
    135deg,
    rgba(255, 90, 90, 0.6),
    rgba(255, 255, 255, 0.35),
    rgba(255, 90, 90, 0.6)
  );
  filter: blur(6px);
  opacity: 0.45;
}

/* Övriga taggar */
.tag-veteran {
  display: inline-flex;
  align-items: center;

  padding: 6px 12px;
  border-radius: var(--radius-pill);

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.6px;

  background: #fff4bf;
  border: 1px solid rgba(11, 58, 94, 0.18);
  color: var(--brand);
}

.tag-premium {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);

  font-size: 11px;
  font-weight: 700;

  background: #fff3c4;
  color: #6a4b00;
  border: 1px solid rgba(106, 75, 0, 0.25);
}


/* =========================================================
   [17] TEMA: theme-blue
   ========================================================= */
body.theme-blue {
  --bg-page: #121610;
  --text-main: #e9eef4;
}

body.theme-blue .card { background: #fff; color: #222; }

body.theme-blue .listing-meta,
body.theme-blue .section-intro { color: #555; }


/* =========================================================
   [18] RESPONSIVE (mobil)
   ========================================================= */
@media (max-width: 700px) {
  body { padding-top: 170px; }

  .container { max-width: 100%; padding: 0 10px; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .main-nav { flex-wrap: wrap; }

  .card { padding: 10px 12px; margin-bottom: 10px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  .add-ad-actions { flex-wrap: wrap; justify-content: flex-start; }
  .type-quicklinks { flex-wrap: wrap; }

  .add-ad-tip {
    padding: 0 10px;
    gap: 10px;
  }

  .listing-item { gap: 12px; }

  .listing-thumb {
    width: 120px;
    height: 86px;
  }

  .listing-thumb.has-multiple {
    margin-right: 12px;
    margin-bottom: 12px;
  }

  .listing-thumb.has-multiple::after {
    transform: translate(7px, 7px) rotate(-0.8deg);
  }

  .listing-thumb.has-multiple::before {
    transform: translate(14px, 14px) rotate(-1.6deg);
  }

  .listing-item:hover .listing-thumb.has-multiple::after {
    transform: translate(8px, 8px) rotate(-0.8deg);
  }

  .listing-item:hover .listing-thumb.has-multiple::before {
    transform: translate(16px, 16px) rotate(-1.6deg);
  }

  .layout-with-sideads { display: block; }

  .side-ads {
    width: 100%;
    margin-top: 15px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .side-ad-box { flex: 1 1 calc(50% - 10px); }

  .radio-group label { width: 100%; justify-content: flex-start; }
}

@media (max-width: 600px) {
  .side-ad-box { flex: 1 1 100%; }
  .popup-window { max-height: 80vh; }
}


/* =========================================================
   [19] THEME TOGGLE – METALLIC BLUE (#0016ff)
   ========================================================= */
button.theme-toggle {
  position: relative;

  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;

  border-radius: 50% !important;
  padding: 0 !important;
  border: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;
  line-height: 1;
  color: #eaf0ff;

  background:
    linear-gradient(
      145deg,
      #2f3dff 0%,
      #0016ff 45%,
      #000fcc 70%,
      #3a47ff 100%
    );

  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35);

  cursor: pointer;

  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background 0.3s ease;
}

button.theme-toggle::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;

  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.35),
      rgba(255, 255, 255, 0.08) 40%,
      rgba(255, 255, 255, 0.0)
    );

  pointer-events: none;
}

button.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.75),
    inset 0 -3px 6px rgba(0, 0, 0, 0.4);
}

button.theme-toggle:active {
  transform: translateY(0);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.5),
    inset 0 3px 6px rgba(0, 0, 0, 0.45);
}

.dark button.theme-toggle,
[data-theme="dark"] button.theme-toggle {
  background:
    linear-gradient(
      145deg,
      #1a24ff,
      #000bb8 45%,
      #00098f 75%,
      #2832ff
    );

  color: #ffd966;

  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.65),
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -4px 8px rgba(0, 0, 0, 0.6);
}


/* =========================================================
   [21] BILDFÖRHANDSVISNING – skapa_annons.php
   ========================================================= */
.preview-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.preview-slot {
  min-height: 120px;

  border-radius: 12px;
  border: 1px dashed rgba(11, 58, 94, 0.25);
  background-color: #f4f7fb;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 12px;
  font-weight: 800;
  color: rgba(11, 58, 94, 0.65);

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  overflow: hidden;
}

.preview-slot.has-image {
  border-style: solid;
  border-color: rgba(11, 58, 94, 0.25);
  color: transparent;
}

@media (max-width: 700px) {
  .preview-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-slot { min-height: 110px; }
}


/* =========================================================
   [20] XMAS FREEBAR – SOLID + polkagris-kant + glow + animation + snö
   (UPDATE: tog bort text-centering så att layouten inte påverkar “känslan”)
   ========================================================= */

#xmasFreebar.xmas-freebar {
  margin-top: 6px;
}

/* Själva baren */
#xmasFreebar .xmas-freebar__inner {
  position: relative;
  isolation: isolate;
  max-width: 1100px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 14px 16px;
  border-radius: 999px;

  background: linear-gradient(135deg, #fff7b2, #e6f4ff 35%, #fde2f3 70%, #e8fbe8);
  background-size: 300% 300%;
  animation: easterGradient 18s ease infinite;
color: #0000FF;

  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);

  overflow: hidden;
}


@keyframes easterGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 🎅 Polkagris-kant */
#xmasFreebar .xmas-freebar__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;

  padding: 6px;
  border-radius: inherit;

  background: repeating-linear-gradient(
    45deg,
    #fff59d 0 12px,
    #bbdefb 12px 24px,
    #f8bbd0 24px 36px,
    #c8e6c9 36px 48px,
    #d1c4e9 48px 60px
  );
background-size: 180% 180%;
  background-position: 0% 0%;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;

  filter:
    drop-shadow(0 0 8px rgba(214, 40, 40, 0.35))
    drop-shadow(0 0 10px rgba(46, 125, 50, 0.28))
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.20));

  animation: candyStripeMove 60s linear infinite;
  pointer-events: none;
}

@keyframes candyStripeMove {
  0% { background-position: 0% 0%; }
  100% { background-position: 140% 140%; }
}

/* ❄️ Snö-lager */
#xmasFreebar .xmas-freebar__snow {
  display: none !important; /* städad påsk: inga overlay-effekter */
  position: absolute;
  inset: 6px;
  z-index: 1;
  pointer-events: none;

  border-radius: inherit;
  overflow: hidden;

  clip-path: inset(0 round 999px);
}

#xmasFreebar .xmas-freebar__snow::before,
#xmasFreebar .xmas-freebar__snow::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -90px;
  bottom: 0;

  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 1) 0 2.2px, rgba(255, 255, 255, 0) 3px),
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1.7px, rgba(255, 255, 255, 0) 3px),
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1.3px, rgba(255, 255, 255, 0) 3px);

  background-size: 126px 126px, 196px 196px, 280px 280px;
  background-position: 0 0, 35px 55px, 85px 25px;

  opacity: 0.85;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.25));

  animation: snowFall 8s linear infinite;
}

#xmasFreebar .xmas-freebar__snow::after {
  opacity: 0.55;
  background-size: 168px 168px, 252px 252px, 364px 364px;
  animation-duration: 30s;
  animation-delay: -4s;
}

@keyframes snowFall {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(220px) translateX(16px); }
}

/* Innehåll över snön */
#xmasFreebar .xmas-freebar__left,
#xmasFreebar .xmas-freebar__right {
  position: relative;
  z-index: 2;
}

#xmasFreebar .xmas-freebar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#xmasFreebar .xmas-freebar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 34px;
  height: 34px;
  border-radius: 999px;

  background: #ffffff;
  border: 1px solid #dcdcdc;

  flex: 0 0 auto;
}

/* UPDATE: text vänsterställd */
#xmasFreebar .xmas-freebar__text {
  min-width: 0;
  text-align: left;
}

#xmasFreebar .xmas-freebar__title,
#xmasFreebar .xmas-freebar__sub {
  text-align: left;
}

#xmasFreebar .xmas-freebar__title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.35px;
}

#xmasFreebar .xmas-freebar__title strong { text-transform: uppercase; }
#xmasFreebar .xmas-freebar__until { font-weight: 800; }

#xmasFreebar .xmas-freebar__sub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62ch;
}

#xmasFreebar .xmas-freebar__right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

#xmasFreebar .xmas-freebar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 14px;
  border-radius: 999px;

  text-decoration: none;
  font-weight: 900;
  font-size: 13px;

  color: #fff;
  border: 1px solid #1e88e5;

  background: linear-gradient(135deg, #1e88e5, #4bb1ff 55%, #1e88e5);
  box-shadow:
    0 10px 22px rgba(30, 136, 229, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

#xmasFreebar .xmas-freebar__cta:hover { filter: brightness(1.08); }

#xmasFreebar .xmas-freebar__close {
  width: 34px;
  height: 34px;
  border-radius: 999px;

  border: 1px solid #444;
  background: #222;
  color: #fff;

  cursor: pointer;
  font-size: 16px;
  line-height: 1;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#xmasFreebar .xmas-freebar__close:hover { background: #000; }

/* Mobil */
@media (max-width: 700px) {
  #xmasFreebar .xmas-freebar__inner {
    border-radius: 14px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #xmasFreebar .xmas-freebar__sub {
    white-space: normal;
    max-width: 100%;
  }

  #xmasFreebar .xmas-freebar__right {
    width: 100%;
    justify-content: flex-start;
  }
}

/* =========================================================
   [7B] 2026-LÄGE: GRID / KORT FÖR ANNONSER
   - Mobil: behåll listlayout
   - Desktop: 2 kolumner
   - Stora skärmar: 3 kolumner
   ========================================================= */

/* Mer kompakt listning (fler annonser per vy) */
.listing-info p {
  display: -webkit-box;
  -webkit-line-clamp: 2;       /* max 2 rader */
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 6px 0 0;
}

@media (min-width: 900px) {
  .listing-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .listing-item {
    flex-direction: column;
    gap: 10px;

    padding: 12px;
    margin: 0;
    border: 1px solid rgba(11, 58, 94, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);

    box-shadow: 0 10px 22px rgba(11, 58, 94, 0.08);
    transition: transform 0.14s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }

  .listing-item:not(:last-child) { border-bottom: none; }

  .listing-item:hover,
  .listing-item:focus-within {
    transform: translateY(-1px);
    border-color: rgba(11, 58, 94, 0.22);
    box-shadow: 0 16px 34px rgba(11, 58, 94, 0.14);
  }

  .listing-thumb {
    width: 100%;
    height: 180px;
    border-radius: 14px;
    overflow: hidden;
  }

  .listing-thumb img {
    border-radius: 14px;
  }

  /* Meta blir en rad (snyggare i grid) */
  .listing-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .listing-info h3 {
    font-size: 15px;
    line-height: 1.25;
  }

  .price {
    margin-top: 8px;
    font-size: 16px;
  }
}

@media (min-width: 1250px) {
  .listing-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   [HOTFIX] PÅSK-FREEBAR + STOPPA SNÖ/ÄGG (OVERRIDE)
   LÄGG SIST I FILEN. Tvingar påskfärger och stänger allt “snow/egg”-lager.
   ========================================================= */

/* Påskig bakgrund på själva baren */
#xmasFreebar .xmas-freebar__inner{
  background: linear-gradient(135deg, #fff7b2, #e6f4ff 35%, #fde2f3 70%, #e8fbe8) !important;
  background-size: 300% 300% !important;
  animation: easterGradient 18s ease infinite !important;
}

/* Pastell-kant/ribbon */
#xmasFreebar .xmas-freebar__inner::before{
  background: repeating-linear-gradient(
    45deg,
    #fff59d 0 12px,
    #bbdefb 12px 24px,
    #f8bbd0 24px 36px,
    #c8e6c9 36px 48px,
    #d1c4e9 48px 60px
  ) !important;
  opacity: .9 !important;
  animation: candyStripeMove 60s linear infinite !important;
}

/* Stoppa ALLT som kan se ut som snö/ägg i freebaren */
#xmasFreebar .xmas-freebar__snow,
#xmasFreebar .xmas-freebar__snow::before,
#xmasFreebar .xmas-freebar__snow::after,
#xmasFreebar .easter-eggs,
#xmasFreebar .easter-egg,
#xmasFreebar .confetti,
#xmasFreebar .snow{
  display: none !important;
  content: none !important;
  background-image: none !important;
  animation: none !important;
}

/* Stoppa även ev. dekor-ägg på ::after/::before */
#xmasFreebar .xmas-freebar__inner::after,
#xmasFreebar .xmas-freebar__left::before{
  content: none !important;
  background-image: none !important;
  animation: none !important;
}

@keyframes easterGradient{
  0%{background-position:0% 50%;}
  50%{background-position:100% 50%;}
  100%{background-position:0% 50%;}
}
@keyframes candyStripeMove{
  0%{background-position:0% 0%;}
  100%{background-position:140% 140%;}
}

/* =========================================================
   POPUPS – FÖRBÄTTRAD LÄSBARHET & TYDLIG STÄNGKNAPP
   ========================================================= */

.popup-overlay {
  background: rgba(0,0,0,0.65);
}

.popup,
.popup-content {
  color: #ffffff;
  line-height: 1.55;
}

.popup p,
.popup-content p {
  color: #ffffff;
  opacity: 0.95;
}

.popup h2,
.popup h3,
.popup-content h2,
.popup-content h3 {
  color: #ffffff;
  margin-top: 0;
}

/* Stängknapp (X) */
.popup-close,
.popup .close {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 44px;
  height: 44px;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.55);

  color: #ffffff;
  font-size: 22px;
  font-weight: 800;

  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}

.popup-close:hover,
.popup .close:hover {
  background: rgba(255,255,255,0.30);
  transform: scale(1.06);
}
