/* ==========================================================================
Palette ufficiale BarPilot

#ef4444  → Titoli cocktail
#f472b6  → Tag
#fbbf24  → Preparazione / Garnish / Bicchiere
#ffffff  → Testo
#111827  → Sfondo
#1f2937  → Elementi secondari




   1. BASE E CONFIGURAZIONE GENERALE
   ========================================================================= */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #111827;
    color: #ffffff;            
}



/* ==========================================================================
   HEADER STICKY
   Rimane in alto durante lo scroll senza creare problemi da fixed
   ========================================================================== */

.header-container {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;
  
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap:10px;
  align-items: center;
  background-color: #0A1121;
  box-sizing: border-box;
  border-bottom: 1px solid #1f2937; 
}

/* ==========================================================================
   IL logo in svg
   ========================================================================= */
.site-logo {
    width: 140px;
    height: auto;
    display: block;
 }

 .header-controls {
    width: 100%;
    display: flex;
    gap: 10px;
}

/* BARRA DI RICERCA DI BASE */
#search {
    flex:1;
    min-width:0;
    padding: 10px 12px;             
    font-size: 0.90rem;
    border:none;
    border-bottom: 1px solid #cc2121;
    background-color: #1f2937;    /* Grigio scuro di base dell'applicazione */
    color: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}



#search:focus, #search:hover {
    border-color: #ef4444 !important; 
    background-color: #1a1f2c !important; 
    box-shadow: 
        0 0 8px rgba(239, 68, 68, 0.6), 
        0 0 15px rgba(239, 68, 68, 0.3);
 
}

/* IL SELECT DEI DISTILLATI DI BASE */
.filter-select {
    width:82px;
    flex-shrink:0;
    padding: 8px 18px 8px 8px;    
    font-size: 0.8rem;
    border:none;
    border-bottom: 1px solid #cc2121;
    background-color: #1f2937;    /* Grigio scuro di base uguale alla ricerca */
    color: #ffffff;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.2s ease;
}

.filter-select:focus, .filter-select:hover {
    border-color: #ef4444 !important;
    background-color: #1a1f2c !important;
    box-shadow: 
        0 0 8px rgba(239, 68, 68, 0.6), 
        0 0 15px rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   3. LA GRIGLIA A DUE COLONNE  Mobile
   ========================================================================== */
#app {
  display: grid;
  grid-template-columns:repeat(2,1fr);
  gap: 20px;
  padding: 20px 16px 32px 16px;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ==========================================================================
   4. DESIGN DELLA CARD 
   ========================================================================== */
.card {
    background-color: #111827;    
    border-radius: 0px;                
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #1f2937;  
    padding-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;         
}

.card:hover {
    transform: translateY(-2px);       
    border-bottom-color: #ef4444 !important; 
    box-shadow: 
        0 6px 20px rgba(239, 68, 68, 0.25),
        0 0 12px rgba(239, 68, 68, 0.15) !important;
}

.card-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
                  
    background-color: #1f2937;
    display: block;
}

.card-body {
    padding: 8px 12px !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card h2 {
    margin: 6px 0 2px 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ef4444;                    
    line-height: 1.3;
}


.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-badge {
    padding:2px;
    color: #f9a8d4;
    background: rgba(236,72,153,.12);

    box-shadow:
      0 0 4px rgba(236,72,153,.25);
                    
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ingredients-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ingredient-badge {
    background-color: #1f2937;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #374151;
}




/* ==========================================================================
   SMARTPHONE
   ========================================================================== */
   @media (max-width: 479px){
    #app{
      grid-template-columns: repeat(2,1fr);
      gap:12px;
      padding: 16px 12px 24px;
    }
    .card-thumb{
      height:140px;
    
    }
    .card h2{
      font-size:0.9rem;
    }
   }
  

/* ==========================================================================
   TABLET
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px){

 #app {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px;
  }

  .card-thumb {
    height: 220px;
  }
}


/* ==========================================================================
   DESKTOP 
   ========================================================================== */

@media (min-width: 1024px) {

    .header-container {
    display: grid;
    grid-template-columns: 180px 1fr 100px;
    align-items: center;
    gap: 16px;

    margin: 0;
    max-width: none;
    width: 100%;

    padding: 24px;
    box-sizing: border-box;
    background: #111827;
  }

  .site-logo {
    width: 150px;
    height: auto;
    display: block;
    justify-self: start;
  }

  .header-controls {
    display: contents;
  }

  #search {
    width: 100%;
    justify-self: stretch;
  }

  .filter-select {
    width: 90px;
    justify-self: end;
    font-size: 0.9rem;
    padding: 10px 14px;
  }

  #app {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 24px 24px 32px 24px !important;
  }



  .card-thumb {
    height: 280px;
    object-fit: cover;
    object-position: center center;
  }
 }


 /* ==========================================================================
   5. MODAL INDIPENDENTE mobile
   ========================================================================== */

