/**
 * RevEstate - Frontend CSS
 * Stili per il frontend del plugin
 */

/* === VARIABILI CSS === */
:root {
    --revestate-primary: #555;
    --revestate-secondary: #6c757d;
    --revestate-success: #28a745;
    --revestate-danger: #dc3545;
    --revestate-warning: #ffc107;
    --revestate-info: #17a2b8;
    --revestate-light: #f8f9fa;
    --revestate-dark: #343a40;
    --revestate-border: #dee2e6;
    --revestate-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* === GENERALI === */
.revestate-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Container fullwidth per la vista halfmap */
.revestate-container.revestate-container-fullwidth {
    max-width: 100%;
    padding: 20px 0;
}

/* Rimuovi i bordi arrotondati e il box-shadow per halfmap in fullwidth */
.revestate-container.revestate-container-fullwidth .halfmap-container {
    border-radius: 0;
    box-shadow: none;
}

/* Regola i margini laterali per gli elementi del container in modalità fullwidth */
.revestate-container.revestate-container-fullwidth .revestate-compact-header,
.revestate-container.revestate-container-fullwidth .revestate-archive-header,
.revestate-container.revestate-container-fullwidth .revestate-filters-panel {
    margin-left: 20px;
    margin-right: 20px;
}
/* === ARCHIVE HEADER === */
.revestate-archive-header {
    margin-bottom: 30px;
    text-align: center;
}

.revestate-archive-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--revestate-dark);
}

.revestate-archive-description {
    font-size: 1.1em;
    color: var(--revestate-secondary);
    max-width: 800px;
    margin: 0 auto;
}

/* === SEARCH FORM === */
.revestate-filters {
    background: #fff;
    padding: 25px;
    border-radius: 3px;
    box-shadow: var(--revestate-shadow);
    margin-bottom: 30px;
}

.revestate-search-form {
    width: 100%;
}

.search-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.search-form-field {
    display: flex;
    flex-direction: column;
}

.search-form-field label {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--revestate-dark);
    font-size: 0.9em;
}

.search-form-field input,
.search-form-field select {
    padding: 10px;
    border: 1px solid var(--revestate-border);
    border-radius: 4px;
    font-size: 1em;
}

.search-form-field input:focus,
.search-form-field select:focus {
    outline: none;
    border-color: var(--revestate-primary);
}

.search-form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* === SORTING BAR === */
.revestate-sorting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 3px;
    box-shadow: var(--revestate-shadow);
}

.revestate-sort-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.revestate-sort-form label {
    font-weight: 600;
    color: var(--revestate-dark);
}

.revestate-sort-form select {
    padding: 8px 12px;
    border: 1px solid var(--revestate-border);
    border-radius: 4px;
}

.revestate-view-toggle {
    display: flex;
    gap: 5px;
}

.revestate-view-toggle button {
    background: #fff;
    border: 1px solid var(--revestate-border);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.revestate-view-toggle button:hover,
.revestate-view-toggle button.active {
    background: var(--revestate-primary);
    color: #fff;
    border-color: var(--revestate-primary);
}

.revestate-view-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* === RESULTS COUNT === */
.revestate-results-count {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: var(--revestate-secondary);
}

/* === GRID LAYOUT === */
.revestate-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}

.revestate-cols-2 {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.revestate-cols-3 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.revestate-cols-4 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* === PROPERTY CARD === */
.revestate-card {
    background: #fff;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: var(--revestate-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.revestate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.revestate-card-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.revestate-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.revestate-card:hover .revestate-card-image img {
    transform: scale(1.05);
}

.revestate-card-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.revestate-card-badges .badge {
    display: inline-block;
    padding: 5px 10px;
    color: #fff;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.revestate-card-content {
    padding: 20px;
}

.revestate-card-price {
    margin-bottom: 10px;
}

.revestate-card-price .price {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--revestate-primary);
}

.revestate-card-title {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.revestate-card-title a {
    color: var(--revestate-dark);
    text-decoration: none;
    transition: color 0.3s;
}

.revestate-card-title a:hover {
    color: var(--revestate-primary);
}

.revestate-card-type {
    color: var(--revestate-secondary);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.revestate-card-location {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--revestate-secondary);
    font-size: 0.95em;
    margin-bottom: 15px;
}

.revestate-card-location .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.revestate-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid var(--revestate-border);
    border-bottom: 1px solid var(--revestate-border);
    margin-bottom: 15px;
}

.revestate-card-features .feature {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    color: var(--revestate-dark);
}

.revestate-card-features .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    color: var(--revestate-primary);
}

.revestate-card-excerpt {
    font-size: 0.95em;
    color: var(--revestate-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.revestate-card-footer {
    display: flex;
    justify-content: flex-end;
}

/* === BUTTONS === */
.revestate-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: var(--revestate-primary);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.revestate-button:hover {
    background: #0056b3;
    color: #fff;
}

.revestate-button.button-secondary {
    background: var(--revestate-secondary);
}

.revestate-button.button-secondary:hover {
    background: #545b62;
}

.revestate-button .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* === SINGLE PROPERTY === */
.revestate-single-wrapper {
    padding: 30px 0;
}

.revestate-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.revestate-breadcrumb a {
    color: var(--revestate-primary);
    text-decoration: none;
}

.revestate-breadcrumb .separator {
    color: var(--revestate-secondary);
}

.revestate-breadcrumb .current {
    color: var(--revestate-secondary);
}

.revestate-single-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--revestate-border);
}

