/* NA: suggest dropdown - dynamic layout + unified styling */

.search-suggest.js-search-result .na-suggest-columns {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 320px;
  height: min(560px, calc(100vh - 220px));
  max-height: min(560px, calc(100vh - 220px));
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
}

/* top area: only devices, dynamic height */
.search-suggest.js-search-result .na-suggest-top {
  display: block;
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.search-suggest.js-search-result .na-suggest-top.na-hidden,
.search-suggest.js-search-result .na-suggest-columns.na-top-hidden .na-suggest-top {
  display: none !important;
}

.search-suggest.js-search-result .na-suggest-col {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
}

.search-suggest.js-search-result .na-suggest-col-devices {
  padding: 12px 14px;
}

.search-suggest.js-search-result .na-suggest-col-products {
  display: none !important;
}

/* fulltext area below takes remaining height */
.search-suggest.js-search-result .na-suggest-col-fulltext {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  background: #fff;
}

/* unified headings */
.search-suggest.js-search-result .na-suggest-col h6 {
  margin: 0 0 10px 0;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  color: #111827;
}

/* device list */
.search-suggest.js-search-result .na-suggest-col-devices .na-suggest-items,
.search-suggest.js-search-result .na-suggest-col-devices .na-device-suggest-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  min-height: 0;
}

/* reset shopware overlay behavior */
.search-suggest.js-search-result .na-suggest-col-fulltext ul.search-suggest-container,
.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-container {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;

  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;

  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 12px 14px !important;

  list-style: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* shared item look top + bottom */
.search-suggest.js-search-result .na-suggest-col-devices .na-suggest-items a,
.search-suggest.js-search-result .na-suggest-col-devices .na-device-suggest-items a,
.search-suggest.js-search-result a.na-device-suggest-item,
.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-product-link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f6f8;
  color: #111827;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.search-suggest.js-search-result .na-suggest-col-devices .na-suggest-items a:hover,
.search-suggest.js-search-result .na-suggest-col-devices .na-device-suggest-items a:hover,
.search-suggest.js-search-result a.na-device-suggest-item:hover,
.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-product-link:hover {
  background: #edf1f5;
  color: #111827;
  text-decoration: none;
}

/* top items can wrap nicely */
.search-suggest.js-search-result .na-suggest-col-devices .na-suggest-items a,
.search-suggest.js-search-result .na-suggest-col-devices .na-device-suggest-items a,
.search-suggest.js-search-result a.na-device-suggest-item {
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* product rows */
.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-product,
.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-no-result {
  position: static !important;
  list-style: none !important;
  margin: 0 0 8px 0 !important;
  padding: 0 !important;
}

.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-product:last-child {
  margin-bottom: 0 !important;
}

.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-product-link {
  overflow: hidden;
}

.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-product-name {
  font-size: 13px;
  line-height: 1.35;
}

.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-product-image-container {
  margin-right: 10px;
}

/* footer below product list */
.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-total {
  flex: 0 0 56px !important;
  min-height: 56px !important;
  background: #fff !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.04) !important;
}

.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-total a,
.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-total .search-suggest-total-link {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 56px !important;
  padding: 12px 14px !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
  color: #111827 !important;
}

.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-total-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-total-count {
  white-space: nowrap;
}

/* empty state */
.search-suggest.js-search-result .na-suggest-col-fulltext .search-suggest-no-result {
  min-height: 100%;
}

.search-suggest.js-search-result .na-suggest-empty-state {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 16px !important;
  min-height: 220px !important;
  padding: 28px 24px !important;
}

.search-suggest.js-search-result .na-suggest-empty-state-text {
  max-width: 560px !important;
  margin: 0 auto !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
  color: #1f2937 !important;
}

.search-suggest.js-search-result .na-suggest-empty-state-btn,
.search-suggest.js-search-result .na-suggest-empty-state .na-suggest-empty-state-btn,
.search-suggest.js-search-result .na-suggest-col-fulltext .na-suggest-empty-state-btn {
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 18px !important;
  margin: 0 auto !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #0d6efd !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: normal !important;
  box-shadow: none !important;
}

.search-suggest.js-search-result .na-suggest-empty-state-btn:hover,
.search-suggest.js-search-result .na-suggest-empty-state-btn:focus {
  color: #ffffff !important;
  text-decoration: none !important;
}

/* mobile */
@media (max-width: 768px) {
  .search-suggest.js-search-result .na-suggest-columns {
    min-height: 300px;
    height: min(70vh, 640px);
    max-height: min(70vh, 640px);
  }

  .search-suggest.js-search-result .na-suggest-col-devices .na-suggest-items,
  .search-suggest.js-search-result .na-suggest-col-devices .na-device-suggest-items {
    max-height: 140px;
  }
}
