/* ################################################## */
/*              ÖFFENTLICHES LAYOUT BASIS              */
/* ################################################## */
:root {
  --container-width: 100%;
}

/* 🌍 Grundlayout */
html {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-dark);
  line-height: var(--line-height-base);
  font-size: var(--font-size-base);
  min-height: 100%;
  
  /* KEIN display:flex hier - das stört position:fixed beim Parallax! */
}

/* 📐 Überschriften */
h1 { font-size: var(--h1-size, 32px); }
h2 { font-size: var(--h2-size, 24px); }
h3 { font-size: var(--h3-size, 20px); }

/* 🖱️ Hover-Effekte für Buttons */
button, .btn, .button {
  transition: all 0.2s ease;
}

/* Hover: Abdunkeln */
body[data-hover="darken"] button:hover,
body[data-hover="darken"] .btn:hover,
body[data-hover="darken"] .button:hover {
  filter: brightness(0.85);
}

/* Hover: Vergrößern */
body[data-hover="zoom"] button:hover,
body[data-hover="zoom"] .btn:hover,
body[data-hover="zoom"] .button:hover {
  transform: scale(1.05);
}

/* Hover: Schatten */
body[data-hover="shadow"] button:hover,
body[data-hover="shadow"] .btn:hover,
body[data-hover="shadow"] .button:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Hover: Leuchten */
body[data-hover="glow"] button:hover,
body[data-hover="glow"] .btn:hover,
body[data-hover="glow"] .button:hover {
  box-shadow: 0 0 15px var(--accent-blue);
}

/* Container zentriert, max-width steuerbar */
.container {
  width: var(--container-fluid, 100%);
  margin: 0 auto;
  padding: var(--container-padding);
  background: var(--container-bg);
  border-radius: var(--container-radius);
  box-shadow: var(--container-shadow);
  box-sizing: border-box;
}

/* Bilder nicht breiter als Container */
.container img,
.page-content img,
.freitext-section img {
  max-width: 100%;
  height: auto;
}

/* Einheitliche Rundungen für Container-artige Elemente */
.container,
.card,
.site-header,
.site-footer,
.search-bar,
.category-menu,
.swiper,
.swiper-slide img,
.produkt-card,
.list-card,
.cookie-banner {
  border-radius: var(--container-radius) !important;
}

/* Einheitliche Rundungen für Buttons */
button,
.button,
.btn,
.search-btn,
.button-login,
.cookie-buttons button {
  border-radius: var(--button-radius) !important;
}

/* Einheitliche Rundungen für Formularelemente */
input,
select,
textarea,
.form-control {
  border-radius: var(--button-radius) !important;
}

/* Navigation Links */
.nav-links a,
.mobile-nav a {
  border-radius: var(--button-radius) !important;
}

/* ################################################## */
/* 🧭 HEADER                                         */
/* ################################################## */

.site-header {
  position: sticky;
  top: 0;
  background: var(--header-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 1000;
  transition: top 0.3s ease;
}

.site-header.scroll-hide {
  top: -100px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--header-padding, 0.8em) 1em;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 1em;
}

.logo {
  height: 50px;
}

.location a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}

/* 🔍 Suchleiste */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-light);
  border: 1px solid #cdd3dc;
  border-radius: var(--container-radius);
  overflow: hidden;
}

.search-category,
.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  padding: 0.6em 0.8em;
  font-size: 0.95em;
  color: var(--text-dark);
}

.search-category {
  border-right: 1px solid #cdd3dc;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='10' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M0 0 L5 5 L10 0 Z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.6em center;
  background-size: 10px;
}

