@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,300;0,400;0,600;1,300&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --blue:       #006AA7;
  --blue-dark:  #004d7a;
  --blue-light: #e8f4fb;
  --yellow:     #FECC02;
  --yellow-dark:#d4a800;
  --white:      #ffffff;
  --gray-50:    #f8f9fa;
  --gray-100:   #f0f2f4;
  --gray-200:   #e2e6ea;
  --gray-400:   #9aa3ad;
  --gray-600:   #5a6472;
  --gray-800:   #2c3440;
  --text:       #1a2332;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.14);
  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--blue);
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,106,167,0.3);
}
.navbar-brand {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 600;
  color: var(--white);
  letter-spacing: -0.5px;
}
.navbar-brand span { color: var(--yellow); }
.navbar-nav {
  display: flex; align-items: center; gap: 8px;
}
.nav-link {
  color: rgba(255,255,255,0.85);
  font-size: 14px; font-weight: 400;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: white; }
.btn-nav {
  background: var(--yellow);
  color: var(--blue-dark) !important;
  font-weight: 600 !important;
  padding: 9px 20px !important;
  border-radius: var(--radius-sm) !important;
  transition: var(--transition) !important;
}
.btn-nav:hover { background: var(--yellow-dark) !important; transform: translateY(-1px); }
.navbar-mobile-toggle {
  display: none;
  background: none; border: none;
  color: white; font-size: 24px; padding: 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  border: none; transition: var(--transition);
  cursor: pointer; white-space: nowrap;
}
.btn-primary {
  background: var(--blue); color: white;
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-yellow {
  background: var(--yellow); color: var(--blue-dark);
  font-weight: 600;
}
.btn-yellow:hover { background: var(--yellow-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline {
  background: transparent; color: var(--blue);
  border: 1.5px solid var(--blue);
}
.btn-outline:hover { background: var(--blue); color: white; }
.btn-ghost {
  background: transparent; color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-full { width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--gray-800); margin-bottom: 6px;
}
.form-label span { color: #e53e3e; margin-left: 2px; }
.form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text);
  background: white; transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,106,167,0.1); }
.form-control::placeholder { color: var(--gray-400); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa3ad' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 12px; color: #e53e3e; margin-top: 4px; display: none; }
.form-control.error { border-color: #e53e3e; }
.form-control.error + .form-error { display: block; }

/* ── Cards ── */
.card {
  background: white; border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  overflow: hidden; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-img { width: 100%; height: 200px; object-fit: cover; background: var(--gray-100); }
.card-body { padding: 16px; }
.card-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px; letter-spacing: 0.3px;
}
.badge-saljes { background: #e8f5e9; color: #2e7d32; }
.badge-skankes { background: #e3f2fd; color: #1565c0; }
.badge-bytes { background: #fff8e1; color: #f57f17; }
.card-title { font-size: 15px; font-weight: 500; margin: 8px 0 4px; line-height: 1.4; }
.card-meta { font-size: 12px; color: var(--gray-400); display: flex; align-items: center; gap: 6px; }
.card-price { font-size: 18px; font-weight: 600; color: var(--blue); margin-top: 10px; }
.card-price.free { color: #2e7d32; }

/* ── Item Grid ── */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ── Section ── */
.section { padding: 60px 0; }
.section-sm { padding: 40px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 560px; margin: 0 auto; padding: 0 24px; }
.section-title { font-size: 32px; margin-bottom: 8px; }
.section-sub { font-size: 16px; color: var(--gray-600); margin-bottom: 40px; }

/* ── Alert ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
  display: none;
}
.alert.show { display: flex; align-items: center; gap: 8px; }
.alert-error { background: #fff5f5; border: 1px solid #fed7d7; color: #c53030; }
.alert-success { background: #f0fff4; border: 1px solid #c6f6d5; color: #276749; }
.alert-info { background: var(--blue-light); border: 1px solid #bee3f8; color: var(--blue-dark); }

/* ── Loading spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.8);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 48px; margin-bottom: 40px;
}
.footer-brand {
  font-family: 'Fraunces', serif;
  font-size: 24px; color: white; margin-bottom: 12px;
}
.footer-brand span { color: var(--yellow); }
.footer-desc { font-size: 14px; line-height: 1.7; opacity: 0.75; }
.footer-heading { font-size: 13px; font-weight: 600; color: white; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { font-size: 14px; opacity: 0.75; transition: var(--transition); }
.footer-links a:hover { opacity: 1; color: var(--yellow); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; opacity: 0.6;
}
.eco-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(254,204,2,0.15);
  border: 1px solid rgba(254,204,2,0.3);
  color: var(--yellow);
  padding: 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
}

/* ── Page header ── */
.page-header {
  background: var(--blue);
  padding: 48px 0 40px;
  color: white;
}
.page-header h1 { font-size: 36px; margin-bottom: 8px; }
.page-header p { opacity: 0.8; font-size: 16px; }

/* ── Auth pages ── */
.auth-wrapper {
  min-height: calc(100vh - 64px);
  background: var(--gray-50);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  overflow: hidden;
}
.auth-header {
  background: var(--blue);
  padding: 32px 40px 28px;
  color: white; text-align: center;
}
.auth-header h1 { font-size: 28px; margin-bottom: 6px; }
.auth-header p { opacity: 0.8; font-size: 15px; }
.auth-body { padding: 32px 40px 40px; }
.auth-footer-text {
  text-align: center; margin-top: 20px;
  font-size: 14px; color: var(--gray-600);
}
.auth-footer-text a { color: var(--blue); font-weight: 500; }

/* ── Type selector ── */
.type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.type-option { display: none; }
.type-label {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
  text-align: center;
}
.type-label:hover { border-color: var(--blue); }
.type-option:checked + .type-label {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}
.type-icon { font-size: 28px; }
.type-name { font-size: 14px; font-weight: 500; }
.type-desc { font-size: 12px; color: var(--gray-400); }

/* ── Map container ── */
#sweden-map-container {
  position: relative;
  background: #eef6fb;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 500px;
}
#sweden-map {
  width: 100%; height: 500px;
}
.map-tooltip {
  position: absolute; top: 16px; left: 16px;
  background: white; border-radius: var(--radius-md);
  padding: 12px 16px; box-shadow: var(--shadow-md);
  font-size: 13px; pointer-events: none; z-index: 10;
  min-width: 160px;
}
.map-tooltip-name { font-weight: 600; color: var(--text); font-size: 14px; }
.map-tooltip-count { color: var(--gray-400); margin-top: 2px; }

/* ── Sidebar filter ── */
.filter-sidebar {
  background: white; border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  padding: 20px; position: sticky; top: 80px;
}
.filter-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-200); }
.filter-group { margin-bottom: 20px; }
.filter-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-600); margin-bottom: 8px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .navbar-mobile-toggle { display: block; }
  .navbar-nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--blue-dark);
    padding: 16px; gap: 4px;
  }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .section { padding: 40px 0; }
  .page-header h1 { font-size: 28px; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .auth-header { padding: 24px; }
  .auth-body { padding: 24px; }
}
@media (max-width: 480px) {
  .items-grid { grid-template-columns: 1fr 1fr; }
}
