/* ===== lenisearch – Style ===== */

/* robustes hidden */
[hidden] { display: none !important; }

/* Launcher Button */
.zfs-launcher, #zfs-launcher {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 24px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overlay */
.zfs-overlay, #zfs-overlay {
  position: fixed;
  inset: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: 9999;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

/* Mobile: Scrollbar nur für Content-Bereich */
@media (max-width: 1024px) {
  .zfs-overlay, #zfs-overlay {
    padding: 0;
    overflow-y: hidden;
  }
}

/* Container für Suchfeld, Kategorien und Ergebnisse - volle Breite */
.zfs-overlay > #zfs-searchbar,
.zfs-overlay > #zfs-categories-bar,
.zfs-overlay > #zfs-results,
.zfs-overlay > .zfs-overlay-content {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

@media (min-width: 1025px) {
  .zfs-overlay, #zfs-overlay {
    padding: 40px 40px;
  }
  
  .zfs-overlay > #zfs-searchbar,
  .zfs-overlay > #zfs-categories-bar,
  .zfs-overlay > #zfs-results {
    max-width: 100%;
  }
}
@media (max-width: 1024px) {
  .zfs-overlay {
    padding: 0;
  }
  
  .zfs-overlay-content {
    padding: 0 20px 80px;
  }
}

/* Suchleiste - Neues Design mit Icon links, unterstrichenem Suchfeld */
.zfs-searchbar {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  margin-bottom: 12px;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  padding: 0 20px;
}

/* Header Icon links */
.zfs-header-icon {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: flex-start;
  height: 48px;
  overflow: hidden;
}

.zfs-header-icon img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: cover;
  object-position: left center;
  display: block;
}

.zfs-header-icon svg {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
}

/* Icon nur auf Desktop anzeigen */
@media (min-width: 1025px) {
  .zfs-header-icon {
    display: flex;
  }
}

.zfs-search-form {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  width: 100%;
  min-height: 48px;
}

/* Lupen-Icon links im Suchfeld */
.zfs-search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  pointer-events: none;
  color: #666;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  display: block;
}

/* Input - unterstrichen */
.zfs-search-input {
  flex: 1;
  padding: 8px 60px 8px 40px;
  border: none !important;
  border-bottom: 1px solid #000 !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 16px;
  outline: none !important;
  outline-style: none !important;
  color: #000;
  min-height: 48px;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  margin-right: 50px;
  margin-left: 32px;
}

/* Mobile: Lupe entfernen, volle Breite, sticky */
@media (max-width: 1024px) {
  .zfs-searchbar {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
    padding: 2px 20px 4px 20px;
    border-bottom: 1px solid #000;
  }
  
  /* WordPress Admin Bar berücksichtigen */
  .admin-bar .zfs-searchbar {
    top: 46px;
  }
  
  @media screen and (max-width: 782px) {
    .admin-bar .zfs-searchbar {
      top: 46px;
    }
  }
  
  .zfs-search-form {
    border-bottom: none;
  }
  
  .zfs-search-icon {
    display: none !important;
  }
  
  .zfs-search-input {
    margin-left: 0 !important;
    margin-right: 50px !important;
    padding: 0 60px 0 12px !important;
    border-bottom: none !important;
    width: 100% !important;
    min-height: 32px;
  }
  
  /* Scrollbar-Container für Content */
  .zfs-overlay-content {
    overflow-y: auto;
    flex: 1;
    width: 100%;
    padding: 0 20px 80px;
  }
}

.zfs-search-input::placeholder {
  color: #999;
}

