/*
 * Site header (frontend/includes/header.blade.php).
 * The header scrolls with the page. Pages were laid out for the old fixed bar
 * (--sg-hdr-old tall), so the body is pushed down by the difference.
 * --sg-hdr-h is set from the real height by a script in the header.
 */
:root { --sg-hdr-h: 76px; --sg-hdr-old: 52px; --sgh-top: 40px; }
@media (max-width: 1023.98px) { :root { --sg-hdr-h: 128px; } }
@media (max-width: 767.98px) { :root { --sg-hdr-old: 40px; --sg-hdr-h: 120px; } }

html body { padding-top: max(0px, calc(var(--sg-hdr-h) - var(--sg-hdr-old))) !important; }

/* Position the bar against the page itself, not the (pushed down) body content. */
html body .sg-site-header, html body .sg-site-header .str, html body .hom-head { position: static !important; transform: none !important; }
html body .hom-head { background: none !important; padding: 0 !important; margin: 0 !important; }
html body .hom-head::before, html body .hom-head::after { display: none !important; content: none !important; }
html body .hom-head .hom-top,
html body .hom-head .hom-top.dmact,
html body .hom-head .hom-top.dmact.act {
  position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; transform: none !important;
  z-index: 10000; height: auto !important; padding: 0 !important; margin: 0 !important;
  background: #066CB5 !important; box-shadow: none !important; transition: none !important;
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
}
html body .hom-head .hom-top > .container { display: block !important; max-width: 1300px; width: 100%; padding: 0 14px; margin: 0 auto; overflow: visible !important; }
html body .hom-head .hom-top > .container > .row { margin: 0; display: block; }
html body .hom-top .hom-nav {
  position: relative; display: flex !important; align-items: center; gap: 12px; height: 76px; padding: 0 !important;
  float: none !important; width: 100% !important; margin: 0 !important;
}
html body .hom-top .hom-nav > :not(.pop-menu) { float: none !important; margin: 0; position: static; }
html body .hom-top .hom-nav > :not(.pop-menu) svg { flex: none; display: block; }

/* Logo */
html body .hom-top .top-log { display: flex !important; align-items: center; flex: none; width: auto !important; height: auto !important; padding: 0 !important; margin: 0 8px 0 0 !important; }
html body .hom-top .top-log img { width: 144px !important; height: auto !important; max-width: none; display: block !important; margin: 0 !important; position: static !important; }

/* Categories button (opens the category menu) */
html body .hom-top .hom-nav .menu.sg-cat-btn {
  display: inline-flex !important; align-items: center; gap: 9px; flex: none; width: 150px; height: 44px; padding: 0 12px !important;
  border: 1px solid rgba(255, 255, 255, .23) !important; border-radius: 10px; background: rgba(255, 255, 255, .055) !important;
  color: #fff !important; font: 500 13px/1 Poppins, system-ui, sans-serif; cursor: pointer; text-align: left;
}
html body .hom-top .hom-nav .menu.sg-cat-btn::before, html body .hom-top .hom-nav .menu.sg-cat-btn::after { display: none !important; content: none !important; }
html body .hom-top .hom-nav .menu.sg-cat-btn:hover, html body .hom-top .hom-nav .menu.sg-cat-btn.ani { background: rgba(255, 255, 255, .14) !important; }
.sg-cat-label { flex: 1; }
.sg-cat-burger { display: none; }
.sg-cat-chev svg { width: 18px; height: 18px; }

