/* ============================================
   SmartPrep — Category Icon Navigation
   Elegant line-art SVG icons, no cheap colors.
   ============================================ */

/* ── Toolbar ── */
.supply-toolbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-line);
}

/* ── Icon grid ── */
.caticon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 6px;
  padding: 12px 0;
}

.caticon-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  color: var(--c-ink-mute);
  text-align: center;
  line-height: 1.25;
  transition: border-color .18s, color .18s, background .18s, box-shadow .18s;
  white-space: nowrap;
  min-width: 0;
}

.caticon-chip:hover {
  border-color: var(--c-line);
  color: var(--c-ink);
  background: var(--c-paper-warm);
}

.caticon-chip.is-active {
  border-color: var(--c-ink);
  background: var(--c-ink);
  color: var(--c-paper);
  box-shadow: var(--sh-sm);
}

.caticon-chip svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}

.caticon-chip svg * {
  stroke: currentColor;
}

@media (max-width: 720px) {
  .caticon-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 4px;
    padding: 10px 0;
  }
  .caticon-chip {
    padding: 8px 4px 6px;
    gap: 3px;
    font-size: var(--fs-3xs);
  }
  .caticon-chip svg {
    width: 22px;
    height: 22px;
  }
}

/* ─── Kompakt mod (scroll sonrası tek satır) ─── */
.supply-toolbar {
  transition: padding .25s ease;
}
.supply-toolbar.is-compact .caticon-grid {
  display: flex !important;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  padding: 4px 0;
  scrollbar-width: thin;
}
.supply-toolbar.is-compact .caticon-chip {
  flex: 0 0 auto;
  flex-direction: row;
  padding: 4px 10px;
  font-size: var(--fs-3xs);
  gap: 6px;
}
.supply-toolbar.is-compact .caticon-chip svg {
  width: 16px;
  height: 16px;
}
.supply-toolbar.is-compact .caticon-back {
  padding: 4px 8px;
}
/* Hover'da tam aç — mouse navbar üstünde her yerde geçince */
.supply-toolbar.is-compact:hover .caticon-grid {
  flex-wrap: wrap;
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 6px;
  padding: 12px 0;
  overflow-x: visible;
}
.supply-toolbar.is-compact:hover .caticon-chip {
  flex-direction: column;
  padding: 10px 6px 8px;
  font-size: var(--fs-2xs);
  gap: 5px;
}
.supply-toolbar.is-compact:hover .caticon-chip svg {
  width: 28px;
  height: 28px;
}

/* ─── Landing'de gizle, scroll'da üste otur (overlay header) ─── */
body.has-supply-toolbar .site-header {
  transition: transform .25s ease;
}
body.toolbar-active .site-header {
  transform: translateY(-100%);
  pointer-events: none;
}
body.toolbar-active .supply-toolbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
  background: var(--c-paper);
}
/* Default: sticky değil — sayfa içinde inline yer alır */
.supply-toolbar {
  position: relative;
  top: auto;
}

/* ─── Floating right-bottom action buttons (chat üstünde) ─── */
.floating-actions {
  position: fixed;
  right: 24px;
  bottom: 96px;  /* chat widget'ın üstünde (chat ~24px+50px civarı) */
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
  pointer-events: none;
}
.floating-actions > button,
.floating-actions > a {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-ink);
  color: var(--c-paper);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.20);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s, transform .15s, background .15s;
  pointer-events: auto;
  text-decoration: none;
}
.floating-actions > .is-visible {
  opacity: 1;
  visibility: visible;
}
.floating-actions > button:hover,
.floating-actions > a:hover {
  background: var(--c-brand);
  transform: translateY(-3px);
}
.floating-actions svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Mobile: biraz daha küçük */
@media (max-width: 720px) {
  .floating-actions { right: 16px; bottom: 84px; gap: 10px; }
  .floating-actions > button,
  .floating-actions > a { width: 42px; height: 42px; }
  .floating-actions svg { width: 18px; height: 18px; }
}

