/* ============================================================
   NordAds – Blocket-inspirert design
   ============================================================ */

:root {
  --primary:     #1a6ebc;
  --primary-dark:#155a9e;
  --accent:      #e8a020;
  --bg:          #f4f4f2;
  --surface:     #ffffff;
  --border:      #ddd;
  --text:        #1a1a1a;
  --muted:       #777;
  --map-fill:    #c8dff0;
  --map-hover:   #1a6ebc;
  --danger:      #c0392b;
  --success:     #27ae60;
  --radius:      6px;
  --shadow:      0 1px 4px rgba(0,0,0,.1);
  --header-h:    56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow    { max-width: 560px; }
.section   { padding: 36px 0; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  height: var(--header-h);
}
.logo {
  font-size: 1.5rem; font-weight: 800;
  color: #fff; letter-spacing: -0.5px;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.main-nav a { color: rgba(255,255,255,.9); font-size: .9rem; }
.main-nav a:hover { color: #fff; text-decoration: none; }

.footer-lang {
  display: flex; align-items: center; gap: 6px;
}
.footer-lang label { font-size: 1rem; line-height: 1; cursor: default; }
.footer-lang select {
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 4px;
  color: rgba(255,255,255,.7);
  font-size: .82rem;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
}
.footer-lang select:hover { border-color: rgba(255,255,255,.55); color: #fff; }
.footer-lang select option { background: #222; color: #fff; }

.hamburger {
  display: none;
  background: none; border: none; color: #fff;
  font-size: 1.5rem; cursor: pointer; margin-left: auto;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--primary-dark);
  padding: 8px 16px 16px;
}
.mobile-nav a {
  color: rgba(255,255,255,.9); padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: 1rem;
}
.mobile-nav.open { display: flex; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-primary  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #d08e10; border-color: #d08e10; text-decoration: none; }
.btn-ghost    { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.25); text-decoration: none; }
.btn-outline  { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #a93226; text-decoration: none; }
.btn-block { display: flex; width: 100%; }
.btn-lg    { padding: 12px 28px; font-size: 1rem; }
.btn-sm    { padding: 4px 10px; font-size: .8rem; }
.btn-fav   { background: var(--surface); color: var(--muted); border-color: var(--border); }
.btn-fav.active { color: #e74c3c; border-color: #e74c3c; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2980b9 100%);
  color: #fff; padding: 48px 0;
  text-align: center;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); margin-bottom: 8px; }
.hero-sub { opacity: .85; margin-bottom: 24px; font-size: 1.05rem; }
.hero-search {
  display: flex; max-width: 560px; margin: 0 auto;
  background: #fff; border-radius: 40px;
  overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.hero-search input {
  flex: 1; border: none; padding: 14px 20px;
  font-size: 1rem; outline: none; color: var(--text);
}
.hero-search button {
  background: var(--accent); color: #fff; border: none;
  padding: 14px 24px; font-size: 1rem; font-weight: 700;
  cursor: pointer; border-radius: 0 40px 40px 0;
}
.hero-search button:hover { background: #d08e10; }

/* ============================================================
   COUNTRY / MAP SECTION
   ============================================================ */
.country-section { background: var(--surface); }
.section-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.see-all { font-size: .9rem; }

.country-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
}
.country-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 20px;
  border: 2px solid var(--border); background: var(--bg);
  cursor: pointer; font-size: .9rem; font-weight: 600;
  transition: all .15s;
}
.country-tab:hover, .country-tab.active {
  border-color: var(--primary); background: var(--primary); color: #fff;
}
.flag { font-size: 1.2rem; }

.map-panel { display: none; }
.map-panel.active { display: block; }

.map-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px; align-items: start;
}

.map-wrap {
  background: var(--bg); border-radius: var(--radius);
  padding: 8px; border: 1px solid var(--border);
}
.map-wrap svg { width: 100%; height: auto; display: block; }

/* SVG region interactivity */
.country-map .region { fill: var(--map-fill); stroke: #fff; stroke-width: 1.5; cursor: pointer; transition: fill .15s; }
.country-map .region:hover { fill: var(--map-hover); }
.country-map .region.selected { fill: var(--primary-dark); }

.map-placeholder {
  height: 300px; display: flex; align-items: center;
  justify-content: center; color: var(--muted);
}

.region-list h3 { font-size: 1rem; margin-bottom: 12px; color: var(--muted); font-weight: 600; }
.region-list ul { list-style: none; columns: 2; column-gap: 16px; }
.region-list li a {
  display: block; padding: 5px 0;
  font-size: .9rem; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.region-list li a:hover { color: var(--primary); text-decoration: none; padding-left: 4px; }

/* Hela Norden panel */
.norden-panel {
  padding: 28px 0 24px;
  text-align: center;
}
.norden-hint {
  font-size: .9rem; color: var(--muted); margin-bottom: 20px;
}
.norden-countries {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-bottom: 28px;
}
.norden-country-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 20px;
  border: 2px solid var(--border); background: var(--bg);
  font-size: .9rem; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: all .15s;
  opacity: .55;
}
.norden-country-btn.active {
  border-color: var(--primary); background: var(--primary);
  color: #fff; opacity: 1;
}
.norden-country-btn:hover { opacity: 1; }

/* ============================================================
   CATEGORY GRID
   ============================================================ */
.category-section { background: var(--bg); }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.category-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; color: var(--text);
  transition: box-shadow .15s, transform .15s;
}
.category-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.cat-icon { font-size: 2rem; }
.cat-name { font-size: .85rem; font-weight: 600; }

/* ============================================================
   LISTING GRID / CARDS
   ============================================================ */
.recent-section { background: var(--surface); }

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.listing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  color: var(--text); display: flex; flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.listing-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); text-decoration: none; }

.listing-thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--bg); }
.listing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--muted); }