/* Haupt-Button-Farbe */
.search-btn,
.button-login {
  background: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  color: white;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

/* 🎨 Globale Hover-Änderung */
.search-btn:hover,
.button-login:hover,
.cookie-buttons button:hover,
.nav-links a:hover,
.footer-top a:hover,
a:hover {
  background-color: var(--accent-dark-blue) !important;
  color: white !important;
  opacity: 1;
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6em 0.9em;
  border-radius: 0 var(--button-radius) var(--button-radius) 0;
}

/* 🔽 Untere Header-Leiste */
.header-sub {
  display: flex;
  align-items: center;
  background: #2a2f39;
  padding: 0.5em 1em;
}

/* Burger-Button ist jetzt im CATEGORY MENU Abschnitt gestylt */

.nav-links a {
  margin-right: 1em;
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.8;
}

/* Slider */
.swiper {
  width: 100%;
  margin: 20px 0;
}
.swiper-slide img {
  width: 100%;
  object-fit: cover;
}

/* ################################################## */
/* 📄 PAGE CONTENT                                    */
/* ################################################## */
.page-content {
  padding-top: 2rem;
  padding-bottom: 3rem;
  min-height: calc(100vh - 200px);
}

/* Wenn Parallax vorhanden: Container transparent */
.page-content.has-hero-parallax {
  padding-top: 0;
  background: transparent !important;
  box-shadow: none !important;
}

/* Freitext-Section mit Parallax: transparent */
.freitext-section.has-parallax {
  background: transparent !important;
}

/* ALLE Content-Elemente brauchen eigenen Hintergrund (außer Parallax) */
.page-content.has-hero-parallax .freitext-section > *:not(.parallax-section) {
  background: var(--container-bg, #fff);
  position: relative;
  z-index: 1;
  padding: 1rem 0;
}

/* Andere Sections bekommen auch Hintergrund */
.page-content.has-hero-parallax .highlight-section,
.page-content.has-hero-parallax .kategorien-section,
.page-content.has-hero-parallax > section:not(.freitext-section) {
  background: var(--container-bg, #fff);
  position: relative;
  z-index: 1;
}

.page-content > *:first-child {
  margin-top: 0;
}

.page-content > *:last-child {
  margin-bottom: 0;
}

/* ========================================
   HERO PARALLAX
   ======================================== */

.freitext-section.hero-first {
  padding: 0;
  margin: 0;
  background: transparent !important;
}

/* Erstes Parallax bricht aus Container aus nach oben */
.freitext-section.hero-first > .parallax-section:first-child,
.page-content.has-hero-parallax .freitext-section:first-child > .parallax-section:first-child {
  margin-top: 0 !important;
}

/* Nach dem Hero-Parallax: Abstand zum nächsten Element */
.freitext-section.hero-first > .parallax-section:first-child + * {
  margin-top: 2rem;
}

/* ################################################## */
/* 🌙 FOOTER                                         */
/* ################################################## */
.site-footer {
  background: var(--header-dark);
  color: var(--text-light);
  text-align: center;
  padding: 1.5em 0;
  font-size: 0.9em;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
  
  /* === STICKY FOOTER (auskommentiert) ===
   * Entkommentiere folgende Zeilen für permanent sichtbaren Footer:
   * 
   * position: fixed;
   * bottom: 0;
   * left: 0;
   * right: 0;
   * z-index: 100;
   * box-shadow: 0 -2px 6px rgba(0,0,0,0.2);
   */
}

.footer-top {
  display: flex;
  justify-content: center;
  gap: 2em;
  margin-bottom: 0.4em;
}

.footer-top a {
  color: var(--text-light);
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.footer-bottom {
  font-size: 0.85em;
  color: #c9c9c9;
}

/* ################################################## */
/* 📂 CATEGORY MENU                                   */
/* ################################################## */
.category-menu {
  display: none;
  background: var(--bg-light);
  padding: 0;
  border-top: 3px solid var(--accent-blue);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-height: 70vh;
  overflow-y: auto;
}

.category-menu.visible {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-menu > ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0;
}

/* Oberkategorien */
.category-menu > ul > li {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  border-right: 1px solid rgba(0,0,0,0.05);
}

.category-menu > ul > li:last-child {
  border-bottom: none;
}

/* Oberkategorie-Titel */
.category-menu > ul > li > .category-title {
  display: block;
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--header-dark);
  background: linear-gradient(135deg, rgba(0,102,204, 0.1) 0%, rgba(0,102,204, 0.02) 100%);
  border-left: 4px solid var(--accent-blue);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Unterkategorien-Liste */
.category-menu > ul > li > ul {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--bg-light);
}

/* Unterkategorie-Items */
.category-menu > ul > li > ul > li {
  border-top: 1px solid rgba(0,0,0,0.04);
}

.category-menu > ul > li > ul > li > a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem 0.7rem 1.5rem;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  position: relative;
}

.category-menu > ul > li > ul > li > a::before {
  content: "›";
  color: var(--accent-blue);
  font-size: 1.2rem;
  font-weight: bold;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.2s ease;
}

.category-menu > ul > li > ul > li > a:hover {
  background: var(--accent-blue);
  color: #fff;
  padding-left: 2rem;
}

.category-menu > ul > li > ul > li > a:hover::before {
  opacity: 1;
  transform: translateX(0);
  color: #fff;
}

/* Burger-Button verschönern */
.burger {
  font-size: 1.3em;
  cursor: pointer;
  color: var(--text-light);
  margin-right: 0.75em;
  padding: 0.4em 0.8em;
  background: var(--accent-blue);
  border-radius: var(--button-radius);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.burger::after {
  content: "Kategorien";
  font-size: 0.85em;
  font-weight: 500;
}

.burger:hover {
  background: var(--accent-dark-blue);
  transform: scale(1.02);
}

/* Mobile: Nur Icon */
@media (max-width: 768px) {
  .category-menu > ul {
    grid-template-columns: 1fr;
  }
  
  .burger::after {
    display: none;
  }
  
  .burger {
    padding: 0.5em 0.7em;
  }
}

/* Scrollbar-Styling für das Menü */
.category-menu::-webkit-scrollbar {
  width: 8px;
}

.category-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.category-menu::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 4px;
}

.category-menu::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark-blue);
}

