/* ==================================================
   search_box.css — Scoped to elementor-widget-sb_search_box
   ================================================== */

/* ---------- Reset box-sizing ---------- */
:root { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

/* ---------- Base / Desktop ---------- */
.elementor-widget-sb_search_box,
.elementor-widget-sb_search_box .legal-box {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

.elementor-widget-sb_search_box .legal-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 28px 32px;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
}

.elementor-widget-sb_search_box .legal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 14px 0;
}

/* Search row */
.elementor-widget-sb_search_box .legal-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f1f4f8;
  border-radius: 10px !important;
  padding: 8px 12px;
  height: 56px;
}

.elementor-widget-sb_search_box .search-icon {
  flex: 0 0 28px;
  width: 28px;
  text-align: center;
  font-size: 18px;
  opacity: 0.8;
  margin: 0;
}

.elementor-widget-sb_search_box .legal-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  padding: 8px 6px;
  height: 100%;
  box-sizing: border-box;
}

/* Action button: remove any hard-coded margins so responsive control works */
.elementor-widget-sb_search_box .legal-btn,
.elementor-widget-sb_search_box a.legal-btn {
  background: #2f5563;
  color: #ffffff;
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 10px !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  box-sizing: border-box;
  margin: 0; /* IMPORTANT: keep zero so Elementor responsive margin overrides apply cleanly */
}

/* Popular row */
.elementor-widget-sb_search_box .popular-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.elementor-widget-sb_search_box .popular-label {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
  margin-right: 8px;
}

.elementor-widget-sb_search_box .tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8dfe6;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- Tablet ---------- */
@media (max-width: 768px) {
  .elementor-widget-sb_search_box .legal-box { padding: 20px; max-width: 560px; border-radius: 16px; }
  .elementor-widget-sb_search_box .legal-title { font-size: 16px; margin-bottom:12px; }
  .elementor-widget-sb_search_box .legal-search { height: 52px; padding: 8px 10px; gap: 10px; }
  .elementor-widget-sb_search_box .search-icon { flex: 0 0 26px; width: 26px; }
  .elementor-widget-sb_search_box .legal-search input { font-size: 15px; padding: 8px 6px; }
  .elementor-widget-sb_search_box .legal-btn { padding: 10px 18px; font-size: 14px; }
  .elementor-widget-sb_search_box .popular-row { gap: 12px; }
}

/* ---------- MOBILE (≤480px) — keep input+icon inline (pill), button below ---------- */
@media (max-width: 480px) {
  .elementor-widget-sb_search_box .legal-box { padding: 16px; border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
  .elementor-widget-sb_search_box .legal-title { font-size: 15px; margin-bottom: 10px; }

  .elementor-widget-sb_search_box .legal-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: transparent; padding: 0; box-sizing: border-box; }

  .elementor-widget-sb_search_box .legal-search .input-row,
  .elementor-widget-sb_search_box .legal-search .row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f4f8;
    border-radius: 999px;
    padding: 8px 12px;
    height: 44px;
    width: 100%;
    box-sizing: border-box;
  }

  .elementor-widget-sb_search_box .legal-search > .search-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #f1f4f8;
    border-radius: 999px;
    margin-left: 0;
  }

  .elementor-widget-sb_search_box .legal-search > input {
    flex: 1 1 auto;
    min-width: 0;
    background: #f1f4f8;
    height: 44px;
    padding: 6px 8px;
    border-radius: 999px;
    border: none !important;
    outline: none !important;
    box-sizing: border-box;
  }

  .elementor-widget-sb_search_box .legal-search .input-row input,
  .elementor-widget-sb_search_box .legal-search .row input {
    flex: 1 1 auto;
    min-width: 0;
    border: none !important;
    outline: none !important;
    background: transparent;
    height: 100%;
    padding: 6px 4px;
    box-sizing: border-box;
    font-size: 14px;
  }

  /* Button goes full width — margin controlled via Elementor responsive control */
  .elementor-widget-sb_search_box .legal-search .legal-btn,
  .elementor-widget-sb_search_box .legal-search > .legal-btn {
    flex: 0 0 100%;
    width: 100%;
    order: 99;
    padding: 12px 14px;
    border-radius: 12px;
    text-align: center;
    box-sizing: border-box;
  }

  .elementor-widget-sb_search_box .popular-row { margin-top: 12px; gap: 8px; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
  .elementor-widget-sb_search_box .popular-label { width: auto; display: inline-block; margin-bottom: 0; font-size: 14px; margin-right: 8px; }
  .elementor-widget-sb_search_box .popular-row .tag { padding: 6px 12px; font-size: 13px; border-radius: 18px; }
  .elementor-widget-sb_search_box .popular-row .tag:nth-of-type(n+3) { display: none !important; }
  .elementor-widget-sb_search_box .popular-row .tag[data-cat-index] { display:inline-flex; }
  .elementor-widget-sb_search_box .popular-row .tag[data-cat-index]:not([data-cat-index="0"]):not([data-cat-index="1"]) { display:none !important; }
}

/* ---------- Desktop tweak: reduce input flex basis ---------- */
@media (min-width: 769px) {
  .elementor-widget-sb_search_box .legal-search input { flex: 0 0 60%; max-width: 60%; }
}
