/*
 * JUST AQAR — Homepage PWA matches native app
 * Applies ONLY when the site is installed/running as standalone PWA.
 */

html.ja-pwa-runtime .app-main.favorites-main {
  width: calc(100% - 16px) !important;
  margin-inline: auto !important;
}

/* -------------------------
   User card = app treatment
   ------------------------- */
html.ja-pwa-runtime .user-card {
  border-radius: 24px !important;
}

html.ja-pwa-runtime .user-card .user-head {
  align-items: flex-start !important;
}

html.ja-pwa-runtime .user-card .user-avatar-modern {
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  flex: 0 0 68px !important;
  border-radius: 20px !important;
  object-fit: cover !important;
}

html.ja-pwa-runtime .user-card .user-meta h2 {
  font-size: 18px !important;
}

html.ja-pwa-runtime .user-card .stat-box .value {
  font-size: 18px !important;
}

/* -------------------------
   Search = app treatment
   direct search + tune button
   ------------------------- */
html.ja-pwa-runtime #searchAccordion.search-card {
  width: 100% !important;
  border-radius: 24px !important;
  overflow: visible !important;
  position: relative !important;
}

html.ja-pwa-runtime #searchAccordion > .search-accordion-head {
  display: none !important;
}

html.ja-pwa-runtime .ja-pwa-search-inline {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  direction: rtl;
}

html.ja-pwa-runtime .ja-pwa-search-inline .search-main-field {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0 !important;
  min-height: 52px !important;
  height: 52px !important;
  margin: 0 !important;
  border: 1.5px solid #2ad067 !important;
  border-radius: 999px !important;
  background: #fff !important;
  padding: 0 14px !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

html.ja-pwa-runtime .ja-pwa-search-inline .search-main-field > .material-symbols-rounded {
  color: #029990 !important;
  font-size: 22px !important;
}

html.ja-pwa-runtime .ja-pwa-search-inline #globalSearchInput {
  width: 100% !important;
  min-width: 0 !important;
  height: 48px !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 16px !important;
}

html.ja-pwa-runtime .ja-pwa-filter-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 52px;
  height: 52px;
  min-width: 52px;
  flex: 0 0 52px;
  margin: 0;
  padding: 0;
  border: 1.5px solid #2ad067;
  border-radius: 999px;
  background: #fff;
  color: #02343a;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

html.ja-pwa-runtime .ja-pwa-filter-toggle .material-symbols-rounded {
  color: #029990;
  font-size: 24px;
}

/* Bottom sheet holding only advanced filters. */
html.ja-pwa-runtime #searchAccordion > .search-accordion-body {
  position: fixed !important;
  z-index: 2147482501 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 520px !important;
  max-height: min(78dvh, 680px) !important;
  margin: 0 auto !important;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom)) !important;
  border-radius: 26px 26px 0 0 !important;
  background: rgba(255,255,255,.985) !important;
  box-shadow: 0 -16px 48px rgba(2,52,58,.18) !important;
  overflow-y: auto !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate3d(0, 105%, 0) !important;
  transition: transform .26s cubic-bezier(.22,.8,.24,1), opacity .18s ease !important;
}

html.ja-pwa-runtime #searchAccordion.is-pwa-sheet-open > .search-accordion-body {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translate3d(0,0,0) !important;
}

html.ja-pwa-runtime #searchAccordion > .search-accordion-body::before {
  content: "";
  display: block;
  width: 54px;
  height: 5px;
  margin: -7px auto 14px;
  border-radius: 999px;
  background: #d3ddda;
}

html.ja-pwa-runtime #searchAccordion .search-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 9px !important;
}

html.ja-pwa-runtime #searchAccordion .search-row > .field-shell {
  min-height: 52px !important;
  border-radius: 18px !important;
  padding: 0 11px !important;
}

html.ja-pwa-runtime #searchAccordion .search-row .field-shell input,
html.ja-pwa-runtime #searchAccordion .search-row .field-shell select {
  font-family: inherit !important;
  font-size: 16px !important;
}

html.ja-pwa-runtime #searchAccordion .search-submit-btn {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-height: 52px !important;
  border-radius: 18px !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

html.ja-pwa-runtime .ja-pwa-filter-overlay {
  position: fixed;
  z-index: 2147482500;
  inset: 0;
  background: rgba(2, 35, 39, .38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

html.ja-pwa-runtime .ja-pwa-filter-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

html.ja-pwa-runtime body.ja-pwa-filter-open {
  overflow: hidden !important;
}

/* Clear, intentional gap after banner dots before search. */
html.ja-pwa-runtime .ja-home-banner-slider {
  margin-bottom: 24px !important;
}

@media (max-width: 390px) {
  html.ja-pwa-runtime #searchAccordion .search-row {
    grid-template-columns: 1fr !important;
  }

  html.ja-pwa-runtime #searchAccordion .search-submit-btn {
    grid-column: auto !important;
  }
}
