/* Tooltip Styles */
.tooltip {
  position: absolute;
  display: none;
  padding: 5px 10px;
  background-color: #333;
  color: #fff;
  font-size: 25px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1100;
}

@media (max-width: 480px) {
  .tooltip {
    display: none !important;
  }
}

rect[id^="shop"] {
  width: 13px; /* Breite */
  height: 13px; /* Höhe */
  rx: 50%; /* Runde Ecken */
  ry: 50%;
  fill: transparent;
  stroke: #2C2C2C;
  stroke-width: 2px;
}

/* Hover-Effekt für die Marker */
rect[id^="shop"]:hover {
  fill: #ffffff57; /* Füllt den Marker mit einer Farbe (z.B. Tomatenrot) */
}

@media (max-width: 480px) {
  rect[id^="shop"] {
    width: 13px; /* Breite */
    height: 13px; /* Höhe */
    rx: 50%; /* Runde Ecken */
    ry: 50%;
    fill: transparent;
    stroke: #2C2C2C;
    stroke-width: 2px;
  }
}

/* Grundlegende Touch-Einstellungen */
html {
  height: 100%;
  width: 100%;
  -webkit-text-size-adjust: 100% !important;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  position: relative;
  -webkit-text-size-adjust: 100% !important;
}

/* Kartenbehälter Styles */
.map-container {
  width: 100%;
  height: auto;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.map-wrapper {
  width: 100%;
  height: 100%;
}

.map-wrapper svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Mobile Styles */
@media (max-width: 768px), (pointer: coarse) {
    .map-container {
        width: 100%;
        height: auto;
        overflow: hidden;
        position: relative;
        touch-action: pan-x pan-y;
        margin-top: 0; /* Kein Abstand nach oben */
    }
    
    .map-wrapper {
        width: 100%;
        height: 100%;
        touch-action: pan-x pan-y;
    }

    .map-wrapper svg {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

/* Prevent page zoom on double tap */
* {
  touch-action: pan-y;
  max-zoom: 1;
  min-zoom: 1;
}

/* Nur Karte zoombar */
.map-container * {
  touch-action: pinch-zoom;
}

.mobileuserhinweis {
  display: none; /* Standardmäßig unsichtbar */
  color: #401a34 !important;
  font-weight:bold !important;
}

@media screen and (max-width: 768px) {
  .mobileuserhinweis {
    display: block; /* Sichtbar auf mobilen Geräten */
  }
}

.reset-map-button {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  padding: 8px 16px;
  background: #c1e5f5;
  border: 1px solid #c1e5f5;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}

.reset-map-button:hover {
  background: #f0f0f0;
}

.shop-point {
    transition: all 0.2s ease;
}

.shop-point:hover {
    r: 7;
    filter: brightness(1.2);
}

/* Popup Styles */
.overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
}

.popup {
    background: #fff !important;
    width: 90% !important;
    max-width: 800px !important;
    max-height: 90vh !important;
    border-radius: 8px !important;
    padding: 20px !important;
    position: relative !important;
    overflow-y: auto !important;
    z-index: 100000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.popup-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #eee !important;
}

.popup-header h2 {
    margin: 0 !important;
    font-size: 24px !important;
    color: #333 !important;
}

.close-btn {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: none !important;
    border: none !important;
    font-size: 28px !important;
    line-height: 1 !important;
    padding: 5px !important;
    cursor: pointer !important;
    color: #666 !important;
    z-index: 100001 !important;
}

.popup-content {
    position: relative !important;
    z-index: 100000 !important;
}

/* Stellen Sie sicher, dass Bilder korrekt angezeigt werden */
.shop-logo {
    max-width: 200px !important;
    height: auto !important;
    display: block !important;
    margin-bottom: 20px !important;
}

.shop-images img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
}
g.shop-marker:nth-child(71) > text:nth-child(2)  {
   color: #000 !important;
}

/* Verhindern Sie Scrolling im Hintergrund */
body.has-popup {
    overflow: hidden !important;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .popup {
        width: 95% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        padding: 15px !important;
        margin: 0 !important;
        border-radius: 8px !important;
    }
    
    .popup-header {
        margin-bottom: 15px !important;
        padding-right: 40px !important; /* Platz für den Close-Button */
    }

    .popup-header h2 {
        font-size: 18px !important;
        line-height: 1.3 !important;
        width: 100% !important;
        padding-right: 30px !important; /* Platz für den Close-Button */
    }
    
    .close-btn {
        top: 12px !important;
        right: 12px !important;
        font-size: 24px !important;
        padding: 8px !important; /* Größerer Touch-Bereich */
        width: 40px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .shop-logo {
        max-width: 150px !important;
        margin: 0 auto 15px auto !important;
    }
    
    .shop-images {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin-bottom: 15px !important;
    }
    
    .shop-images img {
        height: 150px !important;
    }
    
    .popup-content {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    /* Verbesserte Scrollbarkeit auf Mobilgeräten */
    .popup {
        -webkit-overflow-scrolling: touch !important;
        overflow-y: auto !important;
    }
    
    /* Bessere Darstellung von Kontaktinformationen */
    .shop-contact {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    /* Größere Buttons für bessere Touch-Bedienung */
    .popup button, 
    .popup a.button {
        padding: 12px 16px !important;
        font-size: 16px !important;
        margin-top: 10px !important;
        width: 100% !important; /* Volle Breite auf Mobilgeräten */
    }
}

/* Noch kleinere Bildschirme (Smartphones) */
@media (max-width: 480px) {
    .overlay {
        align-items: flex-end !important; /* Popup von unten einblenden */
    }
    
    .popup {
        width: 100% !important;
        max-height: 90vh !important;
        border-radius: 12px 12px 0 0 !important; /* Abgerundete Ecken nur oben */
        padding: 15px 12px !important;
    }
    
    .popup-header h2 {
        font-size: 16px !important;
    }
    
    .shop-images img {
        height: 120px !important;
    }
    
    /* Verbesserte Darstellung von Adresse und Beschreibung */
    .shop-address,
    .shop-description {
        margin-bottom: 12px !important;
    }
    
    /* Bessere Darstellung von Listen */
    .popup ul, .popup ol {
        padding-left: 20px !important;
    }
    
    /* Verbesserter Abstand zwischen Elementen */
    .popup p, .popup div {
        margin-bottom: 10px !important;
    }
}

/* Vollbild-Popup für mobile Geräte */
@media (max-width: 480px) {
    .overlay {
        align-items: flex-start !important; /* Popup von oben ausrichten */
    }
    
    .popup {
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important; /* Keine abgerundeten Ecken im Vollbildmodus */
        padding: 15px !important;
        margin: 0 !important;
        
        /* Verbesserte Scrollbarkeit */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        
        /* Vollbild-Darstellung */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    /* Größerer Schließen-Button für bessere Touch-Bedienung */
    .close-btn {
        top: 15px !important;
        right: 15px !important;
        font-size: 28px !important;
        width: 44px !important;
        height: 44px !important;
        background-color: rgba(255, 255, 255, 0.9) !important;
        border-radius: 50% !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Angepasster Header für Vollbildmodus */
    .popup-header {
        padding-top: 10px !important;
        margin-bottom: 20px !important;
    }
    
    .popup-header h2 {
        font-size: 20px !important;
        padding-right: 40px !important; /* Mehr Platz für den Schließen-Button */
    }
    
    /* Verbesserte Bilddarstellung im Vollbildmodus */
    .shop-logo {
        max-width: 140px !important;
        margin-bottom: 20px !important;
    }
    
    /* Größere Bilder im Vollbildmodus */
    .shop-images img {
        height: 200px !important;
    }
    
    /* Verbesserte Inhaltsdarstellung */
    .popup-content {
        padding-bottom: 30px !important; /* Zusätzlicher Abstand am Ende */
    }
}

/* Zusätzliche Verbesserungen für mobile Ansicht basierend auf dem Screenshot */
@media (max-width: 480px) {
    /* Verbesserte Bildergalerie */
    .shop-images {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    /* Bessere Anzeige des Logos */
    .shop-logo {
        max-width: 120px !important;
        margin: 0 0 15px 0 !important; /* Linksbündig statt zentriert */
    }
    
    /* Verbesserte Überschrift und Header */
    .popup-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding-right: 30px !important;
    }
    
    .popup-header h2 {
        font-size: 22px !important;
        margin-bottom: 5px !important;
        line-height: 1.2 !important;
    }
    
    /* Verbesserte Darstellung der Bilder in einer Reihe */
    .shop-images {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        gap: 10px !important;
        padding-bottom: 10px !important;
        margin: 0 -12px !important; /* Überschreitet den Padding-Bereich */
        padding: 0 12px !important;
    }
    
    .shop-images > div {
        flex: 0 0 auto !important;
        width: 85% !important;
        scroll-snap-align: start !important;
    }
    
    .shop-images img {
        width: 100% !important;
        height: 180px !important;
        object-fit: cover !important;
        border-radius: 6px !important;
    }
    
    /* Verbesserte Kontaktinformationen */
    .contact-section {
        margin-top: 15px !important;
        padding-top: 15px !important;
        border-top: 1px solid #eee !important;
    }
    
    /* Verbesserte Icons */
    .info-icon, .contact-icon {
        width: 24px !important;
        height: 24px !important;
        margin-right: 10px !important;
    }
    
    /* Verbesserte Abschnitte */
    .section-title {
        font-size: 16px !important;
        font-weight: bold !important;
        margin-bottom: 8px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Verbesserte Telefonnummer */
    .phone-number {
        font-size: 16px !important;
        color: #333 !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        padding: 8px 0 !important;
    }
    
    .phone-number:before {
        content: "" !important;
        display: inline-block !important;
        width: 18px !important;
        height: 18px !important;
        margin-right: 8px !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M20 15.5c-1.2 0-2.4-.2-3.6-.6-.3-.1-.7 0-1 .2l-2.2 2.2c-2.8-1.4-5.1-3.8-6.6-6.6l2.2-2.2c.3-.3.4-.7.2-1-.3-1.1-.5-2.3-.5-3.5 0-.6-.4-1-1-1H4c-.6 0-1 .4-1 1 0 9.4 7.6 17 17 17 .6 0 1-.4 1-1v-3.5c0-.6-.4-1-1-1zM21 6h-3V3h-2v3h-3v2h3v3h2V8h3z'/%3E%3C/svg%3E") !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
    }
    
    /* Verbesserte Adresse */
    .address {
        margin-top: 10px !important;
        line-height: 1.4 !important;
    }
    
    .address:before {
        content: "" !important;
        display: inline-block !important;
        width: 18px !important;
        height: 18px !important;
        margin-right: 8px !important;
        vertical-align: top !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") !important;
        background-size: contain !important;
        background-repeat: no-repeat !important;
    }
}

.shop-marker {
    transition: all 0.2s ease;
}

.shop-marker:hover circle {
    r: 10;
    filter: brightness(1.2);
}

.shop-marker text {
    pointer-events: none; /* Verhindert, dass der Text Hover-Events blockiert */
}

@media (max-width: 768px) {
    .shop-marker circle {
        r: 10; /* Größerer Radius auf mobilen Geräten */
    }
    
    .shop-marker text {
        font-size: 12; /* Größere Schrift auf mobilen Geräten */
    }
}

/* Suchfunktion Styles */
.search-container {
    position: relative;
    max-width: 400px;
    margin: 20px;
    z-index: 1000;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 8px rgba(0, 0, 0, 0.06);
    width: 100%;
    box-sizing: border-box;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #eef2f7;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
    width: 100%;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #3498DB;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.category-filter {
    padding: 12px 16px;
    border: 2px solid #eef2f7;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    background: #f8fafc;
    width: 180px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.category-filter:focus {
    border-color: #3498DB;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 12px;
    right: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 8px rgba(0, 0, 0, 0.06);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    border: 1px solid #eef2f7;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8fafc;
}

.search-result-item .shop-name {
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 4px;
}

.search-result-item .shop-address {
    font-size: 14px;
    color: #64748b;
}

/* Responsive Styles für die Suche */
@media (max-width: 768px) {
    .search-container {
        margin: 15px;
        max-width: calc(100% - 30px);
    }

    .search-box {
        flex-direction: column;
        padding: 10px;
    }
    
    .category-filter {
        width: 100%;
    }

    .search-input,
    .category-filter {
        padding: 10px 14px;
        font-size: 14px;
    }
}

/* Scrollbar-Styling für die Suchergebnisse */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 12px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 12px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.shop-pulse circle, .shop-pulse rect {
  filter: drop-shadow(0 0 10px #3498db) drop-shadow(0 0 20px #3498db);
  stroke: #3498db !important;
  stroke-width: 3 !important;
  animation: shop-pulse-anim 1s infinite alternate;
}

@keyframes shop-pulse-anim {
  0% { r: 12; filter: drop-shadow(0 0 10px #3498db); }
  100% { r: 18; filter: drop-shadow(0 0 24px #3498db); }
}
