/* =========================
   🔍 SEARCH BOX
========================= */
.ptk-search-box {
  position: relative;
  width: 100%;
}

/* ช่อง input */
#ptk-search-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: #1a1a1a;
  color: #fff;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

#ptk-search-input::placeholder {
  color: rgba(255,255,255,.42);
}

#ptk-search-input:hover {
  border-color: rgba(255,255,255,.14);
}

#ptk-search-input:focus {
  border-color: rgba(212,170,78,.35);
  box-shadow: 0 0 0 3px rgba(212,170,78,.08);
  background: #1d1d1d;
}

/* =========================
   📋 RESULT DROPDOWN
========================= */
#ptk-search-result {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #181818;
  z-index: 9999;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  backdrop-filter: blur(8px);
}

/* scrollbar */
#ptk-search-result::-webkit-scrollbar {
  width: 8px;
}

#ptk-search-result::-webkit-scrollbar-track {
  background: transparent;
}

#ptk-search-result::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}

#ptk-search-result::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.18);
}

/* =========================
   📚 GROUP
========================= */
.ptk-search-group {
  padding: 8px 0;
}

.ptk-search-group + .ptk-search-group {
  border-top: 1px solid #222;
}

.ptk-search-group-title {
  padding: 8px 14px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #d1a84a;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* =========================
   📄 ITEM
========================= */
.ptk-item {
  padding: 0;
}

.ptk-item a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  transition: background .18s ease, transform .18s ease;
}

.ptk-item:hover a {
  background: #222;
}

.ptk-item-thumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 54px;
  background: linear-gradient(180deg, #151515 0%, #101010 100%);
  border: 1px solid rgba(255,255,255,.05);
}

.ptk-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ptk-item-thumb.is-empty::after {
  content: "ไม่มีรูป";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #777;
  font-size: 10px;
  letter-spacing: .02em;
}

.ptk-item-content {
  min-width: 0;
  flex: 1 1 auto;
}

.ptk-item-title {
  color: #fff;
  line-height: 1.45;
  font-size: 14px;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ptk-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* ประเภท */
.ptk-type {
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
}

.ptk-item-price {
  font-size: 13px;
  font-weight: 700;
  color: #e0bb63;
  line-height: 1.4;
}

/* =========================
   📢 STATES
========================= */
.ptk-loading,
.ptk-empty,
.ptk-error {
  padding: 12px;
  text-align: center;
  color: #aaa;
}

/* =========================
   📱 MOBILE
========================= */
@media (max-width: 768px) {
  #ptk-search-input {
    height: 46px;
    padding: 0 12px;
    border-radius: 12px;
  }

  #ptk-search-result {
    border-radius: 12px;
    max-height: 360px;
  }

  .ptk-item a {
    gap: 10px;
    padding: 10px 12px;
  }

  .ptk-item-thumb {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 9px;
  }

  .ptk-item-title {
    font-size: 13px;
  }

  .ptk-item-price,
  .ptk-type {
    font-size: 12px;
  }
}