/* =====================================
   Klarwerk Reinigung — Elegant Classic Theme
   Single CSS for all pages (mobile-first, flex-only)
   ===================================== */

/* --- CSS Reset / Normalize --- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, picture, svg, video, canvas { display: inline-block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* --- Theme Variables --- */
:root {
  --primary: #0A2A43;
  --secondary: #2FAF7D;
  --accent: #F4F9FC;
  --paper: #FBFBF8; /* subtle warm paper */
  --ink: #16222E;   /* elegant dark text */
  --muted: #6B7280;
  --line: #E6E6E0;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-sm: 0 1px 2px rgba(10,42,67,0.06);
  --shadow-md: 0 6px 18px rgba(10,42,67,0.08);
  --shadow-lg: 0 14px 34px rgba(10,42,67,0.12);
}

/* --- Base Typography --- */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Montserrat, Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--primary);
  margin: 0 0 12px 0;
  letter-spacing: 0.2px;
}

h1 { font-size: 32px; line-height: 1.25; }
h2 { font-size: 24px; line-height: 1.3; }
h3 { font-size: 18px; line-height: 1.4; }
h4 { font-size: 16px; line-height: 1.4; }

p { margin: 0 0 12px 0; }

/* Refined links */
a { color: var(--primary); transition: color .2s ease, background-color .2s ease, border-color .2s ease; }
a:hover { color: #103654; }
a:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; border-radius: 4px; }

/* Lists with elegant markers */
ul { list-style: none; padding-left: 0; margin: 0 0 12px 0; }
ul li { position: relative; padding-left: 22px; margin: 0 0 8px 0; }
ul li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--secondary); position: absolute; left: 0; top: 0.65em; box-shadow: var(--shadow-sm); }

ol { margin: 0 0 12px 22px; padding-left: 0; }
ol li { margin: 0 0 8px 0; }

/* --- Layout Containers (Flex-only) --- */
.container { display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.content-wrapper { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }

/* Section spacing (global) */
section { margin-bottom: 60px; padding: 32px 0; background: transparent; }

/* --- Header & Navigation --- */
header { background: #FFFFFF; border-bottom: 1px solid var(--line); position: relative; z-index: 50; }
header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.logo img { height: 42px; width: auto; }

.main-nav { display: none; align-items: center; gap: 8px; }
.main-nav a { color: var(--primary); padding: 8px 10px; border-radius: var(--radius-s); font-weight: 500; }
.main-nav a:hover { background: var(--accent); }

.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); color: var(--primary); background: #fff; font-size: 20px; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.mobile-menu-toggle:hover { background: var(--accent); }
.mobile-menu-toggle:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }

/* --- Mobile Menu (overlay + slide-in panel) --- */
.mobile-menu { position: fixed; inset: 0; display: flex; align-items: stretch; justify-content: flex-end; background: rgba(10, 25, 38, 0.48); opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 1000; }
.mobile-menu .mobile-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 84%; max-width: 360px; background: #FFFFFF; padding: 20px; border-top-left-radius: 14px; border-bottom-left-radius: 14px; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .35s ease; }
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu.open .mobile-nav { transform: translateX(0); }

.mobile-menu-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--primary); font-size: 18px; box-shadow: var(--shadow-sm); }
.mobile-menu-close:hover { background: var(--accent); }

.mobile-nav a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 10px; border-radius: 10px; color: var(--primary); font-weight: 500; }
.mobile-nav a:hover { background: var(--accent); }

/* Prevent body scroll when menu open (requires body.menu-open toggle via JS) */
body.menu-open { overflow: hidden; }

/* --- Content Styling --- */
.text-section { color: var(--ink); }
.text-section img { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }

/* CTA buttons inside content (excluding phone/mail for elegant inline presentation) */
.content-wrapper > a,
.text-section > a:not([href^="tel:"]):not([href^="mailto:"]) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border: 1px solid var(--primary); border-radius: 10px;
  background: transparent; color: var(--primary); font-weight: 600;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .05s ease;
}
.content-wrapper > a:hover,
.text-section > a:not([href^="tel:"]):not([href^="mailto:"]):hover { background: var(--primary); color: #fff; }
.content-wrapper > a:active,
.text-section > a:not([href^="tel:"]):not([href^="mailto:"]):active { transform: translateY(1px); }
.text-section > a + a { margin-left: 12px; }

/* Elegant text blocks */
.content-wrapper p { max-width: 72ch; }

/* Testimonials: light background with dark text for strong readability */
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); color: var(--ink); }
.testimonial-card p { margin: 0; }
.testimonial-card strong { color: var(--primary); }