/* X-Button rechts */
.zfs-close-button {
  position: absolute !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 40px !important;
  height: 40px !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  color: #000 !important;
  transition: color 0.2s ease;
  flex-shrink: 0;
  z-index: 10000 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.zfs-close-button svg {
  width: 20px !important;
  height: 20px !important;
  display: block !important;
  stroke: #000 !important;
  stroke-width: 2.5 !important;
  fill: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
}

.zfs-close-button:hover {
  background: #f0f0f0 !important;
}

.zfs-close-button:hover {
  color: #000;
}

.zfs-close-button:active {
  color: #666;
}

/* Kategorien-Leiste - Horizontale Zeile mit Pillen, scrollbar */
.zfs-categories-bar {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 12px 10px;
  margin-bottom: 12px;
  min-height: 48px;
  align-items: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.zfs-categories-bar::-webkit-scrollbar {
  display: none;
}

.zfs-category-pill {
  display: inline-block;
  padding: 8px 16px;
  background: #f0f0f0;
  border-radius: 20px;
  text-decoration: none;
  color: #333;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid #e0e0e0;
}

.zfs-category-pill:hover {
  background: #e0e0e0;
  border-color: #d0d0d0;
  transform: translateY(-1px);
}

/* Ergebnisse Grid - Mobile: 1 Spalte, Desktop: 3 Spalten */
.zfs-results, #zfs-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  padding: 0 10px 80px;
}

/* Desktop: 3 Spalten ab 1025px - volle Breite */
@media (min-width: 1025px) {
  .zfs-searchbar {
    padding: 14px 40px;
    margin-left: 0;
    margin-right: 0;
  }
  
  .zfs-categories-bar {
    padding: 12px 20px;
    margin-left: 0;
    margin-right: 0;
  }
  
  .zfs-results, #zfs-results {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 100%;
    padding: 0 20px 80px;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Produktkarte - Horizontal: Bild links, Text rechts */
.zfs-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-decoration: none;
  color: #111;
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
  gap: 12px;
}
.zfs-card:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Bild-Container - Kleines Bild links */
.zfs-thumb-wrapper {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 6px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zfs-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  transition: transform .3s ease;
}
.zfs-card:hover .zfs-thumb {
  transform: translateZ(0) scale(1.02);
}

/* Text-Container rechts vom Bild */
.zfs-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.zfs-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 4px;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.zfs-brand {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

/* Preis-Container */
.zfs-price-container {
  margin-top: auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

/* Aktueller Preis - größer, schwarz, fett */
.zfs-price {
  font-size: 16px;
  color: #000;
  font-weight: 700;
  line-height: 1.2;
}

/* Streichpreis - gleich groß wie Preis, aber nicht fett */
.zfs-strike-price {
  font-size: 16px;
  color: #000;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: line-through;
  opacity: 0.7;
}

/* Grundpreis - kleiner, grau */
.zfs-base-price {
  font-size: 12px;
  color: #666;
  font-weight: 400;
  line-height: 1.2;
  align-self: flex-end;
}

/* Placeholder */
.zfs-placeholder {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
  background-size: 400% 100%;
  animation: zfs-shimmer 1.2s infinite;
  border-radius: 6px;
}
@keyframes zfs-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* Mobile: Optimierungen für kleine Bildschirme */
@media (max-width: 1024px) {
  .zfs-overlay-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
    width: 100%;
  }
  
  .zfs-searchbar {
    max-width: 100%;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
  }
  
  .zfs-categories-bar {
    margin-top: 50px;
    padding: 0 10px 14px 10px !important;
  }
  
  .zfs-results, #zfs-results {
    margin-top: 0;
  }
  
  .zfs-categories-bar {
    padding: 0 10px 14px 10px !important;
    min-height: 52px;
    margin-bottom: 12px;
    margin-top: 50px;
  }
  
  .zfs-category-pill {
    padding: 10px 18px;
    font-size: 14px;
  }
  
  .zfs-results, #zfs-results {
    gap: 10px;
    padding: 0 8px 80px;
  }
  .zfs-card {
    padding: 10px;
    gap: 10px;
  }
  .zfs-thumb-wrapper {
    width: 70px;
    height: 70px;
  }
  .zfs-title {
    font-size: 13px;
    line-height: 1.3;
  }
  .zfs-brand {
    font-size: 11px;
  }
  .zfs-price-container {
    gap: 6px;
  }
  .zfs-price {
    font-size: 14px;
  }
  .zfs-strike-price {
    font-size: 14px;
  }
  .zfs-base-price {
    font-size: 11px;
  }
}

/* Extra kleine Screens */
@media (max-width: 480px) {
  .zfs-searchbar {
    margin-left: 0;
    margin-right: 0;
  }
  
  .zfs-search-input {
    font-size: 15px;
    padding: 12px 40px 12px 10px;
  }
  
  .zfs-search-button {
    width: 40px;
  }
  
  .zfs-search-button svg {
    width: 16px;
    height: 16px;
  }
  
  .zfs-categories-bar {
    padding: 14px 8px;
    min-height: 56px;
    margin-bottom: 12px;
  }
  
  .zfs-category-pill {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .zfs-results, #zfs-results {
    gap: 8px;
    padding: 0 8px 80px;
  }
  .zfs-card {
    padding: 8px;
    gap: 8px;
  }
  .zfs-thumb-wrapper {
    width: 60px;
    height: 60px;
  }
  .zfs-title {
    font-size: 12px;
  }
  .zfs-brand {
    font-size: 10px;
  }
  .zfs-price-container {
    gap: 4px;
  }
  .zfs-price {
    font-size: 13px;
  }
  .zfs-strike-price {
    font-size: 13px;
  }
  .zfs-base-price {
    font-size: 10px;
  }
}

/* ===== Elementor Widget: LeniSearch ===== */
/* Stelle sicher, dass Parent-Container die volle Breite erlauben */
[class*="lenisearch"],
[class*="lenisearch"] * {
  box-sizing: border-box;
}

