/* Main container */
.wp-immo-slider-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto 40px;
    overflow: visible; /* Geändert von hidden zu visible, um Pfeile außerhalb anzuzeigen */
    padding: 0 60px; /* Platz für die Pfeile rechts und links */
}

/* Slider wrapper */
.wp-immo-slider-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    overflow: visible;
    gap: 20px;
    padding: 10px 0;
    min-height: 400px; /* Minimale Höhe für den Wrapper */
    align-items: stretch; /* Stellt sicher, dass alle Items gleich hoch sind */
}

/* Loading indicator */
.wp-immo-slider-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 300px;
}

.wp-immo-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #14213d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Slide */
.wp-immo-slider-slide {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

/* Slider item */
.wp-immo-slider-item {
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
    height: 100%; /* Volle Höhe für das Item */
}

@media (min-width: 768px) {
    .wp-immo-slider-item {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
}

@media (min-width: 992px) {
    .wp-immo-slider-item {
        flex: 0 0 calc(33.33% - 14px);
        max-width: calc(33.33% - 14px);
    }
}

/* Property card */
.wp-immo-property-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-height: 380px; /* Feste Mindesthöhe für alle Karten */
}

/* Property image container */
.wp-immo-property-image {
    position: relative;
    height: 200px; /* Feste Höhe für Bilder */
    overflow: hidden;
}

/* Add WebP fallback support */
.no-webp-support .wp-immo-property-image img[src$=".webp"] {
    /* Fallback for browsers without WebP support */
    display: none;
}

.no-webp-support .wp-immo-property-image {
    background-image: url('../images/no-image.jpg');
    background-size: cover;
    background-position: center;
}

/* Property image with lazy loading */
.wp-immo-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.5s;
    will-change: transform, opacity;
}

/* Loading animation for lazy-loaded images */
.wp-immo-property-image img:not([loaded]) {
    opacity: 0;
}

.wp-immo-property-image img[loaded], 
.wp-immo-property-image img.no-transition {
    opacity: 1;
}

/* Property logo (top left text) */
.wp-immo-property-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    color: #333;
    z-index: 2;
}

/* Sold stamp overlay */
.wp-immo-property-sold {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.wp-immo-property-sold img {
    width: 70%;
    height: auto;
    object-fit: contain;
    max-width: 200px;
}

/* Property content */
.wp-immo-property-content {
    padding: 15px;
    color: #fff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 250px; /* Feste Mindesthöhe für den Content-Bereich */
}

/* Property title */
.wp-immo-property-title {
    font-size: 16px;
    margin: 0 0 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    min-height: 75px; /* Feste Höhe für den Titel */
    border-bottom: 1px solid rgba(255,255,255,0.75);
}

/* Property details */
.wp-immo-property-details {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    min-height: 120px; /* Feste Mindesthöhe für Details */
}

.wp-immo-property-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    min-height: 24px; /* Feste Höhe für jede Detailzeile */
}

.wp-immo-detail-label {
    color: #ccc;
}

.wp-immo-detail-value {
    color: #fff;
    text-align: right;
    font-weight: 600;
}

/* Navigation arrows */
.wp-immo-slider-nav {
    position: absolute;
    top: 50%;
    left: -20px; /* Pfeil links außerhalb des Sliders */
    right: -20px; /* Pfeil rechts außerhalb des Sliders */
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    z-index: 10;
    width: calc(100% + 40px); /* Breite erhöht, um Pfeile außerhalb zu platzieren */
}

.wp-immo-slider-prev,
.wp-immo-slider-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(199, 199, 200, 0.44);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
    color: #fff;
    position: absolute; /* Absolute Positionierung für die Pfeile */
}

.wp-immo-slider-prev {
    left: 0; /* Linker Pfeil */
}

.wp-immo-slider-next {
    right: 0; /* Rechter Pfeil */
}

.wp-immo-slider-prev:hover,
.wp-immo-slider-next:hover {
    background-color: #d13b2d91;
}

/* Custom arrows with CSS */
.wp-immo-slider-prev::before,
.wp-immo-slider-next::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-top: 2px solid #fff;
    border-left: 2px solid #fff;
    position: relative;
}

.wp-immo-slider-prev::before {
    transform: rotate(-45deg);
    left: 2px; /* Adjust position */
}

.wp-immo-slider-next::before {
    transform: rotate(135deg);
    right: 2px; /* Adjust position */
}

/* Dots navigation */
.wp-immo-slider-dots {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.wp-immo-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    border: none;
    margin: 0 5px;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.wp-immo-slider-dot.active,
.wp-immo-slider-dot:hover {
    background-color: #d13b2d;
}

/* Swipe indicator für mobile Geräte */
.wp-immo-swipe-indicator {
    display: none;
}

/* Swipe-Effekte für mobile Ansicht */
.wp-immo-swiping {
    cursor: grabbing !important;
}

.wp-immo-swiping .wp-immo-property-card {
    transform: scale(0.98);
    transition: transform 0.2s ease;
}

/* Mobile Anpassungen */
@media (max-width: 767px) {
    /* Pfeile und Dots in der mobilen Ansicht ausblenden */
    .wp-immo-slider-nav, 
    .wp-immo-slider-dots {
        display: none;
    }
    
    /* Container-Padding reduzieren, da keine Pfeile angezeigt werden */
    .wp-immo-slider-container {
        padding: 0 10px;
        touch-action: pan-y; /* Verbessert die Touch-Interaktion */
        user-select: none; /* Verhindert Text-Auswahl beim Swipen */
    }
    
    /* Swipe-Indikator anzeigen */
    .wp-immo-swipe-indicator {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 10px 0;
        color: #666;
        font-size: 14px;
        animation: pulse 2s infinite;
    }
    
    .wp-immo-swipe-indicator::before,
    .wp-immo-swipe-indicator::after {
        content: "〈";
        margin: 0 5px;
        font-size: 18px;
    }
    
    .wp-immo-swipe-indicator::after {
        content: "〉";
    }
    
    /* Verbesserte Berührungsfläche für Cards */
    .wp-immo-property-card {
        cursor: grab;
    }
    
    .wp-immo-property-card:active {
        cursor: grabbing;
    }
    
    /* Verbesserte visuelle Rückmeldung beim Blättern */
    .wp-immo-slider-slide {
        transition: transform 0.3s ease;
    }
    
    /* Animations für Hinweis */
    @keyframes pulse {
        0% { opacity: 0.7; }
        50% { opacity: 1; }
        100% { opacity: 0.7; }
    }
    
    /* Mehr Platz für die Karten im mobilen Layout */
    .wp-immo-slider-item {
        margin-bottom: 15px;
    }
}

/* Error message */
.wp-immo-slider-error {
    padding: 40px 20px;
    text-align: center;
    background-color: #f8f9fa;
    color: #721c24;
    font-size: 16px;
}

/* Media Queries */
@media (min-width: 576px) {
    .wp-immo-property-image {
        height: 230px;
    }
}

@media (min-width: 768px) {
    .wp-immo-property-image {
        height: 200px;
    }
}

@media (min-width: 992px) {
    .wp-immo-property-image {
        height: 220px;
    }
}

@media (min-width: 1200px) {
    .wp-immo-property-image {
        height: 240px;
    }
}

/* Property link styles */
.wp-immo-property-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.wp-immo-property-link:hover {
    transform: translateY(-5px);
    text-decoration: none;
    color: inherit;
}

.wp-immo-property-link:hover .wp-immo-property-card {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.wp-immo-property-link:focus {
    outline: none;
    text-decoration: none;
    color: inherit;
} 