/* SOLFOTON Search — wszystkie style scopowane prefiksem .sf- */

.sf-search-root {
  --sf-green:#2E7D4F;
  --sf-green-dark:#1F5536;
  --sf-green-light:#A8D5BA;
  --sf-green-mint:#D4EDDA;
  --sf-sun:#F5C518;
  --sf-sun-dark:#D4A411;
  --sf-sky:#E8F1F5;
  --sf-charcoal:#1A2E1F;
  --sf-slate:#5B6B5F;
  --sf-off-white:#FAFAF6;
  --sf-white:#FFFFFF;
  --sf-border:#E5E5E0;
  --sf-shadow-md:0 12px 40px rgba(46,125,79,0.12);
  --sf-r-btn:8px;
  --sf-r-card:12px;
  --sf-r-panel:16px;
  --sf-sans:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sf-serif:"Fraunces", Georgia, "Times New Roman", serif;
  --sf-mono:"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  position: relative;
  font-family: var(--sf-sans);
  color: var(--sf-charcoal);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.sf-search-root *, .sf-search-root *::before, .sf-search-root *::after { box-sizing: border-box; }

/* Input */
.sf-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--sf-white);
  border: 1px solid #E5E5E0;
  border-radius: 8px;
  outline: none;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sf-search-input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(46,125,79,.08);
}
.sf-icon-search {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--sf-slate);
  pointer-events: none;
}
.sf-search-root .sf-search-input,
input.sf-search-input[type="search"] {
  flex: 1;
  height: 100% !important;
  padding: 0 14px 0 44px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  font: 14px/1.4 var(--sf-sans);
  color: var(--sf-charcoal);
  width: 100%;
  transition: none !important;
}
.sf-search-input::-webkit-search-cancel-button { display: none; }
.sf-search-input::placeholder { color: var(--sf-slate); opacity: 1; }

.sf-kbd {
  position: absolute;
  right: 10px;
  padding: 3px 8px;
  font: 11px/1 var(--sf-mono);
  color: var(--sf-slate);
  background: var(--sf-off-white);
  border: 1px solid var(--sf-border);
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

/* Panel */
.sf-search-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(640px, calc(100vw - 32px));
  background: var(--sf-white);
  border: 1px solid var(--sf-border);
  border-radius: 10px;
  box-shadow: var(--sf-shadow-md);
  padding: 12px;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .18s ease-out, transform .18s ease-out;
}
.sf-search-panel.sf-open { opacity: 1; transform: translateY(0); }

@media (max-width: 1023px) {
  .sf-search-panel {
    position: fixed;
    top: 64px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    min-width: 0;
  }
}

/* Grid layout */
.sf-results-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
@media (max-width: 1023px) {
  .sf-results-grid { grid-template-columns: 1fr; gap: 12px; }
}

.sf-section + .sf-section,
.sf-side-section + .sf-side-section { margin-top: 10px; }

.sf-section-title {
  font-family: var(--sf-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sf-slate);
  margin: 0 0 6px;
  font-weight: 500;
}

/* Filters / chips */
.sf-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sf-border);
}
.sf-filter-label {
  font: 11px var(--sf-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sf-slate);
  margin-right: 4px;
}
.sf-filter-label:not(:first-child) { margin-left: 8px; }

.sf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font: 11px/1.2 var(--sf-sans);
  background: var(--sf-off-white);
  border: 1px solid var(--sf-border);
  border-radius: 12px;
  color: var(--sf-charcoal);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.sf-chip:hover { border-color: var(--sf-green-light); }
.sf-chip-active {
  background: var(--sf-green) !important;
  color: var(--sf-white) !important;
  border-color: var(--sf-green) !important;
}