.revestate-title {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    color: var(--revestate-dark);
}

.revestate-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.1em;
    color: var(--revestate-secondary);
}

.revestate-price-area {
    text-align: right;
}

.revestate-price {
    font-size: 2em;
    font-weight: 700;
    color: var(--revestate-primary);
    margin-bottom: 10px;
}

.revestate-badges {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.revestate-badges .badge {
    padding: 8px 15px;
    color: #fff;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
}

.revestate-single-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

.revestate-main-column > div {
    margin-bottom: 40px;
}

.revestate-main-column h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: var(--revestate-dark);
    border-bottom: 2px solid var(--revestate-primary);
    padding-bottom: 10px;
}

/* === GALLERY === */
.revestate-gallery-main {
    margin-bottom: 15px;
    border-radius: 3px;
    overflow: hidden;
}

.revestate-gallery-main img {
    width: 100%;
    height: auto;
    display: block;
}

.revestate-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.revestate-gallery-thumbs .thumb-item {
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.revestate-gallery-thumbs .thumb-item:hover,
.revestate-gallery-thumbs .thumb-item.active {
    border-color: var(--revestate-primary);
}

.revestate-gallery-thumbs img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

/* === MAIN FEATURES === */
.revestate-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--revestate-light);
    border-radius: 3px;
}

.feature-item .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--revestate-primary);
}

.feature-content {
    display: flex;
    flex-direction: column;
}

.feature-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--revestate-dark);
}

.feature-label {
    font-size: 0.85em;
    color: var(--revestate-secondary);
}

/* === DESCRIPTION === */
.description-content {
    line-height: 1.5;
    font-size: 1.05em;
    color: var(--revestate-dark);
}

/* === ADDITIONAL FEATURES === */
.features-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.features-list .dashicons {
    color: var(--revestate-success);
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* === PLANIMETRIE === */
.planimetrie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.planimetria-item img {
    width: 100%;
    height: auto;
    border-radius: 3px;
    border: 1px solid var(--revestate-border);
}

/* === VIDEO === */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 3px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* === MAP === */
.revestate-map {
    overflow: hidden;
    border: 1px solid var(--revestate-border);
}

.revestate-infowindow {
    max-width: 250px;
}

.revestate-infowindow img {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.revestate-infowindow h4 {
    margin: 0 0 10px 0;
}

.revestate-infowindow h4 a {
    color: var(--revestate-dark);
    text-decoration: none;
}

.revestate-infowindow .price {
    font-weight: 700;
    color: var(--revestate-primary);
}

/* === SIDEBAR === */
.revestate-sidebar {
    position: sticky;
    top: 20px;
}

.revestate-widget {
    background: #fff;
    padding: 25px;
    border-radius: 3px;
    box-shadow: var(--revestate-shadow);
    margin-bottom: 25px;
}

.revestate-widget h3 {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    color: var(--revestate-dark);
    border-bottom: 2px solid var(--revestate-primary);
    padding-bottom: 10px;
}

.details-list {
    margin: 0;
}

.details-list dt {
    font-weight: 600;
    color: var(--revestate-dark);
    margin-bottom: 5px;
}

.details-list dd {
    margin: 0 0 15px 0;
    color: var(--revestate-secondary);
}

/* === CONTACT FORM === */
.revestate-contact-form .form-field {
    margin-bottom: 15px;
}

.revestate-contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--revestate-dark);
}

.revestate-contact-form input[type="text"],
.revestate-contact-form input[type="email"],
.revestate-contact-form input[type="tel"],
.revestate-contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--revestate-border);
    border-radius: 4px;
    font-size: 1em;
}

.revestate-contact-form input[type="checkbox"] {
    margin-right: 5px;
}

.revestate-contact-form .form-message {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.revestate-contact-form .form-message.success {
    background: var(--revestate-success);
    color: #fff;
}

.revestate-contact-form .form-message.error {
    background: var(--revestate-danger);
    color: #fff;
}

/* === SHARE BUTTONS === */
.share-buttons {
    display: flex;
    gap: 10px;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: transform 0.3s;
}


.share-button.email {
    background: var(--revestate-secondary);
}

.share-button .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* === PAGINATION === */
.revestate-pagination {
    margin-top: 40px;
    text-align: center;
}

.revestate-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.revestate-pagination a,
.revestate-pagination .current {
    padding: 10px 15px;
    background: #fff;
    border: 1px solid var(--revestate-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--revestate-dark);
    transition: all 0.3s;
}

.revestate-pagination a:hover,
.revestate-pagination .current {
    background: var(--revestate-primary);
    color: #fff;
    border-color: var(--revestate-primary);
}

/* === NO RESULTS === */
.revestate-no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--revestate-light);
    border-radius: 3px;
}