/* Sol-üst tedariğe dön — sadece supply-toolbar OLMAYAN tedarik sayfalarında */
.back-to-supply-corner {
  position: fixed;
  top: 84px;  /* header altında */
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: var(--c-brand);
  color: var(--c-paper);
  text-decoration: none;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s, transform .15s, background .15s;
  z-index: 998;
}
.back-to-supply-corner.is-visible { opacity: 1; visibility: visible; }
.back-to-supply-corner:hover {
  background: var(--c-brand-deep, var(--c-brand));
  transform: translateY(-2px);
}
.back-to-supply-corner svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.back-to-supply-corner span { display: inline-block; }

/* Chat açıkken floating-actions alta kaysın (z-index düşük + opacity kıs) */
body.chat-is-open .floating-actions {
  z-index: 1;
  opacity: 0.25;
  pointer-events: none;
}
body.chat-is-open .back-to-supply-corner {
  z-index: 1;
  opacity: 0.25;
  pointer-events: none;
}

@media (max-width: 720px) {
  .back-to-supply-corner {
    top: 70px;
    left: 12px;
    padding: 6px 12px 6px 10px;
    font-size: var(--fs-2xs);
  }
  .back-to-supply-corner svg { width: 14px; height: 14px; }
}

/* ─── Tedarik ürün arama kutusu (firin-pastane + sandvic) ─── */
.product-search {
  position: relative;
  max-width: 720px;
  margin: 20px auto 32px;
  padding: 0 16px;
  z-index: 50;
}
.product-search-inner {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--c-paper);
  border: 1.5px solid var(--c-line);
  border-radius: 12px;
  padding: 4px 10px 4px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  transition: border-color .15s, box-shadow .15s;
}
.product-search-inner:focus-within {
  border-color: var(--c-brand);
  box-shadow: 0 4px 18px rgba(161,14,23,0.12);
}
.product-search-icon {
  width: 18px; height: 18px;
  color: var(--c-ink-mute);
  flex-shrink: 0;
}
.product-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-ink);
  outline: none;
  min-width: 0;
}
.product-search-input::placeholder { color: var(--c-ink-faint); }
.product-search-clear {
  border: none;
  background: var(--c-paper-warm);
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--c-ink-mute);
  display: flex; align-items: center; justify-content: center;
}
.product-search-clear:hover { background: var(--c-line); color: var(--c-ink); }
.product-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 16px; right: 16px;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  max-height: 420px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  z-index: 51;
}
.product-search-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: var(--c-paper);
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--c-line);
  font: inherit;
  transition: background .12s;
}
.product-search-item:last-child { border-bottom: none; }
.product-search-item:hover { background: var(--c-paper-warm); }
.product-search-item-sku {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--c-brand);
  letter-spacing: 0.04em;
}
.product-search-item-name {
  font-size: var(--fs-sm);
  color: var(--c-ink);
  font-weight: var(--fw-medium);
}
.product-search-item-meta {
  font-size: var(--fs-2xs);
  color: var(--c-ink-mute);
}
.product-search-empty {
  padding: 18px;
  text-align: center;
  color: var(--c-ink-mute);
  font-size: var(--fs-sm);
}
@media (max-width: 720px) {
  .product-search-item {
    grid-template-columns: 70px 1fr;
  }
  .product-search-item-meta { display: none; }
}

/* ─── Strip içindeki search box (firin-pastane + sandvic) ─── */
.cat-info-strip.has-search {
  align-items: center;
}
.cat-info-strip .product-search {
  margin: 0 0 0 auto;
  max-width: 320px;
  padding: 0;
  flex: 0 1 320px;
}
.cat-info-strip .product-search-inner {
  padding: 2px 8px 2px 10px;
  border-radius: 8px;
  background: var(--c-paper);
}
.cat-info-strip .product-search-input {
  padding: 6px 8px;
  font-size: var(--fs-2xs);
}
.cat-info-strip .product-search-icon { width: 14px; height: 14px; }
.cat-info-strip .product-search-dropdown {
  left: 0; right: 0;
  top: calc(100% + 8px);
}
@media (max-width: 720px) {
  .cat-info-strip .product-search {
    margin: 8px 0 0 0;
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* SKU portal alt-not */
.sku-portal-note {
  text-align: center;
  font-size: var(--fs-2xs);
  color: var(--c-ink-faint);
  margin: -16px 0 24px;
  letter-spacing: 0.02em;
}
