/* ===== CSS RESET & NORMALIZE ===== */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup, 
main, menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
article, aside, details, figcaption, figure, 
footer, header, hgroup, main, menu, nav, section {
  display: block;
}
body {
  line-height: 1.6;
  background: #fff;
  color: #233952;
  font-family: 'Roboto', Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
ol, ul {
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
img {
  max-width: 100%;
  height: auto;
  border: 0;
  display: block;
}

/* ===== ROOT VARIABLES (with fallback for custom properties) ===== */
:root {
  --primary: #233952;
  --primary-rgb: 35, 57, 82;
  --secondary: #FFA500;
  --accent: #E0E7EF;
  --text: #233952;
  --text-dark: #171e27;
  --text-light: #fff;
  --muted: #73809a;
  --background: #ffffff;
  --section-bg: #F7F8FA;
  --shadow: 0 6px 24px rgba(35,57,82, 0.08);
  --radius: 14px;
  --font-display: 'Montserrat', Georgia, "Times New Roman", Times, serif;
  --font-body: 'Roboto', Georgia, "Times New Roman", Times, serif;
}

/* ===== LAYOUT & CONTAINER ===== */
.container {
  width: 100%;
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
.content-wrapper {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: var(--section-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 768px) {
  .content-wrapper {
    padding: 50px 40px;
    margin-bottom: 60px;
  }
}

.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: var(--section-bg);
  border-radius: var(--radius);
}

.text-section {
  margin-bottom: 32px;
}
.text-section:last-child {
  margin-bottom: 0;
}

/* Spacing helpers */
.mt-24 {margin-top: 24px;}
.mb-24 {margin-bottom: 24px;}
.mt-40 {margin-top: 40px;}
.mb-40 {margin-bottom: 40px;}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin-bottom: 16px;
}
h1 {
  font-size: 2.4rem;
  margin-bottom: 20px;
}
h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}
h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--primary);
}
p, li, ol, ul, span, strong {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-dark);
}
strong {
  font-weight: 600;
  font-family: var(--font-display);
}
.subheadline {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 20px;
  font-family: var(--font-display);
}
.client-name {
  font-size: 0.94rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 6px;
  display: block;
}

@media (max-width: 767px) {
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.22rem; }
}

/* ===== BUTTONS & CTAS ===== */
.cta-btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--secondary);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.04rem;
  border: none;
  border-radius: 32px;
  box-shadow: 0 2px 8px rgba(35,57,82,0.10);
  transition: background 0.17s, color 0.17s, box-shadow 0.17s, transform 0.15s;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 20px;
}
.cta-btn:hover,
.cta-btn:focus {
  background: #ffd17d;
  color: var(--primary);
  box-shadow: 0 4px 20px rgba(35,57,82,0.13);
  transform: translateY(-2px) scale(1.03);
}

button {
  font-family: var(--font-display);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.17s, color 0.17s, box-shadow 0.17s, transform 0.14s;
}

