/**
 * Product List Styles
 *
 * @package EntourancePlugin
 */

.entourance-product-list {
    width: 100%;
}

.entourance-product-list .card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    height: 100%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

/* Assicura che le colonne abbiano la stessa altezza */
.entourance-product-list .row {
    display: flex;
    flex-wrap: wrap;
}

.entourance-product-list [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.entourance-product-list .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.entourance-product-list .card-img-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.entourance-product-list .card-img-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.entourance-product-list .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.25rem;
}

.entourance-product-list .card-meta {
    font-size: 0.9rem;
    color: #666;
    min-height: 1.5rem;
    margin-bottom: 0.5rem;
}

.entourance-product-list .card-meta i {
    margin-right: 0.25rem;
}

.entourance-product-list .card-title {
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Altezza fissa per 2 righe: line-height * numero righe */
    min-height: 2.8em; /* 1.4 * 2 = 2.8em */
    max-height: 2.8em;
}

.entourance-product-list .card-footer {
    padding: 1rem 1.25rem;
    background-color: #fff;
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.entourance-product-list .card:after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: transparent;
}

.entourance-product-list .badges-wrapper {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 2rem;
}

.entourance-product-list .type-badge {
    font-size: 0.8rem;
    padding: 0.5em 1em;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}

.entourance-product-list .category-badge {
    font-size: 0.8rem;
    padding: 0.5em 1em;
    background-color: transparent;
    color: #007bff;
    border: 1px solid #007bff;
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stili moderni per i tab */
.entourance-product-list .nav-tabs {
    border: none;
    background: transparent;
    padding: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.entourance-product-list .nav-tabs .nav-item {
    margin: 0;
}

.entourance-product-list .nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    padding: 12px 20px;
    font-weight: 500;
    color: #6c757d;
    background: transparent;
    transition: all 0.2s ease;
    outline: none;
    position: relative;
    margin-right: 8px;
}

.entourance-product-list .nav-tabs .nav-link:hover {
    color: #495057;
    background: transparent;
    border-bottom: 2px solid #dee2e6;
}

.entourance-product-list .nav-tabs .nav-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    color: #495057;
    background: transparent;
}

.entourance-product-list .nav-tabs .nav-link.active {
    background: transparent;
    color: #007bff;
    border-bottom: 2px solid #007bff;
    box-shadow: none;
}

.entourance-product-list .nav-tabs .nav-link.active:hover {
    background: transparent;
    color: #0056b3;
    border-bottom: 2px solid #0056b3;
}

.entourance-product-list .nav-tabs .nav-link.active:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    background: transparent;
    color: #0056b3;
    border-bottom: 2px solid #0056b3;
}

/* Animazione per il contenuto dei tab */
.entourance-product-list .tab-content {
    position: relative;
}

.entourance-product-list .tab-pane {
    transition: opacity 0.2s ease-in-out;
}

.entourance-product-list .tab-pane.fade {
    opacity: 0;
}

.entourance-product-list .tab-pane.fade.show {
    opacity: 1;
}

/* Responsive per i tab */
@media (max-width: 767.98px) {
    .entourance-product-list .nav-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .entourance-product-list .nav-tabs .nav-item {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #e9ecef;
    }
    
    .entourance-product-list .nav-tabs .nav-link {
        text-align: center;
        padding: 12px 16px;
        margin-right: 0;
        border-bottom: none;
    }
    
    .entourance-product-list .nav-tabs .nav-link.active {
        border-bottom: none;
        border-left: 3px solid #007bff;
        background: rgba(0, 123, 255, 0.05);
    }
    
    .entourance-product-list .nav-tabs .nav-link:hover {
        border-bottom: none;
        border-left: 3px solid #dee2e6;
    }
}

@media (max-width: 767.98px) {
    .entourance-product-list .card-img-wrapper {
        height: 180px;
    }
}

/* Pagination controls */
.pagination-controls .btn-link {
    padding: 0.375rem 0.75rem;
}
.pagination-controls .btn-link:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination-controls .btn-link:not(:disabled):hover {
    text-decoration: underline !important;
}

/* Stili per i popup della mappa */
.entourance-custom-popup .leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
    background: white;
}
.entourance-custom-popup .leaflet-popup-content {
    margin: 0 !important;
    width: 100% !important;
}
.entourance-map-popup {
    min-width: 250px;
}
.entourance-map-popup .popup-image {
    margin: 0;
    line-height: 0;
    position: relative;
}
.entourance-map-popup .popup-image img {
    display: block;
    width: 100%;
}
.entourance-map-popup .popup-link-btn {
    transition: all 0.3s ease !important;
}
.entourance-map-popup .popup-link-btn:hover {
    background: var(--gyg-primary, #007bff) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}
.entourance-custom-popup .leaflet-popup-tip-container {
    margin-top: -1px;
}
.entourance-custom-popup .leaflet-popup-close-button {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    background: white !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    color: #666 !important;
    font-size: 20px !important;
    font-weight: bold !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
    border: 2px solid #f0f0f0 !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    text-decoration: none !important;
}
.entourance-custom-popup .leaflet-popup-close-button:hover {
    background: #f8f9fa !important;
    color: #333 !important;
    border-color: #ddd !important;
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2) !important;
    text-decoration: none !important;
}

/* Placeholder per immagini mancanti */
.card-img-placeholder {
    height: 200px;
    width: 100%;
    background: linear-gradient(135deg, rgba(var(--gyg-primary-rgb, 0, 123, 255), 0.15), rgba(var(--gyg-primary-rgb, 0, 123, 255), 0.25)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.card-img-placeholder i {
    color: white !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Lazy loading styles */
.lazy-img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    min-height: 200px;
}
.lazy-img.loaded {
    animation: none;
    background: none;
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
} 