/**
 * Address Autocomplete & Locked Fields Styles
 * Pizze & Cook - PrestaShop
 */

/* Locked input fields (Postcode & City) */
.readonly-address-field,
input.readonly-address-field {
  background-color: #f4f5f7 !important;
  cursor: not-allowed !important;
  color: #495057 !important;
  border-color: #d1d5db !important;
  box-shadow: none !important;
  user-select: none;
}

.readonly-address-field:focus {
  outline: none !important;
  border-color: #d1d5db !important;
  box-shadow: none !important;
}

/* Helper text below locked fields */
.field-locked-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 4px;
}

.field-locked-hint .material-icons {
  font-size: 14px;
  vertical-align: middle;
  color: #9ca3af;
}

/* Wrapper for address input autocomplete */
.address-autocomplete-wrapper {
  position: relative;
  width: 100%;
}

/* Suggestions Dropdown Container */
.address-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10050;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  max-height: 280px;
  overflow-y: auto;
  margin: 5px 0 0 0;
  padding: 4px 0;
  list-style: none;
  font-family: inherit;
}

/* Individual suggestion item */
.address-autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}

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

.address-autocomplete-item:hover,
.address-autocomplete-item.active {
  background-color: #fff7ed;
}

.address-autocomplete-item:hover .address-autocomplete-main,
.address-autocomplete-item.active .address-autocomplete-main {
  color: #ea580c;
}

.address-autocomplete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fee2e2;
  color: #ef4444;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 14px;
}

.address-autocomplete-content {
  flex: 1;
  min-width: 0;
}

.address-autocomplete-main {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
  word-break: break-word;
}

.address-autocomplete-sub {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 2px;
  line-height: 1.2;
}

/* Badge BAN */
.address-autocomplete-footer {
  padding: 6px 12px;
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: right;
  border-top: 1px solid #f3f4f6;
  background-color: #fafafa;
}

/* Success animation when populated */
@keyframes addressFieldSuccessPulse {
  0% { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
  50% { border-color: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3); }
  100% { border-color: #d1d5db; box-shadow: none; }
}

.address-field-success {
  animation: addressFieldSuccessPulse 1.2s ease forwards;
}

/* Loading spinner indicator inside input */
.address-autocomplete-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid #e5e7eb;
  border-top-color: #ea580c;
  border-radius: 50%;
  animation: addressSpin 0.7s linear infinite;
  display: none;
  pointer-events: none;
  z-index: 5;
}

.address-autocomplete-wrapper.is-loading .address-autocomplete-spinner {
  display: block;
}

@keyframes addressSpin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}
