/* =============================================================================
   RICOSTRUTTORE — Design Tokens
   ============================================================================= */

:root {
    --blu-petrolio:   #2B5C89;
    --blu-notte:      #21364e;
    --carta-zucchero: #568EA6;
    --oro-antico:     #ceaa55;
    --giallo-opaco:   #ceaa5566;

    --grigio-luce:      #f8f8f8;
    --grigio-argento:   #ccc;
    --grigio-cenere:    #adadad;
    --grigio-antracite: #333;

    --nero-footer:    #181818;
}


/* =============================================================================
   RICOSTRUTTORE — Reset & Base
   ============================================================================= */

html, body {
    font-size: 16px;
}

#ricostruttore h1,
#ricostruttore h2,
#ricostruttore h3,
#ricostruttore h4,
#ricostruttore h5,
#ricostruttore h6 {
    font-family: 'PT Sans Narrow', sans-serif;
    font-weight: 500;
    line-height: 1.1;
    color: var(--grigio-antracite);
}

#ricostruttore h1 {
    margin-top: 0;
    margin-bottom: 0; 
    font-size: 36px;
    white-space: nowrap;
}

body#ricostruttore {
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: var(--grigio-antracite);
    overflow: hidden;
    font-family: 'Dosis', sans-serif;
    height: 100vh;
}


/* =============================================================================
   RICOSTRUTTORE — Utility
   ============================================================================= */

#ricostruttore .u-margin-0 {
    margin: 0 !important;
}

#ricostruttore .u-flex-1 {
    flex: 1;
}

#ricostruttore .highlight {
    background-color: var(--giallo-opaco);
    border-radius: 2px;
    padding: 0 1px;
    font-weight: bold;
    color: var(--grigio-antracite);
}

#ricostruttore .u-hidden {
    display: none !important;
}

#ricostruttore .u-h-80 {
    height: 80px;
}


/* =============================================================================
   RICOSTRUTTORE — Bootstrap Override
   ============================================================================= */

.btn-default {
    color: var(--grigio-antracite) !important;
    background-color: white !important;
    border-color: var(--grigio-argento) !important;
}

.btn-default.active,
.btn-default:active,
.open > .dropdown-toggle.btn-default {
    color: var(--grigio-antracite) !important;
    background-color: var(--grigio-luce) !important;
    background-image: none !important;
    border-color: var(--grigio-cenere) !important;
}


/* =============================================================================
   RICOSTRUTTORE — Layout principale
   ============================================================================= */

#ricostruttore .main-container {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
    align-items: stretch;
}

#ricostruttore #scrivania-osd {
    flex: 1;
    height: 100%;
    position: relative;
    background-color: var(--grigio-antracite);
}

#ricostruttore #placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--grigio-luce);
    font-family: 'PT Sans Narrow', sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    text-align: center;
    pointer-events: none;
    opacity: 0.5;
    z-index: 5;
    max-width: 80%;
    line-height: 1.6;
}


/* =============================================================================
   RICOSTRUTTORE — Sidebar
   ============================================================================= */

#ricostruttore #sidebar {
    min-width: 260px;
    width: fit-content;
    background-color: var(--grigio-luce);
    color: var(--blu-petrolio);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    border-right: 1px solid var(--grigio-argento);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

#ricostruttore .header-flex-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

#ricostruttore .header-flex-container .info {
    cursor: pointer;
    color: var(--blu-petrolio);
    font-size: 1.2rem;
    transition: transform 0.2s;
}

#ricostruttore .header-flex-container .info:hover {
    transform: scale(1.2);
}

#ricostruttore #sidebar h2,
#ricostruttore .archive-section h3,
#ricostruttore .btn-main {
    font-family: 'Dosis', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

#ricostruttore #sidebar h2 {
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--carta-zucchero);
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: var(--blu-petrolio);
}

#ricostruttore .nav-label {
    display: block;
    margin-bottom: 20px;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--grigio-argento);
    border-left: 4px solid var(--carta-zucchero);
    color: var(--blu-petrolio);
    font-weight: bold;
}

#ricostruttore .nav-label,
#ricostruttore .radio-group label,
#ricostruttore .slider-row span {
    font-family: 'PT Sans Narrow', sans-serif;
    text-transform: uppercase;
    font-weight: 400;
}

#ricostruttore .lingua {
    float: right;
    margin-right: 20px;
}

