/* ==========================================================================
   kostendienst.de - Central Stylesheet
   Designed for extreme performance (100/100 PageSpeed), clean UX, and high CTR
   ========================================================================== */

:root {
  --primary: #1e40af;       /* Deep Trust Blue */
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #2563eb;
  --secondary: #0f172a;     /* Dark Slate */
  --text: #334155;          /* Body Text Slate */
  --text-muted: #64748b;
  --bg: #f8fafc;            /* Clean light background */
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.main-content {
  flex: 1;
  padding: 2rem 0;
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--secondary);
}

.logo-badge {
  background: var(--primary);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.825rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
}

.nav-link {
  text-decoration: none;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--primary);
}

@media (max-width: 520px) {
  .trust-badge {
    display: none;
  }
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb li+li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--border-dark);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #ffffff;
  padding: 3rem 0;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.125rem;
  color: #dbeafe;
  max-width: 700px;
  margin: 0 auto 1.5rem auto;
}

/* Search Box */
.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.25rem;
  padding-right: 3rem;
  font-size: 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  outline: none;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.3);
}

/* Autocomplete Dropdown */
#search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  z-index: 100;
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}

#search-dropdown.open {
  display: block;
}

.search-dd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  transition: background 0.12s ease;
}

.search-dd-item:last-child {
  border-bottom: none;
}

.search-dd-item:hover,
.search-dd-item.active {
  background: var(--primary-light);
}

.search-dd-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--secondary);
  flex: 1;
}

.search-dd-label mark {
  background: #fef08a;
  color: var(--secondary);
  border-radius: 2px;
  padding: 0 1px;
}

.search-dd-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-dd-empty {
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  font-style: italic;
}

/* Category heading shrinks when search is active */
#kategorien-heading {
  transition: font-size 0.25s ease, color 0.25s ease, margin-bottom 0.25s ease;
}

#kategorien-heading.search-active {
  font-size: 1rem !important;
  color: var(--text-muted) !important;
  margin-bottom: 0.75rem !important;
}



/* Category Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-dark);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-light);
}

.category-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.category-title {
  font-size: 1.25rem;
  color: var(--secondary);
}

.calculator-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calculator-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.calculator-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.calculator-link .badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  background: var(--bg);
  border-radius: 4px;
  color: var(--text-muted);
}

/* Calculator Widget */
.calc-widget {
  background: var(--surface);
  border: 2px solid var(--primary-light);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-md);
}

.calc-widget h2 {
  font-size: 1.5rem;
  color: var(--secondary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--secondary);
}

.form-control, .form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Result Box */
.calc-result-box {
  background: linear-gradient(to right, #f8fafc, #eff6ff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.calc-result-label {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.calc-result-price {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.calc-result-details {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid #dbeafe;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.calc-result-details span strong {
  color: var(--secondary);
}

.calc-disclaimer {
  font-size: 0.725rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 0.6rem;
  font-style: italic;
  opacity: 0.85;
}

/* AdSense Containers */
.adsense-container {
  background: #f1f5f9;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 2rem 0;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.adsense-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.adsense-placeholder {
  color: #64748b;
  font-size: 0.85rem;
  font-style: italic;
}

/* Content & Data Tables */
.content-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.content-section h2 {
  font-size: 1.5rem;
  color: var(--secondary);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.price-table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.price-table th, .price-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.price-table th {
  background: var(--primary-light);
  color: var(--secondary);
  font-weight: 700;
}

.price-table tbody tr:hover {
  background-color: #f8fafc;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem 1.25rem;
  text-align: left;
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--primary);
  transition: transform 0.2s ease;
}

.faq-item.active .faq-question::after {
  content: "-";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out, padding 0.25s ease;
  padding: 0 1.25rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 1.25rem 1.25rem 1.25rem;
}

/* Footer */
.footer {
  background: var(--secondary);
  color: #94a3b8;
  padding: 3rem 0 1.5rem 0;
  margin-top: auto;
  font-size: 0.9rem;
}

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

.footer-col h3 {
  color: #f8fafc;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #ffffff;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #334155;
  font-size: 0.85rem;
}

/* Utilities */
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .calc-widget { padding: 1.25rem; }
  .calc-result-price { font-size: 1.85rem; }
  .calc-result-details { flex-direction: column; gap: 0.25rem; }
  .content-section { padding: 1.25rem; }
}

/* ==========================================================================
   Consent Banner / Privacy Modal
   ========================================================================== */
.consent-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.consent-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.consent-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 90vh;
  overflow-y: auto;
}

.consent-header h2 {
  font-size: 1.4rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.consent-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.consent-intro a {
  color: var(--primary);
  text-decoration: underline;
}

.consent-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.consent-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.consent-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.consent-group-header strong {
  font-size: 0.95rem;
  color: var(--secondary);
  display: block;
  margin-bottom: 0.25rem;
}

.consent-group-header p {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.consent-toggle {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.btn-consent {
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--secondary);
  border-color: var(--border-dark);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

@media (max-width: 600px) {
  .consent-card { padding: 1.25rem; }
  .consent-actions { flex-direction: column; }
  .btn-consent { width: 100%; text-align: center; }
}

