/* ==========================================================================
   1. GLOBALS
   ========================================================================== */
.container.mx-auto {
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }

/* ==========================================================================
   2. PAGINA ELENCO / ARCHIVIO (Filtri + Griglia)
   ========================================================================== */
.annunci-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

@media (min-width: 992px) {
    .annunci-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Sidebar filtri */
.sidebar-filtri {
    width: 100%;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

@media (min-width: 992px) {
    .sidebar-filtri {
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 20px;
    }
}

.sidebar-filtri h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #1f2937;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.filter-form-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #4b5563;
    text-transform: uppercase;
}

.filter-group input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: white;
}

.btn-search {
    background: #1e293b;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    margin-top: 10px;
}

.btn-search:hover { background: #334155; }

.btn-reset {
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    text-decoration: none;
    margin-top: 5px;
}

/* Griglia annunci catalogo */
.content-annunci { flex-grow: 1; }

.griglia-annunci {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Card scheda catalogo */
.scheda {
    background: #ffffff;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
}

.scheda:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.scheda img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.scheda .titolo { padding: 15px 15px 5px 15px; }
.scheda .titolo strong {
    font-size: 1.1rem;
    color: #1f2937;
    line-height: 1.3;
}

.scheda .caratteristiche { padding: 0 15px; margin: 10px 0; }
.scheda .caratteristiche ul {
    list-style: none;
    padding: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 !important;
}

.scheda ul li {
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #4b5563;
    box-shadow: 1px 1px 1px #ddd;
}

.scheda .prezzo {
    padding: 15px;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
}

.scheda .prezzo strong {
    color: #d97706;
    font-size: 1.25rem;
    display: block;
    text-align: right;
}

/* Dropdown filtri */
.dropdown-checkbox {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 12px;
    overflow: hidden;
}

.dropdown-label {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 600;
}

.dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.dropdown-checkbox.is-active .dropdown-content {
    max-height: 300px;
    border-top: 1px solid #f1f5f9;
    padding: 10px 15px;
}

.arrow { transition: transform 0.3s ease; }
.dropdown-checkbox.is-active .arrow { transform: rotate(180deg); }

/* ==========================================================================
   3. PAGINA SINGOLO ANNUNCIO (Layout 2/3 + 1/3)
   ========================================================================== */
.grid-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1280px) {
    .grid-main {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
    .col-span-2 {
        grid-column: span 2 / span 2;
    }
    .xl-sticky {
        position: sticky;
        top: 2rem;
    }
}

/* Dati tecnici centrali (Griglia flessibile) */
.dati-tecnici-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .dati-tecnici-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Sidebar specifiche & box */
.sidebar-box {
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.sidebar-data-list { list-style: none; padding: 0; margin: 0; }
.sidebar-data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.sidebar-data-label { color: #64748b; font-size: 0.875rem; }
.sidebar-data-value { color: #1e293b; font-weight: 700; font-size: 0.875rem; }

/* Dotazioni (Grid responsive) */
.grid-dotazioni {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 640px) { .grid-dotazioni { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .grid-dotazioni { grid-template-columns: repeat(3, 1fr); gap: 15px 30px; } }

.dotazione-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.4;
}

.spunta { color: #2563eb; margin-right: 10px; font-weight: bold; flex-shrink: 0; }

/* Swiper & Lightbox fix */
.swiper-slide { height: auto !important; }
.swiper-button-next, .swiper-button-prev { opacity: 0; transition: opacity 0.3s; }
.group:hover .swiper-button-next, .group:hover .swiper-button-prev { opacity: 1; }

/* Controllo visibilità blocchi mobile/desktop */
@media (max-width: 1279px) {
    .hidden-mobile { display: none; }
    .mobile-only-block, .mobile-header { display: block; }
}
@media (min-width: 1280px) {
    .mobile-only-block, .mobile-header { display: none; }
}