/* ################################################## */
/* 🍪 COOKIE BANNER                                   */
/* ################################################## */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-light);
  color: var(--text-dark);
  padding: 1em;
  display: none;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid var(--accent-blue);
  z-index: 2000;
}

.cookie-buttons {
  display: flex;
  gap: 1em;
}

/* ################################################## */
/* 📱 RESPONSIVE                                      */
/* ################################################## */
body.is-phone .container {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0.8em;
  margin: 0.5em auto !important;
  box-sizing: border-box;
}

/* ################################################## */
/* 🚫 EDITOR STUFF HIDDEN IN FRONTEND                 */
/* ################################################## */
.rt-slideshow-actions,
.rt-parallax-actions,
.rt-resize-handle {
  display: none !important;
}

/* Editor Preview-Elemente verstecken (werden durch render_blocks.php ersetzt) */
.rt-parallax-preview,
.rt-parallax-box,
.rt-parallax-overlay,
.rt-parallax-thumb {
  display: none !important;
}

/* ================================================== */
/* SLIDESHOW / SWIPER                                 */
/* ================================================== */

/* Slideshow Basis */
.swiper {
    width: 100%;
    max-width: 100%; 
    margin: 0 auto;
    position: relative;
}

/* Vollbreite - bricht aus Container aus */
.swiper.swiper-fullwidth {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 0;
    margin-right: 0;
}

/* Vollbreite Bilder ohne Rundung */
.swiper.swiper-fullwidth .swiper-slide img {
    border-radius: 0;
}

/* Bilder sauber einpassen */
.swiper-slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    border-radius: var(--container-radius);
}

/* Navigation: Nur Punkte (keine Pfeile) */
.swiper.swiper-nav-dots-only .swiper-button-next,
.swiper.swiper-nav-dots-only .swiper-button-prev {
    display: none !important;
}

/* Navigation: Nur Pfeile (keine Punkte) */
.swiper.swiper-nav-arrows-only .swiper-pagination {
    display: none !important;
}

/* Navigation: Keine */
.swiper.swiper-nav-none .swiper-button-next,
.swiper.swiper-nav-none .swiper-button-prev,
.swiper.swiper-nav-none .swiper-pagination {
    display: none !important;
}

/* Übergang: Fade Effekt */
.swiper.swiper-effect-fade .swiper-slide {
    opacity: 0 !important;
    transition: opacity 0.5s ease;
}
.swiper.swiper-effect-fade .swiper-slide-active {
    opacity: 1 !important;
}


