/* ── Typesense Live Search Dropdown ──────────────────────────────────────── */

.ts-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 250;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e4e0);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow-lg, 0 2px 8px rgba(0,0,0,.08), 0 16px 48px rgba(0,0,0,.10));
  overflow: hidden;
  animation: ts-fade-in .15s ease;
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

@keyframes ts-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Section header ────────────────────────────────────────────────────── */

.ts-section-title {
  padding: 10px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3, #9a9a96);
}

.ts-divider {
  height: 1px;
  background: var(--border, #e5e4e0);
  margin: 4px 0;
}

/* ── Category item ──────────────────────────────────────────────────────── */

.ts-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text, #1a1a18);
  cursor: pointer;
  transition: background .12s;
  outline: none;
}

.ts-cat-item:hover,
.ts-cat-item.ts-active {
  background: var(--surface2, #f3f2ef);
}

.ts-cat-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm, 8px);
  background: var(--accent-light, #dcfce7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ts-cat-icon img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: var(--radius-sm, 8px);
}

.ts-cat-icon svg {
  width: 16px;
  height: 16px;
  color: var(--accent, #16a34a);
}

.ts-cat-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.ts-cat-count {
  font-size: 12px;
  color: var(--text3, #9a9a96);
  white-space: nowrap;
}

/* ── Product item ───────────────────────────────────────────────────────── */

.ts-prod-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text, #1a1a18);
  cursor: pointer;
  transition: background .12s;
  outline: none;
}

.ts-prod-item:hover,
.ts-prod-item.ts-active {
  background: var(--surface2, #f3f2ef);
}

.ts-prod-img {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm, 8px);
  background: var(--surface2, #f3f2ef);
  overflow: hidden;
  border: 1px solid var(--border, #e5e4e0);
}

.ts-prod-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ts-prod-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ts-prod-img-placeholder svg {
  width: 22px;
  height: 22px;
  color: var(--border2, #d1d0cc);
}

.ts-prod-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ts-prod-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text, #1a1a18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-prod-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ts-prod-price {
  font-family: 'Geologica', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1a1a18);
}

.ts-prod-price.is-sale {
  color: var(--red, #dc2626);
}

.ts-prod-old {
  font-size: 12px;
  color: var(--text3, #9a9a96);
  text-decoration: line-through;
}

.ts-prod-btn {
  flex-shrink: 0;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: var(--accent, #16a34a);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ts-prod-btn:hover {
  background: var(--accent-hover, #15803d);
}

/* ── Highlight mark ────────────────────────────────────────────────────── */

.ts-dropdown mark {
  background: none;
  color: var(--accent, #16a34a);
  font-weight: 700;
}

/* ── Footer link ────────────────────────────────────────────────────────── */

.ts-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #16a34a);
  text-decoration: none;
  border-top: 1px solid var(--border, #e5e4e0);
  transition: background .12s;
  gap: 6px;
}

.ts-footer:hover { background: var(--surface2, #f3f2ef); }

.ts-footer svg { width: 14px; height: 14px; }

/* ── Empty / loading ────────────────────────────────────────────────────── */

.ts-empty,
.ts-loading {
  padding: 18px 14px;
  text-align: center;
  color: var(--text3, #9a9a96);
  font-size: 13px;
}

.ts-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border2, #d1d0cc);
  border-top-color: var(--accent, #16a34a);
  border-radius: 50%;
  animation: ts-spin .6s linear infinite;
  vertical-align: middle;
  margin-left: 8px;
}

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

/* ── Fixed dropdown (mobile offcanvas portal) ───────────────────────────── */

.ts-dropdown--portal {
  position: fixed;
  z-index: 350;
  max-height: 60vh;
}

/* ── Mobile hero search ─────────────────────────────────────────────────── */

/* ── Font size override ─────────────────────────────────────────────────── */

.search-wrap input[type="search"],
.search-wrap input[type="text"] {
  font-size: 17px !important;
}

/* ── Mobile hero search ─────────────────────────────────────────────────── */

.mobile-hero-search {
  display: none;
  padding: 40px 0 0;
}

.mobile-hero-search .search-wrap input[type="search"] {
  border-radius: var(--radius-lg, 16px) !important;
}

.mobile-hero-search .search-btn {
  border-radius: 0 var(--radius-lg, 16px) var(--radius-lg, 16px) 0 !important;
}

.mobile-hero-search .search-wrap {
  max-width: 100%;
}

.mobile-hero-search__input {
  caret-color: var(--accent, #16a34a);
}

.mobile-menu__search-wrap {
  flex: 1;
  position: relative;
}

.mobile-menu__search-wrap .ts-dropdown {
  top: calc(100% + 4px);
  left: 0;
  right: 0;
}

@media (max-width: 768px) {
  .mobile-hero-search { display: block; }
  .ts-prod-btn { display: none; }
  .ts-prod-name { white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ── Typewriter cursor ──────────────────────────────────────────────────── */

.ts-typewriter-active::placeholder {
  color: var(--text2, #6b6b67);
}

@keyframes ts-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