#ricostruttore #btn-add-folio {
    margin-top: 20px;
    background-color: transparent;
    color: var(--carta-zucchero);
    border: 2px dashed var(--carta-zucchero);
    padding: 15px;
    font-size: 0.9rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

#ricostruttore #btn-add-folio:hover {
    background-color: var(--carta-zucchero);
    color: white;
    border-style: solid;
}

#ricostruttore #btn-add-folio.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    filter: grayscale(1);
}


/* =============================================================================
   RICOSTRUTTORE — Toggle sidebar (Robust Pill Design)
   ============================================================================= */

#ricostruttore .toggle-sidebar-inline {
    display: flex;
    flex-direction: row; /* Allineamento orizzontale */
    align-items: center;
    justify-content: center;
    gap: 8px; /* Spazio tra testo e toggle */
    flex: 1;
}

#ricostruttore .toggle-label-sidebar {
    font-family: 'PT Sans Narrow', sans-serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--blu-petrolio);
    font-weight: bold;
    white-space: nowrap;
}

/* Cornice esterna (Pillola) */
#ricostruttore .toggle-sidebar-inline .toggle.btn {
    min-width: 40px !important;
    height: 20px !important;
    border-radius: 20px !important;
    border: none !important;
    padding: 0 !important;
    background-color: var(--grigio-argento) !important; /* Grigio per OFF */
    transition: background-color 0.2s ease-in-out !important;
    position: relative;
    overflow: hidden;
}

/* Sfondo quando ON */
#ricostruttore .toggle-sidebar-inline .toggle:not(.off) {
    background-color: var(--blu-petrolio) !important;
}

/* BLOCCO CRITICO: impediamo al plugin di spostare il contenuto interno */
#ricostruttore .toggle-sidebar-inline .toggle-group {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    left: 0 !important; /* Forza il contenitore a restare fermo */
    transition: none !important;
}

/* Nascondiamo completamente i testi ON/OFF */
#ricostruttore .toggle-sidebar-inline .toggle-on,
#ricostruttore .toggle-sidebar-inline .toggle-off {
    visibility: hidden !important;
    display: none !important;
}

/* La Maniglia (Cerchio Bianco) */
#ricostruttore .toggle-sidebar-inline .toggle-handle {
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background-color: white !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important; /* Posizione iniziale (OFF) */
    transition: left 0.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
    padding: 0 !important;
    border: none !important;
    min-width: 16px !important;
}

/* Posizionamento a DESTRA quando ON */
#ricostruttore .toggle-sidebar-inline .toggle:not(.off) .toggle-handle {
    left: 22px !important; /* 40px totali - 16px cerchio - 2px margine */
}

/* Stato disabled per il componente Carta Lucida */
#ricostruttore .toggle-sidebar-inline.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    filter: grayscale(1);
}

#ricostruttore .toggle-sidebar-inline.disabled .toggle-label-sidebar {
    color: var(--grigio-cenere);
}


/* =============================================================================
   RICOSTRUTTORE — Pulsanti
   ============================================================================= */

#ricostruttore .btn-main {
    width: 100%;
    padding: 10px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
    transition: background 0.3s;
}

#ricostruttore .btn-main:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#ricostruttore .btn-main:disabled:hover {
    background-color: var(--blu-petrolio);
    border-color: var(--blu-petrolio);
}

#ricostruttore #btn-reset,
#ricostruttore #btn-clear,
#ricostruttore #btn-export,
#ricostruttore #btn-import {
    background-color: var(--blu-petrolio);
    border: 1px solid var(--blu-petrolio);
    font-size: 0.8rem;
}

#ricostruttore #btn-reset:hover,
#ricostruttore #btn-clear:hover,
#ricostruttore #btn-export:hover,
#ricostruttore #btn-import:hover {
    background-color: var(--carta-zucchero);
    border-color: var(--carta-zucchero);
    transition: all 0.3s ease;
}

#ricostruttore .btn-trash {
    background: transparent;
    border: none;
    color: var(--blu-petrolio);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 5px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ricostruttore .btn-trash:hover {
    color: var(--oro-antico);
    transform: scale(1.15);
}

#ricostruttore .btn-order {
    background: white;
    color: var(--blu-petrolio);
    border: 1px solid var(--carta-zucchero);
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.7rem;
}

#ricostruttore .btn-order:hover {
    background: var(--grigio-luce);
}

#ricostruttore .btn-order {
    font-size: 0.8rem;
    padding: 3px 8px;
}