.revestate-no-results p {
    font-size: 1.2em;
    color: var(--revestate-secondary);
    margin-bottom: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .revestate-single-content {
        grid-template-columns: 1fr;
    }
    
    .revestate-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .revestate-single-header {
        flex-direction: column;
    }
    
    .revestate-price-area {
        text-align: left;
        width: 100%;
    }
    
    .revestate-badges {
        justify-content: flex-start;
    }
    
    .revestate-cols-2,
    .revestate-cols-3,
    .revestate-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .search-form-row {
        grid-template-columns: 1fr;
    }
    
    .revestate-sorting {
        flex-direction: column;
        gap: 15px;
    }
    
    .revestate-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .revestate-title {
        font-size: 1.8em;
    }
    
    .revestate-price {
        font-size: 1.5em;
    }
    
    .revestate-features-grid {
        grid-template-columns: 1fr;
    }
    
    .features-list {
        grid-template-columns: 1fr;
    }
}

/* === HIDE MAP VIEW BY DEFAULT === */
.revestate-map-view {
    margin-bottom: 30px;
}

/* === LIST VIEW === */
.revestate-grid.view-list {
    grid-template-columns: 1fr;
}

.revestate-grid.view-list .revestate-card {
    display: grid;
    grid-template-columns: 300px 1fr;
}

.revestate-grid.view-list .revestate-card-image {
    height: 100%;
    min-height: 250px;
}

@media (max-width: 768px) {
    .revestate-grid.view-list .revestate-card {
        grid-template-columns: 1fr;
    }
}

/* === HEADER COMPATTO === */
.revestate-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 25px;
    background: #fff;
    border-radius: 3px;
    box-shadow: var(--revestate-shadow);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.revestate-compact-header .revestate-results-count {
    font-size: 1em;
    color: var(--revestate-dark);
    margin: 0;
    font-weight: 600;
    flex-shrink: 0;
}

.revestate-compact-header .revestate-sort-form {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
}

.revestate-compact-header .revestate-sort-form select {
    padding: 8px 30px 8px 12px;
    border: 1px solid var(--revestate-border);
    border-radius: 4px;
    font-size: 0.95em;
    background-color: #fff;
    cursor: pointer;
}

.revestate-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--revestate-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--revestate-dark);
    transition: all 0.3s ease;
}

.btn-control:hover {
    background: var(--revestate-light);
}

.btn-control.active {
    background: var(--revestate-success);
    color: #fff;
    border-color: var(--revestate-success);
}

.btn-control .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* === PANNELLO FILTRI COLLASSABILE === */
.revestate-filters-panel {
    background: #fff;
    padding: 25px;
    border-radius: 3px;
    box-shadow: var(--revestate-shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.revestate-filters-panel.collapsed {
    max-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
}

/* === FORM DI RICERCA AGGIORNATO === */
.revestate-search-form .search-form-row {
    margin-bottom: 20px;
}

.revestate-search-form .search-form-row-2cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.revestate-search-form .search-form-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--revestate-dark);
    font-size: 0.95em;
}

.revestate-search-form .search-form-field label .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    color: var(--revestate-primary);
}

/* === SLIDER DOPPIO === */
.search-form-slider {
    margin-bottom: 25px;
}

.search-form-slider label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.search-form-slider .slider-values {
    font-weight: 700;
    color: var(--revestate-success);
}

.dual-slider {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

.dual-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
}

.dual-slider input[type="range"]::-webkit-slider-track {
    width: 100%;
    height: 8px;
    background: var(--revestate-light);
    border-radius: 4px;
}

.dual-slider input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: var(--revestate-light);
    border-radius: 4px;
}

.dual-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--revestate-success);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.dual-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--revestate-success);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.dual-slider input[type="range"]:active::-webkit-slider-thumb {
    background: #1e7e34;
}

.dual-slider input[type="range"]:active::-moz-range-thumb {
    background: #1e7e34;
}

/* Traccia colorata per slider */
.dual-slider::before {
    content: '';
    position: absolute;
    height: 8px;
    background: var(--revestate-success);
    border-radius: 4px;
    left: 0;
    right: 0;
}

/* === CARATTERISTICHE === */
.search-form-caratteristiche {
    margin-bottom: 25px;
}

.caratteristiche-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--revestate-dark);
    font-size: 0.95em;
}

.caratteristiche-title .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    color: var(--revestate-primary);
}

.caratteristiche-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: var(--revestate-light);
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
}

.checkbox-label:hover {
    background: #e9ecef;
    border-color: var(--revestate-primary);
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked + .dashicons {
    color: var(--revestate-success);
}

.checkbox-label .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    color: var(--revestate-secondary);
    transition: color 0.3s ease;
}

/* === CHECKBOX GROUPS (Tipologia & Tipo Contratto) === */
.search-form-checkboxes {
    display: flex;
    flex-direction: column;
}

.checkboxes-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--revestate-dark);
    font-size: 0.95em;
}

.checkboxes-title .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    color: var(--revestate-primary);
}

.checkboxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

/* Stile speciale per checkbox senza icone */
.checkboxes-grid .checkbox-label {
    justify-content: flex-start;
}

.checkboxes-grid .checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
}

.checkboxes-grid .checkbox-label .checkbox-text {
    flex: 1;
}

/* Stato checked per checkbox nei gruppi */
.checkboxes-grid .checkbox-label input[type="checkbox"]:checked {
    accent-color: var(--revestate-success);
}

/* Evidenzia il label quando il checkbox è checked */
.checkboxes-grid .checkbox-label:has(input[type="checkbox"]:checked) {
    background: #d4edda;
    border-color: var(--revestate-success);
}

