/* Global search modal — compact sheet, single-row category scroll */

/* Fit viewport on mobile: no horizontal overflow */
#globalPopupModal.modal {
  padding-inline: 0.75rem;
  box-sizing: border-box;
}

#globalPopupModal .modal-dialog.modal-search-dialog {
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
  padding: 0;
}

#globalPopupModal .search-modal-content {
  background: transparent;
  box-shadow: none;
  max-width: 100%;
  overflow-x: hidden;
}

#globalPopupModal .search-card {
  border-radius: 14px;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.04),
    0 16px 40px -8px rgba(15, 23, 42, 0.16);
}

#globalPopupModal .search-card-header.card-header {
  padding: 0.65rem 0.85rem !important;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  border-radius: 0 !important;
}

#globalPopupModal .search-card-head__text {
  min-width: 0;
}

#globalPopupModal .search-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

#globalPopupModal .search-card-sub {
  font-size: 0.7rem;
  margin-top: 0.1rem;
  color: rgba(15, 23, 42, 0.48);
  line-height: 1.2;
}

#globalPopupModal .search-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(38, 158, 112, 0.14);
  color: #0d9266;
  font-size: 1rem;
  flex-shrink: 0;
}

#globalPopupModal .search-card-close {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.6);
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

#globalPopupModal .search-card-close:hover {
  background: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

#globalPopupModal .search-card-body.card-body {
  padding: 0.6rem 0.85rem 0.7rem !important;
}

#globalPopupModal .search-modal-form {
  text-align: left;
}

/* One row: horizontal scroll — no negative margins (avoids 100vw overflow on mobile) */
#globalPopupModal .search-modal-cats-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 0 0.45rem;
  padding: 0 0 6px;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.2) transparent;
}

#globalPopupModal .search-modal-cats-scroll::-webkit-scrollbar {
  height: 3px;
}

#globalPopupModal .search-modal-cats-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 3px;
}

#globalPopupModal .search-modal-cats {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  width: max-content;
  max-width: none;
}

#globalPopupModal .search-modal-cats .cat_label {
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.11);
  background: #fff;
  color: rgba(15, 23, 42, 0.78);
  line-height: 1.15;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

#globalPopupModal .search-modal-cats .cat_item:checked + .cat_label {
  background: linear-gradient(135deg, #0d9266 0%, #0a6b4a 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 6px rgba(13, 146, 102, 0.32);
}

#globalPopupModal .search-modal-loc .form-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(15, 23, 42, 0.4);
  margin-bottom: 0.2rem;
}

#globalPopupModal .search-modal-loc .form-select {
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 0.32rem 2rem 0.32rem 0.55rem;
  min-height: calc(1.35em + 0.64rem + 2px);
  max-width: 100%;
  border-radius: 9px;
  border-color: rgba(15, 23, 42, 0.1);
  background-color: #fafbfc;
}

#globalPopupModal .search-modal-loc .form-select:focus {
  border-color: rgba(13, 146, 102, 0.45);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(13, 146, 102, 0.12);
}

#globalPopupModal .search-modal-actions {
  margin-top: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

#globalPopupModal .search-modal-submit {
  width: 100%;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.45rem 0.875rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #0d9266 0%, #0a6b4a 100%);
  box-shadow: 0 3px 12px rgba(13, 146, 102, 0.28);
}

#globalPopupModal .search-modal-submit:hover {
  filter: brightness(1.05);
}

#globalPopupModal .search-modal-submit:active {
  transform: scale(0.995);
}

/* Backdrop only while global search modal is visible */
body:has(#globalPopupModal.show) .modal-backdrop.show {
  background: rgba(11, 18, 32, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
