/* Entkreis Product Map Styles */
.entkreis-product-map-container {
    width: 100%;
    margin: 20px 0;
}

.entkreis-map-search {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.entkreis-search-form .search-fields {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #2EA847;
    box-shadow: 0 0 0 2px rgba(46, 168, 71, 0.2);
}

.search-radius {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 100px;
    font-size: 14px;
    background: white;
}

.search-button, .reset-button {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    text-transform: none;
}

.search-button {
    background: #2EA847;
    color: white;
}

.search-button:hover:not(:disabled) {
    background: #238a37;
    transform: translateY(-1px);
}

.search-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.reset-button {
    background: #B0C5A8;
    color: #333;
}

.reset-button:hover {
    background: #9bb193;
    transform: translateY(-1px);
}

.entkreis-map-wrapper {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

#entkreis-product-map {
    width: 100%;
    z-index: 1;
}

.map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #666;
    font-size: 16px;
    min-height: 400px;
}

.entkreis-products-section {
    margin-top: 30px;
}

.products-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.products-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

.products-count {
    color: #2EA847;
    font-weight: bold;
}

/* Responsive Grid Layout */
.entkreis-products-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.entkreis-columns-1 {
    grid-template-columns: 1fr;
}

.entkreis-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.entkreis-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.entkreis-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Product Card Styles */
.entkreis-product-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.entkreis-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.entkreis-product-card:hover .product-thumbnail {
    transform: scale(1.05);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 600;
}

.product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.product-title a:hover {
    color: #2EA847;
}

.product-location {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.product-location i {
    margin-right: 6px;
    font-size: 16px;
    color: #2EA847;
}

.product-slots {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    color: #666;
    font-size: 14px;
}

.product-slots i {
    margin-right: 6px;
    font-size: 16px;
    color: #2EA847;
}

.product-price {
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #2EA847;
}

.product-actions {
    margin-top: auto;
}

.view-product-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #2EA847;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.view-product-btn:hover {
    background: #238a37;
    color: white;
    transform: translateY(-1px);
}

/* No Products Found */
.no-products-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.no-products-found p {
    margin: 0;
    font-size: 16px;
}

/* Pagination */
.entkreis-pagination {
    text-align: center;
    margin-top: 40px;
}

.entkreis-pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 3px;
    background: white;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 500;
}

.entkreis-pagination .page-numbers:hover:not(.current) {
    background: #f8f9fa;
    border-color: #2EA847;
    color: #2EA847;
    transform: translateY(-1px);
}

.entkreis-pagination .page-numbers.current {
    background: #2EA847;
    color: white;
    border-color: #2EA847;
}

.entkreis-pagination .page-numbers.prev,
.entkreis-pagination .page-numbers.next {
    font-weight: 600;
}

/* Leaflet Map Customizations */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 15px;
    line-height: 1.4;
}

.leaflet-popup-content b {
    color: #2EA847;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .entkreis-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .entkreis-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-header h3 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .entkreis-search-form .search-fields {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: 100%;
        margin-bottom: 10px;
    }
    
    .search-radius {
        margin-bottom: 10px;
    }
    
    .entkreis-columns-4,
    .entkreis-columns-3,
    .entkreis-columns-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .entkreis-products-grid {
        gap: 15px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-title {
        font-size: 16px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .products-header h3 {
        font-size: 20px;
    }
    
    .entkreis-map-search {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .entkreis-columns-4,
    .entkreis-columns-3,
    .entkreis-columns-2 {
        grid-template-columns: 1fr;
    }
    
    .entkreis-products-grid {
        gap: 15px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .products-header h3 {
        font-size: 18px;
    }
    
    .entkreis-map-search {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .search-input,
    .search-radius,
    .search-button,
    .reset-button {
        padding: 10px 15px;
    }
}

/* Loading states */
.search-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.search-button:disabled:hover {
    transform: none;
}

/* Map container specific styles */
.entkreis-map-wrapper {
    position: relative;
    background: white;
}

.entkreis-map-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(46, 168, 71, 0.1) 50%, transparent 51%);
    pointer-events: none;
    z-index: 0;
}

/* Ensure proper z-index for map controls */
.leaflet-control-container {
    z-index: 1000;
}

/* Custom marker styles */
.leaflet-marker-icon {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Search result highlighting */
.search-result-marker {
    filter: hue-rotate(180deg) saturate(1.5);
}

/* Product Map Popup Styles */
.product-map-popup {
    min-width: 200px;
    max-width: 300px;
}

.product-map-popup h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.3;
}

.product-map-popup h4 a {
    color: #2EA847;
    text-decoration: none;
    font-weight: 600;
}

.product-map-popup h4 a:hover {
    text-decoration: underline;
}

.product-map-popup p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.product-map-popup .view-product-link {
    display: inline-block;
    padding: 6px 12px;
    background: #2EA847;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
}

.product-map-popup .view-product-link:hover {
    background: #238a37;
    color: white;
} 

/* Pulse animation for search location marker */
@keyframes entkreis-pulse {
    0% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.3); 
        opacity: 0.7; 
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

/* Search location marker styles */
.search-location-marker {
    animation: entkreis-pulse 2s infinite;
}

/* Improved search button states */
.search-button:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Map loading state */
.entkreis-map-wrapper.loading {
    position: relative;
}

.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.map-loading-overlay p {
    margin: 10px 0 0 0;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* Products loading state */
.products-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 200px;
}

.products-loading p {
    margin: 15px 0 0 0;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2EA847;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* No products found styling */
.no-products-found {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    min-height: 200px;
}

.no-products-found p {
    font-size: 16px;
    color: #666;
    margin: 0;
} 