.lenisearch-elementor-widget {
  width: 100% !important;
  max-width: 100% !important;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.lenisearch-search-form {
  position: relative;
  display: flex;
  width: 100% !important;
  max-width: 100% !important;
  cursor: pointer;
  box-sizing: border-box;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  flex: 1 1 100% !important;
}

/* Desktop: Maximale Breite des Suchfelds auf 600px begrenzen */
@media (min-width: 1025px) {
  .lenisearch-search-form {
    max-width: 600px !important;
  }
  
  .lenisearch-input {
    max-width: 600px !important;
  }
}

/* Input */
.lenisearch-input {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 14px 44px 14px 12px;
  border: 1px solid #999 !important;
  border-style: solid;
  border-radius: 0 !important;
  font-size: 16px;
  outline: none;
  outline-style: none;
  color: #000;
  cursor: pointer;
  min-height: 48px;
  box-sizing: border-box;
  margin: 0 !important;
  background: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Lupen-Icon rechts im Input */
.lenisearch-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  pointer-events: none;
  color: #666;
  stroke: currentColor;
  fill: none;
}

.lenisearch-input::placeholder {
  color: #999;
}

/* Fokus-Rahmen */
.lenisearch-search-form:focus-within .lenisearch-input {
  border-color: #999;
  border-width: 1px;
  border-style: solid;
}

/* Mobile Optimierungen */
@media (max-width: 768px) {
  /* Stelle sicher, dass alle Parent-Elemente die volle Breite nutzen */
  .lenisearch-elementor-widget {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
    justify-content: flex-start !important;
  }
  
  .lenisearch-search-form {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 1 1 100% !important;
    display: flex !important;
  }
  
  .lenisearch-input {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    font-size: 15px;
    padding: 14px 44px 14px 12px;
    margin: 0 !important;
  }
  
  .lenisearch-icon {
    width: 22px;
    height: 22px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  .lenisearch-input {
    font-size: 14px;
    padding: 12px 40px 12px 10px;
  }
  
  .lenisearch-icon {
    width: 20px;
    height: 20px;
    right: 10px;
  }
}

/* ===== Astra Theme spezifische Breiten-Fixes ===== */
/* Für Desktop-Header */
.ast-desktop-header .lenisearch-elementor-widget {
  width: 100% !important;
  max-width: 100% !important;
}

@media (min-width: 1025px) {
  .ast-desktop-header .lenisearch-search-form {
    width: 100% !important;
    max-width: 600px !important;
  }

  .ast-desktop-header .lenisearch-input {
    width: 100% !important;
    max-width: 600px !important;
  }
}

@media (max-width: 1024px) {
  .ast-desktop-header .lenisearch-search-form {
    width: 100% !important;
    max-width: 100% !important;
  }

  .ast-desktop-header .lenisearch-input {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Für Mobile-Header */
.ast-mobile-header .lenisearch-elementor-widget,
.ast-mobile-header .lenisearch-search-form {
  width: 100% !important;
  max-width: 100% !important;
}

.ast-mobile-header .lenisearch-input {
  width: 100% !important;
  max-width: 100% !important;
}

/* Spezifischer: Desktop-Header im Primary-Bereich */
.site-header-primary-section-center .ast-header-html-1,
.site-header-primary-section-center .lenisearch-elementor-widget {
  width: 100% !important;
  max-width: 100% !important;
}

@media (min-width: 1025px) {
  .site-header-primary-section-center .lenisearch-search-form {
    width: 100% !important;
    max-width: 600px !important;
  }
}

@media (max-width: 1024px) {
  .site-header-primary-section-center .lenisearch-search-form {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (min-width: 1025px) {
  .site-header-primary-section-center .lenisearch-input {
    width: 100% !important;
    max-width: 600px !important;
  }
}

@media (max-width: 1024px) {
  .site-header-primary-section-center .lenisearch-input {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Spezifischer: Mobile-Header im Below-Bereich */
.site-header-below-section-left .ast-header-html-1,
.site-header-below-section-left .lenisearch-elementor-widget {
  width: 100% !important;
  max-width: 100% !important;
}

@media (min-width: 1025px) {
  .site-header-below-section-left .lenisearch-search-form {
    width: 100% !important;
    max-width: 600px !important;
  }

  .site-header-below-section-left .lenisearch-input {
    width: 100% !important;
    max-width: 600px !important;
  }
}

@media (max-width: 1024px) {
  .site-header-below-section-left .lenisearch-search-form {
    width: 100% !important;
    max-width: 100% !important;
  }

  .site-header-below-section-left .lenisearch-input {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Überschreibe Astra's Standard-Suchfeld-Breitenbegrenzung */
.ast-search-menu-icon .search-form {
  padding-right: 0;
}

.ast-search-menu-icon .lenisearch-input {
  width: 100% !important;
  max-width: 100% !important;
}

