/* iZap Algolia Search */

.izap-alg-wrapper {
  max-width: 900px;
  margin: 0 auto;
  font-family: inherit;
}

.izap-alg-title {
  font-size: 1.3em;
  margin-bottom: 0.75em;
  font-weight: 600;
}

.izap-alg-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.izap-alg-input-wrap {
  flex: 1;
  position: relative;
}

.izap-alg-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font-size: 1em;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.izap-alg-input:focus {
  border-color: #0073aa;
}

.izap-alg-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
}

.izap-alg-suggestions[hidden] {
  display: none !important;
}

.izap-alg-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9em;
}

.izap-alg-suggestion-item:last-child {
  border-bottom: none;
}

.izap-alg-suggestion-item:hover,
.izap-alg-suggestion-item.is-active {
  background: #f0f7fc;
}

.izap-alg-suggestion-img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #f6f6f6;
}

.izap-alg-suggestion-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.izap-alg-suggestion-text {
  flex: 1;
  line-height: 1.35;
}

/* Dropdown no header (busca do tema): largura do container + z-index acima da nav */
.search-container.position-relative .izap-alg-suggestions--header,
.search-container--header .izap-alg-suggestions--header {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 10050;
  min-width: min(100vw - 2rem, 420px);
}

.izap-alg-suggestions-footer {
  padding: 8px 12px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  font-size: 0.85em;
}

.izap-alg-suggestions-viewall {
  color: #0073aa;
  font-weight: 600;
  text-decoration: none;
}

.izap-alg-suggestions-viewall:hover {
  text-decoration: underline;
}

.izap-alg-suggestion-loading {
  padding: 12px;
  font-size: 0.9em;
  color: #666;
}

.izap-alg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.2s,
    opacity 0.2s;
  white-space: nowrap;
  align-self: flex-start;
}

.izap-alg-btn:hover:not(:disabled) {
  background: #005580;
}

.izap-alg-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.izap-alg-status {
  font-size: 0.9em;
  padding: 6px 0;
  color: #555;
}

.izap-alg-results-summary {
  font-size: 0.95em;
  font-weight: 600;
  margin: 12px 0 8px;
  color: #333;
}

.izap-alg-product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.izap-alg-product-card {
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    transform 0.15s;
  background: #fff;
}

.izap-alg-product-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.izap-alg-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.izap-alg-card-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f6f6f6;
}

.izap-alg-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.izap-alg-product-card:hover .izap-alg-card-image img {
  transform: scale(1.04);
}

.izap-alg-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  flex: 1;
}

.izap-alg-card-name {
  font-size: 0.95em;
  font-weight: 600;
  color: #222;
  line-height: 1.3;
}

.izap-alg-card-cats {
  font-size: 0.78em;
  color: #888;
}

.izap-alg-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.izap-alg-card-price {
  font-size: 1em;
  font-weight: 700;
  color: #222;
}

.izap-alg-card-stock {
  font-size: 0.72em;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.izap-alg-in-stock {
  background: #e8f5e9;
  color: #2e7d32;
}

.izap-alg-out-stock {
  background: #fce4ec;
  color: #c62828;
}

@media (max-width: 480px) {
  .izap-alg-search-row {
    flex-direction: column;
  }

  .izap-alg-product-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