/* Search */
html body .hom-top .hom-nav .top-ser { display: block !important; flex: 1 1 auto; min-width: 0; max-width: 520px; width: auto !important; margin: 0 6px !important; padding: 0 !important; position: static !important; }
html body .hom-top .top-ser form { margin: 0; padding: 0; }
html body .hom-top .top-ser ul {
  display: flex; align-items: center; gap: 8px; height: 46px; margin: 0 !important; padding: 0 5px 0 14px !important; list-style: none;
  background: #fff; border: 1px solid rgba(255, 255, 255, .63); border-radius: 11px; box-shadow: 0 2px 4px rgba(3, 60, 111, .06); width: 100% !important;
}
html body .hom-top .top-ser li { float: none !important; width: auto !important; margin: 0 !important; padding: 0 !important; list-style: none; border: 0 !important; background: none !important; }
html body .hom-top .top-ser .sr-sea { flex: 1; min-width: 0; display: flex !important; align-items: center; gap: 10px; height: 44px; }
.sg-ser-ic { color: #5B7083; display: flex; }
html body .hom-top .top-ser input {
  flex: 1; min-width: 0; width: 100% !important; height: 44px !important; padding: 0 8px 0 0 !important; margin: 0 !important;
  border: 0 !important; outline: 0; box-shadow: none !important; background: transparent !important; color: #193348; font: 400 13px/44px Poppins, system-ui, sans-serif;
}
html body .hom-top .top-ser input::placeholder { color: #6B7C8C; }
html body .hom-top .top-ser input::-webkit-search-cancel-button { -webkit-appearance: none; }
html body .hom-top .top-ser ul:focus-within { box-shadow: 0 0 0 3px rgba(77, 163, 224, .55); }
html body .hom-top .top-ser .sbtn button {
  display: grid !important; place-items: center; width: 34px !important; height: 34px !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; border-radius: 8px !important; background: #EAF4FC !important; background-image: none !important; color: #066CB5 !important; cursor: pointer; box-shadow: none !important;
}
html body .hom-top .top-ser .sbtn button:hover { background: #D6EAF8 !important; }

/* Account actions */
html body .hom-top .hom-nav .sg-actions { display: flex !important; align-items: center; gap: 6px; margin: 0 0 0 auto !important; padding: 0 !important; list-style: none; width: auto !important; position: static !important; }
html body .hom-top .sg-actions li { float: none !important; margin: 0 !important; padding: 0 !important; list-style: none; border: 0 !important; width: auto !important; }
html body .hom-top .sg-actions li::before, html body .hom-top .sg-actions li::after, html body .hom-top .sg-actions a::before, html body .hom-top .sg-actions a::after { display: none !important; content: none !important; }
html body .hom-top .sg-actions a {
  display: inline-flex !important; align-items: center; gap: 7px; height: 44px; padding: 0 10px !important; border-radius: 10px !important;
  color: #fff !important; font: 600 13px/1 Poppins, system-ui, sans-serif !important; white-space: nowrap; text-decoration: none !important;
  background: transparent !important; border: 1px solid transparent !important; box-shadow: none !important; width: auto !important; margin: 0 !important;
}
html body .hom-top .sg-actions .sg-act-text a:hover { background: rgba(255, 255, 255, .1) !important; }
html body .hom-top .sg-actions .sg-act-post a { background: #098342 !important; border-color: rgba(255, 255, 255, .15) !important; padding: 0 16px !important; margin-left: 6px !important; }
html body .hom-top .sg-actions .sg-act-post a:hover { background: #07703A !important; }
html body .hom-top .hom-nav a:focus-visible, html body .hom-top .hom-nav button:focus-visible { outline: 3px solid #9CCDF2; outline-offset: 2px; }

/* Logged in: notifications, messages and the account menu */
html body .hom-top .hom-nav > #userNotification,
html body .hom-top .hom-nav > #userMessages { display: flex !important; align-items: center; flex: none; position: relative !important; top: auto !important; right: auto !important; width: auto !important; }
html body .hom-top .hom-nav > .al { position: relative !important; flex: none; top: auto !important; right: auto !important; display: flex !important; align-items: center; width: auto !important; }
html body .hom-top .hom-nav > .al .head-pro { position: relative !important; top: auto !important; right: auto !important; display: flex !important; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 4px !important; margin: 0 !important; border-radius: 10px; width: auto !important; }
html body .hom-top .hom-nav > .al .head-pro:hover { background: rgba(255, 255, 255, .1); }
html body .hom-top .hom-nav > .al .head-pro img, html body .hom-top .hom-nav > .al .head-pro .sg-hinitials { position: static !important; width: 34px !important; height: 34px !important; border-radius: 50% !important; margin: 0 !important; flex: none; }
html body .hom-top .hom-nav > .al .head-pro h4 { position: static !important; margin: 0 !important; padding: 0 !important; color: #fff !important; font: 600 13px/1.2 Poppins, system-ui, sans-serif !important; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Category menu opens under the header (phones keep their full-screen menu) */
@media (min-width: 1024px) {
  html body .hom-top .hom-nav > .pop-menu { position: absolute !important; top: 100% !important; margin-top: 0 !important; }
}

/* Pages that place themselves under the header with --sg-header-h (sell/partials/assets)
   already get the body's top padding, so take it off again. */
html body .sg.sg-offset { margin-top: calc(var(--sg-header-h, 78px) - var(--sg-hdr-h) + var(--sg-hdr-old)); }

/* Category strip on inner pages: scrolls with the header */
html body .v3-list-ql { position: absolute !important; top: var(--sg-hdr-h) !important; }

/* Tablets and phones: menu + logo on top, search underneath */
@media (max-width: 1023.98px) {
  html body .hom-top .hom-nav { flex-wrap: wrap; height: auto; padding: 12px 0 !important; row-gap: 12px; column-gap: 10px; }
  html body .hom-top .hom-nav .menu.sg-cat-btn { width: 40px; height: 40px; padding: 0 !important; justify-content: center; border: 0 !important; background: transparent !important; order: 0; }
  html body .hom-top .hom-nav .menu.sg-cat-btn:hover { background: rgba(255, 255, 255, .1) !important; }
  .sg-cat-grid, .sg-cat-label, .sg-cat-chev { display: none; }
  .sg-cat-burger { display: flex; }
  .sg-cat-burger svg { width: 24px; height: 24px; }
  html body .hom-top .top-log { order: 1; }
  html body .hom-top .top-log img { width: 122px !important; }
  html body .hom-top .hom-nav .sg-actions { order: 2; }
  html body .hom-top .hom-nav > #userNotification, html body .hom-top .hom-nav > #userMessages, html body .hom-top .hom-nav > .al { order: 3; }
  html body .hom-top .hom-nav > #userNotification { margin-left: auto !important; }
  html body .hom-top .hom-nav .sg-actions + #userNotification { margin-left: 0 !important; }
  html body .hom-top .hom-nav .top-ser { order: 10; flex: 0 0 100%; max-width: none; margin: 0 !important; }
}
@media (max-width: 767.98px) {
  /* Post ad and log in are in the bottom bar on phones. */
  html body .hom-top .hom-nav .sg-actions, html body .hom-top .hom-nav > .al { display: none !important; }
  html body .hom-top .hom-nav > #userNotification { margin-left: auto !important; }
  html body .hom-top .top-ser input { font-size: 16px; }
}
