/* ============================================
   Atabaque Jair — Buscador Flutuante v2
   ============================================ */

/* Botão gatilho — sempre visível no topo */
#ajs-trigger {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 999999;
  width: auto;
  height: auto;
  background: #B8962E;
  color: #fff;
  border: none;
  border-radius: 12px 0 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 12px 14px;
  box-shadow: -4px 4px 20px rgba(184,150,46,0.4);
  transition: background 0.2s, padding 0.2s;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: inherit;
}

#ajs-trigger:hover {
  background: #9A7A20;
  padding-right: 20px;
}

#ajs-trigger svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

#ajs-trigger span {
  white-space: nowrap;
}

#ajs-trigger.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Overlay */
#ajs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999997;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

#ajs-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Barra principal */
#ajs-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999998;
  background: #fff;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  transform: translateY(-110%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-bottom: 3px solid #B8962E;
}

#ajs-bar.open {
  transform: translateY(0);
}

/* Inner com input */
#ajs-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #fff;
}

#ajs-icon {
  color: #B8962E;
  font-size: 20px;
  flex-shrink: 0;
}

#ajs-input {
  flex: 1;
  background: #F8F4EE;
  border: 2px solid #E8DFD0;
  border-radius: 10px;
  padding: 12px 16px;
  outline: none;
  color: #2C2C2C;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#ajs-input:focus {
  border-color: #B8962E;
  box-shadow: 0 0 0 3px rgba(184,150,46,0.12);
}

#ajs-input::placeholder {
  color: #B0A090;
}

/* Spinner */
#ajs-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(184,150,46,0.2);
  border-top-color: #B8962E;
  border-radius: 50%;
  animation: ajs-spin 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
}

#ajs-spinner.active { display: block; }

@keyframes ajs-spin {
  to { transform: rotate(360deg); }
}

/* Botão fechar */
#ajs-close {
  background: #F8F4EE;
  border: 1px solid #E8DFD0;
  color: #7A6A50;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
  letter-spacing: 0.5px;
}

#ajs-close:hover {
  background: #2C2C2C;
  color: #fff;
  border-color: #2C2C2C;
}

/* Label total */
#ajs-count {
  font-size: 12px;
  color: #B0A090;
  padding: 0 24px 8px;
  border-bottom: 1px solid #F0EAE0;
}

/* Área de resultados */
#ajs-results {
  overflow-y: auto;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(88vh - 80px);
}

/* Mensagens */
.ajs-msg {
  text-align: center;
  color: #B0A090;
  font-size: 14px;
  padding: 32px 0;
}

.ajs-msg strong {
  display: block;
  font-size: 16px;
  color: #2C2C2C;
  margin-bottom: 6px;
}

/* Card de produto */
.ajs-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #EDE5D8;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  animation: ajs-fadein 0.18s ease both;
}

.ajs-item:hover {
  background: #FFF8EE;
  border-color: #B8962E;
  box-shadow: 0 2px 12px rgba(184,150,46,0.12);
  text-decoration: none !important;
}

@keyframes ajs-fadein {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Imagem */
.ajs-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #F8F4EE;
  border: 1px solid #E8DFD0;
}

/* Info */
.ajs-info { flex: 1; min-width: 0; }

.ajs-name {
  color: #2C2C2C;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.ajs-price {
  color: #B8962E;
  font-size: 15px;
  font-weight: 700;
}

.ajs-price bdi { font-style: normal; }

/* Seta */
.ajs-arrow {
  color: #D5C9B8;
  font-size: 20px;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.ajs-item:hover .ajs-arrow {
  color: #B8962E;
  transform: translateX(3px);
}

/* Responsivo */
@media (max-width: 600px) {
  #ajs-trigger span { display: none; }
  #ajs-trigger { padding: 14px 14px 14px 12px; border-radius: 10px 0 0 10px; }
  #ajs-inner { padding: 12px 14px; }
  .ajs-img { width: 52px; height: 52px; }
}
