:root {
  --befree-accent: #111111;
  --befree-radius: 18px;
}

html.befree-search-open,
html.befree-search-open body { overflow: hidden; }

.befree-search-overlay[hidden] { display: none !important; }

.befree-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 30px;
  background: rgba(19, 19, 19, .56);
  backdrop-filter: blur(2px);
}

.befree-search-dialog {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 18px 20px 24px;
  border-radius: var(--befree-radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .2);
  color: #171717;
}

.befree-search-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #222;
  font: 300 32px/1 Arial, sans-serif;
  cursor: pointer;
}

.befree-search-form {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 46px 0 8px;
  border-bottom: 1px solid #e7e7e7;
}

.befree-search-icon { flex: 0 0 24px; width: 24px; height: 24px; margin-right: 10px; color: #454545; }
.befree-search-input { flex: 1; width: 100%; min-width: 0; height: 50px !important; padding: 0 !important; border: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; color: #171717 !important; font-size: 17px !important; }
.befree-search-input::-webkit-search-cancel-button { display: none; }
.befree-search-clear, .befree-section-action { padding: 5px 0; border: 0; background: transparent; color: #999; font-size: 13px; cursor: pointer; }
.befree-search-status { min-height: 24px; padding: 10px 0 0; color: #777; font-size: 12px; }
.befree-search-content { transition: opacity .15s ease; }
.befree-search-content.is-loading { opacity: .55; }
.befree-search-section + .befree-search-section { margin-top: 14px; }
.befree-search-section header { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.befree-search-section h3 { margin: 0; color: #222; font-size: 15px; font-weight: 600; }

.befree-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.befree-product-card { display: block; min-width: 0; color: inherit !important; text-decoration: none !important; }
.befree-product-image { display: block; overflow: hidden; aspect-ratio: 1 / 1.08; margin-bottom: 8px; border-radius: 14px; background: #f5f3f1; }
.befree-product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.befree-product-card:hover .befree-product-image img { transform: scale(1.035); }
.befree-product-name { display: block; overflow: hidden; color: #222; font-size: 13px; font-weight: 500; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.befree-product-price { display: block; margin-top: 3px; color: #111; font-size: 14px; font-weight: 700; }
.befree-product-price del { color: #999; font-weight: 400; }
.befree-product-price ins { text-decoration: none; }
.befree-search-empty { margin: 30px 0; text-align: center; color: #777; }
.befree-search-view-all { display: block; width: max-content; margin: 22px auto 0; padding: 10px 20px; border-radius: 999px; background: var(--befree-accent); color: #fff !important; font-size: 13px; font-weight: 600; text-decoration: none !important; }
.befree-search-shortcode { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: inherit; cursor: pointer; }

@media (max-width: 767px) {
  .befree-search-overlay { align-items: stretch; padding: 0; background: #fff; }
  .befree-search-dialog { width: 100%; max-height: 100vh; min-height: 100vh; padding: 12px 14px 24px; border-radius: 0; box-shadow: none; }
  .befree-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .befree-product-image { border-radius: 12px; }
  .befree-search-form { padding-right: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .befree-product-image img, .befree-search-content { transition: none; }
}