/* ################################################## */
/* 🌄 PARALLAX - BILD NUR SO BREIT WIE CONTAINER     */
/* ################################################## */

/* Das fixed Bild-Element (wird per JS erstellt) */
.parallax-bg-fixed {
  position: fixed;
  top: 0;
  /* left und width werden per JS gesetzt */
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
}

/* Container wird transparent wenn Parallax vorhanden */
.container.page-content {
  position: relative;
  z-index: 1;
}

/* Die Parallax-Section = das LOCH (transparent) */
.parallax-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: transparent !important;
}

/* Fullwidth */
.parallax-section.parallax-fullwidth {
  width: 100%;
  margin: 0;
}

/* Titel-Overlay */
.parallax-inner {
  position: relative;
  z-index: 2;
  background: rgba(0,0,0,0.45);
  padding: 2rem 3rem;
  border-radius: var(--container-radius);
  max-width: 900px;
  text-align: center;
}

.parallax-title {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
}

.parallax-subtitle {
  font-size: 1rem;
  margin: 0;
  opacity: 0.9;
}

/* Mobile */
@media (max-width: 768px) {
  .parallax-inner {
    padding: 1.5rem 1rem;
    margin: 0 1rem;
  }
  
  .parallax-title {
    font-size: 1.5rem;
  }
}

/* ################################################## */
/* 📊 TABELLEN                                        */
/* ################################################## */

/* Basis-Tabelle */
table,
.table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.9em;
  margin: 1em 0;
  border: 1px solid #ddd;
}

table th,
table td,
.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #ddd;
  vertical-align: middle;
}

