/* R&M Store Search: matches the rmdist.com design system.
   Navy #0a2a57 headings, green #00843d accents, page background #f5f7fa,
   white cards with a light border and 12px radius. */

.rm-search-form {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 640px;
}

.rm-search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px;
  font-size: 16px;
  color: #0a2a57;
  background: #fff;
  border: 1px solid #dfe6ea;
  border-right: none;
  border-radius: 8px 0 0 8px;
  outline: none;
}

.rm-search-input:focus {
  border-color: #00843d;
  box-shadow: 0 0 0 2px rgba(0, 132, 61, 0.18);
}

.rm-search-button {
  flex: 0 0 auto;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #0a2a57;
  border: 1px solid #0a2a57;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}

.rm-search-button:hover,
.rm-search-button:focus {
  background: #00843d;
  border-color: #00843d;
}

.rm-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 9999;
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dfe6ea;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(4, 19, 47, 0.18);
  text-align: left;
}

.rm-search-group-title {
  padding: 8px 14px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0a2a57;
  background: #f5f7fa;
  border-top: 1px solid #dfe6ea;
}

.rm-search-group:first-child .rm-search-group-title {
  border-top: none;
  border-radius: 12px 12px 0 0;
}

.rm-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  color: #0a2a57;
  text-decoration: none;
  border-top: 1px solid #eef2f5;
}

.rm-search-item:hover,
.rm-search-item-active {
  background: #f5f7fa;
}

.rm-search-thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eef2f5;
  border-radius: 6px;
}

.rm-search-thumb-empty {
  display: inline-block;
}

.rm-search-product-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rm-search-product-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-search-product-meta {
  font-size: 12px;
  color: #5a6b7d;
}

.rm-search-sku {
  font-weight: 700;
  color: #0a2a57;
}

.rm-search-brand::before {
  content: " · ";
}

.rm-search-product-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.rm-search-price {
  font-size: 14px;
  font-weight: 700;
  color: #00843d;
  white-space: nowrap;
}

.rm-search-stock {
  font-size: 12px;
  color: #5a6b7d;
  white-space: nowrap;
}

.rm-search-stock-in {
  color: #00843d;
  font-weight: 600;
}

.rm-search-term {
  font-size: 14px;
  font-weight: 600;
}

.rm-search-empty {
  padding: 14px;
  font-size: 14px;
  color: #0a2a57;
}

.rm-search-all {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #0a2a57;
  text-align: center;
  text-decoration: none;
  border-radius: 0 0 12px 12px;
}

.rm-search-all:hover,
.rm-search-all:focus {
  background: #00843d;
  color: #fff;
}

@media (max-width: 640px) {
  .rm-search-form {
    max-width: none;
    width: 100%;
  }

  .rm-search-results {
    position: fixed;
    top: auto;
    left: 8px;
    right: 8px;
    max-height: 60vh;
  }

  .rm-search-product-title {
    white-space: normal;
  }
}
