/* ============================================================
 * AD24 Smart Search PRO - Frontend CSS
 * ============================================================ */

.ad24ss-dd {
  position: absolute;
  z-index: 99999;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.ad24ss-dd::-webkit-scrollbar { width: 8px; }
.ad24ss-dd::-webkit-scrollbar-track { background: #f8f8f8; }
.ad24ss-dd::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 4px; }

/* ── Loading state ──────────────────────────────────────── */
.ad24ss-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  color: #777;
  font-size: 13px;
}
.ad24ss-spin {
  width: 18px;
  height: 18px;
  border: 2px solid #e2e8f0;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: ad24ss-spin .8s linear infinite;
}
@keyframes ad24ss-spin { to { transform: rotate(360deg); } }

/* ── Sectiuni (popular, history) ──────────────────────────── */
.ad24ss-sec {
  border-bottom: 1px solid #f0f0f0;
}
.ad24ss-sec:last-child { border-bottom: none; }

.ad24ss-sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.ad24ss-sec-h i { color: #1a73e8; margin-right: 4px; }
.ad24ss-sec-b {
  padding: 4px 12px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ad24ss-clear-h {
  background: none;
  border: none;
  color: #1a73e8;
  font-size: 11px;
  cursor: pointer;
  text-transform: none;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.ad24ss-clear-h:hover { background: #f0f7ff; }

/* ── Chips (popular/history items) ────────────────────────── */
.ad24ss-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 5px 11px;
  font-size: 12.5px;
  color: #333;
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad24ss-chip:hover {
  background: #e0eaff;
  border-color: #1a73e8;
  color: #1a73e8;
}
.ad24ss-chip i { font-size: 10px; opacity: .6; }
.ad24ss-chip-c {
  background: #fff;
  color: #777;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 600;
  margin-left: 2px;
}

.ad24ss-empty-sm {
  width: 100%;
  padding: 6px;
  color: #aaa;
  font-size: 12px;
  font-style: italic;
}

/* ── Typo correction notice ───────────────────────────────── */
.ad24ss-corr {
  background: linear-gradient(to right, #fff7ed, #fff);
  border-bottom: 1px solid #fde68a;
  padding: 10px 14px;
  font-size: 13px;
  color: #92400e;
}
.ad24ss-corr i { color: #f59e0b; margin-right: 4px; }
.ad24ss-corr a { color: #92400e; text-decoration: none; }
.ad24ss-corr a:hover { text-decoration: underline; }

/* ── Rezultate ────────────────────────────────────────────── */
.ad24ss-results { padding: 4px 0; }

.ad24ss-res {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background .12s;
}
.ad24ss-res:hover,
.ad24ss-res.sel {
  background: #f8fafc;
  border-left-color: #1a73e8;
}

.ad24ss-th {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  background: #f0f0f0;
  display: block;
}
.ad24ss-th-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 18px;
}

.ad24ss-res-b {
  flex: 1;
  min-width: 0;
}

.ad24ss-res-t {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.ad24ss-res-t mark {
  background: #fff3a0;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
.ad24ss-prem {
  color: #f59e0b;
  font-size: 11px;
}

.ad24ss-res-m {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: #666;
}
.ad24ss-res-m i { font-size: 10px; opacity: .65; margin-right: 2px; }
.ad24ss-price {
  font-weight: 700;
  color: #059669;
}

/* ── No results ───────────────────────────────────────────── */
.ad24ss-no {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 14px;
  text-align: center;
  color: #888;
  font-size: 13px;
}

/* ── Footer "Vezi toate" ──────────────────────────────────── */
.ad24ss-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #1a73e8;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  transition: background .15s;
}
.ad24ss-all:hover { background: #1557b0; color: #fff; }

/* ── Responsive mobile ────────────────────────────────────── */
@media (max-width: 640px) {
  .ad24ss-dd {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    font-size: 13px;
  }
  .ad24ss-th { width: 44px; height: 44px; }
  .ad24ss-res-t { font-size: 13px; }
  .ad24ss-res-m { font-size: 11px; gap: 6px; }
  .ad24ss-chip { font-size: 12px; padding: 5px 10px; }
  .ad24ss-sec-h { padding: 8px 12px 4px; font-size: 11px; }
  .ad24ss-sec-b { padding: 4px 10px 10px; }
}