/* Product card */
.sf-product {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--sf-border);
  text-decoration: none;
  color: inherit;
  border-left: 2px solid transparent;
  transition: background .12s ease;
  border-radius: 4px;
}
.sf-product:last-child { border-bottom: 0; }
.sf-product:hover { background: var(--sf-green-mint); }
.sf-product.sf-selected {
  background: var(--sf-green-mint);
  border-left-color: var(--sf-green);
}
.sf-product-thumb {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--sf-off-white);
  object-fit: cover;
  border: 1px solid var(--sf-border);
}
.sf-product-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.sf-product-main { flex: 1; min-width: 0; }
.sf-product-prices {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 1px;
  white-space: nowrap;
}
.sf-product-brand {
  font: 9px/1.4 var(--sf-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sf-slate);
}
.sf-product-title {
  margin: 1px 0 2px;
  font: 500 13px/1.3 var(--sf-sans);
  color: var(--sf-charcoal);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.sf-product-cat {
  font: 11px/1.3 var(--sf-sans);
  color: var(--sf-slate);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sf-product-price {
  font: 600 13px/1.2 var(--sf-sans);
  color: var(--sf-green-dark);
}
.sf-product-price-net {
  font: 11px/1.2 var(--sf-sans);
  color: var(--sf-slate);
}
.sf-tax-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sf-slate);
  margin-left: 2px;
}

/* Side suggestions */
.sf-side { display: flex; flex-direction: column; gap: 10px; }
.sf-side-list { list-style: none; margin: 0; padding: 0; }
.sf-side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--sf-charcoal);
  text-decoration: none;
  border-radius: 5px;
  border-left: 2px solid transparent;
  transition: background .12s ease;
}
.sf-side-link:hover { background: var(--sf-green-mint); }
.sf-side-link.sf-selected {
  background: var(--sf-green-mint);
  border-left-color: var(--sf-green);
}
.sf-side-count {
  font: 11px var(--sf-mono);
  color: var(--sf-slate);
}

/* Footer */
.sf-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--sf-border);
}
.sf-all-link {
  font-size: 13px;
  color: var(--sf-green);
  font-weight: 500;
  text-decoration: none;
}
.sf-all-link:hover { color: var(--sf-green-dark); text-decoration: underline; }
.sf-help-keys {
  font: 11px var(--sf-mono);
  color: var(--sf-slate);
  margin-left: auto;
}

/* Empty state */
.sf-empty { text-align: center; padding: 24px 12px; }
.sf-empty-icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  background: var(--sf-green-mint);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--sf-green);
}
.sf-empty-title {
  font: 500 20px/1.3 var(--sf-serif);
  color: var(--sf-charcoal);
  margin: 0 0 6px;
}
.sf-empty-text {
  font-size: 13px;
  color: var(--sf-slate);
  margin: 0 0 16px;
}
.sf-popular-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}
.sf-cta {
  display: inline-block;
  padding: 10px 18px;
  background: var(--sf-green);
  color: var(--sf-white);
  text-decoration: none;
  border-radius: var(--sf-r-btn);
  font: 500 14px var(--sf-sans);
  transition: background .15s;
}
.sf-cta:hover { background: var(--sf-green-dark); }

/* Loading shimmer */
.sf-loading-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid var(--sf-border);
}
.sf-loading-card:last-child { border-bottom: 0; }
.sf-shimmer {
  background: linear-gradient(90deg, var(--sf-off-white) 0%, #efefe7 50%, var(--sf-off-white) 100%);
  background-size: 200% 100%;
  animation: sfShimmer 1.2s ease-in-out infinite;
  border-radius: 6px;
}
.sf-shimmer-thumb { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 8px; }
.sf-shimmer-line { height: 12px; margin-bottom: 8px; }
.sf-shimmer-line.sf-w-30 { width: 30%; }
.sf-shimmer-line.sf-w-50 { width: 50%; }
.sf-shimmer-line.sf-w-70 { width: 70%; }
@keyframes sfShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Recent */
.sf-recent {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sf-recent-chip { background: var(--sf-sky); border-color: transparent; }

/* Highlight */
.sf-mark {
  background: rgba(245, 197, 24, 0.35);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* Compact mode (np. mały header) */
.sf-search-root.sf-compact .sf-search-input-wrap { height: 38px; }
.sf-search-root.sf-compact .sf-search-input { padding: 0 50px 0 36px; font-size: 13px; }
.sf-search-root.sf-compact .sf-icon-search { left: 12px; width: 16px; height: 16px; }
.sf-search-root.sf-compact .sf-kbd { font-size: 10px; padding: 2px 6px; }