#ricostruttore .btn-order:disabled {
    background-color: var(--grigio-luce);
    color: var(--grigio-cenere);
    border-color: var(--grigio-argento);
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
}

#ricostruttore .btn-order:disabled:hover {
    background-color: var(--grigio-luce);
    color: var(--grigio-antracite);
}

#ricostruttore .btn-only-icon {
    flex: 1;
    width: auto;
    margin-bottom: 0;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

#ricostruttore .btn-close-modal {
    background-color: var(--blu-petrolio);
    width: auto;
    padding: 10px 30px;
    margin-bottom: 0;
}

#ricostruttore .btn-confirm-import {
    background-color: var(--carta-zucchero);
    width: auto;
    padding: 10px 20px;
    margin-bottom: 0;
    margin-right: 10px;
}

#ricostruttore .btn-filigrana-inline {
    background-color: white;
    color: var(--blu-petrolio);
    border: 1px solid var(--grigio-argento);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

#ricostruttore .btn-filigrana-inline:hover {
    background-color: var(--blu-petrolio);
    color: white;
    border-color: var(--blu-petrolio);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#ricostruttore .btn-scelta {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    color: white;
    font-family: 'PT Sans Narrow', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    min-width: 80px;
    margin-left: 10px;
    transition: opacity 0.2s;
}

#ricostruttore .btn-scelta:hover {
    opacity: 0.8;
}

#ricostruttore .btn-si {
    background-color: var(--carta-zucchero);
}

#ricostruttore .btn-no {
    background-color: var(--blu-petrolio);
}


/* =============================================================================
   RICOSTRUTTORE — Sezione archivio
   ============================================================================= */

#ricostruttore .archive-section {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

#ricostruttore .archive-section h3 {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    color: var(--blu-petrolio);
    text-transform: uppercase;
}

#ricostruttore .archive-section .main-buttons-row {
    margin-bottom: 0;
}


/* =============================================================================
   RICOSTRUTTORE — Pannelli folio (accordion)
   ============================================================================= */

.nav {
    font-size: 20px;
    color: var(--grigio-antracite);
}

#ricostruttore .folio-control {
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 6px;
    background-color: white;
    border: 1px solid var(--grigio-argento);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

#ricostruttore .folio-control.active {
    border-color: var(--oro-antico);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#ricostruttore .folio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#ricostruttore .folio-header-label {
    margin: 0;
    flex-grow: 1;
    cursor: pointer;
}

#ricostruttore .folio-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
    opacity: 0;
    cursor: default;
}

#ricostruttore .folio-control.active .folio-content {
    max-height: 500px;
    opacity: 1;
    margin-top: 15px;
    transition: max-height 0.4s ease-in, opacity 0.3s ease-in;
}

#ricostruttore .radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    gap: 10px;
    font-weight: 500;
    color: var(--blu-petrolio);
}

#ricostruttore .order-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

#ricostruttore .order-row-with-thumb {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--grigio-luce);
    gap: 10px;
}

#ricostruttore .level-indicator-wrapper {
    display: flex;
    align-items: center;
}

#ricostruttore .level-indicator {
    font-size: 0.75rem;
    color: var(--blu-petrolio);
    margin-right: 10px;
    font-weight: bold;
}


/* =============================================================================
   RICOSTRUTTORE — Slider
   ============================================================================= */

#ricostruttore .slider-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#ricostruttore .slider-container-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#ricostruttore .slider-container span {
    font-size: 0.85rem;
    color: var(--blu-petrolio);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#ricostruttore .slider-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

#ricostruttore .slider-row input[type="range"] {
    flex: 1;
    min-width: 0;
}

#ricostruttore .slider-row span {
    font-size: 0.75rem;
    color: var(--blu-petrolio);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#ricostruttore .slider-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

#ricostruttore .slider-header-label {
    font-size: 0.85rem;
    color: var(--blu-petrolio);
}

#ricostruttore input[type="range"] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--oro-antico);
}


/* =============================================================================
   RICOSTRUTTORE — Layout righe pulsanti
   ============================================================================= */

#ricostruttore .main-buttons-row {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

#ricostruttore .main-buttons-row .main-buttons-row {
    margin-bottom: 0;
}


/* =============================================================================
   RICOSTRUTTORE — Modali & Toast
   ============================================================================= */

#ricostruttore .custom-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0;
    border: 1px solid var(--blu-petrolio);
    z-index: 1000;
    color: var(--blu-petrolio);
    width: 600px;
    max-width: 90vw;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#ricostruttore #export-modal {
    width: 500px;
}