/* ===== HEADER, NAVIGATION ===== */
header {
  background: var(--background);
  box-shadow: 0 4px 24px 0 rgba(35,57,82,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}
header nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
header nav a {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 7px;
  transition: background 0.16s, color 0.12s;
}
header nav a:hover,
header nav a:focus {
  background: var(--accent);
  color: var(--secondary);
}

header .cta-btn {
  margin-top: 0;
}
header img {
  max-height: 46px;
}

/* Hamburger for mobile */
.mobile-menu-toggle {
  display: none;
  background: var(--primary);
  color: var(--text-light);
  font-size: 2.1rem;
  border-radius: 8px;
  padding: 6px 16px 5px 16px;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 202;
  transition: background 0.17s, transform 0.10s;
  box-shadow: 0 3px 12px rgba(35,57,82,0.07);
}
.mobile-menu-toggle:active,
.mobile-menu-toggle:focus {
  background: #334764;
  transform: scale(1.07);
}
@media (max-width: 992px) {
  header nav, header .cta-btn {display: none;}
  .mobile-menu-toggle {
    display: block;
  }
}

/* ===== MOBILE MENU OVERLAY ===== */
.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(35,57,82, 0.98);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 320ms cubic-bezier(.82,.01,.41,1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  min-width: 220px;
}
.mobile-menu.open { /* JS toggles 'open' class */
  transform: translateX(0%);
}
.mobile-menu-close {
  align-self: flex-end;
  background: var(--secondary);
  color: var(--primary);
  font-size: 2rem;
  padding: 8px 20px 8px 20px;
  border-radius: 99px;
  margin: 18px 26px 10px 0;
  box-shadow: 0 1px 10px rgba(35,57,82,0.11);
  transition: background 0.12s;
}
.mobile-menu-close:focus,
.mobile-menu-close:hover {
  background: #ffd17d;
  color: var(--primary);
}
.mobile-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-top: 12px;
  padding: 0 36px;
}
.mobile-nav a {
  font-family: var(--font-display);
  font-size: 1.13rem;
  color: var(--accent);
  padding: 13px 0;
  border-radius: 6px;
  width: 100%;
  transition: background 0.13s, color 0.11s;
}
.mobile-nav a:hover,
.mobile-nav a:focus {
  background: #fff5da;
  color: var(--secondary);
}

/* Hide mobile menu above breakpoint */
@media (min-width: 993px) {
  .mobile-menu {display: none;}
}

/* ===== MAIN & FLEX UTILITIES ===== */
main {
  width: 100%;
  min-height: 50vh;
  margin-bottom: 40px;
}
.flex {
  display: flex;
}
.align-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.flex-col {
  flex-direction: column;
}
.flex-row {
  flex-direction: row;
}
.flex-wrap {
  flex-wrap: wrap;
}

/* ===== FLEXBOX MANDATORY PATTERNS ===== */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 26px 26px 20px 26px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: box-shadow 0.18s, transform 0.11s;
}
.card:hover {
  box-shadow: 0 8px 34px rgba(35,57,82,0.13);
  transform: translateY(-3px) scale(1.01);
}

.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;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 12px 0 rgba(35,57,82,0.08);
  margin-bottom: 20px;
  flex: 1 1 0;
  position: relative;
  min-width: 220px;
}
.testimonial-card p {
  color: #233952;
  font-style: italic;
  font-size: 1.06rem;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(35,57,82,0.09);
  padding: 18px 22px 16px 22px;
}

/* ===== FEATURE GRID ===== */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
  padding-left: 0;
}
.feature-grid li {
  flex: 1 1 186px;
  min-width: 220px;
  max-width: 25%;
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 2px 11px rgba(35,57,82,0.08);
  padding: 20px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  transition: box-shadow 0.19s, transform 0.10s;
}
.feature-grid li:hover {
  box-shadow: 0 7px 32px 0 rgba(35,57,82,0.10);
  transform: translateY(-2px) scale(1.015);
}
.feature-grid img {
  height: 38px;
  width: 38px;
  margin-bottom: 10px;
}
@media (max-width: 900px) {
  .feature-grid li {max-width: 44%;}
}
@media (max-width: 700px) {
  .feature-grid {gap: 12px;}
  .feature-grid li {
    min-width: 85vw;
    max-width: 98vw;
  }
}

/* ===== SERVICE CARDS (3D-Druck Dienstleistungen) ===== */
.service-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}
.service-cards > div {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  flex: 1 1 210px;
  min-width: 220px;
  padding: 28px 22px 24px 22px;
  transition: box-shadow 0.16s, transform 0.11s;
}
.service-cards > div:hover {
  box-shadow: 0 9px 38px rgba(35,57,82,0.11);
  transform: translateY(-3px) scale(1.015);
}
.service-cards .cta-btn {
  margin: 0 auto 0 0;
}
@media (max-width: 900px) {
  .service-cards > div {max-width: 99vw;}
}
@media (max-width: 700px) {
  .service-cards {flex-direction: column;gap: 14px;}
}

