body { background-color: white; }
  .navbar2 { 
    background-color: white !important;
    display: flex;
    border-bottom: slategrey 1px solid;  
    min-height: 56px;
  }
  .navbar-brand, .nav-link { color: black; padding-top: 4px !important; padding-bottom: 4px !important; }
  .navbar-container { display: flex; width: 100%; justify-content: space-between; align-items: center; }
  .navbar-left { display: flex; align-items: center; gap: 15px; }
  .navbar-nav { flex-grow: 1; display: flex; justify-content: center; gap: 10px; }
  .navbar-nav2 { flex-grow: 1; display: flex; justify-content: center;}
  .sidebar { overflow-y: auto; background: whitesmoke; padding: 5px; box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); }
  .list-group-item { cursor: pointer; transition: background 0.3s; }
  .sub-list { display: none; padding-left: 0;}
  
  .product-card {
      background: white;
      border-radius: 7px;
      box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
      padding: 0px;
      text-align: center;
      transition: transform 0.3s ease;
      width: 95%;
      height: auto;         /* permette altezza variabile */
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-left: 5px;
      margin-top: 5px;
  }

  .product-card img {
      /* width: 120px;
      height: 120px; */
      object-fit: cover;    /* mantiene proporzione tagliando se necessario */
      display: block;
  }

  .product-card p {
      font-family: "Segoe UI", Arial, sans-serif;
      color: slategray;
      padding: 3px;
      padding-bottom: 0;
      margin: 0;
      font-size: 14px;
      word-break: break-word;  /* evita overflow su nomi lunghi */
  }

  .settore.selected { background-color: #007bff !important; color: white !important; border-radius: 5px; }    

  /* Miglioramento della visualizzazione delle categorie e sub-categorie */
  .categoria, .prima-subcategoria, .seconda-subcategoria {            
      border-radius: 5px;
      /* margin: 5px 0; */
      padding: 5px;
      /* font-weight: bold; */        
  }
  /* .categoria {
      background-color: lightslategray;
      color: white;            
  } */
  .categoria.selected, .prima-subcategoria.selected, .seconda-subcategoria.selected {
     background-color: steelblue !important;
     color: white;
     font-weight: bold;
  }
  .prima-subcategoria.selected span {
     background-color: steelblue !important;
     color: white;
     font-weight: bold;
  }
  .prima-subcategoria, .seconda-subcategoria {           
      /* border: 1px solid #dee2e6; */
      border-radius: 5px;
      padding: 0px;
      /* margin-left: 20px; */
  }
  .sub-list {
      list-style: none;
      /* padding-left: 15px; */            
      border-radius: 5px;
  }
  .toggle-icon {
      font-size: 12px;
      position: absolute;
      right: 10px;
      padding: 2px;
  }
  /* .btn-primary:hover {
      background-color: #007bff;
      color: white !important;
      border-radius: 5px;
  } */
  .nav-item2 {
      color: white;
      font-weight: 600;
      background-color: slategrey;
      border: slategrey 1px solid;
      border-radius: 5px;
      width: 145px;
      cursor: pointer;
  }
  /* .btn-primary {
      color: white;
  } */
  .list-group-item {
      border: 1px solid #dee2e6 !important;
  }
  .my-btn{
      border: none;
      background-color: white;
      color: black
  }
  .descrizione {
      font-size: xx-small;
  }
  .nav-item2 {
      height: 50px;
      display: flex;
      justify-content: center; /* centra orizzontalmente */
      align-items: center;     /* centra verticalmente */
      text-align: center;      /* centra il testo dentro il bottone */            
  }        
  .nav-link {
      color: black;
  }
  /* .settore:hover{
      color: white !important;
      background-color: #007bff !important;
  } */
  /* .categoria{
      background-color: slategrey;
      color: white;
  }
  .prima-subcategoria{
      background-color: grey;
      color: white;
  } */

  .product-card:hover{
      box-shadow: 0 0 20px 0 slategrey;
  }

  .nav-item {
        text-align: center;
      }

  @media (max-width: 767.98px) {
  /* #barratop {
    display: none !important;
  } */
  .sidebar { 
    height: auto; 
  }
  #contenitoreEsterno {
    height: auto !important;
  }
  #prodotti-container { 
    height: auto !important; 
  }
  #openCarrello {
    position: fixed;
    bottom: 10px;
    z-index: 100;
  }
  footer {
    padding-bottom: 50px;
  }
  .carousel-item img {
    height: 150px;
  }
}
/* @media (max-width: 767.98px) {
  .sidebar {
    display: none;
  }
  .sidebar.show {
    display: block;
  }
} */