/* === AZIONI DEL FORM === */
.revestate-search-form .search-form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid var(--revestate-border);
    margin-top: 25px;
}

.revestate-search-form .search-form-actions .button-secondary {
    background: transparent;
    color: var(--revestate-secondary);
    border: 2px solid var(--revestate-border);
}

.revestate-search-form .search-form-actions .button-secondary:hover {
    background: var(--revestate-secondary);
    color: #fff;
    border-color: var(--revestate-secondary);
}

.revestate-search-form .search-form-actions .button-primary {
    background: var(--revestate-success);
    padding: 12px 30px;
    font-weight: 600;
}

.revestate-search-form .search-form-actions .button-primary:hover {
    background: #1e7e34;
}

/* === RESPONSIVE HEADER COMPATTO === */
@media (max-width: 1024px) {
    .revestate-compact-header {
        gap: 15px;
    }
    
    .revestate-controls {
        gap: 6px;
    }
    
    .btn-control {
        padding: 8px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 768px) {
    .revestate-compact-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .revestate-compact-header .revestate-results-count,
    .revestate-compact-header .revestate-sort-form {
        justify-content: center;
        text-align: center;
    }
    
    .revestate-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .btn-control {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
    
    .search-form-row-2cols {
        grid-template-columns: 1fr !important;
    }
    
    .caratteristiche-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .checkboxes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === AUTOCOMPLETE LOCALITÀ CON CHIPS === */

/* Wrapper principale dell'autocomplete */
.localita-autocomplete-wrapper {
    position: relative;
}

/* Hide old chips container if it exists */
.localita-chips-container {
    display: none !important;
}

/* Input-like container that holds both tags and input */
.localita-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--revestate-border);
    border-radius: 4px;
    background: #fff;
    cursor: text;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.localita-input-container:focus-within {
    border-color: var(--revestate-primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Container for inline tags */
.localita-inline-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* Singolo tag inline */
.localita-inline-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--revestate-primary);
    color: #fff;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.localita-inline-tag:hover {
    background: #0056b3;
}

/* Pulsante di rimozione del tag */
.localita-inline-tag .tag-remove {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.localita-inline-tag .tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.localita-inline-tag .tag-remove:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 1px;
}

/* Tag contatore (es. "+2") */
.localita-tag-counter {
    background: var(--revestate-secondary);
    cursor: help;
}

.localita-tag-counter:hover {
    background: #5a6268;
}

/* Input autocomplete - now sits inline with tags */
.localita-autocomplete-input {
    flex: 1;
    min-width: 120px;
    padding: 4px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
}

.localita-autocomplete-input::placeholder {
    color: #999;
}

/* Dropdown autocomplete */
.localita-autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--revestate-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

/* Item del dropdown */
.localita-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 14px;
    color: var(--revestate-dark);
    border-bottom: 1px solid #f0f0f0;
}

.localita-dropdown-item:last-child {
    border-bottom: none;
}

.localita-dropdown-item:hover,
.localita-dropdown-item.focused {
    background-color: var(--revestate-light);
}

.localita-dropdown-item:active {
    background-color: #e2e6ea;
}

/* Messaggi nel dropdown */
.localita-loading,
.localita-no-results,
.localita-error {
    padding: 12px 15px;
    text-align: center;
    font-size: 14px;
    color: var(--revestate-secondary);
}

.localita-loading {
    color: var(--revestate-info);
}

.localita-error {
    color: var(--revestate-danger);
}

/* Container degli input nascosti */
.localita-hidden-inputs {
    display: none;
}

/* Stile speciale quando il campo ha focus */
.search-form-field-localita:focus-within label {
    color: var(--revestate-primary);
}

/* Scrollbar personalizzata per il dropdown */
.localita-autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.localita-autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 4px 4px 0;
}

.localita-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.localita-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}

@media (max-width: 480px) {
    .btn-control span:not(.dashicons) {
        display: none;
    }
    
    .btn-control {
        min-width: 50px;
        padding: 8px;
    }
    
    .caratteristiche-grid {
        grid-template-columns: 1fr;
    }
    
    .checkboxes-grid {
        grid-template-columns: 1fr;
    }
    
    /* Adattamenti per mobile */
    .localita-chip {
        font-size: 13px;
        padding: 5px 10px;
        max-width: 150px;
    }
    
    .localita-autocomplete-dropdown {
        max-height: 200px;
    }
    
    .localita-dropdown-item {
        padding: 10px 12px;
        font-size: 13px;
    }
}



/* ========================================
   COMPACT SEARCH LAYOUT
   ======================================== */

.revestate-search-compact {
    width: 100%;
    margin: 0 auto;
}

.revestate-compact-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 15px;
    border-radius: 3px;
    box-shadow: var(--revestate-shadow);
    flex-wrap: wrap;
}

/* Campo Località Compact */
.compact-search-localita {
    flex: 1 1 300px;
    min-width: 250px;
}

.compact-search-localita .localita-autocomplete-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    min-height: 44px;
}

.compact-search-localita .localita-icon {
    color: #6c757d;
    font-size: 18px;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Input container for compact layout */
.compact-search-localita .localita-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    flex: 1;
    padding: 0;
    border: none;
    background: transparent;
    min-height: auto;
}

