:root {
  --red: #CC3300;
  --red-dark: #a82900;
  --black: #111111;
  --dark: #1a1a1a;
  --dark2: #242424;
  --dark3: #2e2e2e;
  --gray: #888;
  --gray-light: #ccc;
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(0,0,0,0.1);
  --white: #ffffff;
  --bg: #f5f4f0;
  --bg2: #eeede9;
  --text: #1a1a1a;
  --text-muted: #666;
  --card-bg: #ffffff;
  --card-border: rgba(0,0,0,0.09);
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.11);
  --radius: 6px;
  --radius-md: 10px;
  --nav-h: 60px;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Barlow Condensed', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ============ NAVBAR ============ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--black);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  max-width: 1300px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 32px; padding: 0 24px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-m {
  width: 32px; height: 32px; background: var(--red); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -1px;
}
.logo-text { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.logo-red { color: var(--red); }
.nav-links { display: flex; gap: 4px; list-style: none; flex: 1; }
.nav-links a {
  padding: 6px 14px; color: rgba(255,255,255,0.7); font-size: 14px; font-weight: 500;
  border-radius: var(--radius); transition: all 0.15s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.07); }
.nav-admin { border: 1px solid rgba(255,255,255,0.2) !important; }
.nav-admin:hover { border-color: var(--red) !important; color: var(--red) !important; }
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.lang-switcher { display: flex; gap: 2px; }
.lang-btn {
  padding: 4px 8px; background: none; border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5); font-size: 12px; font-weight: 600; border-radius: 3px;
  transition: all 0.15s; cursor: pointer;
}
.lang-btn:hover, .lang-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.burger { display: none; background: none; border: none; color: #fff; font-size: 20px; padding: 4px; }
.mobile-menu {
  display: none; flex-direction: column; background: var(--black);
  border-top: 1px solid var(--border); padding: 12px 24px 16px;
}
.mobile-menu a { padding: 10px 0; color: rgba(255,255,255,0.8); border-bottom: 1px solid var(--border); font-size: 15px; }
.mobile-menu.open { display: flex; }

/* ============ MAIN / PAGES ============ */
main { padding-top: var(--nav-h); min-height: 100vh; }
.page { display: none; }
.page.active { display: block; }

/* ============ HERO ============ */
.hero {
  background: var(--black); position: relative;
  padding: 80px 24px 72px; overflow: hidden; text-align: center;
}
.hero-grid-bg {
  position: absolute; inset: 0; opacity: 0.04;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 40px, #fff 40px, #fff 41px),
                    repeating-linear-gradient(90deg, transparent, transparent 40px, #fff 40px, #fff 41px);
}
.hero-content { position: relative; max-width: 780px; margin: 0 auto; }
.hero-tag { font-size: 11px; letter-spacing: 3px; color: var(--red); font-weight: 600; margin-bottom: 16px; }
.hero h1 {
  font-family: var(--font-display); font-size: clamp(36px, 6vw, 64px); font-weight: 700;
  color: #fff; line-height: 1.05; letter-spacing: -0.5px; margin-bottom: 18px;
}
.hero-sub { font-size: 17px; color: rgba(255,255,255,0.55); max-width: 520px; margin: 0 auto 32px; line-height: 1.6; }
.hero-search {
  display: flex; border-radius: 8px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12); max-width: 660px; margin: 0 auto 16px;
}
.hero-search select, .hero-search input {
  background: rgba(255,255,255,0.06); border: none; padding: 14px 16px; color: #fff;
  font-size: 14px; outline: none;
}
.hero-search select { flex-shrink: 0; border-right: 1px solid rgba(255,255,255,0.12); min-width: 160px; cursor: pointer; }
.hero-search select option { background: #222; }
.hero-search input { flex: 1; }
.hero-search input::placeholder { color: rgba(255,255,255,0.35); }
.hero-search button {
  background: var(--red); border: none; padding: 14px 24px; color: #fff;
  font-size: 14px; font-weight: 600; flex-shrink: 0; transition: background 0.15s;
}
.hero-search button:hover { background: var(--red-dark); }
.hero-tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero-tag-btn {
  padding: 5px 12px; border: 1px solid rgba(255,255,255,0.15); border-radius: 20px;
  color: rgba(255,255,255,0.5); font-size: 12px; background: none; cursor: pointer; transition: all 0.15s;
}
.hero-tag-btn:hover { border-color: var(--red); color: var(--red); }

/* ============ STATS BAR ============ */
.stats-bar {
  background: var(--dark); display: flex; justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.stat-item {
  display: flex; flex-direction: column; align-items: center; padding: 20px 40px;
  border-right: 1px solid rgba(255,255,255,0.06); gap: 3px;
}
.stat-item:last-child { border-right: none; }
.stat-num { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--red); line-height: 1; }
.stat-item span:last-child { font-size: 12px; color: rgba(255,255,255,0.45); letter-spacing: 1px; text-transform: uppercase; }

/* ============ SECTIONS ============ */
.section { max-width: 1300px; margin: 0 auto; padding: 60px 24px; }
.section-dark { background: var(--bg2); max-width: none; }
.section-dark > .section-inner { max-width: 1300px; margin: 0 auto; padding: 60px 24px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.section-header h2 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: 0.5px; }
.see-all { color: var(--red); font-size: 14px; font-weight: 500; }
.see-all:hover { text-decoration: underline; }

/* ============ MACHINE CARD ============ */
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.machine-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md);
  overflow: hidden; cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow);
}
.machine-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(204,51,0,0.2); }
.card-image {
  height: 180px; background: var(--bg2); display: flex; align-items: center;
  justify-content: center; position: relative; overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-image-placeholder { color: var(--gray); font-size: 48px; opacity: 0.3; }
.card-status {
  position: absolute; top: 10px; left: 10px; padding: 3px 8px;
  font-size: 10px; font-weight: 700; border-radius: 3px; letter-spacing: 0.5px; text-transform: uppercase;
}
.status-available { background: #1a4a2a; color: #6fcf97; }
.status-reserved { background: #3a3010; color: #f2c94c; }
.status-sold { background: #3a1010; color: #eb5757; }
.card-featured { position: absolute; top: 10px; right: 10px; background: var(--red); color: #fff; padding: 3px 7px; font-size: 9px; font-weight: 700; border-radius: 3px; text-transform: uppercase; }
.card-body { padding: 14px 16px; }
.card-brand { font-size: 11px; color: var(--red); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; line-height: 1.3; color: var(--text); }
.card-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--border-light); }
.card-price { font-size: 15px; font-weight: 700; color: var(--red); }
.card-location { font-size: 11px; color: var(--text-muted); }

/* ============ CATEGORIES ============ */
.cat-grid { max-width: 1300px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.section-dark .cat-grid { padding: 0; }
.cat-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md);
  padding: 20px; cursor: pointer; transition: all 0.2s; text-align: center;
}
.cat-card:hover { border-color: var(--red); transform: translateY(-2px); }
.cat-icon { font-size: 28px; margin-bottom: 10px; }
.cat-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cat-count { font-size: 12px; color: var(--text-muted); }
.cat-grid-big { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* ============ CTA ============ */
.cta-section {
  background: var(--red); padding: 64px 24px; text-align: center;
}
.cta-section h2 { font-family: var(--font-display); font-size: 32px; color: #fff; margin-bottom: 12px; }
.cta-section p { color: rgba(255,255,255,0.8); margin-bottom: 28px; }
.cta-section button {
  background: #fff; color: var(--red); border: none; padding: 14px 32px;
  font-size: 15px; font-weight: 700; border-radius: 6px; transition: opacity 0.15s;
}
.cta-section button:hover { opacity: 0.9; }

/* ============ LIST PAGE ============ */
.list-layout { display: flex; max-width: 1300px; margin: 0 auto; padding: 32px 24px; gap: 32px; }
.filters {
  width: 240px; flex-shrink: 0; background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-md); padding: 20px; height: fit-content;
  position: sticky; top: calc(var(--nav-h) + 16px);
}
.filter-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.filter-header h3 { font-size: 15px; font-weight: 700; }
.reset-btn { background: none; border: none; color: var(--red); font-size: 13px; cursor: pointer; padding: 0; }
.filter-group { margin-bottom: 16px; }
.filter-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.filter-group select, .filter-group input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--card-border); border-radius: var(--radius);
  background: var(--bg); font-size: 14px; outline: none; color: var(--text);
}
.filter-group select:focus, .filter-group input:focus { border-color: var(--red); }
.year-range { display: flex; gap: 6px; }
.year-range input { flex: 1; }
.list-main { flex: 1; min-width: 0; }
.list-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.search-bar-inline { flex: 1; }
.search-bar-inline input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--card-border); border-radius: var(--radius);
  background: var(--card-bg); font-size: 14px; outline: none;
}
.search-bar-inline input:focus { border-color: var(--red); }
.result-count { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.filter-toggle-btn {
  display: none; padding: 9px 16px; background: var(--dark); color: #fff;
  border: none; border-radius: var(--radius); font-size: 13px; font-weight: 600;
}

/* ============ PAGINATION ============ */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.page-btn {
  padding: 8px 14px; border: 1px solid var(--card-border); border-radius: var(--radius);
  background: var(--card-bg); font-size: 13px; cursor: pointer; transition: all 0.15s; color: var(--text);
}
.page-btn:hover { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ============ DETAIL PAGE ============ */
.page-header-block { background: var(--dark); padding: 40px 24px; text-align: center; }
.page-header-block h1 { font-family: var(--font-display); font-size: 36px; color: #fff; margin-bottom: 8px; }
.page-header-block p { color: rgba(255,255,255,0.5); }
.detail-container { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.detail-breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.detail-breadcrumb a { color: var(--red); cursor: pointer; }
.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; }
.detail-gallery { margin-bottom: 24px; }
.main-image { width: 100%; height: 400px; object-fit: cover; border-radius: var(--radius-md); background: var(--bg2); }
.main-image-placeholder { width: 100%; height: 400px; background: var(--bg2); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 64px; opacity: 0.3; }
.thumb-row { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumb { width: 72px; height: 56px; object-fit: cover; border-radius: var(--radius); cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.thumb.active { border-color: var(--red); }
.detail-info h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-bottom: 6px; line-height: 1.2; }
.detail-brand { color: var(--red); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.detail-meta-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-meta-item { font-size: 13px; color: var(--text-muted); }
.detail-meta-item strong { color: var(--text); }
.detail-status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 16px; }
.detail-description { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }
.specs-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.specs-table h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.specs-table table { width: 100%; }
.specs-table td { padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--border-light); }
.specs-table td:first-child { color: var(--text-muted); width: 45%; }
.specs-table td:last-child { font-weight: 500; }

/* SIDEBAR INQUIRY CARD */
.inquiry-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md); padding: 24px; position: sticky; top: calc(var(--nav-h) + 16px); }
.inquiry-price { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--red); margin-bottom: 16px; }
.inquiry-card button {
  width: 100%; padding: 13px; background: var(--red); color: #fff; border: none;
  border-radius: var(--radius); font-size: 15px; font-weight: 700; transition: background 0.15s; margin-bottom: 10px;
}
.inquiry-card button:hover { background: var(--red-dark); }
.inquiry-card .secondary-btn { background: transparent; color: var(--text); border: 1px solid var(--card-border); }
.inquiry-card .secondary-btn:hover { background: var(--bg2); background-color: var(--bg2); }
.inquiry-form { display: none; }
.inquiry-form.open { display: block; margin-top: 16px; }
.inquiry-form input, .inquiry-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--card-border); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font); margin-bottom: 8px; outline: none; background: var(--bg);
}
.inquiry-form input:focus, .inquiry-form textarea:focus { border-color: var(--red); }

