/* =========================================================
   2.34 - Zaawansowana wyszukiwarka produktów
   ========================================================= */
.header-search-area {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 80;
}

.header-search-area .header-search {
  width: 100%;
}

.search-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.shop-header--market .header-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-suggest-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  max-height: min(620px, calc(100vh - 180px));
  overflow: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  border: 1px solid #dfe7e1;
  box-shadow: 0 18px 48px rgba(18, 46, 31, .16);
  z-index: 500;
}

.search-suggest-panel[hidden] {
  display: none !important;
}

.search-suggest-state {
  min-height: 0;
  font-family: var(--font-primary);
  color: #6f7973;
  font-size: 13px;
}

.search-suggest-state:not(:empty) {
  padding: 12px 16px;
  border-bottom: 1px solid #edf1ee;
}

.search-suggest-section {
  padding: 10px 10px 12px;
}

.search-suggest-section + .search-suggest-section {
  border-top: 1px solid #edf1ee;
}

.search-suggest-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 6px 8px;
  font-family: var(--font-primary);
}

.search-suggest-heading strong {
  color: #17271f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.search-suggest-heading span {
  color: #7d8680;
  font-size: 12px;
  font-weight: 600;
}

.search-suggest-products {
  display: grid;
  gap: 2px;
}

.search-suggest-product {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 7px 8px;
  color: #17271f;
  text-decoration: none;
  outline: 0;
  transition: background-color .14s ease;
}

.search-suggest-product:hover,
.search-suggest-product.is-active,
.search-suggest-product:focus-visible {
  background: #f3f7f4;
}

.search-suggest-thumb {
  width: 58px;
  height: 58px;
  display: block;
  object-fit: contain;
  background: #f7f8f6;
}

.search-suggest-main {
  min-width: 0;
  font-family: var(--font-primary);
}

.search-suggest-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #12251c;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.28;
}

.search-suggest-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggest-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  background: #0b5a43;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.search-suggest-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
  color: #77817b;
  font-size: 11px;
  font-weight: 600;
}

.search-suggest-meta .is-available {
  color: #167243;
}

.search-suggest-meta .is-unavailable {
  color: #9d5348;
}

.search-suggest-price {
  min-width: 96px;
  color: #0b5a43;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.search-suggest-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 6px 3px;
}

.search-suggest-category {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #dce6df;
  background: #ffffff;
  color: #254334;
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: border-color .14s ease, background-color .14s ease, color .14s ease;
}

.search-suggest-category:hover,
.search-suggest-category.is-active,
.search-suggest-category:focus-visible {
  border-color: #0b5a43;
  background: #f2f7f3;
  color: #0b5a43;
  outline: 0;
}

.search-suggest-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 9px 16px;
  border-top: 1px solid #e7ece8;
  background: #fafcfb;
  font-family: var(--font-primary);
}

.search-suggest-footer a {
  color: #0b5a43;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.search-suggest-footer small {
  color: #7a847e;
  font-size: 11px;
  font-weight: 600;
}

.search-suggest-empty {
  padding: 24px 18px;
  text-align: center;
  font-family: var(--font-primary);
}

.search-suggest-empty strong {
  display: block;
  margin-bottom: 5px;
  color: #1b2a22;
  font-size: 14px;
}

.search-suggest-empty span {
  color: #748078;
  font-size: 12px;
  line-height: 1.5;
}

.search-suggest-panel.is-loading .search-suggest-state {
  position: relative;
  padding-left: 38px;
}

.search-suggest-panel.is-loading .search-suggest-state::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid #d7e5dc;
  border-top-color: #0b5a43;
  border-radius: 50%;
  animation: zd-search-spin .7s linear infinite;
}

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

@media (max-width: 980px) {
  .search-suggest-panel {
    top: calc(100% + 8px);
    max-height: min(560px, calc(100vh - 150px));
  }
}

@media (max-width: 640px) {
  .search-suggest-panel {
    width: 100%;
    max-height: min(520px, calc(100vh - 130px));
  }

  .search-suggest-product {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 9px;
    min-height: 64px;
  }

  .search-suggest-thumb {
    width: 48px;
    height: 48px;
  }

  .search-suggest-price {
    grid-column: 2;
    min-width: 0;
    margin-top: -2px;
    text-align: left;
    font-size: 12px;
  }

  .search-suggest-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-suggest-panel.is-loading .search-suggest-state::before {
    animation: none;
  }
}
