/* =========================
   BUSCA INTELIGENTE · DNN
   Dropdown: DESKTOP FIXED (portal) + largura igual barra
   ========================= */

.dnn-smart-search-wrapp{
  position: relative;
  width: 100%;
  max-width: 880px;
  z-index: 999999; /* wrapper alto, dropdown ainda mais alto */
}

.dnn-smart-search-form{
  display:flex;
  align-items:center;
  background:#fff;
  border:1px solid rgba(12,23,38,.08);
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 12px 25px rgba(4,9,20,.06);
}

.dnn-smart-search-input{
  flex:1;
  border:0;
  outline:0;
  padding:10px 14px;
  font-size:.95rem;
  background:transparent;
}
.dnn-smart-search-input::placeholder{
  color:rgba(15,23,42,.4);
}

.dnn-smart-search-btn{
  border:0;
  background:linear-gradient(135deg,#7a3cff,#5a00ff);
  color:#fff;
  padding:0 16px;
  height:38px;
  margin-right:6px;
  border-radius:14px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.1rem;
  transition:filter .2s ease, transform .12s ease;
}
.dnn-smart-search-btn:hover{ filter:brightness(.96); }
.dnn-smart-search-btn:active{ transform:translateY(1px); }

/* =========================
   DROPDOWN (DESKTOP PORTAL)
   ========================= */

/* ✅ DESKTOP: fixed + posição via CSS vars (setadas no JS) */
.dnn-smart-search-dropdown{
  position: fixed;
  top: var(--dnn-ss-top, 90px);
  left: var(--dnn-ss-left, 10px);
  width: var(--dnn-ss-width, 880px);

  background:#fff;
  border:1px solid rgba(12,23,38,.06);
  border-radius:14px;
  box-shadow:0 18px 40px rgba(15,23,42,.16);

  z-index: 2147483647;
  max-height:420px;
  overflow-y:auto;
  overscroll-behavior:contain;

  transition:opacity .18s ease, transform .18s ease;
  transform: translateY(0);
  isolation:isolate;
}

.dnn-smart-search-dropdown::-webkit-scrollbar{ width:7px; }
.dnn-smart-search-dropdown::-webkit-scrollbar-thumb{
  background:rgba(15,23,42,.12);
  border-radius:999px;
}

/* GRID */
.dnn-smart-search-inner{
  display:grid;
  grid-template-columns: 1.2fr .6fr;
  gap:12px;
  padding:10px 10px 12px;
}

.dnn-smart-search-results{
  display:grid;
  gap:6px;
}

.dnn-ss-empty{
  margin:8px 6px;
  color:rgba(15,23,42,.72);
  font-weight:600;
}

.dnn-ss-row{
  display:flex;
  gap:10px;
  align-items:center;
  padding:8px;
  border-radius:12px;
  text-decoration:none;
  background:transparent;
  transition:background .12s ease, transform .12s ease;
}
.dnn-ss-row:hover{
  background:rgba(90,0,255,.06);
  transform:translateY(-1px);
}

.dnn-ss-thumb{
  width:58px;
  height:58px;
  border-radius:12px;
  background-size:cover;
  background-position:center;
  background-color:#eff1f7;
  flex:0 0 58px;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.05);
}
.dnn-ss-thumb--empty::after{
  content:'';
  display:block;
  width:100%;
  height:100%;
  background:repeating-linear-gradient(45deg, rgba(0,0,0,.02) 0 6px, rgba(0,0,0,0) 6px 12px);
  border-radius:inherit;
}

.dnn-ss-meta{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.dnn-ss-title{
  font-weight:650;
  color:#0f172a;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.dnn-ss-price{
  font-weight:800;
  color:#5a00ff;
  font-size:.78rem;
}
.dnn-ss-all{
  display:inline-block;
  margin-top:6px;
  font-weight:700;
  text-decoration:none;
  color:#5a00ff;
}

/* Histórico */
.dnn-smart-search-history{
  border-left: 1px solid rgba(15,23,42,.06);
  padding-left: 10px;
}
.dnn-ssh-title{
  margin:6px 6px 8px;
  font-weight:800;
  color:#0f172a;
  font-size:.85rem;
}
.dnn-ssh-list{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:6px;
}
.dnn-ssh-item{
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  background:rgba(15,23,42,.03);
  font-weight:700;
  color:rgba(15,23,42,.82);
  transition:.12s ease;
}
.dnn-ssh-item:hover{
  background:rgba(90,0,255,.06);
  color:#0f172a;
}

/* =========================
   OVERLAY E CAMADAS (MOBILE)
   ========================= */

@media (max-width: 991px){
  body.dnn-search-open::before{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.55);
    backdrop-filter:blur(2px);
    -webkit-backdrop-filter:blur(2px);
    z-index:99999;
  }

  html.dnn-search-open .dnn-bottombar{
    transform:translateY(110%);
    opacity:0;
    pointer-events:none;
  }

  /* ✅ trava scroll APENAS no mobile */
  html.dnn-search-open,
  body.dnn-search-open{
    overflow:hidden !important;
    touch-action:none;
  }

  .dnn-smart-search-inner{ grid-template-columns:1fr; }
  .dnn-smart-search-wrapp{ max-width:none; }

  /* Mobile: dropdown centralizado */
  .dnn-smart-search-dropdown{
    left:50%;
    transform:translateX(-50%);
    top: calc(var(--dnn-topbar-h, 70px) + 10px);
    width: min(100vw - 12px, 760px);
    max-height: 80vh;
    border-radius:16px;
    padding-bottom:10px;
  }

  .dnn-smart-search-history{
    border-left:0;
    padding-left:0;
    border-top: 1px solid rgba(15,23,42,.06);
    padding-top: 10px;
  }
}

@media (max-width: 768px){
  .dnn-smart-search-input{
    font-size:.9rem;
    padding:10px 12px;
  }
  .dnn-ss-thumb{
    width:50px;
    height:50px;
    flex:0 0 50px;
  }
  .dnn-ss-title{ font-size:.9rem; }
  .dnn-ss-price{ font-size:.8rem; }
}