table th,
.table th {
  background: var(--accent-blue, #007bff);
  color: #fff;
  font-weight: 600;
}

table tr:nth-child(even),
.table tr:nth-child(even) {
  background: #f9f9f9;
}

table tr:hover,
.table tr:hover {
  background: #f0f7ff;
}

/* Responsive */
@media (max-width: 768px) {
  table th,
  table td,
  .table th,
  .table td {
    padding: 8px;
    font-size: 0.85em;
  }
}

/* ################################################## */
/* 📱 MOBILE HEADER (basiert auf is-phone/is-tablet)   */
/* ################################################## */

/* Mobile Nav Toggle - standardmäßig versteckt */
.mobile-nav-toggle {
  display: none;
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 0.5em 1em;
  cursor: pointer;
  border-radius: var(--button-radius);
  margin: 0.3em;
}

/* Mobile Nav Menu */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--header-dark);
  padding: 0.5em;
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav a {
  color: var(--text-light);
  text-decoration: none;
  padding: 0.8em 1em;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav a:hover {
  background: rgba(255,255,255,0.1);
}

/* ========================================
   TABLET (is-tablet) - Ratio 0.8 - 1.2
   ======================================== */
body.is-tablet .header-top {
  flex-wrap: wrap;
  gap: 0.5em;
  padding: 0.5em;
}

body.is-tablet .header-center {
  order: 3;
  width: 100%;
  margin-top: 0.5em;
}

body.is-tablet .search-bar {
  width: 100%;
}

body.is-tablet .search-category {
  display: none;
}

body.is-tablet .mobile-nav-toggle {
  display: block;
}

body.is-tablet .nav-links {
  display: none;
}

/* ========================================
   PHONE (is-phone) - Ratio < 0.8
   ======================================== */
body.is-phone {
  font-size: calc(var(--font-size-base) * 2) !important;
}

body.is-phone .header-top {
  padding: 0.3em;
  gap: 0.3em;
}

body.is-phone .header-left,
body.is-phone .header-right {
  gap: 0.4em;
}

/* Logo kleiner */
body.is-phone .header-left img {
  height: 28px !important;
}

/* Suchleiste verstecken auf Phone */
body.is-phone .header-center {
  display: none;
}

/* Standort kürzen */
body.is-phone .location span {
  display: none;
}

body.is-phone .location a {
  font-size: 0.8em;
}

body.is-phone .location::before {
  content: "📍";
}

/* Login kürzen */
body.is-phone .button-login {
  padding: 0.3em 0.5em !important;
  font-size: 0.75em;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Warenkorb nur Icon */
body.is-phone .cart span:last-child {
  display: none;
}

body.is-phone .cart {
  font-size: 1.1em;
}

/* Navigation verstecken */
body.is-phone .nav-links {
  display: none;
}

body.is-phone .header-sub {
  padding: 0.2em 0.4em;
}

/* Mobile Nav Toggle anzeigen */
body.is-phone .mobile-nav-toggle {
  display: block;
  font-size: 0.85em;
  padding: 0.3em 0.6em;
}

/* Burger verstecken auf Phone - wir nutzen mobile-nav-toggle */
body.is-phone .burger {
  display: none;
}

/* Fallback: @media für Geräte ohne JS */
@media (max-width: 900px) {
  .header-top {
    flex-wrap: wrap;
    gap: 0.5em;
    padding: 0.5em;
  }
  
  .header-center {
    order: 3;
    width: 100%;
    margin-top: 0.5em;
  }
  
  .search-bar {
    width: 100%;
  }
  
  .search-category {
    display: none;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .header-top {
    padding: 0.4em;
    gap: 0.3em;
  }
  
  .header-left,
  .header-right {
    gap: 0.5em;
  }
  
  /* Logo kleiner */
  .header-left img {
    height: 30px !important;
  }
  
  /* Standort kürzen */
  .location span {
    display: none;
  }
  
  .location a {
    font-size: 0.85em;
  }
  
  .location::before {
    content: "📍 ";
  }
  
  /* Login kürzen */
  .button-login {
    padding: 0.4em 0.6em !important;
    font-size: 0.8em;
  }
  
  /* Warenkorb nur Icon */
  .cart span:last-child {
    display: none;
  }
  
  .cart {
    font-size: 1.2em;
  }
  
  /* Navigation */
  .nav-links {
    display: none;
  }
  
  .header-sub {
    padding: 0.3em 0.5em;
  }
  
  /* Mobile Nav Toggle anzeigen */
  .mobile-nav-toggle {
    display: block;
  }
}

/* Sehr kleine Bildschirme (Z Fold außen, iPhone SE) */
@media (max-width: 400px) {
  .header-top {
    padding: 0.3em;
  }
  
  /* Suchleiste ausblenden */
  .header-center {
    display: none;
  }
  
  /* Logo noch kleiner */
  .header-left img {
    height: 25px !important;
  }
  
  /* Standort nur Icon */
  .location a {
    font-size: 0;
  }
  
  .location a::after {
    content: "Ort";
    font-size: 0.75rem;
  }
  
  /* Login minimal */
  .button-login {
    padding: 0.3em 0.5em !important;
    font-size: 0.75em;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Mobile Nav Button anzeigen */
  .mobile-nav-toggle {
    display: block;
    font-size: 0.9em;
    padding: 0.4em 0.8em;
  }
  
  /* Burger Menu ausblenden - wir nutzen mobile-nav-toggle */
  .burger {
    display: none;
  }
}

/* ################################################## */
/* ➔ • FLIEGENDE AUFZÄHLUNG (Flying List)            */
/* ################################################## */

.flying-list-container {
    padding: 1.5rem 0;
    overflow: hidden;
}

.flying-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.flying-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    
    /* Start: komplett links außerhalb */
    opacity: 0;
    transform: translateX(-100%);
    
    /* KEINE transition - wird per JS scroll-synchron gesteuert */
}

.flying-list-bullet {
    color: var(--accent-blue, #0066cc);
    font-size: 1.4rem;
    font-weight: bold;
    flex-shrink: 0;
}

.flying-list-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-dark, #333);
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .flying-list-item {
        padding: 0.5rem 0;
        gap: 0.75rem;
    }
    
    .flying-list-bullet {
        font-size: 1.2rem;
    }
    
    .flying-list-text {
        font-size: 1rem;
    }
}

/* Editor-Elemente im Frontend verstecken */
.rt-flyinglist-block,
.rt-flyinglist-actions,
.rt-flyinglist-remove {
    display: none !important;
}