.compact-search-localita .localita-input-container:focus-within {
    box-shadow: none;
}

/* Inline tags container for compact */
.compact-search-localita .localita-inline-tags {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* Hide old chips container */
.compact-search-localita .localita-chips-container {
    display: none !important;
}

/* Individual inline tag for compact */
.compact-search-localita .localita-inline-tag {
    display: inline-flex;
    align-items: center;
    background: #555;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 13px;
    white-space: nowrap;
    gap: 4px;
}

.compact-search-localita .localita-tag-counter {
    background: #6c757d;
    cursor: help;
}

.compact-search-localita .tag-remove {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-weight: bold;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.compact-search-localita .tag-remove:hover {
    opacity: 0.8;
}

.compact-search-localita .localita-autocomplete-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 4px;
    min-width: 120px;
}

.compact-search-localita .localita-autocomplete-input::placeholder {
    color: #999;
}

.compact-search-localita .localita-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
}

.compact-search-localita .localita-autocomplete-dropdown.active {
    display: block;
}

.compact-search-localita .autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.compact-search-localita .autocomplete-item:hover,
.compact-search-localita .autocomplete-item.active {
    background: #f8f9fa;
}

.compact-search-localita .autocomplete-item:last-child {
    border-bottom: none;
}

/* Pulsanti Compact */
.compact-search-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.compact-search-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.button-filtri {
    background: #fff;
    color: #333;
    border: 1px solid #dee2e6;
}

.button-filtri:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.button-cerca {
    background: #28a745;
    color: #fff;
}

.button-cerca:hover {
    background: #218838;
}

/* Responsive Compact */
@media (max-width: 768px) {
    .revestate-compact-search-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .compact-search-localita {
        width: 100%;
        flex: none;
    }
    
    .compact-search-button {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   MODAL FILTERS
   ======================================== */

.revestate-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.revestate-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.revestate-modal-content {
    position: relative;
    background: #fff;
    border-radius: 3px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 2;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.revestate-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #dee2e6;
}

.revestate-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.revestate-modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #6c757d;
    font-size: 24px;
    line-height: 1;
    transition: color 0.2s ease;
}

.revestate-modal-close:hover {
    color: #333;
}

.revestate-modal-close .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
}

/* Modal Body */
.revestate-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-filter-section {
    margin-bottom: 30px;
}

.modal-filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.filter-section-title .dashicons {
    color: #555;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.filter-section-title .slider-values {
    font-weight: 500;
    color: #555;
    margin-left: auto;
}

/* Checkboxes Grid nel Modal */
.filter-checkboxes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

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

.filter-checkboxes-grid .checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-checkboxes-grid .checkbox-label:hover {
    background: #e9ecef;
}

.filter-checkboxes-grid .checkbox-label input[type="checkbox"] {
    margin: 0 10px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-checkboxes-grid .checkbox-text {
    font-size: 14px;
    color: #333;
}


/* Modal Footer */
.revestate-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-top: 1px solid #dee2e6;
    gap: 12px;
}

.revestate-modal-button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.revestate-modal-button.button-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #dee2e6;
}

.revestate-modal-button.button-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.revestate-modal-button.button-primary {
    background: #28a745;
    color: #fff;
}

.revestate-modal-button.button-primary:hover {
    background: #218838;
}

/* Modal Responsive */
@media (max-width: 768px) {
    .revestate-modal {
        padding: 10px;
    }
    
    .revestate-modal-content {
        max-height: 95vh;
    }
    
    .revestate-modal-header,
    .revestate-modal-body,
    .revestate-modal-footer {
        padding: 15px;
    }
    
    .filter-checkboxes-2cols {
        grid-template-columns: 1fr;
    }
    
    .revestate-modal-footer {
        flex-direction: column;
    }
    
    .revestate-modal-button {
        width: 100%;
    }
}

/* Screen Reader Only */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}



/* ========================================
   HALFMAP VIEW - SPLIT SCREEN LAYOUT
   ======================================== */

/* Contenitore principale della halfmap view */
.revestate-halfmap-view {
    margin-bottom: 30px;
}

/* Container del layout split */
.halfmap-container {
    display: flex;
    gap: 0;
    height: 700px;
    background: #fff;
    border-radius: 3px;
    box-shadow: var(--revestate-shadow);
    overflow: hidden;
}

/* Lista immobili a sinistra (40%) */
.halfmap-listings {
    flex: 0 0 40%;
    width: 40%;
    overflow: hidden;
    border-right: 1px solid var(--revestate-border);
    display: flex;
    flex-direction: column;
}

/* Contenitore scrollabile per le card */
.halfmap-listings-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: var(--revestate-light);
}

/* Scrollbar personalizzata per la lista */
.halfmap-listings-scroll::-webkit-scrollbar {
    width: 10px;
}

.halfmap-listings-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.halfmap-listings-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.halfmap-listings-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Card nella halfmap - layout verticale compatto */
.halfmap-listings .revestate-card {
    margin-bottom: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
	display:flex;
}


@media (min-width: 1024px) {
.halfmap-listings .revestate-card {display:grid;grid-template-columns: 1fr 2fr;}
.halfmap-listings .revestate-card-image {display:contents;object-fit: cover;width:}
}

