/* =========================================
   BASE E RESET
========================================= */
.virofpl-locator-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; margin: 20px 0; width: 100%; box-sizing: border-box; }

.virofpl-filters { grid-area: filters; background: #ffffff; padding: 25px; border-radius: 12px; border: 1px solid #eaeaea; box-shadow: 0 2px 15px rgba(0,0,0,0.03); align-self: start; }
.virofpl-list-wrapper { grid-area: list; display: flex; flex-direction: column; gap: 20px; }
.virofpl-map-container { grid-area: map; border-radius: 12px; border: 1px solid #eaeaea; box-shadow: 0 2px 15px rgba(0,0,0,0.03); z-index: 1; overflow: hidden; }

.virofpl-text-input { width: 100%; padding: 12px 15px; margin-bottom: 25px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-size: 15px; transition: border-color 0.2s;}
.virofpl-text-input:focus { border-color: #888; outline: none; }

/* GRIGLIA INTELLIGENTE PER I FILTRI */
.virofpl-checkbox-group { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 15px; margin-bottom: 25px; }
.virofpl-filter-section { margin: 0; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.virofpl-filter-section.virofpl-multi-child { grid-column: 1 / -1; }
.virofpl-filter-section.virofpl-single-child { grid-column: span 1; border-bottom: none; padding-bottom: 0; }
.virofpl-filter-section:last-child { border-bottom: none; padding-bottom: 0; }
.virofpl-filter-title { margin: 0 0 12px 0; font-size: 12px; text-transform: uppercase; color: #888; letter-spacing: 0.8px; font-weight: 700;}
.virofpl-filter-labels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 15px; }
.virofpl-filter-labels-grid.virofpl-single-col { grid-template-columns: 1fr; }
.virofpl-filter-label { cursor: pointer; display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: #444; line-height: 1.4; transition: color 0.2s;}
.virofpl-filter-label:hover { color: #000; }
.virofpl-filter-checkbox { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border: 2px solid #ccc; border-radius: 4px; position: relative; cursor: pointer; outline: none; transition: all 0.2s ease-in-out; margin: 1px 0 0 0; flex-shrink: 0; }
.virofpl-filter-checkbox:checked::after { content: '✔'; position: absolute; color: white; font-size: 12px; left: 2px; top: -2px; }

.virofpl-btn { width: 100%; padding: 12px 20px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 15px; transition: opacity 0.2s ease;}

/* =========================================
   STILE CARD NELLA LISTA
========================================= */
.virofpl-list-item { padding: 20px; border: 1px solid #eaeaea; border-radius: 12px; background: #fff; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; box-sizing: border-box; display: flex; flex-direction: column;}
.virofpl-list-item:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.06); border-color: #ddd;}

.virofpl-list-image { 
    width: 100% !important; 
    height: 160px !important; 
    object-fit: cover !important; 
    border-radius: 8px !important; 
    margin-bottom: 15px !important; 
    display: block !important; 
    max-height: 160px !important;
}

.virofpl-list-item h4 { margin: 0 0 8px 0; font-size: 18px; color: #222; line-height: 1.2;}
.virofpl-address { font-size: 0.95em; color: #555; margin: 0 0 15px 0; line-height: 1.4;}
.virofpl-contacts-wrapper { margin-top: auto; border-top: 1px solid #f0f0f0; padding-top: 15px; } 

.virofpl-contact { margin: 0 0 4px 0 !important; font-size: 0.9em; color: #444; line-height: 1.2 !important; }
.virofpl-contact a { color: inherit; text-decoration: none; font-weight: 500;}
.virofpl-contact a:hover { opacity: 0.7; }
.virofpl-more-info { margin: 12px 0 0 0;}
.virofpl-more-info a { font-weight: 600; color: inherit; text-decoration: none; font-size: 0.9em;}

/* =========================================
   STILE POPUP MAPPA MODERNI (NATIVO E PULITO)
========================================= */
.virofpl-popup-container { 
    width: 100%; /* Si adatta perfettamente allo spazio della mappa */
    min-width: 220px; 
    font-family: inherit; 
    box-sizing: border-box;
}

.virofpl-popup-image { 
    width: 100% !important; 
    height: 130px !important; 
    object-fit: cover !important; 
    margin-bottom: 12px !important; 
    display: block !important; 
    border-radius: 8px !important;
}

.virofpl-popup-title { margin: 0 0 8px 0; font-size: 16px; color: #222; font-weight: 700; line-height: 1.2; }
.virofpl-popup-address { margin: 0 0 12px 0; font-size: 13px; color: #666; line-height: 1.4; }
.virofpl-popup-contacts { border-top: 1px solid #f0f0f0; padding-top: 10px; margin-bottom: 12px; }

.virofpl-popup-contact { margin: 0 0 4px 0 !important; font-size: 13px; color: #444; line-height: 1.2 !important; }
.virofpl-popup-contact a { color: inherit; text-decoration: none; font-weight: 500; }
.virofpl-popup-contact a:hover { opacity: 0.7; }
.virofpl-popup-more-info a { display: block; padding: 8px 12px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: bold; text-align: center; box-sizing: border-box; transition: opacity 0.2s;}

/* Ammorbidiamo solo gli angoli del popup nativo per un look più moderno */
.leaflet-popup-content-wrapper { border-radius: 12px !important; box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important; }
.gm-style .gm-style-iw-c { border-radius: 12px !important; box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important; }

/* =========================================
   STILE PAGINAZIONE
========================================= */
.virofpl-pagination-wrap { text-align: center; padding: 15px 0 40px 0; }
.virofpl-load-more-btn { width: auto; padding: 14px 35px; margin: 0 auto; display: inline-block;}
.virofpl-pagination-nav { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.virofpl-page-btn { padding: 8px 14px; border: 1px solid #ddd; background: #fff; cursor: pointer; border-radius: 4px; transition: 0.2s; font-weight: bold; color: #333; }
.virofpl-page-btn:hover { background: #f1f1f1; }
.virofpl-page-btn.active { background: #333; color: #fff; border-color: #333; }

/* =========================================
   SISTEMA DI LAYOUT (CSS GRID)
========================================= */
.virofpl-locator-container.layout-1 { display: grid; grid-template-columns: 340px 1fr; grid-template-areas: "filters map" "list list"; gap: 30px; align-items: stretch; }
.virofpl-locator-container.layout-1 .virofpl-map-container { height: 100%; min-height: 450px; }
.virofpl-locator-container.layout-1 .virofpl-filters { align-self: stretch; }
.virofpl-locator-container.layout-1 .virofpl-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.virofpl-locator-container.layout-2 { display: grid; grid-template-columns: 340px 1fr; grid-template-areas: "filters list" "map map"; gap: 30px; align-items: start; }
.virofpl-locator-container.layout-2 .virofpl-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-content: start; }
.virofpl-locator-container.layout-2 .virofpl-map-container { height: 450px; width: 100%; margin-top: 10px;}

.virofpl-locator-container.layout-3 { display: grid; grid-template-columns: 340px 300px 1fr; grid-template-areas: "filters list map"; gap: 25px; align-items: stretch; }
.virofpl-locator-container.layout-3 .virofpl-list-wrapper { max-height: none; overflow-y: visible; padding-right: 0; }
.virofpl-locator-container.layout-3 .virofpl-list { display: flex; flex-direction: column; gap: 20px; }
.virofpl-locator-container.layout-3 .virofpl-map-container { height: 100%; min-height: 450px; }
.virofpl-locator-container.layout-3 .virofpl-filters { align-self: stretch; }
.virofpl-locator-container.layout-3 .virofpl-pagination-wrap { padding: 10px 0; }
.virofpl-locator-container.layout-3 .virofpl-load-more-btn { width: 100%; box-sizing: border-box; }

.virofpl-locator-container.virofpl-no-map { display: grid; grid-template-columns: 340px 1fr; grid-template-areas: "filters list"; gap: 30px; align-items: start;}
.virofpl-locator-container.virofpl-no-map .virofpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; align-content: start; }

/* =========================================
   RESPONSIVE MOBILE / TABLET
========================================= */
@media (max-width: 1200px) and (min-width: 901px) {
    .virofpl-locator-container.layout-1 .virofpl-list,
    .virofpl-locator-container.layout-2 .virofpl-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .virofpl-locator-container.layout-1, .virofpl-locator-container.layout-2, .virofpl-locator-container.layout-3 { grid-template-columns: 1fr; grid-template-areas: "filters" "map" "list"; }
    .virofpl-locator-container.virofpl-no-map { grid-template-columns: 1fr; grid-template-areas: "filters" "list"; }
    
    .virofpl-locator-container.layout-1 .virofpl-list, .virofpl-locator-container.layout-2 .virofpl-list { grid-template-columns: 1fr; }
    .virofpl-locator-container.layout-1 .virofpl-map-container, .virofpl-locator-container.layout-2 .virofpl-map-container, .virofpl-locator-container.layout-3 .virofpl-map-container { height: 450px; min-height: auto; }
}