/* =============================
   Pilatus Klimatechnik - style.css
   Nature_Organic aesthetic with brand personality
   Mobile-first, Flexbox-only, accessible & performant
   ============================= */

/* ===== Reset & Base Normalize ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { margin: 0; font-family: Verdana, Arial, sans-serif; line-height: 1.6; background: #F8F6F1; color: #25352E; }
img, svg, video { max-width: 100%; height: auto; display: block; }
img { vertical-align: middle; }
a { text-decoration: none; color: inherit; }
ul, ol { margin: 0; padding-left: 20px; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
button { font: inherit; background: none; border: none; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #2E7D32; outline-offset: 2px; }

/* ===== Theme Variables (with fallbacks) ===== */
:root {
  /* Brand */
  --primary: #0E3A5B; /* deep alpine blue */
  --secondary: #2F6F7A; /* cool teal */
  --accent: #F3F7FA; /* light airy */
  /* Nature Organic */
  --moss: #2E7D32; /* moss green */
  --leaf: #99B28F; /* soft leaf */
  --sand: #F3EFE6; /* warm sand */
  --paper: #F8F6F1; /* paper */
  --clay: #C2AD8F; /* clay */
  --bark: #5A4634; /* bark */
  --stone: #7D8F87; /* stone */
  --text: #25352E; /* dark forest text */
  --muted: #50635A; /* muted forest */
  --white: #FFFFFF;
  --shadow: 0 6px 20px rgba(18, 44, 28, 0.12);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
}

