/* Nutmec Search */
.nms { position: relative; width: 100%; max-width: 620px; margin: 0 auto; }
.nms-input {
  width: 100%; height: 42px; box-sizing: border-box; padding: 0 84px 0 18px;
  border: 1px solid #d9dce1; border-radius: 999px; background: #fff; color: #1d1f23;
  font: inherit; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.nms-input::-webkit-search-cancel-button { display: none; }
.nms-input::placeholder { color: #8a8f96; }
.nms-input:focus { border-color: #3f51b5; box-shadow: 0 0 0 3px rgba(63,81,181,.12); }
.nms.is-open .nms-input { border-radius: 21px 21px 0 0; border-bottom-color: #eef0f3; box-shadow: none; }
.nms-submit, .nms-clear { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: #1d1f23; display: grid; place-items: center; padding: 0; }
.nms-submit { right: 8px; width: 34px; height: 34px; border-radius: 50%; }
.nms-submit:hover { color: #3f51b5; }
.nms-clear { right: 44px; width: 28px; height: 28px; font-size: 20px; line-height: 1; color: #8a8f96; }
.nms-clear:hover { color: #1d1f23; }

.nms-panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 1000; max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border: 1px solid #d9dce1; border-top: 0; border-radius: 0 0 16px 16px;
  box-shadow: 0 18px 40px rgba(16,24,40,.12); padding: 6px 0 4px; text-align: left;
}
.nms-sec { padding: 6px 0 4px; }
.nms-sec + .nms-sec { border-top: 1px solid #f0f1f4; }
.nms-h { display: block; padding: 6px 18px 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8a8f96; }
.nms-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 6px; }
.nms-cat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #e3e6eb; border-radius: 999px; font-size: 13px; color: #1d1f23 !important; text-decoration: none; background: #fff; }
.nms-cat small { color: #8a8f96; font-size: 11px; }
.nms-cat:hover, .nms-cat.is-active { border-color: #3f51b5; color: #3f51b5 !important; }
.nms-cat.is-nut:hover, .nms-cat.is-nut.is-active { border-color: #8a4b22; color: #8a4b22 !important; }
.nms-list { list-style: none; margin: 0; padding: 0; }
.nms-item { display: flex; align-items: center; gap: 12px; padding: 8px 18px; color: #1d1f23 !important; text-decoration: none; border-left: 3px solid transparent; }
.nms-item img, .nms-noimg { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 8px; object-fit: cover; background: #f4f5f7; border: 1px solid #eef0f3; }
.nms-txt { display: flex; flex-direction: column; min-width: 0; }
.nms-t { font-size: 14px; line-height: 1.35; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nms-m { font-size: 12px; color: #8a8f96; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nms-m em { font-style: normal; color: #6a6e76; background: #f4f5f7; border-radius: 4px; padding: 0 6px; margin-right: 4px; }
.nms-item:hover, .nms-item.is-active { background: #f6f7fb; border-left-color: #3f51b5; }
.nms-item.is-nut:hover, .nms-item.is-nut.is-active { background: #fbf6f0; border-left-color: #8a4b22; }
.nms-list--plain .nms-item { padding: 7px 18px; }
.nms mark { background: none; color: inherit; font-weight: 700; padding: 0; }
.nms-all { display: flex; justify-content: center; gap: 6px; margin: 4px 12px 6px; padding: 10px; border-radius: 10px; background: #f4f5fb; color: #3f51b5 !important; font-size: 13px; font-weight: 600; text-decoration: none; }
.nms-all:hover, .nms-all.is-active { background: #3f51b5; color: #fff !important; }
.nms-empty { padding: 14px 18px; font-size: 13.5px; line-height: 1.55; color: #4a4e55; }
.nms-empty strong { display: block; color: #1d1f23; margin-bottom: 2px; }
.nms-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nms-sugg a { padding: 5px 11px; border: 1px solid #e3e6eb; border-radius: 999px; font-size: 12.5px; color: #1d1f23 !important; text-decoration: none; }
.nms-sugg a:hover { border-color: #3f51b5; color: #3f51b5 !important; }

/* tablets + phones */
@media (max-width: 1024px) {
  .nms { max-width: none; }
  .nms-input { font-size: 16px; height: 44px; } /* 16px: no zoom on iOS */
}
@media (max-width: 600px) {
  .nms-panel { max-height: 72vh; border-radius: 0 0 14px 14px; }
  .nms.is-open .nms-input { border-radius: 22px 22px 0 0; }
  .nms-item { padding: 10px 14px; gap: 10px; }
  .nms-item img, .nms-noimg { width: 44px; height: 44px; flex-basis: 44px; }
  .nms-t { font-size: 14.5px; }
  .nms-h { padding-left: 14px; }
  .nms-cats { padding: 4px 12px 8px; }
}
@media (prefers-reduced-motion: reduce) { .nms-input { transition: none; } }

/* square corners (owner's choice, 2026-11-26) */
.nms-input, .nms.is-open .nms-input { border-radius: 0 !important; }
.nms-panel { border-radius: 0 !important; }
.nms-submit { border-radius: 0; }
.nms-cat, .nms-sugg a { border-radius: 2px; }
.nms-all { border-radius: 0; }
.nms-item img, .nms-noimg { border-radius: 2px; }

/* soft rounded corners (owner's choice, 2026-11-26 later) — overrides the square block above */
.nms-input { border-radius: 8px !important; }
.nms.is-open .nms-input { border-radius: 8px 8px 0 0 !important; }
.nms-panel { border-radius: 0 0 8px 8px !important; }
.nms-submit { border-radius: 6px; }
.nms-cat, .nms-sugg a { border-radius: 6px; }
.nms-all { border-radius: 6px; }
.nms-item img, .nms-noimg { border-radius: 4px; }

/* fully rounded (pill) search box — owner, 2026-11-26 (overrides the 8px block above) */
.nms-input { border-radius: 999px !important; padding-left: 20px !important; }
.nms.is-open .nms-input { border-radius: 21px 21px 0 0 !important; }
.nms-panel { border-radius: 0 0 16px 16px !important; }
.nms-submit { border-radius: 50% !important; right: 6px; }