.halfmap-listings .revestate-card:last-child {
    margin-bottom: 0;
}

/* Hover effect sulle card */
.halfmap-listings .revestate-card:hover,
.halfmap-listings .revestate-card.halfmap-hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
    border-left: 4px solid var(--revestate-primary);
}

/* Highlight effect quando si clicca su un marker */
.halfmap-listings .revestate-card.halfmap-highlight {
    animation: halfmapPulse 2s ease-in-out;
    border-left: 4px solid var(--revestate-success);
}

@keyframes halfmapPulse {
    0%, 100% {
        background-color: #fff;
    }
    50% {
        background-color: #e8f5e9;
    }
}

/* Immagine più piccola nelle card halfmap */
.halfmap-listings .revestate-card-image {
    height: 180px;
}

/* Mappa a destra (60%) */
.halfmap-map {
    flex: 0 0 60%;
    width: 60%;
    position: relative;
}

/* Map container */
#revestate-halfmap {
    height: 100%;
    width: 100%;
}

/* InfoWindow personalizzata */
.halfmap-map .revestate-infowindow {
    max-width: 280px;
}

.halfmap-map .revestate-infowindow img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.halfmap-map .revestate-infowindow h4 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.halfmap-map .revestate-infowindow h4 a {
    color: var(--revestate-dark);
    text-decoration: none;
    transition: color 0.3s;
}

.halfmap-map .revestate-infowindow h4 a:hover {
    color: var(--revestate-primary);
}

.halfmap-map .revestate-infowindow .price {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--revestate-primary);
}

/* No results nella halfmap */
.halfmap-listings .revestate-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 3px;
}

/* ========================================
   RESPONSIVE DESIGN - HALFMAP VIEW
   ======================================== */

/* Tablet landscape */
@media (max-width: 1024px) {
    .halfmap-container {
        height: 600px;
    }
    
    .halfmap-listings {
        flex: 0 0 45%;
        width: 45%;
    }
    
    .halfmap-map {
        flex: 0 0 55%;
        width: 55%;
    }
}

/* Tablet portrait e mobile */
@media (max-width: 768px) {
    /* Stack verticale invece di split-screen */
    .halfmap-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .halfmap-listings {
        flex: 0 0 auto;
        width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 2px solid var(--revestate-border);
    }
    
    .halfmap-map {
        flex: 0 0 auto;
        width: 100%;
        height: 50vh;
        min-height: 400px;
        position: sticky;
        top: 0;
    }
    
    /* Riduci padding nelle card mobile */
    .halfmap-listings-scroll {
        padding: 15px;
    }
    
    .halfmap-listings .revestate-card {
        margin-bottom: 15px;
    }
    
    .halfmap-listings .revestate-card-image {
        height: 160px;
    }
    
    /* Disabilita l'effetto translateX su mobile */
    .halfmap-listings .revestate-card:hover,
    .halfmap-listings .revestate-card.halfmap-hover {
        transform: none;
        border-left: 3px solid var(--revestate-primary);
    }
}

/* Mobile small */
@media (max-width: 480px) {
    .halfmap-container {
        border-radius: 4px;
    }
    
    .halfmap-listings {
        max-height: 45vh;
    }
    
    .halfmap-map {
        height: 55vh;
        min-height: 350px;
    }
    
    .halfmap-listings-scroll {
        padding: 10px;
    }
    
    .halfmap-listings .revestate-card {
        margin-bottom: 12px;
    }
    
    .halfmap-listings .revestate-card-image {
        height: 140px;
    }
    
    .halfmap-listings .revestate-card-content {
        padding: 15px;
    }
    
    .halfmap-listings .revestate-card-title {
        font-size: 1.1em;
    }
    
    /* InfoWindow più piccola su mobile */
    .halfmap-map .revestate-infowindow {
        max-width: 220px;
    }
    
    .halfmap-map .revestate-infowindow h4 {
        font-size: 1em;
    }
    
    .halfmap-map .revestate-infowindow .price {
        font-size: 1.1em;
    }
}

/* Alternative layout: tabs on mobile (optional) */
.halfmap-mobile-tabs {
    display: none;
}

@media (max-width: 768px) {
    /* Uncomment to enable tab layout on mobile
    .halfmap-mobile-tabs {
        display: flex;
        background: #fff;
        border-bottom: 2px solid var(--revestate-border);
    }
    
    .halfmap-mobile-tabs button {
        flex: 1;
        padding: 15px;
        background: transparent;
        border: none;
        border-bottom: 3px solid transparent;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.3s;
    }
    
    .halfmap-mobile-tabs button.active {
        border-bottom-color: var(--revestate-primary);
        color: var(--revestate-primary);
    }
    
    .halfmap-container {
        flex-direction: column;
    }
    
    .halfmap-listings,
    .halfmap-map {
        display: none;
        width: 100%;
        height: auto;
    }
    
    .halfmap-listings.active,
    .halfmap-map.active {
        display: block;
    }
    
    .halfmap-map.active {
        height: 70vh;
    }
    */
}

/* Print styles */
@media print {
    .revestate-halfmap-view {
        display: none;
    }
}



/* ============================================
   REVESTATE SLIDER (CAROUSEL)
   ============================================ */

/* Container principale dello slider */
.revestate-slider-container {
    position: relative;
    padding: 60px 50px 80px;
    margin: 40px 0;
}