/* Nasconde la modal quando è chiusa */
.hidden {
  display: none !important;
}

/* Overlay scuro sopra tutta la pagina */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.85);
  overflow-y: auto;
}

/* Contenitore principale della modal */
.modal-content {
  background: #111827;
  color: #ffffff;
  min-height: 100dvh;
  position: relative;
}

/* Bottone X per chiudere */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 1000000;
}

/* Corpo dinamico della modal */
#modal-body {
  width: 100%;
}

/* MOBILE: immagine sopra, contenuto sotto */
.modal-img {
  width: 100%;
  height: auto;
  max-height:42dvh;
  object-fit: cover;
  display: block;
  background: #111827;;
}

/* Testo della modal */
.modal-info {
  padding: 22px 24px 90px;
  box-sizing: border-box;
}

/* Titolo cocktail nella modal */
.modal-info h2 {
  margin: 0 0 12px 0;
  font-size: 2.1rem;
  font-weight: 900;
  color: #ef4444;
}

/* Ingredienti nella modal: uno sotto l'altro */
.modal-info .ingredients-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px 0;
}

/* Ingredienti nella modal: senza badge pesante */
.modal-info .ingredient-badge {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 1.1rem;
  color: #ffffff;
}

/* Nasconde quantità nelle card */
.card .qty {
  display: none;
}

/* Mostra quantità nella modal */
.modal-info .qty {
  display: inline;
  color: #ef4444;
  font-weight: 800;
  margin-right: 8px;
}

/* Bicchiere e garnish */
.modal-info .bicchiere,
.modal-info .garnish {
  display: block;
  color: #9ca3af;
  margin: 12px 0;
}

/* Testo preparazione */
.modal-info .preparazione {
  display: block !important;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #1f2937;
  line-height: 1.7;
  color: #f3f4f6;
}

/* Titoli piccoli dentro preparazione, bicchiere e garnish */
.modal-info .preparazione strong,
.modal-info .bicchiere strong,
.modal-info .garnish strong {
  color: #fbbf24;
}


/* Note cocktail */
.note {
  margin-top: 20px;
}

.note ul {
  padding-left: 20px;
}

.note li {
  margin-bottom: 6px;
}

/* Blocca lo scroll della pagina sotto la modal */
body.modal-open {
  overflow: hidden;
}

/* Nasconde elementi che non devono comparire nella card */
.card .preparazione,
.card .ingredients-container,
.close-card-btn {
  display: none !important;
}
 
  /* MOBILE MODAL */
.modal {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-content {
  min-height: 100dvh;
  background: #111827;
}

.modal-info {
  padding: 22px 24px 120px;
}
  
  .tag-badge {
    padding:1px;
    font-size: 0.70rem;
    font-weight: 600;
   }

   /* ==========================================================================
      MODAL DESKTOP - deve stare ALLA FINE del CSS
   ========================================================================== */

@media (min-width: 1024px) {
  .modal {
    display: flex;
    justify-content: center;
    align-items: center;

    padding: 40px;
    box-sizing: border-box;
  }

  .modal-content {
    width: min(1200px, 95vw);
    max-height: calc(100vh - 80px);

    min-height: 0;
    height: auto;

    border-radius: 16px;
    overflow: hidden;

    border: 1px solid #1f2937;
    background: #111827;
    position: relative;
  }

  #modal-body {
    display: grid;
    grid-template-columns: 40% 60%;
    height: auto;
    max-height: calc(100vh - 80px);
  }

  .modal-img {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 80px);

    object-fit: cover;
    object-position: left;

    display: block;
    background: #111827;
  }

  .modal-info {
    max-height: calc(100vh - 80px);
    overflow-y: auto;

    padding: 36px;
    box-sizing: border-box;
    background: #111827;
  }

  .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
  }
}

/* ==========================================================================
   MOBILE GRANDE: 480px - 767px
   ========================================================================== */

@media (min-width: 480px) and (max-width: 767px) {
  .modal-img {
    width: 100%;
    height: auto;
    max-height: 45dvh;
    object-fit: contain;
    object-position: center;
    background: #000000
  }

  .modal-info {
    padding: 22px 24px 120px;
  }
}

/* ==========================================================================
   TABLET modal 
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px){
   
    .modal-img {
  
   
    object-fit: contain;
    object-position: center;
    background: #000000
  }


  .card-thumb {
    height: 220px;
  }
}