/* ===== FORM & INPUTS (Kontakt, optional) ===== */
input, textarea, select {
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid #CAD4DC;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  width: 100%;
  transition: border-color 0.16s, box-shadow 0.13s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 2px 1px #c2cae0 inset;
}
label {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 7px;
  display: block;
}

/* ===== LISTS & ICONS ===== */
ul, ol {
  margin-bottom: 20px;
  margin-left: 1.36em;
  padding-left: 0.36em;
}
ul li, ol li {
  line-height: 1.7;
  position: relative;
  padding-left: 0.95em;
  margin-bottom: 8px;
}
ul li:before {
  content: '•';
  color: var(--secondary);
  font-weight: 700;
  display: inline-block;
  position: absolute;
  left: 0; top: 0;
  font-size: 1.04em;
}
ul li img, ol li img {
  display: inline-block;
  margin-right: 12px;
  vertical-align: middle;
  height: 23px;
}

ol {
  list-style-type: decimal inside;
}
ol li {
  padding-left: 0.30em;
  font-weight: 500;
  color: var(--primary);
}

/* ===== FOOTER ===== */
footer {
  background: var(--primary);
  color: var(--text-light);
  padding: 38px 0 20px 0;
  margin-top: 48px;
}
footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-top: 0;
  padding-bottom: 0;
}
.footer-brand img {
  max-width: 56px;
  margin-bottom: 13px;
}
footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}
footer nav a {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.03rem;
  opacity: 0.97;
  transition: color 0.16s, text-decoration 0.13s;
  padding: 4px 6px;
}
footer nav a:hover {
  color: var(--secondary);
  text-decoration: underline;
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.99rem;
}
.footer-contact ul {
  padding-left: 0;
  margin-left: 0;
  margin-bottom: 8px;
}
.footer-contact li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--accent);
}
.footer-contact a {
  color: var(--accent);
  text-decoration: underline;
  font-size: 1rem;
}
.footer-contact a:hover {
  color: var(--secondary);
  text-decoration: underline dotted;
}
.footer-contact img {
  height: 18px;
  width: 18px;
  margin-right: 3px;
}
footer p {color: #dbe7f7; opacity: 0.72; font-size: 0.96rem;}
@media (max-width: 950px) {
  footer .container {
    flex-direction: column;
    gap: 22px;
    align-items: flex-start;
  }
}

/* ===== COOKIE CONSENT BANNER ===== */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100vw;
  z-index: 9999;
  background: var(--accent);
  color: var(--primary);
  box-shadow: 0 -3px 22px 0 rgba(35,57,82,0.13);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  gap: 22px;
  font-size: 1rem;
  border-radius: 20px 20px 0 0;
  animation: cookieFadeIn 0.48s 0.15s both cubic-bezier(.52,.01,.50,1.01);
}
@keyframes cookieFadeIn {
  0% { opacity: 0; transform: translateY(80px); }
  100% { opacity: 1; transform: translateY(0); }
}
.cookie-banner-text {
  flex: 1 1 340px;
  max-width: 520px;
}
.cookie-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-left: 24px;
}
.cookie-btn {
  padding: 10px 26px;
  background: var(--primary);
  color: var(--accent);
  border-radius: 7px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.03rem;
  border: none;
  box-shadow: 0 1px 8px rgba(35,57,82,0.11);
  margin: 0;
  transition: background 0.16s, color 0.16s;
}
.cookie-btn.reject {
  background: #d2dbe2;
  color: var(--primary);
}
.cookie-btn.settings {
  background: var(--secondary);
  color: var(--primary);
}
.cookie-btn:hover,
.cookie-btn:focus {
  background: #344b73;
  color: #fff;
}
.cookie-btn.reject:hover {
  background: #b4b4b4;
}
.cookie-btn.settings:hover {
  background: #ffd17d;
}