/* Cards (generic) */
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; display: flex; flex-direction: column; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow-sm); }

/* Content grids (generic flex layout) */
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }

/* Text-Image section (if used) */
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.text-image-section .text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; }
.text-image-section .media { flex: 1 1 280px; display: flex; align-items: center; justify-content: center; }

/* Feature item (generic) */
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }

/* Section utility class (required exact spacing) */
.section { margin-bottom: 60px; padding: 40px 20px; }

/* --- Footer --- */
footer { background: var(--primary); color: #EAF0F6; border-top: 1px solid rgba(255,255,255,0.08); }
footer .container { padding-top: 28px; padding-bottom: 28px; }
footer .content-wrapper { flex-direction: column; gap: 20px; }
footer h3, footer h4 { color: #FFFFFF; margin-bottom: 6px; }
footer a { color: #EAF0F6; }
footer a:hover { color: #FFFFFF; text-decoration: underline; }

/* --- Cookie Consent Banner & Modal --- */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: #FFFFFF; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center; padding: 14px 16px; z-index: 1100; transform: translateY(100%); transition: transform .35s ease; }
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .content { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 1140px; padding: 0 20px; }
.cookie-text { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cookie-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-weight: 600; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s; }
.cookie-actions .btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.cookie-actions .btn-primary:hover { background: #0D3658; }
.cookie-actions .btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.cookie-actions .btn-outline:hover { background: var(--accent); }
.cookie-actions .btn-muted { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.cookie-actions .btn-muted:hover { background: #F8FAFB; }

/* Cookie preferences modal (overlay + panel) */
.cookie-modal-backdrop { position: fixed; inset: 0; background: rgba(10, 25, 38, 0.48); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 1200; }
.cookie-modal-backdrop.show { opacity: 1; pointer-events: auto; }
.cookie-modal { width: 92%; max-width: 720px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.cookie-modal .header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cookie-modal .header h3 { margin: 0; }
.cookie-modal .body { display: flex; flex-direction: column; gap: 12px; }
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cookie-row .desc { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }
.cookie-row .control { display: flex; align-items: center; gap: 10px; }

/* Simple toggle switch (JS should add .on for enabled) */
.switch { position: relative; width: 44px; height: 24px; border-radius: 999px; background: #D1D5DB; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s ease; }
.switch.on { background: var(--secondary); }
.switch.on::after { transform: translateX(20px); }

/* --- Accessibility helpers --- */
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* --- Subtle separators within content --- */
hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* --- Elegant Classic micro-interactions --- */
[class*="btn"], .main-nav a, .mobile-nav a, .content-wrapper > a, .text-section > a { will-change: background, color, transform; }

/* --- Page-specific gentle accents --- */
section:nth-of-type(odd) .content-wrapper { background: #FFFFFF; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); }

/* --- Responsive Typography Scale --- */
@media (min-width: 480px) {
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
}
@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
}

/* --- Responsive Layout Adjustments --- */
@media (min-width: 680px) {
  .testimonial-card { flex-direction: row; }
}

@media (min-width: 768px) {
  .content-wrapper { gap: 18px; }
  .text-image-section { flex-direction: row; }
}

/* Show desktop nav, hide burger */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
  header .container { padding-top: 14px; padding-bottom: 14px; }
  /* Footer columns */
  footer .content-wrapper { flex-direction: row; flex-wrap: wrap; gap: 28px; }
  footer .content-wrapper > * { flex: 1 1 240px; }
}

/* --- Contrast & readability for testimonial/review sections --- */
/* Ensures dark text on light background */
section:has(.testimonial-card) .content-wrapper, /* progressive enhancement */
.testimonial-card { background: #FFFFFF; color: var(--ink); }

/* --- Additional Utility / Safety --- */
.z-top { z-index: 9999; }

/* --- Print tweaks --- */
@media print {
  .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-modal-backdrop { display: none !important; }
  a { text-decoration: underline; }
}

/* --- Compliance: Mandatory Flex Spacing & Alignment Patterns (exact) --- */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* --- Header Nav nuanced styling for elegant classic feel --- */
.main-nav a { border: 1px solid transparent; }
.main-nav a:hover { border-color: var(--line); background: var(--accent); }

/* --- Inline contact links with icons --- */
.text-section a[href^="tel:"],
.text-section a[href^="mailto:"] { text-decoration: underline; text-underline-offset: 3px; }
.text-section a[href^="tel:"]:hover,
.text-section a[href^="mailto:"]:hover { color: #103654; }
