/* ============================================================
   Address Autocomplete — autocomplete.css
   Compatible: PrestaShop 8 & 9
   ============================================================ */

/* ── Dropdown container ─────────────────────────────────────── */
.aac-dropdown {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: #ffffff;
  border: 1px solid #cbd5e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 320px;
  overflow-y: auto;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  /* Ensure it appears above PS overlays */
  z-index: 99999 !important;
}

/* ── Each suggestion item ───────────────────────────────────── */
.aac-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f4f8;
  transition: background 0.12s ease;
  list-style: none;
}

.aac-item:last-child {
  border-bottom: none;
}

.aac-item:hover,
.aac-item.is-active {
  background: #f0f7ff;
}

.aac-item:hover .aac-street,
.aac-item.is-active .aac-street {
  color: #1a1a2e;
}

/* ── Street line ─────────────────────────────────────────────── */
.aac-street {
  font-weight: 600;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Postcode + city line ───────────────────────────────────── */
.aac-context {
  font-size: 12px;
  color: #718096;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Highlighted match ──────────────────────────────────────── */
.aac-mark {
  background: #fef08a;
  color: #1a1a2e;
  border-radius: 2px;
  padding: 0 1px;
  font-style: normal;
  font-weight: 700;
}

/* ── Empty / no results ─────────────────────────────────────── */
.aac-empty {
  color: #a0aec0;
  font-style: italic;
  cursor: default;
  padding: 12px 14px;
}

.aac-empty:hover {
  background: transparent;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
.aac-dropdown::-webkit-scrollbar {
  width: 4px;
}
.aac-dropdown::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 99px;
}
.aac-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

/* ── Input focus indicator ──────────────────────────────────── */
input[data-aac-bound="1"]:focus {
  outline: none;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* ── Loading indicator (spinner shown while fetching) ───────── */
input[data-aac-bound="1"].aac-loading {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2'%3E%3Cpath d='M21 12a9 9 0 11-6.219-8.56'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  animation: aac-spin 0.8s linear infinite;
}

@keyframes aac-spin {
  from { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' style='transform:rotate(0deg)'%3E%3Cpath d='M21 12a9 9 0 11-6.219-8.56'/%3E%3C/svg%3E"); }
  to   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' style='transform:rotate(360deg)'%3E%3Cpath d='M21 12a9 9 0 11-6.219-8.56'/%3E%3C/svg%3E"); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .aac-dropdown {
    font-size: 13px;
    max-height: 240px;
  }
  .aac-item {
    padding: 10px 12px;
  }
}