/* Slider Swiper */
.revestate-slider {
    overflow: hidden;
}

/* Slide individuali */
.revestate-slider .swiper-slide {
    height: auto;
    display: flex;
}

/* Card all'interno delle slide */
.revestate-slider .revestate-card {
    height: 100%;
    width: 100%;
    margin: 0; /* Override eventuali margini della grid */
}

/* ============================================
   NAVIGATION BUTTONS (Frecce)
   ============================================ */

.revestate-slider .swiper-button-prev,
.revestate-slider .swiper-button-next {
    color: var(--revestate-primary);
    background: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.revestate-slider .swiper-button-prev:after,
.revestate-slider .swiper-button-next:after {
    font-size: 20px;
    font-weight: bold;
}

.revestate-slider .swiper-button-prev:hover,
.revestate-slider .swiper-button-next:hover {
    background: var(--revestate-primary);
    color: #fff;
    transform: scale(1.1);
}

.revestate-slider .swiper-button-prev.swiper-button-disabled,
.revestate-slider .swiper-button-next.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ============================================
   PAGINATION DOTS
   ============================================ */

.revestate-slider .swiper-pagination {
    bottom: 30px !important;
}

.revestate-slider .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #d1d1d1;
    opacity: 1;
    transition: all 0.3s ease;
}

.revestate-slider .swiper-pagination-bullet-active {
    background: var(--revestate-primary);
    width: 30px;
    border-radius: 6px;
}

.revestate-slider .swiper-pagination-bullet:hover {
    background: var(--revestate-secondary);
    transform: scale(1.2);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .revestate-slider-container {
        padding: 40px 20px 70px;
    }
    
    .revestate-slider .swiper-button-prev,
    .revestate-slider .swiper-button-next {
        width: 40px;
        height: 40px;
    }
    
    .revestate-slider .swiper-button-prev:after,
    .revestate-slider .swiper-button-next:after {
        font-size: 16px;
    }
    
    .revestate-slider .swiper-pagination {
        bottom: 20px !important;
    }
}

@media (max-width: 480px) {
    .revestate-slider-container {
        padding: 30px 10px 60px;
    }
    
    /* Nascondi le frecce su schermi molto piccoli (solo touch) */
    .revestate-slider .swiper-button-prev,
    .revestate-slider .swiper-button-next {
        display: none;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */

.revestate-slider.swiper-initialized {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.revestate-slider:not(.swiper-initialized) {
    opacity: 0.5;
}

/* ============================================
   FALLBACK GRID (se Swiper non si carica)
   ============================================ */

.no-js .revestate-slider .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.no-js .revestate-slider .swiper-slide {
    height: auto;
}



/* ============================================
   NEW GALLERY GRID LAYOUT
   Layout: 1 large image left + 3 vertical images right
   ============================================ */

.revestate-gallery-grid {
    margin-bottom: 30px;
}

/* Grid container */
.revestate-gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    height: 600px;
    border-radius: 3px;
    overflow: hidden;
}

/* Immagine grande a sinistra */
.gallery-grid-main {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    background: var(--revestate-light);
}

.gallery-grid-main .gallery-grid-item {
    width: 100%;
    height: 100%;
}

/* Colonna destra con 3 immagini */
.gallery-grid-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gallery-grid-sidebar .gallery-grid-item {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    background: var(--revestate-light);
    min-height: 0;
}

/* Singolo item della gallery */
.gallery-grid-item {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Immagini nella gallery */
.gallery-grid-item .gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.gallery-grid-item:hover .gallery-image {
    opacity: 0.9;
}

/* Overlay con "+X" */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.gallery-grid-item:hover .gallery-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.overlay-text {
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ============================================
   GALLERY MODAL
   Fullscreen modal with vertical scrolling
   ============================================ */

.revestate-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    animation: galleryModalFadeIn 0.3s ease;
}

@keyframes galleryModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Overlay scuro */
.gallery-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
}

/* Contenuto del modal */
.gallery-modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px;
    z-index: 2;
}

/* Pulsante chiusura */
.gallery-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3;
    backdrop-filter: blur(10px);
}

.gallery-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.gallery-modal-close .dashicons {
    width: 30px;
    height: 30px;
    font-size: 30px;
}

/* Container delle immagini - layout verticale */
.gallery-modal-images {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* Wrapper per ogni immagine */
.gallery-modal-image-wrapper {
    width: 100%;
    max-width: 1000px;
    background: #000;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: galleryImageSlideIn 0.4s ease;
}

@keyframes galleryImageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Immagine nel modal */
.gallery-modal-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Scrollbar personalizzata per il modal */
.revestate-gallery-modal::-webkit-scrollbar {
    width: 12px;
}

.revestate-gallery-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.revestate-gallery-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
}

.revestate-gallery-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Previeni lo scroll del body quando il modal è aperto */
body.gallery-modal-open {
    overflow: hidden;
}

/* ============================================
   RESPONSIVE - GALLERY GRID
   ============================================ */