@media (max-width: 410px) {      
      .nav-item2 {
          width: 100%;
          color: white;
          font-weight: 600;
          background-color: slategrey;            
          border: slategrey 1px solid;
          border-radius: 5px;
      }      
      #prodotti-container {
          margin-left: 0 !important;
      }      
      #openCarrello {
        width: 261px;
      }      
  }

  li.settore {
      margin: 3px;
      color: white;            
      background-color: slategrey;                    
      border: slategrey 1px solid;
      border-radius: 5px;
  }
  
  .row {
      --bs-gutter-x: 0 !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
  }

  /* Sidebar ha larghezza fissa */
  .sidebar {            
            height: 99%;    /* 99% di 87vh */            
            width: 360px;            
            overflow-y: auto;
            background: whitesmoke;
            padding: 5px;
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        }

        /* Colonna principale dei contenuti */
        .content {
          /* height: 60vh; */
          min-width: 0; /* evita problemi di overflow */
          /* overflow-y: auto; */
        }

        /* Comportamento mobile */
        @media (max-width: 767.98px) {
            #main-layout {
                flex-direction: column;
            }
            .sidebar {
                width: 100% !important;
                height: auto;
            }
        }
        #settori-container {
            display: flex;
            flex-wrap: nowrap; /* NON permette l'andata a capo */
            justify-content: start; /* centra i bottoni */   
            min-height: 61px;          
            /* margin-left: 150px; */
        }

        #settori-container .nav-item2 {
            flex: 0 0 135px; /* larghezza fissa ma si adatta a flex */
            margin: 5px 2px;
        }

        .container-fluid {            
            justify-content: center !important;
        }

        .col-6, .col-md-4, .col-lg-2 {
          padding-left: 5px !important;
          padding-right: 5px !important;
          padding-top: 15px !important;
        }

        .custom-img {
          height: 40px; /* o come preferisci */
        }
        
        #rigaCarrello {
          background-color: #f8f9fa; 
          height: 55px;
          border-top: slategrey 1px solid;
          border-bottom: slategrey 1px solid;
        }

        @media (max-width: 1020px) {                
          #spaziaturaCarrello {
            justify-content: center !important;
          }

          #sitoAva {
            display: none;
          }

          #immagineAva {
            display: none;
          }

          #rigaCarrello {
            background-color: white !important;
            border-top: 0px !important;
            border-bottom: 0px !important;
          }

          #openCarrello {
            height: 38px !important;
          }
    }

    #footer {
    position: relative;
    margin-top: 10px; /* negative value of footer height */
    height: 80px;      
    clear:both;
    }

    .selected-card {
      border: 2px solid #009846 !important; /* Blu Bootstrap */
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
      transition: all 0.3s ease;
    }

    .fa-2x {
    font-size: 1.5em;
    }

    .custom-nav {
      background: none;
      border: none;
      color: #333;
      cursor: pointer;
      padding: 0 5px;
    }

    .custom-nav:focus {
      outline: none;
      box-shadow: none;
    }

    /* Impedisce overflow del carosello */
    .carousel-wrapper {
      /* background-color: lightgrey; */
      display: flex;
      align-items: center;
      gap: 0.5rem;
      overflow: hidden;
      max-width: 100%;
    }

    /* Imposta larghezza del carosello limitata allo spazio disponibile */
    .carousel-wrapper .owl-carousel {
      flex: 1 1 auto;
      min-width: 0; /* Importantissimo per impedire overflow */
    }

    /* Le card non devono superare la loro larghezza */
    .owl-carousel .item {
      max-width: 100%;
    }

    .owl-carousel {
      background-color: white;
      margin-bottom: 0 !important;
      margin-top: 0 !important;
    }    

    /* Impedisce che le immagini forzino l’allargamento */
    .owl-carousel img {
      width: 100%;
      height: auto;
      object-fit: contain;
    }

    .owl-dots {
      display: none;
    }

@media (max-width: 458px) {      
  #chiudiModal {
    margin-top: 10px;
  }
  /* #prodotti-container {
    height: auto !important;
    max-height: 75.5vh;
  } */
}
@media (max-width: 443px) {      
  #chiudiModal-2 {
    margin-top: 10px;
  }

  #modalvariante {
      height: 100% !important;
  }

  #openCarrello {
      margin-top: 10px;
  }
}

@media (max-width: 991px) {     
  #procediPagaButton {
    margin-top: 10px;
  }
  .navbar2 {
    display: none;
  }
  #sidebar {
    display: block !important;
  }
  #infoRivenditore {
    display: none;
  }
  #ricercaProdottoMobile{
    display: block !important;
  }
  /* #prodotti-container { 
    height: 710px !important; 
  } */
  #barraInfoSeller {
    display: none;
  }
}

@media (max-width: 1200px) {      
  #main-layout {
    padding-left: 0px !important;
    padding-right: 0px !important;
  }

  #chiSiamoButton {
    margin-left: 0px !important;
  }

}

#modalvariante {
  height: auto;
}

/* @media (max-width: 1388px) {      
  #navbarTogglerDemo03 {
    padding-bottom: 63px !important;
  }
} */

@media (min-width: 767.98px) {
    #main-layout { 
      height: 655px; 
    }
}

/* stile per barra info seller versione mobile */
#barraMobile { backface-visibility: hidden; }
/* Pulsanti icona circolari con area touch ampia */
.icon-btn { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; }
/* Migliore supporto dark mode */
@media (prefers-color-scheme: dark) {
  #barraMobile { background-color: rgba(var(--bs-emphasis-color-rgb), 0.05); }
}

#modalvariante select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-size: 14px;
  line-height: 1.4;
}

/* body.modal-open {
  padding-right: 0 !important;
  overflow-y: auto !important;  
} */

/* Il contenitore principale */
#contenitoreEsterno {
    height: 87vh;
    height: 87dvh;                 /* migliore su mobile */
    display: flex;
}

/* Il layout interno (sidebar + content) */
#main-layout {
    display: flex;
    width: 100%;
    height: 100%;                  /* ⇒ prende i 87vh del padre */
    overflow: hidden;              /* impedisce "uscite" */
}

/* Colonna contenuto */
.content {
    height: 100%;                  /* ⇒ 87vh */
    display: flex;
    flex-direction: column;        /* navbar + prodotti + footer */
}

/* Contenitore prodotti che deve scrollare */
#prodotti-container {
    flex: 1;                       /* prende tutto lo spazio disponibile */
    overflow-y: auto;
    overflow-x: hidden;
}
