/* =========================================================
   RICERCA TESTUALE
   - lente nella banda rossa del menu -> ricerca in sovrapposizione
   - form nella pagina /ricerca.asp
   ========================================================= */

/* --- lente nella banda rossa: ultima voce del menu (li.dd-search-li) --- */
/* padding, colore e hover grigio arrivano dalle regole del template per le voci del menu */
.navbar-default .navbar-nav > li.dd-search-li > a.dd-search-open {
  font-family: 'FontAwesome', sans-serif;
  font-weight: 400;
  padding-left: 14px;
  padding-right: 14px;
  cursor: pointer;
}
.dd-search-open:before { content: '\f002'; }
/* su mobile si usa la lente del template in alto a destra (.search-form_toggle) */
@media (max-width: 767px) {
  .navbar-nav > li.dd-search-li { display: none; }
}

/* --- sovrapposizione --- */
.dd-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(20, 20, 20, .85);
  z-index: 1000000000; /* sopra menu, header fisso e lente mobile del template */
  overflow-y: auto;
}
.dd-search-overlay.open { display: block; }
html.dd-noscroll,
html.dd-noscroll body { overflow: hidden; }
.dd-search-overlay-box {
  position: relative;
  width: 700px;
  max-width: calc(100% - 30px);
  margin: 12vh auto 40px;
}
.dd-search-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  color: #fff;
  font: 400 30px/40px 'FontAwesome', sans-serif;
  cursor: pointer;
}
.dd-search-close:before { content: '\f00d'; }
.dd-search-close:hover { opacity: .75; }

/* --- campo di ricerca (comune) --- */
.dd-search { position: relative; text-align: left; }
.dd-search-input {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 50px 0 14px;
  font-size: 16px;
  color: #333;
  background: #fff;
  border: 1px solid #c9c9c9;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  box-shadow: none;
  transition: border-color .2s;
}
.dd-search-input:focus { border-color: #be0101; }
.dd-search-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 46px;
  padding: 0;
  border: none;
  background: none;
  color: #999;
  font: 400 20px/46px 'FontAwesome', sans-serif;
  cursor: pointer;
  -webkit-appearance: none;
}
.dd-search-btn:before { content: '\f002'; }
.dd-search-btn:hover { color: #be0101; }
.dd-search.loading .dd-search-btn:before { content: '\f110'; display: inline-block; animation: dd-gira 1s linear infinite; }
@keyframes dd-gira { to { transform: rotate(360deg); } }

/* campo grande nella sovrapposizione */
.dd-search-ov .dd-search-input { height: 58px; font-size: 20px; border: none; padding-left: 18px; }
.dd-search-ov .dd-search-btn { height: 58px; line-height: 58px; font-size: 24px; width: 58px; }

/* --- anteprima risultati --- */
.dd-search-preview {
  display: none;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.dd-search-preview.open { display: block; }
/* nella sovrapposizione l'anteprima sta sotto al campo, nel flusso */
.dd-search-ov .dd-search-preview { margin-top: 8px; max-height: 65vh; overflow-y: auto; }
/* nella pagina ricerca è una tendina */
.dd-search-page .dd-search-preview {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid #ddd;
  z-index: 1000;
}

.dd-sp-sez { padding: 6px 0; border-bottom: 1px solid #eee; }
.dd-sp-tit {
  display: block;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: #999;
}
.dd-search a.dd-sp-item {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  color: #333;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
}
.dd-search a.dd-sp-item:hover,
.dd-search a.dd-sp-item.attivo { background: #f4f4f4; color: #be0101; }
.dd-search a strong { font-weight: 700; color: #be0101; }
.dd-sp-img {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.dd-sp-img img { max-width: 100%; max-height: 100%; }
.dd-sp-marca .dd-sp-img { flex-basis: 80px; width: 80px; height: 36px; }
.dd-sp-txt { display: flex; flex-direction: column; min-width: 0; }
.dd-sp-nome { display: block; }
.dd-sp-info { display: block; font-size: 12px; color: #888; }
.dd-search a.dd-sp-tutti {
  display: block;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
  color: #be0101;
  background: #fafafa;
  text-decoration: none;
}
.dd-search a.dd-sp-tutti:hover,
.dd-search a.dd-sp-tutti.attivo { background: #be0101; color: #fff; }
.dd-sp-vuoto { display: block; padding: 16px 14px; color: #888; font-size: 15px; }

/* --- pagina risultati /ricerca.asp --- */
.dd-search.dd-search-page { width: 100%; max-width: 560px; margin: 10px 0 30px; }
.dd-ricerca-sez { margin-bottom: 30px; }
.dd-ricerca-tit { font-size: 22px; margin: 0 0 15px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.dd-ricerca-tit small { font-size: 60%; color: #999; }
.dd-ricerca-msg { color: #777; }
.dd-ricerca-marca a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  margin-bottom: 15px;
  padding: 8px;
  border: 1px solid #eee;
  background: #fff;
}
.dd-ricerca-marca a:hover { border-color: #be0101; }
.dd-ricerca-marca img { max-width: 100%; max-height: 100%; }
.dd-ricerca-cat a {
  display: inline-block;
  margin: 0 6px 8px 0;
  padding: 6px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  color: #333;
  background: #fff;
}
.dd-ricerca-cat a:hover { border-color: #be0101; color: #be0101; text-decoration: none; }
.dd-ricerca-sez .lead strong { color: #be0101; }