/* ===== Typography ===== */
h1, h2, h3, h4 { font-family: "Trebuchet MS", Verdana, sans-serif; color: var(--primary); line-height: 1.2; letter-spacing: 0.2px; }
h1 { font-size: 32px; margin-bottom: 12px; }
h2 { font-size: 24px; margin-bottom: 14px; }
h3 { font-size: 18px; margin-top: 8px; margin-bottom: 8px; color: #1F2E35; }
p { font-size: 16px; color: var(--text); }
.small { font-size: 14px; color: var(--muted); }
strong { color: #1F2E35; }

/* ===== Containers & Layout (Flexbox-only) ===== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; justify-content: center; }
.content-wrapper { width: 100%; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }

main { display: flex; flex-direction: column; gap: 40px; }
section { padding: 28px 0; }

/* Mandatory spacing & alignment patterns */
.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; }

/* Prevent overlap and ensure spacing */
.content-wrapper > * { margin: 0; }
.content-wrapper > * + * { margin-top: 0; }

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

.main-nav { display: none; align-items: center; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: var(--primary); font-size: 15px; padding: 8px 10px; border-radius: 10px; transition: color .2s ease, background-color .2s ease; }
.main-nav a:hover { background: var(--sand); color: #0a2a42; }

.header-cta { display: flex; align-items: center; }
.header-cta a { background: var(--moss); color: var(--white); padding: 10px 16px; border-radius: var(--radius-pill); box-shadow: var(--shadow); font-weight: 700; transition: background .25s ease, transform .2s ease; }
.header-cta a:hover { background: #27692A; transform: translateY(-1px); }
.header-cta a:active { transform: translateY(0); }

/* Mobile menu button */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--sand); color: var(--primary); box-shadow: 0 1px 0 rgba(0,0,0,0.04); transition: background .2s ease; }
.mobile-menu-toggle:hover { background: #EFEADF; }

/* ===== Mobile Menu Overlay ===== */
.mobile-menu { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-end; background: rgba(14, 58, 91, 0.2); backdrop-filter: blur(2px); transform: translateX(100%); transition: transform .35s ease; z-index: 999; }
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-close { margin: 12px; width: 40px; height: 40px; border-radius: 10px; background: var(--white); color: var(--primary); box-shadow: var(--shadow); }
.mobile-nav { width: 86%; max-width: 360px; height: 100%; background: var(--white); display: flex; flex-direction: column; padding: 20px; gap: 6px; box-shadow: -8px 0 24px rgba(0,0,0,0.12); }
.mobile-nav a { display: flex; align-items: center; padding: 12px 14px; border-radius: 12px; color: var(--primary); transition: background .2s ease, color .2s ease; }
.mobile-nav a:hover { background: var(--sand); color: #0a2a42; }

/* ===== Hero ===== */
.hero { position: relative; background: var(--sand); border-bottom: 1px solid #E6E2D9; overflow: hidden; }
.hero .container { padding: 14px 0; }
.hero .content-wrapper { padding: 14px 0; gap: 12px; }
.hero h1 { color: var(--primary); }
.hero p { color: var(--muted); }

/* Organic decorative shapes (decorative only) */
.hero::before, .hero::after { content: ""; position: absolute; z-index: 0; border-radius: 52% 48% 44% 56% / 50% 45% 55% 50%; opacity: 0.18; }
.hero::before { width: 340px; height: 340px; background: var(--leaf); left: -120px; top: -80px; }
.hero::after { width: 260px; height: 260px; background: var(--accent); right: -90px; bottom: -80px; }
.hero .content-wrapper > * { position: relative; z-index: 1; }

/* ===== Common content blocks ===== */
.text-section { display: flex; flex-direction: column; gap: 12px; }
.text-section ul, .text-section ol { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.text-section li { position: relative; padding-left: 28px; color: var(--text); }
.text-section li::before { content: ""; width: 10px; height: 10px; background: var(--moss); border-radius: 4px 6px 6px 10px; position: absolute; left: 8px; top: 8px; transform: rotate(12deg); }

.metrics { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14px; }

/* CTA group */
.cta-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cta-group a { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: var(--radius-pill); border: 1px solid transparent; background: var(--moss); color: var(--white); font-weight: 700; transition: background .2s ease, color .2s ease, transform .2s ease, border-color .2s ease; }
.cta-group a:nth-child(2) { background: var(--white); color: var(--primary); border-color: #D9D3C7; }
.cta-group a:hover { transform: translateY(-1px); }
.cta-group a:first-child:hover { background: #27692A; }
.cta-group a:nth-child(2):hover { background: #EFEADF; }

/* Links in text paragraphs */
.text-section a, p a { color: var(--secondary); text-decoration: underline; text-decoration-color: rgba(47,111,122,0.4); text-underline-offset: 3px; transition: color .2s ease, background .2s ease; }
.text-section a:hover, p a:hover { color: #1E5560; background: rgba(158, 188, 173, 0.14); }

/* ===== Cards ===== */
.card { background: var(--white); border: 1px solid #E5DFD4; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px; }

/* Testimonials - strong contrast, light background, dark text */
.testimonial-card { background: var(--paper); border: 1px solid #E5DFD4; border-left: 6px solid var(--moss); border-radius: var(--radius); box-shadow: var(--shadow); color: #1E2B24; }
.testimonial-card p { color: #1E2B24; }
.testimonial-card strong { color: var(--primary); }

/* ===== Footer ===== */
footer { background: var(--primary); color: var(--white); padding: 26px 0; margin-top: 20px; }
footer .content-wrapper { gap: 14px; }
footer a { color: #E6F2FF; }
footer a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
.footer-nav, .legal-nav { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-cta { display: flex; }
.footer-cta a { background: var(--leaf); color: #0E2C1D; padding: 10px 16px; border-radius: var(--radius-pill); font-weight: 700; transition: background .2s ease, transform .2s ease; }
.footer-cta a:hover { background: #8AA786; transform: translateY(-1px); }

/* ===== Cookie Consent Banner ===== */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 12px; background: var(--sand); color: var(--text); border-top: 1px solid #E1DCCD; padding: 16px; z-index: 998; box-shadow: 0 -8px 24px rgba(0,0,0,0.12); transform: translateY(100%); transition: transform .35s ease; }
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: var(--radius-pill); border: 1px solid transparent; font-weight: 700; }
.cookie-btn.accept { background: var(--moss); color: var(--white); }
.cookie-btn.reject { background: var(--white); color: var(--primary); border-color: #D9D3C7; }
.cookie-btn.settings { background: #ECE6DA; color: #2C3B36; }
.cookie-btn:hover { filter: brightness(0.98); }

/* Cookie Preferences Modal */
.cookie-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(8, 24, 16, 0.42); z-index: 1000; }
.cookie-modal.show { display: flex; }
.cookie-modal .cookie-dialog { width: 92%; max-width: 720px; background: var(--white); border-radius: var(--radius-lg); box-shadow: 0 30px 60px rgba(0,0,0,0.24); display: flex; flex-direction: column; padding: 18px; gap: 16px; transform: translateY(24px); transition: transform .3s ease; }
.cookie-modal.show .cookie-dialog { transform: translateY(0); }
.cookie-dialog .cookie-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cookie-dialog .cookie-body { display: flex; flex-direction: column; gap: 10px; }
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid #EEE8DD; border-radius: 12px; background: #FAF8F3; }
.cookie-row .always-on { color: #2C3B36; font-size: 14px; background: #E9F3EA; padding: 4px 10px; border-radius: var(--radius-pill); }
.cookie-dialog .cookie-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Toggle (optional if implemented) */
.toggle { display: inline-flex; width: 44px; height: 26px; border-radius: 26px; background: #CFD8D2; position: relative; transition: background .2s ease; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--white); border-radius: 50%; transition: transform .2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.toggle.active { background: var(--moss); }
.toggle.active::after { transform: translateX(18px); }

/* ===== Utility & Helpers ===== */
.hidden { display: none !important; }
.center { display: flex; align-items: center; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-direction: row; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ===== Page-specific subtle accents ===== */
/* Price, FAQ, etc maintain consistent look via text-section rules */

/* ===== Responsive ===== */
@media (min-width: 480px) {
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
}

@media (min-width: 768px) {
  body { font-size: 17px; }
  .content-wrapper { gap: 22px; }
  section { padding: 36px 0; }
  .hero .container { padding: 24px 0; }
  .hero h1 { font-size: 44px; }
  .hero p { font-size: 18px; max-width: 800px; }
  .logo img { height: 50px; }
}

@media (min-width: 992px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
  header .content-wrapper { gap: 18px; }
  .text-image-section { flex-direction: row; }
}

/* Mobile text-image column rule (explicit) */
@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
}

/* ===== Additional Components (optional usage) ===== */
/* Feature items / icon + text stacks */
.feature-item h3 { margin: 0; }

/* Generic buttons if needed */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: var(--radius-pill); border: 1px solid transparent; font-weight: 700; }
.btn-primary { background: var(--moss); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--primary); border-color: #D9D3C7; }
.btn-ghost { background: #ECE6DA; color: #2C3B36; }
.btn:hover { filter: brightness(0.98); }

/* ===== Accessibility & Micro-interactions ===== */
a, button { transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; border-radius: 8px; }

/* ===== Ensure flex for all nav/sections present in HTML ===== */
nav.main-nav, nav.footer-nav, nav.legal-nav { display: flex; flex-wrap: wrap; gap: 12px; }
footer nav.footer-nav a, footer nav.legal-nav a { padding: 6px 8px; border-radius: 10px; }

/* ===== Readability in testimonial/review contexts ===== */
/* Dark text on light bg enforced */
section .testimonial-card, .testimonial-card p, .testimonial-card strong { color: #14231B; }

/* ===== Lists in legal pages better spacing ===== */
section .content-wrapper .text-section ul li, section .content-wrapper .text-section ol li { line-height: 1.6; }

/* ===== Borders and subtle dividers ===== */
hr { border: 0; border-top: 1px solid #E6E2D9; margin: 16px 0; }

/* ===== Prevent accidental absolute on content cards (decorative allowed) ===== */
/* Cards and text blocks use natural flow; only hero shapes and overlays use positioned elements as above. */

/* ===== Touch targets ===== */
nav a, .cookie-btn, .header-cta a, .cta-group a { min-height: 40px; }

/* ===== Page-specific tweaks ===== */
/* Hero links on thank you */
.hero .cta-group a:nth-child(2) { background: var(--white); color: var(--primary); border-color: #D9D3C7; }

/* Contact info links underline for clarity */
.text-section a[href^="tel:"], .text-section a[href^="mailto:"] { text-decoration: underline; text-underline-offset: 3px; }

/* ===== Print (basic) ===== */
@media print {
  .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: underline; color: #000; }
}