.listing-info { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.listing-title { font-weight: 600; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing-meta { font-size: .78rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.listing-price { font-weight: 700; font-size: 1rem; color: var(--text); margin-top: auto; }
.listing-price.free { color: var(--success); }
.listing-price.muted { color: var(--muted); font-weight: 400; }

/* Sparade annonser — card with remove button */
.listing-card-wrap { position: relative; }
.listing-card-wrap .listing-card { display: flex; flex-direction: column; height: 100%; }
.fav-remove-form { position: absolute; top: 6px; right: 6px; }
.fav-remove-btn { background: rgba(0,0,0,.45); color: #fff; border: none; border-radius: 50%;
  width: 26px; height: 26px; font-size: 1.1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.fav-remove-btn:hover { background: var(--danger, #c0392b); }

/* ============================================================
   BROWSE PAGE
   ============================================================ */
.browse-wrap {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 24px; padding-top: 24px; padding-bottom: 40px;
  align-items: start;
}

.filter-sidebar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  position: sticky; top: calc(var(--header-h) + 12px);
}
.filter-group { margin-bottom: 16px; }
.filter-group label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.filter-group input, .filter-group select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .9rem; background: var(--bg);
}
.filter-group input:focus, .filter-group select:focus { outline: none; border-color: var(--primary); }
.price-range { display: flex; align-items: center; gap: 8px; }
.price-range input { flex: 1; }
.filter-toggle-btn  { display: none; }
.filter-close       { display: none; }
.filter-overlay     { display: none; }
.filter-handle      { display: none; }
.filter-checks { display: flex; flex-direction: column; gap: 4px; }
.filter-check {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0; font-size: .9rem; cursor: pointer; color: var(--text);
}
.filter-check input[type="checkbox"] {
  width: auto; margin: 0; accent-color: var(--primary); cursor: pointer;
}

.results-header { margin-bottom: 16px; }
.result-count { font-size: .9rem; color: var(--muted); }

.pagination { display: flex; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.page-btn {
  padding: 6px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .85rem; color: var(--text);
}
.page-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state p { margin-bottom: 16px; }

/* ============================================================
   LISTING DETAIL
   ============================================================ */
.listing-detail { padding: 24px 0 48px; }

/* Layout grid: main column + sticky sidebar */
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.detail-col-main { min-width: 0; }

/* Gallery */
.detail-gallery {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 12px;
	box-shadow: var(--shadow); margin-bottom: 16px;
}
.gallery-main { border-radius: 4px; overflow: hidden; }
.gallery-stage {
	background: var(--bg); border-radius: 4px; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	min-height: 300px; max-height: 460px;
}
.gallery-stage img { max-height: 460px; width: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumb {
	width: 80px; height: 60px; object-fit: cover; border-radius: 4px;
	cursor: pointer; border: 2px solid transparent; opacity: .7;
	transition: opacity .15s, border-color .15s;
}
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--primary); opacity: 1; }
.no-image {
	height: 200px; background: var(--bg); border-radius: var(--radius);
	display: flex; align-items: center; justify-content: center; color: var(--muted);
}

/* Breadcrumb */
.detail-breadcrumb {
	font-size: .82rem; color: var(--muted); margin-bottom: 14px;
	display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin-right: 4px; margin-left: 4px;
}
.detail-breadcrumb a { color: var(--muted); }
.detail-breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.bc-sep { color: var(--border); }

/* Header card: title + price + fav */
.detail-header-card {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 20px 20px 16px;
	box-shadow: var(--shadow); margin-bottom: 12px;
  margin-right: 4px; margin-left: 4px;
}
.listing-h1 { font-size: 1.6rem; margin-bottom: 10px; }
.listing-price-big { font-size: 1.6rem; font-weight: 800; color: var(--text); display: flex; align-items: baseline; gap: 10px; }
.listing-price-big .free { color: var(--success); }
.listing-price-big .badge { font-size: .75rem; background: var(--bg); border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; vertical-align: middle; font-weight: 500; }
.detail-header-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Meta chips */
.listing-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; margin-right: 4px; margin-left: 4px; }
.tag { background: var(--bg); border: 1px solid var(--border); padding: 4px 10px; border-radius: 20px; font-size: .8rem; }
.tag.muted { color: var(--muted); }
.tag-location { background: #eaf3fb; border-color: #aacde8; color: #1a5276; }
.tag-condition { background: #fef9ec; border-color: #f0d080; color: #7a5800; }
.tag-meta { color: var(--muted); background: var(--bg); }

/* Shared card style for content blocks */
.detail-card {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 20px;
	box-shadow: var(--shadow); margin-bottom: 14px;
  margin-right: 4px; margin-left: 4px;
}
.detail-card-title {
	font-size: .75rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: .06em; color: var(--muted);
	margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
  
}

/* Description */
.listing-description { line-height: 1.8; color: #333; }

/* Attributes table */
.attr-list { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.attr-row { display: contents; }
.attr-list dt {
	color: var(--muted); font-size: .82rem;
	padding: 7px 12px 7px 0; border-bottom: 1px solid var(--border);
}
.attr-list dd {
	font-weight: 600; font-size: .88rem; margin: 0;
	padding: 7px 0; border-bottom: 1px solid var(--border);
}
.attr-row:last-child dt,
.attr-row:last-child dd { border-bottom: none; }

/* Seller card */
.seller-card {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
	position: sticky; top: calc(var(--header-h) + 12px);
}
.seller-card h3 {
	font-size: .75rem; font-weight: 700; text-transform: uppercase;
	letter-spacing: .06em; color: var(--muted);
	margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.seller-avatar {
	width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
	background: var(--primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.1rem; font-weight: 700; margin-bottom: 10px;
}
.seller-avatar img { width: 100%; height: 100%; object-fit: cover; }
.seller-name { font-weight: 700; font-size: 1.05rem; }
.seller-name a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.seller-since { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.seller-location { font-size: .85rem; color: var(--text); margin-bottom: 16px; }

/* Seller profile page */
.seller-profile-header {
  display: flex; align-items: center; gap: 20px;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border); margin-bottom: 28px;
}
.seller-profile-header .seller-avatar {
  width: 72px; height: 72px; font-size: 1.8rem; flex-shrink: 0;
}
.seller-profile-name { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.seller-profile-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 768px) {
  .seller-profile-layout { grid-template-columns: 1fr; }
  .seller-profile-layout .seller-card { position: static; }
}
.phone-masked { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; font-size: .9rem; margin-top: 10px; }
.phone-masked span { color: var(--muted); letter-spacing: .04em; }
.phone-masked a { font-size: .8rem; white-space: nowrap; }
.form-hint { display: block; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form-check { padding: 4px 0; }
.check-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: .95rem; }
.check-label input[type=checkbox] { margin-top: 3px; flex-shrink: 0; }
.label-optional { font-size: .8rem; color: var(--muted); font-weight: 400; }
.share-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 2px; }
.share-label { font-size: .85rem; color: var(--muted); }

.msg-form textarea {
	width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
	padding: 10px; font-size: .9rem; resize: vertical;
	font-family: inherit; margin-bottom: 10px;
}
.msg-form textarea:focus { outline: none; border-color: var(--primary); }

/* Related listings */
.related-section { margin-top: 40px; padding-top: 28px; border-top: 2px solid var(--border); }
.related-section .section-title { font-size: 1.15rem; }

/* ============================================================
   FORMS
   ============================================================ */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-top: 20px;
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .95rem; font-family: inherit;
  background: var(--bg);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.flex-wrap { display: flex; flex-wrap: wrap; gap: 16px; }
.form-row.flex-wrap .form-group { flex: 1 1 200px; }
.section-label { font-size: 1rem; font-weight: 700; margin: 0 0 16px; }
.form-row .form-group:nth-child(3) { grid-column: span 1; }

/* Image section at top of form */
.form-images-section { margin-bottom: 4px; }
.form-images-heading {
  font-size: .95rem; font-weight: 700; margin-bottom: 14px;
  color: var(--text);
}
.form-section-divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.uploaded-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin-bottom: 8px;
}
.uploaded-count {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 1px 8px; font-size: .75rem;
  font-weight: 400; color: var(--muted);
}
.uploaded-hint { margin-top: 8px; }
.uploaded-badge {
  position: absolute; bottom: 4px; left: 4px;
  background: #22a05a; color: #fff;
  font-size: .65rem; font-weight: 700; line-height: 1;
  padding: 2px 5px; border-radius: 3px; pointer-events: none;
}

.file-drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  color: var(--muted); transition: border-color .15s;
  position: relative;
}
.file-drop:hover, .file-drop.drag { border-color: var(--primary); color: var(--primary); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.img-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.preview-img-wrap {
	position: relative; aspect-ratio: 4/3; width: 100%;
	border-radius: 4px; overflow: hidden; border: 1px solid var(--border);
}
.preview-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-delete-btn {
	position: absolute; top: 3px; right: 3px;
	background: rgba(0,0,0,.55); color: #fff;
	border: none; border-radius: 50%; width: 18px; height: 18px;
	font-size: .6rem; line-height: 1; cursor: pointer; padding: 0;
	display: flex; align-items: center; justify-content: center;
	opacity: 0; transition: opacity .15s;
}
.preview-img-wrap:hover .preview-delete-btn { opacity: 1; }
.preview-delete-btn:hover { background: var(--danger); }

.existing-images { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.existing-img-wrap {
	position: relative; aspect-ratio: 4/3; width: 100%;
	border-radius: var(--radius); overflow: hidden;
	border: 1px solid var(--border);
}
.existing-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-delete-btn {
	position: absolute; top: 4px; right: 4px;
	width: 22px; height: 22px; border-radius: 50%;
	background: rgba(0,0,0,.6); color: #fff;
	border: none; cursor: pointer; font-size: 11px; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
	line-height: 1; padding: 0;
	opacity: 0; transition: opacity .15s;
}
.existing-img-wrap:hover .img-delete-btn { opacity: 1; }
.img-delete-btn:hover { background: var(--danger); }

.page-title { font-size: 1.6rem; margin: 24px 0 4px; }

/* ============================================================
   AUTH
   ============================================================ */
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; margin: 40px auto;
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 24px; }
.auth-switch { margin-top: 20px; text-align: center; font-size: .9rem; color: var(--muted); }
.remember-label { display: flex; align-items: center; gap: 8px; font-size: .9rem;
  color: var(--muted); margin-bottom: 14px; cursor: pointer; }
.remember-label input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.field-error { border-color: var(--danger) !important; outline: none; }
.field-error-msg { color: var(--danger); font-size: .82rem; margin-top: 4px; display: block; }
.alert-error   { background: #fdf0ef; border: 1px solid #e74c3c; color: #922b21; }
.alert-success { background: #eafaf1; border: 1px solid #27ae60; color: #1e8449; }
.alert-warning { background: #fef9e7; border: 1px solid #f39c12; color: #7d6608; }
.alert-info    { background: #eaf3fb; border: 1px solid #2980b9; color: #1a5276; }
.alert p { margin-bottom: 4px; }
.alert p:last-child { margin-bottom: 0; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 20px; flex-wrap: wrap; gap: 12px; }
.dashboard-header-actions { display: flex; gap: 8px; align-items: center; }
.msg-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 20px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
.msg-unread td { font-weight: 600; background: #f0f6ff; }
.msg-body-preview { color: var(--muted); font-size: .88rem; max-width: 340px; }

.conv-listing-ref { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.conv-thread { display: flex; flex-direction: column; gap: 10px; margin: 24px 0; max-width: 680px; }
.conv-empty { color: var(--muted); text-align: center; padding: 32px 0; }
.conv-msg { display: flex; flex-direction: column; max-width: 75%; }
.conv-msg--mine { align-self: flex-end; align-items: flex-end; }
.conv-msg--theirs { align-self: flex-start; align-items: flex-start; }
.conv-bubble {
	padding: 10px 14px; border-radius: 16px; font-size: .92rem; line-height: 1.5;
	word-break: break-word;
}
.conv-msg--mine .conv-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.conv-msg--theirs .conv-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.conv-meta { font-size: .75rem; color: var(--muted); margin-top: 3px; }
.conv-reply-form { max-width: 680px; border-top: 1px solid var(--border); padding-top: 20px; display: flex; gap: 10px; align-items: flex-end; }
.conv-reply-form textarea { flex: 1; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; font-size: .92rem; font-family: inherit; resize: vertical; }
.conv-reply-form textarea:focus { outline: none; border-color: var(--primary); }
.dashboard-header h1 { font-size: 1.6rem; }

.dashboard-table-wrap { overflow-x: auto; }
.dashboard-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dashboard-table th {
  text-align: left; padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.dashboard-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dashboard-table tr:hover td { background: var(--bg); }
.dashboard-table tr.status-sold td { opacity: .6; }

.dash-listing-title { display: flex; align-items: center; gap: 10px; }
.dash-thumb { width: 50px; height: 38px; object-fit: cover; border-radius: 4px; }
.dash-actions { display: flex; gap: 6px; white-space: nowrap; align-items: stretch; }
.dash-actions form { display: flex; }
.dash-actions form .btn { flex: 1; }

.status-badge { padding: 3px 8px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.status-active  { background: #eafaf1; color: #1e8449; }
.status-sold    { background: #eaf3fb; color: #1a5276; }
.status-deleted { background: #fdf0ef; color: #922b21; }

/* ============================================================
   NAV MESSAGES BUTTON
   ============================================================ */
.nav-msg-btn { position: relative; display: flex; align-items: center; color: rgba(255,255,255,.85);
  text-decoration: none; padding: 4px; border-radius: 6px; transition: color .15s; }
.nav-msg-btn:hover { color: #fff; }
.nav-msg-btn svg { display: block; }
.nav-msg-badge { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px;
  padding: 0 4px; border-radius: 9px; background: #e53; color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
  pointer-events: none; }

/* ============================================================
   NAV AVATAR
   ============================================================ */
.nav-avatar-link { display: flex; align-items: center; text-decoration: none; }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,.3); }
.nav-avatar-letter { display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; }

/* Avatar dropdown */
.nav-avatar-wrap { position: relative; }
.nav-avatar-btn { background: none; border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; }
.nav-avatar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px;
  border-radius: 50%; }
.avatar-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); min-width: 180px; padding: 6px 0;
  list-style: none; margin: 0; z-index: 200; }
.avatar-dropdown.open { display: block; }
.avatar-dropdown li a { display: block; padding: 9px 16px; color: var(--text);
  text-decoration: none; font-size: .93rem; white-space: nowrap; }
.avatar-dropdown li a:hover { background: var(--bg); color: var(--accent); }
.avatar-dropdown-divider { border-top: 1px solid #e8e8e8; margin: 4px 0; }

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 32px 0 48px; }
.profile-sidebar { display: flex; flex-direction: column; align-items: center; text-align: center; }
.profile-avatar-wrap { margin-bottom: 12px; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border); }
.profile-avatar-placeholder { display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 2.2rem; font-weight: 700; }
.profile-sidebar-name  { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.profile-sidebar-email { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.profile-sidebar-since { font-size: .8rem;  color: var(--muted); margin-bottom: 20px; }
.profile-sidebar-nav   { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.profile-sidebar-nav a { padding: 8px 12px; border-radius: var(--radius); background: var(--bg);
  color: var(--primary); font-size: .9rem; text-decoration: none; }
.profile-sidebar-nav a:hover { background: var(--border); }

.profile-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px; }
.profile-card h2 { font-size: 1rem; margin-bottom: 18px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border); }

.avatar-upload-row { display: flex; align-items: flex-start; gap: 20px; }
.avatar-preview { width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); flex-shrink: 0; }
.avatar-preview-placeholder { display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 1.6rem; font-weight: 700; flex-shrink: 0; }
.avatar-file-input { display: none; }

/* ============================================================
   STATIC PAGES (terms, privacy)
   ============================================================ */
.static-page { padding: 32px 0 48px; max-width: 720px; }
.static-page h1 { font-size: 1.8rem; margin-bottom: 6px; }
.static-page h2 { font-size: 1.1rem; margin: 28px 0 8px; }
.static-page p, .static-page li { line-height: 1.7; color: var(--text); }
.static-page ul { padding-left: 20px; margin: 8px 0 12px; }
.static-page li { margin-bottom: 4px; }
.static-updated { color: var(--muted); font-size: .85rem; margin-bottom: 24px; }
.privacy-table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: .9rem; }
.privacy-table th, .privacy-table td { text-align: left; padding: 8px 12px; border: 1px solid var(--border); }
.privacy-table th { background: var(--bg); font-weight: 600; }

/* ============================================================
   COOKIE BAR
   ============================================================ */
.cookie-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: #222; color: rgba(255,255,255,.85);
  border-top: 3px solid var(--accent);
  padding: 14px 0;
}
.cookie-bar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.cookie-bar p { margin: 0; font-size: .9rem; line-height: 1.5; }
.cookie-bar a { color: var(--accent); }
.cookie-bar-actions { flex-shrink: 0; display: flex; gap: 8px; align-items: center; }
.cookie-bar .btn-outline { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.4); }
.cookie-bar .btn-outline:hover { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.7); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: #222; color: rgba(255,255,255,.6); padding: 20px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.site-footer nav { display: flex; gap: 16px; }
.site-footer a { color: rgba(255,255,255,.6); font-size: .85rem; }
.site-footer a:hover { color: #fff; text-decoration: none; }

/* ============================================================
   LISTING ID BAR + DIRECT LINK  (Feature A)
   ============================================================ */
.listing-id-bar {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 20px;
}
.listing-id-label {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.listing-link-wrap {
  display: flex; gap: 8px; align-items: center;
}
.listing-link-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 10px; font-size: .82rem; color: var(--muted);
  background: var(--bg); font-family: inherit;
  cursor: default;
}
.listing-link-input:focus { outline: none; }
.copy-feedback {
  font-size: .78rem; color: var(--success); font-weight: 600;
  align-self: flex-end;
}

/* ============================================================
   REPORT LISTING  (Feature B)
   ============================================================ */
.report-toggle {
  margin: 0 4px 14px;
}
.report-toggle > summary.report-link {
  display: inline-block; list-style: none;
  font-size: .8rem; color: var(--muted); cursor: pointer;
  padding: 4px 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.report-toggle > summary.report-link::-webkit-details-marker { display: none; }
.report-toggle > summary.report-link:hover { color: var(--danger); }
.report-toggle[open] > summary.report-link { color: var(--danger); }
.report-form-wrap {
  margin-top: 10px; padding: 18px 20px;
}
.report-form-wrap .form-group:last-of-type { margin-bottom: 14px; }

/* alert-danger alias (same as alert-error) */
.alert-danger { background: #fdf0ef; border: 1px solid #e74c3c; color: #922b21; }

/* ============================================================
   COMMENTS  (Feature C)
   ============================================================ */
.comments-section {
  margin-top: 36px; padding-top: 28px;
  border-top: 2px solid var(--border);
}
.comments-section .section-title { font-size: 1.15rem; margin-bottom: 20px; }

.comment-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 32px; }

.comment {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 10px;
}
.comment-meta {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px;
}
.comment-meta strong { font-size: .92rem; }
.comment-date { font-size: .78rem; color: var(--muted); }
.comment-body { font-size: .92rem; line-height: 1.7; color: #333; word-break: break-word; }

/* Replies — indented block */
.comment-replies {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
  padding-left: 16px;
}
.comment-reply {
  background: var(--bg); border-color: var(--border);
  padding: 12px 14px; margin-bottom: 0;
}

/* Reply form toggle */
.reply-toggle {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.reply-toggle > summary {
  list-style: none; font-size: .8rem; color: var(--primary);
  cursor: pointer; display: inline-block;
  text-decoration: underline; text-underline-offset: 2px;
}
.reply-toggle > summary::-webkit-details-marker { display: none; }
.reply-toggle > summary:hover { color: var(--primary-dark); }

/* Comment form (new + reply) */
.comment-form {
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.comment-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font-size: .92rem; font-family: inherit;
  resize: vertical; background: var(--bg);
}
.comment-form textarea:focus { outline: none; border-color: var(--primary); background: #fff; }

.reply-form textarea { min-height: 72px; }

/* New comment block */
.comment-new {
  border-top: 1px solid var(--border); padding-top: 24px;
}
.comment-new h3 {
  font-size: .85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 14px;
}
.comments-empty { color: var(--muted); font-size: .92rem; margin-bottom: 24px; }
.comment-login-prompt { margin-top: 12px; font-size: .9rem; color: var(--muted); }
.comment-login-prompt a { font-weight: 600; }

/* ============================================================
   ADMIN TABLE  (Feature B — /admin/rapporter)
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 20px; }
.data-table th {
  text-align: left; padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:hover td { background: var(--bg); }

/* ============================================================
   ADMIN ANALYTICS  (/admin/statistik)
   ============================================================ */
.stats-section {
  margin-top: 36px; padding-top: 28px;
  border-top: 1px solid var(--border);
}
.stats-section:first-of-type { border-top: none; margin-top: 20px; }
.stats-section h2 {
  font-size: 1rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 16px;
}
.stats-chart-wrap {
  overflow-x: auto; padding-bottom: 8px; margin-bottom: 20px;
}
.stats-table tr.stats-zero td { color: var(--muted); }
.stats-rank { color: var(--muted); font-size: .85rem; width: 32px; }
.stats-empty { color: var(--muted); font-size: .9rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .profile-wrap { grid-template-columns: 1fr; }
  .profile-sidebar { flex-direction: row; flex-wrap: wrap; text-align: left;
    align-items: center; gap: 16px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border); margin-bottom: 8px; }
  .profile-sidebar-nav { flex-direction: row; flex-wrap: wrap; width: auto; }
  .map-layout { grid-template-columns: 1fr; }
  .map-wrap { max-width: 320px; margin: 0 auto; }
  .region-list ul { columns: 1; }
  .detail-layout { grid-template-columns: 1fr; }
  .seller-card { position: static; }
  .browse-wrap { grid-template-columns: 1fr; }
  .filter-sidebar { position: static; }
  .form-row { grid-template-columns: 1fr; }

  /* Filter toggle button (results header) */
  .filter-toggle-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    border: 1px solid var(--border); background: var(--surface);
    font-size: .85rem; font-weight: 600; cursor: pointer;
  }

  /* Filter bottom sheet */
  #filter-sidebar {
    position: fixed; left: 0; right: 0; bottom: 0;
    max-height: calc(82vh + 35px); overflow-y: auto;
    background: var(--surface); border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    margin-right: 4px; margin-left: 4px;
    padding: 20px 20px 0px;
    z-index: 300;
    transform: translateY(120%);
    transition: transform .25s ease;
  }
  #filter-sidebar.open { transform: translateY(0); }
  .filter-handle {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 6px;
    position: fixed; bottom: 0; left: 0; right: 0; height: 52px;
    border: none;
    background: var(--surface); border-top: 1px solid var(--border);
    z-index: 301; cursor: pointer;
    
  }
  .filter-handle-pill {
    width: 36px; height: 4px; border-radius: 2px; background: var(--border);
  }
  .filter-handle-label {
    display: flex; align-items: center; gap: 6px;
    font-size: .85rem; font-weight: 600; color: var(--muted);
  }
  .filter-badge {
    background: var(--primary); color: #fff;
    font-size: .72rem; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
  }
  .filter-close {
    display: block; position: absolute; top: 16px; right: 16px;
    background: none; border: none; font-size: 1.2rem;
    cursor: pointer; color: var(--muted); line-height: 1;
  }
  .filter-overlay {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 299;
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  .filter-overlay.open { opacity: 1; pointer-events: auto; }
  .browse-wrap { padding-bottom: 60px; }
}

@media (max-width: 640px) {
  .listing-link-wrap { flex-direction: column; align-items: stretch; }
  .listing-link-input { font-size: .78rem; }
  .comment-replies { padding-left: 8px; }
  .comments-section { padding-left: 14px; padding-right: 14px; }
  .main-nav { display: none; }
  .hamburger { display: block; }
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 32px 0; }
  .dashboard-table-wrap { overflow-x: visible; }
  .dashboard-table,
  .dashboard-table tbody,
  .dashboard-table tr,
  .dashboard-table td { display: block; width: 100%; box-sizing: border-box; }
  .dashboard-table thead { display: none; }
  .dashboard-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 12px;
    background: #fff;
  }
  .dashboard-table tr:hover td { background: transparent; }
  .dashboard-table td { padding: 4px 0; border-bottom: none; }
  .dashboard-table td[data-label] {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .dashboard-table td[data-label]::before {
    content: attr(data-label);
    font-size: .72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    min-width: 76px;
    flex-shrink: 0;
  }
  .dash-td-title {
    padding-bottom: 10px !important;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border) !important;
  }
  .dashboard-table td.dash-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px !important;
    padding-bottom: 6px !important;
    margin-top: 6px;
    border-top: 1px solid var(--border);
    width: 100%;
  }
  .dashboard-table td.dash-actions > .btn,
  .dashboard-table td.dash-actions > form { flex: none; }
  .dashboard-table td.dash-actions > form > .btn { width: auto; }
}

@media (max-width: 400px) {
  .listing-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