@media (max-width: 820px) {
  .cookie-banner {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding: 16px 12px;
    font-size: 0.97rem;
    box-shadow: 0 -2px 14px 0 rgba(35,57,82,0.11);
  }
  .cookie-btn-group {
    margin-left: 0;
    justify-content: flex-start;
  }
}

/* Cookie Preferences Modal */
.cookie-modal {
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  z-index: 12001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(35,57,82, 0.40);
  animation: modalFadeIn 0.28s 0.02s both;
}
@keyframes modalFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.cookie-modal-content {
  background: #fff;
  color: var(--primary);
  border-radius: 26px;
  box-shadow: 0 12px 44px rgba(35,57,82,0.23);
  padding: 32px 24px 28px 24px;
  max-width: 95vw;
  min-width: 310px;
  width: 440px;
  animation: scaleAppear 0.23s cubic-bezier(0.73,0.16,0.58,1.14);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
@keyframes scaleAppear {
  0% { opacity: 0; transform: scale(0.90); }
  100% { opacity: 1; transform: scale(1); }
}
.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cookie-modal-header h2 {
  margin-bottom: 0;
  font-size: 1.22rem;
}
.cookie-modal-close {
  background: var(--accent);
  font-size: 1.55rem;
  color: var(--primary);
  padding: 6px 18px;
  border-radius: 50px;
  border: none;
  margin-left: 12px;
  transition: background 0.11s;
}
.cookie-modal-close:hover {
  background: #ffefc2;
  color: var(--secondary);
}
.cookie-modal-list {
  display: flex;
  flex-direction: column;
  gap: 17px;
  margin: 18px 0 24px 0;
}
.cookie-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 4px 0;
  border-bottom: 1px solid #E0E7EF;
}
.cookie-modal-row span {
  font-family: var(--font-display);
  font-weight: 600;
}
.cookie-modal-row .cookie-toggle {
  appearance: none;
  width: 42px; height: 22px;
  background: #E0E7EF;
  border-radius: 14px;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background 0.14s;
  box-shadow: 0 2px 4px rgba(35,57,82,0.08) inset;
}
.cookie-modal-row .cookie-toggle:checked {
  background: var(--secondary);
}
.cookie-modal-row .cookie-toggle:before {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(35,57,82,0.15);
  transition: left 0.13s;
}
.cookie-modal-row .cookie-toggle:checked:before {
  left: 22px;
}
.cookie-modal-row .cookie-toggle[disabled],
.cookie-modal-row .cookie-toggle[aria-disabled='true'] {
  background: #cfd5db;
  opacity: 0.63;
  cursor: not-allowed;
}
.cookie-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 18px;
}
.cookie-modal-footer .cookie-btn {
  min-width: 110px;
}
@media (max-width: 501px) {
  .cookie-modal-content {padding: 22px 8px; width: 94vw;}
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .container {
    padding-left: 8px; padding-right: 8px;
  }
  .content-wrapper, .section {
    padding: 22px 8px;
  }
  h1 {font-size: 1.25rem;}
  h2 {font-size: 1.11rem;}
}
@media (max-width: 768px) {
  .text-image-section {
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
  }
  .content-wrapper, .section {
    padding: 20px 4px;
    margin-bottom: 40px;
  }
}

/* Hide unnecessary horizontal scroll */
body {overflow-x: hidden;}

/* ===== UTILITIES & ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.45s cubic-bezier(.22,.68,.43,1) 0.1s both;
}
@keyframes fadeIn {
  0%{opacity:0;transform:translateY(16px);}
  100%{opacity:1;transform:translateY(0);}
}

.shadow-hover {
  transition: box-shadow .13s, transform .09s;
}
.shadow-hover:hover {
  box-shadow: 0 9px 38px rgba(35,57,82,0.13) !important;
  transform: translateY(-3px) scale(1.01) !important;
}

/* ===== Print optimizations ===== */
@media print {
  header, nav, .mobile-menu, .cookie-banner, footer {
    display: none !important;
  }
  main, body, .container, .content-wrapper {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
