@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-v20-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/fraunces-v38-latin-700.woff2") format("woff2");
}

:root {
  --bg: #f2f5fa;
  --panel: #ffffff;
  --muted: #5f6d84;
  --text: #182236;
  --accent: #1769ff;
  --accent-dark: #0f4fd1;
  --accent-soft: #dfeaff;
  --ok: #058a5b;
  --border: #dbe3ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f7faff 0%, var(--bg) 62%);
}

header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(20, 40, 74, 0.08);
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  letter-spacing: 0.3px;
}

.subtitle,
.sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav,
.header-link-wrap {
  margin-top: 11px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 6px;
  border-radius: 999px;
  width: fit-content;
  background: #f4f8ff;
  border: 1px solid #d8e3f5;
}

.nav a,
.header-link,
.btn {
  text-decoration: none;
  color: #30517f;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 13px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-block;
  cursor: pointer;
  transition: all .18s ease;
}

.nav a:hover,
.header-link:hover {
  color: #113a77;
  background: #e5efff;
}

.nav a[aria-current="page"],
.header-link[aria-current="page"] {
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-color: #0f58e8;
  box-shadow: 0 4px 12px rgba(23, 105, 255, 0.24);
}

.btn {
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: 1px solid #0f58e8;
  box-shadow: 0 6px 14px rgba(23, 105, 255, 0.26);
}

.btn:hover {
  filter: brightness(1.04);
}

.btn:disabled,
button:disabled {
  opacity: .62;
  cursor: not-allowed;
  box-shadow: none;
}

.card,
.meta,
.filters,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(23, 45, 82, 0.06);
}

.mobile-filter-toggle {
  display: none;
}

.mobile-filter-toggle strong {
  min-width: 24px;
  height: 24px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 0.78rem;
}

input,
select,
button {
  border: 1px solid #cfd9e7;
  background: #ffffff;
  color: #1f2d45;
  border-radius: 10px;
  padding: 10px;
  font-size: 0.93rem;
}

button {
  font-weight: 700;
  color: #26426c;
  background: #f2f6ff;
  border-color: #c9d8f5;
}

button:hover {
  background: #e8f0ff;
}

.filter-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 7px;
  margin: 8px 0 12px;
}

.favorite-btn {
  width: auto;
  min-width: 96px;
  padding: 7px 10px;
  color: #30517f;
  background: #f4f8ff;
}

.favorite-btn.is-favorite {
  color: #704d00;
  border-color: #f0c94d;
  background: #fff8d7;
}

.favorites-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}

.favorites-form label { display: grid; gap: 6px; }
.autocomplete-field { position: relative; }
.autocomplete-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 40;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 45, 82, .16);
}
.autocomplete-menu[hidden] { display: none; }
.autocomplete-menu button {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  text-align: left;
  background: transparent;
}
.autocomplete-menu button:hover,
.autocomplete-menu button:focus { background: var(--accent-soft); }
.alert-matches { margin-top: 14px; padding: 12px; border-radius: 10px; background: #eaf8f2; }
.price-alert-toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 10000; max-width: 360px;
  padding: 14px 16px; border-radius: 12px; color: #fff; background: #173b70;
  box-shadow: 0 12px 30px rgba(17, 42, 80, .3); text-decoration: none; font-weight: 750;
}

input:focus,
select:focus,
button:focus {
  outline: none;
  border-color: #90b8ff;
  box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.16);
}

label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.price {
  color: var(--ok);
  font-weight: 700;
}

.breadcrumbs {
  margin-top: 9px;
  color: #7788a6;
  font-size: 0.84rem;
}

.breadcrumbs a {
  color: #466794;
  text-decoration: none;
  border-bottom: 1px solid rgba(70, 103, 148, 0.3);
}

.energy-tools-card {
  padding: 14px;
  line-height: 1.5;
}

.energy-tools-card h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1rem;
}

.energy-tools-card p {
  margin: 0;
  color: var(--muted);
}

.energy-tools-card a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 79, 209, 0.28);
}

.energy-tools-card a:hover {
  color: var(--accent);
}

.site-footer {
  margin-top: 34px;
  padding: 22px 20px;
  border-top: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
}

.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.site-footer strong {
  display: block;
  color: var(--text);
  margin-bottom: 3px;
}

.site-footer nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer a {
  color: #466794;
  text-decoration: none;
  border-bottom: 1px solid rgba(70, 103, 148, 0.28);
}

.site-footer a:hover {
  color: var(--accent-dark);
}

.legal-page {
  max-width: 920px;
  margin: 24px auto 0;
  padding: 0 18px;
}

.legal-card {
  padding: 22px;
  line-height: 1.65;
}

.legal-card h2 {
  margin: 24px 0 8px;
  font-size: 1.08rem;
}

.legal-card h2:first-child {
  margin-top: 0;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
}

.legal-card a {
  color: var(--accent-dark);
  font-weight: 700;
}

@media (max-width: 700px) {
  header {
    position: static;
    padding: 12px 12px 10px;
  }

  h1 {
    font-size: 1.05rem;
    line-height: 1.2;
  }

  .subtitle,
  .sub {
    font-size: 0.84rem;
  }

  .nav,
  .header-link-wrap {
    width: 100%;
    border-radius: 14px;
    gap: 6px;
    padding: 5px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .nav a,
  .header-link,
  .btn {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .breadcrumbs {
    display: none;
  }

  input,
  select,
  button {
    min-height: 42px;
    font-size: 16px;
  }

  .mobile-filter-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 9px 12px;
    color: #173b70;
    background: #f4f8ff;
    border: 1px solid #c9d8f5;
    border-radius: 12px;
    font-weight: 800;
  }

  .collapsible-filter-content.is-collapsed {
    display: none;
  }

}