#ricostruttore #catalog-modal {
    width: 900px;
    max-width: 95vw;
}

#ricostruttore .modal-header-custom {
    background-color: var(--blu-petrolio);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'PT Sans Narrow', sans-serif;
}

#ricostruttore .modal-header-custom h3 {
    margin: 0;
    font-size: 1.25rem;
    color: white;
    font-weight: 400;
}

#ricostruttore .modal-confirm-mini {
    width: auto;
    min-width: 350px;
    max-width: 95vw;
}

#ricostruttore .modal-confirm-mini .modal-header-custom h3 {
    padding-right: 30px;
}

#ricostruttore .close-modal-x {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

#ricostruttore .close-modal-x:hover {
    opacity: 1;
}

#ricostruttore .modal-body-custom {
    padding: 20px;
    font-size: 1.25em;
    color:#333333;
}

#ricostruttore .modal-help-text {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--grigio-antracite);
}

#ricostruttore .modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

#ricostruttore .modal-confirm-mini .modal-footer-actions {
    margin-top: 0;
}

#ricostruttore #toast-notification {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--blu-petrolio);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    border: 2px solid var(--oro-antico);
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-family: sans-serif;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}


/* =============================================================================
   RICOSTRUTTORE — Esportazione
   ============================================================================= */

#ricostruttore .copy-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 25px;
}

#ricostruttore .export-field {
    flex: 1;
    padding: 10px;
    background: var(--grigio-luce);
    border: 1px solid var(--grigio-argento);
    border-radius: 4px;
    box-sizing: border-box;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--grigio-antracite);
    resize: none;
}

#ricostruttore .copy-btn {
    background: var(--carta-zucchero);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: background 0.2s;
}

#ricostruttore .copy-btn:hover {
    background: var(--blu-petrolio);
}


/* =============================================================================
   RICOSTRUTTORE — Catalogo
   ============================================================================= */

#ricostruttore .catalog-header-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

#ricostruttore .catalog-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

#ricostruttore .catalog-option-label {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--blu-petrolio);
    text-transform: uppercase;
}

#ricostruttore .catalog-search {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid var(--grigio-argento);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
}

#ricostruttore .collection-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--grigio-argento);
}

#ricostruttore .tab-btn {
    padding: 8px 15px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--blu-petrolio);
    font-weight: bold;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
}

#ricostruttore .tab-btn.active {
    border-bottom-color: var(--oro-antico);
    background: var(--grigio-luce);
}

#ricostruttore .tab-btn.disabled {
    color: var(--grigio-cenere);
    cursor: not-allowed;
    border-bottom: 3px solid transparent;
    opacity: 0.6;
}

#ricostruttore .tab-btn.disabled:hover {
    background: none;
}

#ricostruttore .catalog-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--grigio-argento);
    border-radius: 6px;
}

#ricostruttore .catalog-list.grid-2-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

#ricostruttore .catalog-list.grid-2-columns .catalog-item:nth-child(odd) {
    border-right: 1px solid var(--grigio-luce);
}

#ricostruttore .catalog-item {
    padding: 10px;
    border-bottom: 1px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

#ricostruttore .catalog-item:hover {
    background: var(--grigio-luce);
}

#ricostruttore .catalog-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

#ricostruttore .catalog-item-title {
    font-weight: bold;
    color: var(--blu-petrolio);
}

#ricostruttore .catalog-item-label {
    font-weight: bold;
    color: var(--blu-petrolio);
    white-space: nowrap;
    line-height: 1.2;
}

#ricostruttore .catalog-thumb {
    width: 50px;
    height: 50px;
    background-color: var(--grigio-luce);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    display: block;
    flex-shrink: 0;
}

#ricostruttore .catalog-thumb-small {
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 4px;
    border: 1px solid var(--grigio-argento);
    flex-shrink: 0;
    background-color: var(--grigio-luce);
    display:none !important;
}

#ricostruttore .fili-wrapper {
    grid-column: 1 / -1;
    background: white;
    border-left: 2px solid var(--oro-antico);
}

#ricostruttore .item-fili {
    padding-left: 30px !important;
    border-bottom: 1px dashed var(--grigio-argento);
}


/* =============================================================================
   RICOSTRUTTORE — Toggle switch
   ============================================================================= */

#ricostruttore .modern-toggler {
    display: inline-block;
    vertical-align: middle;
}

#ricostruttore .pure-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    margin: 0;
}