/* SIMILAR MACHINES */
.similar-section { margin-top: 48px; }
.similar-section h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 20px; }

/* ============ CONTACT PAGE ============ */
.contact-layout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; max-width: 1000px; margin: 0 auto; padding: 48px 24px; }
.info-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md); padding: 20px; margin-bottom: 14px; }
.info-card h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.info-card p { font-size: 14px; }
.info-card a { color: var(--red); }
.contact-form-wrap { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-md); padding: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--card-border); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font); outline: none; background: var(--bg); color: var(--text);
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--red); }
#cf-submit, #inq-submit {
  padding: 13px 28px; background: var(--red); color: #fff; border: none;
  border-radius: var(--radius); font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.15s;
}
#cf-submit:hover, #inq-submit:hover { background: var(--red-dark); }
.form-result { margin-top: 12px; font-size: 14px; padding: 10px 14px; border-radius: var(--radius); display: none; }
.form-result.success { background: #e8f5e9; color: #2e7d32; display: block; }
.form-result.error { background: #fce4ec; color: #c62828; display: block; }

/* ============ FOOTER ============ */
#footer { background: var(--black); color: rgba(255,255,255,0.6); padding: 48px 24px 0; margin-top: 64px; }
.footer-inner { max-width: 1300px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.footer-brand .logo-text { font-size: 16px; display: block; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.7; }
.footer-links h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.35); margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 14px; transition: color 0.15s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { max-width: 1300px; margin: 0 auto; padding: 16px 0; font-size: 13px; }

/* ============ LOADING ============ */
.loading-spinner {
  width: 36px; height: 36px; border: 3px solid var(--bg2); border-top-color: var(--red);
  border-radius: 50%; animation: spin 0.7s linear infinite; margin: 60px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .burger { display: block; }
  .detail-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .filters { display: none; }
  .filters.open { display: block; width: 100%; position: static; }
  .filter-toggle-btn { display: block; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 32px; }
  .hero-search { flex-direction: column; }
  .hero-search select { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.12); }
  .stats-bar { flex-wrap: wrap; }
  .stat-item { padding: 14px 20px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .footer-inner { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .list-layout { flex-direction: column; padding: 16px; }
  .machine-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .machine-grid { grid-template-columns: 1fr; }
}

/* ============ LEGAL PAGES (Impressum, Datenschutz, AGB) ============ */
.legal-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.ownership-banner {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a1a0a 100%);
  border: 1px solid #e63946;
  border-left: 4px solid #e63946;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  color: #f0f0f0;
}
.ownership-banner p { margin: 0; }
.ownership-banner strong { color: #e63946; }

.legal-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}
.legal-section:last-child { border-bottom: none; }
.legal-section h2 {
  font-size: 1.5rem;
  color: #CC3300;
  margin-bottom: 1rem;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.03em;
}
.legal-section h3 {
  font-size: 1.05rem;
  color: #333;
  margin: 1.5rem 0 0.6rem;
  font-weight: 600;
}
.legal-section p {
  color: #555;
  line-height: 1.75;
  margin-bottom: 0.8rem;
}
.legal-section a { color: #CC3300; text-decoration: none; }
.legal-section a:hover { text-decoration: underline; }

/* Footer owner text */
.footer-owner {
  font-size: 0.82rem;
  color: #888;
  margin-top: 0.4rem;
}