/* Tablet landscape */
@media (max-width: 1024px) {
    .revestate-gallery-grid {
        height: 500px;
        gap: 12px;
    }
    
    .gallery-grid-sidebar {
        gap: 12px;
    }
    
    .overlay-text {
        font-size: 40px;
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .revestate-gallery-grid {
        height: 400px;
        gap: 10px;
    }
    
    .gallery-grid-sidebar {
        gap: 10px;
    }
    
    .overlay-text {
        font-size: 36px;
    }
    
    .gallery-modal-content {
        padding: 70px 15px 30px;
    }
    
    .gallery-modal-close {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }
    
    .gallery-modal-close .dashicons {
        width: 25px;
        height: 25px;
        font-size: 25px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    /* Stack layout verticale su mobile */
    .revestate-gallery-grid {
        grid-template-columns: 1fr;
        height: auto;
        gap: 10px;
    }
    
    .gallery-grid-main {
        height: 300px;
    }
    
    .gallery-grid-sidebar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        height: auto;
    }
    
    .gallery-grid-sidebar .gallery-grid-item {
        height: 120px;
    }
    
    .overlay-text {
        font-size: 28px;
    }
    
    .gallery-modal-content {
        padding: 60px 10px 20px;
    }
    
    .gallery-modal-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .gallery-modal-close .dashicons {
        width: 22px;
        height: 22px;
        font-size: 22px;
    }
    
    .gallery-modal-images {
        gap: 15px;
    }
}

/* Mobile small */
@media (max-width: 480px) {
    .gallery-grid-main {
        height: 250px;
    }
    
    .gallery-grid-sidebar .gallery-grid-item {
        height: 100px;
    }
    
    .overlay-text {
        font-size: 24px;
    }
}

/* === TAXONOMY CARD STYLES === */
/* Card container */
.revestate-taxonomy-card {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--revestate-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.revestate-taxonomy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Stile con background-image */
.revestate-taxonomy-card-image {
    position: relative;
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.revestate-taxonomy-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 180px;
}

.revestate-taxonomy-card-image .revestate-taxonomy-card-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.revestate-taxonomy-card-image .revestate-taxonomy-card-count {
    font-size: 16px;
    margin: 0 0 15px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.revestate-taxonomy-card-image .revestate-taxonomy-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 10px 20px;
    background: var(--revestate-primary);
    border-radius: 6px;
    transition: background 0.3s ease, gap 0.3s ease;
    width: fit-content;
}

.revestate-taxonomy-card-image .revestate-taxonomy-card-link:hover {
    background: #0056b3;
    gap: 12px;
}

/* Stile con tag img */
.revestate-taxonomy-card-wrapper {
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

.revestate-taxonomy-card-img-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.revestate-taxonomy-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.revestate-taxonomy-card:hover .revestate-taxonomy-card-img {
    transform: scale(1.05);
}

.revestate-taxonomy-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.revestate-taxonomy-card-wrapper .revestate-taxonomy-card-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--revestate-dark);
}

.revestate-taxonomy-card-wrapper .revestate-taxonomy-card-count {
    font-size: 15px;
    margin: 0;
    color: var(--revestate-secondary);
    font-weight: 500;
}

.revestate-taxonomy-card-wrapper .revestate-taxonomy-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--revestate-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: gap 0.3s ease, color 0.3s ease;
    width: fit-content;
}

.revestate-taxonomy-card-wrapper .revestate-taxonomy-card-link:hover {
    color: #0056b3;
    gap: 12px;
}

/* Stile senza immagine */
.revestate-taxonomy-card-no-image {
    background: linear-gradient(135deg, var(--revestate-primary) 0%, #0056b3 100%);
}

.revestate-taxonomy-card-no-image .revestate-taxonomy-card-content {
    padding: 40px 30px;
}

.revestate-taxonomy-card-no-image .revestate-taxonomy-card-title {
    color: white;
    font-size: 26px;
}

.revestate-taxonomy-card-no-image .revestate-taxonomy-card-count {
    color: rgba(255, 255, 255, 0.9);
}

.revestate-taxonomy-card-no-image .revestate-taxonomy-card-link {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.revestate-taxonomy-card-no-image .revestate-taxonomy-card-link:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Arrow animation */
.revestate-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.revestate-taxonomy-card-link:hover .revestate-arrow {
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 768px) {
    .revestate-taxonomy-card-image {
        height: 250px;
    }
    
    .revestate-taxonomy-card-overlay {
        padding: 20px;
        min-height: 150px;
    }
    
    .revestate-taxonomy-card-image .revestate-taxonomy-card-title {
        font-size: 24px;
    }
    
    .revestate-taxonomy-card-image .revestate-taxonomy-card-count {
        font-size: 14px;
    }
    
    .revestate-taxonomy-card-wrapper .revestate-taxonomy-card-title {
        font-size: 20px;
    }
    
    .revestate-taxonomy-card-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .revestate-taxonomy-card-image {
        height: 220px;
    }
    
    .revestate-taxonomy-card-overlay {
        padding: 15px;
        min-height: 130px;
    }
    
    .revestate-taxonomy-card-image .revestate-taxonomy-card-title {
        font-size: 20px;
    }
    
    .revestate-taxonomy-card-image .revestate-taxonomy-card-link {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .revestate-taxonomy-card-content {
        padding: 15px;
    }
}


/* Print styles */
@media print {
    .revestate-gallery-modal {
        display: none !important;
    }
    
    .gallery-overlay {
        display: none !important;
    }
}