#ricostruttore .pure-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

#ricostruttore .pure-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--grigio-argento);
    transition: .4s;
    border-radius: 34px;
}

#ricostruttore .pure-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

#ricostruttore .pure-switch input:checked + .slider {
    background-color: var(--blu-petrolio);
}

#ricostruttore .pure-switch input:checked + .slider:before {
    transform: translateX(22px);
}


/* =============================================================================
   RICOSTRUTTORE — Navbar
   ============================================================================= */

#ricostruttore .selezionato {
    text-decoration: underline;
    visibility: visible !important;
}

#ricostruttore .logoMG {
    background-color: var(--blu-notte);
}

#ricostruttore .logoMG img {
    padding: 3px 5px 6px 3px;
    max-height: 40px;
}

#ricostruttore .navbar {
    border-radius: 0;
    -webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.3);
    -moz-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.3);
    box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.3);
    margin-bottom: 0;
    min-height: initial;
}

#ricostruttore .navbar-brand {
    padding: 0;
    height: auto;
}

#ricostruttore .navbar-header button[aria-expanded="true"]:before {
    content: "";
}

#ricostruttore .navbar-header button[aria-expanded="false"]:before {
    content: "";
}

@media (min-width: 768px) {
    #ricostruttore .navbar-header {
        float: initial;
        text-align: center;
        margin: 0 auto;
    }
    #ricostruttore .navbar-nav > li > a {
        padding-top: 5px;
        padding-bottom: 5px;
    }
    #ricostruttore .navbar-nav {
        float: right;
    }
}

@media (max-width: 767px) {
    #ricostruttore .navbar-default .navbar-collapse,
    .navbar-default .navbar-form {
        background-color: white;
        box-shadow: 5px 5px 10px var(--grigio-argento);
    }
    #ricostruttore .navbar-brand {
        max-width: 80%;
    }
    #ricostruttore .navbar-header img {
        max-width: 80%;
    }
}


/* =============================================================================
   RICOSTRUTTORE — Footer
   ============================================================================= */

#ricostruttore #footer {
    background-color: var(--nero-footer);
    padding: 15px;
    bottom: 0;
    width: 100%;
}

#ricostruttore #footer a {
    color: white;
    text-decoration: none;
}

#ricostruttore .grid.tabfooter {
    display: flex;
}

#ricostruttore .grid {
    display: contents;
}

#ricostruttore .totop {
    margin-right: 20px;
    font-size: medium;
    text-align: right;
    width: 10%;
}

@media (max-width: 767px) {
    #ricostruttore .totop {
        display: none;
    }
}

#ricostruttore .copyright {
    color: white;
    display: flex;
    flex: 1;
    justify-content: center;
    padding: 0 5px;
}

#ricostruttore .crediti {
    text-align: center;
}

#ricostruttore .intro {
    width: 80%;
    display: block;
    margin: 0 auto;
}

/* --- Fix UI per Modali jQuery UI (Info Modal) --- */
.ui-dialog.important-zindex {
    z-index: 10001 !important; /* Deve stare sopra OpenSeadragon e altre modali */
}

.headerModale .ui-dialog-titlebar-close {
    top: 50% !important;
    margin-top: -10px !important;
    height: 20px !important;
    background: transparent !important;
    border: none !important;
}

.headerModale .ui-dialog-titlebar-close span {
    margin: -8px !important;
}

.ui-dialog-titlebar {
    background-color: var(--blu-petrolio) !important;
    color: white !important;
    border: none !important;
    font-family: 'PT Sans Narrow', sans-serif !important;
}

#infoModal {
    display: none;
}

/* =============================================================================
   RICOSTRUTTORE — Soluzione C (Cella Affiancata con Dummy)
   ============================================================================= */

/* Quando la griglia a due colonne è attiva, forziamo l'accordion a occupare una sola cella (50%) */
#ricostruttore .catalog-list.grid-2-columns .fili-wrapper {
    grid-column: auto !important;
    background: #fffdf9 !important; /* Un avorio leggero per staccare visivamente dai fogli */
    border-left: 2px solid var(--oro-antico) !important;
}

/* Rendiamo la cella di riempimento dummy completamente invisibile e impenetrabile al mouse */
#ricostruttore .fili-dummy {
    visibility: hidden !important;
    pointer-events: none !important;
    background: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* Evitiamo che la cella dummy si evidenzi al passaggio del mouse */
#ricostruttore .catalog-item.fili-dummy:hover {
    background: none !important;
}