/* Header Styles */
.site-header {
  background-color: var(--brand-primary);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left { display: flex; align-items: center; }
.header-center { flex: 1; display: flex; justify-content: center; }
.header-right { display: flex; align-items: center; gap: 20px; }

/* Brand */
.site-logo { color: #fff; font-size: 24px; font-weight: bold; text-decoration: none; }
.site-logo .logo-accent { color: #FF6B35; }
.site-logo .custom-logo { max-height: 36px; height: 36px; width: auto; }

/* Search */
.header-search { flex: 1; max-width: 500px; margin: 0 40px; position: relative; }
.search-input {
  width: 100%; padding: 12px 50px 12px 20px; border: none; border-radius: 25px;
  font-size: 16px; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); color: var(--brand-text);
}
.search-input::placeholder { color: #999; }
.search-button {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--brand-primary); border: none; border-radius: 50%; width: 36px; height: 36px;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.search-button:hover { background: var(--brand-primary-600); }

/* Live Search Results */
.live-search-results {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  max-height: 400px; overflow-y: auto; z-index: 1000; margin-top: 8px;
}
.header-search:focus-within .live-search-results { display: block; }
.live-search-results a {
  display: block; padding: 10px 14px; color: var(--brand-text); text-decoration: none; font-size: 14px;
}
.live-search-results a:hover { background: #f8fafc; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-actions a { display: inline-flex; align-items: center; gap: 8px; }
.whatsapp-btn, .login-btn {
  color: #fff; text-decoration: none; padding: 8px 16px; border-radius: 20px; font-size: 14px; transition: background-color 0.3s;
}
.whatsapp-btn { background-color: #25D366; }
.whatsapp-btn:hover { background-color: #1da954; }
.login-btn:hover { background-color: rgba(255,255,255,0.1); }

/* ---------- Mobile-only: Row1 centered logo, Row2 = search (left) + login (right) ---------- */
@media (max-width: 768px) {
  .site-header .header-container{
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    row-gap: 12px;
    column-gap: 12px;
    padding: 12px 16px !important;
  }

  .site-header .header-left{
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }

  .site-header .header-center{
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }
  .site-header .header-center .header-search{
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    position: relative; z-index: 1;
  }

  .site-header .header-right{
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    z-index: 2;
  }

  .site-header .header-search .search-input{
    padding: 12px 48px 12px 16px !important;
    font-size: 16px !important;
    border-radius: 28px !important;
  }
  .site-header .header-search .search-button{
    width: 36px !important; height: 36px !important; right: 8px !important;
  }

  .site-header .header-actions .login-btn{
    font-size: 14px;
    padding: 8px 12px;
    line-height: 1;
    white-space: nowrap;
    border-radius: 999px;
    gap: 6px;
  }
  .site-header .header-actions .login-btn svg{
    width: 18px; height: 18px;
  }
}

/* Very small phones: even smaller button and padding */
@media (max-width: 480px) {
  .site-header .header-container{ padding: 10px 14px !important; }
  .site-header .header-search .search-input{ padding: 12px 44px 12px 14px !important; }
  .site-header .header-search .search-button{ width: 34px !important; height: 34px !important; right: 8px !important; }
  .site-header .header-actions .login-btn{ font-size: 13px; padding: 8px 10px; gap: 6px; }
}

/* Header light theme + thin separator (strong override) */
header.site-header,
#site-header.site-header,
.site-header{
  background: #faf9f6 !important;
  background-color: #faf9f6 !important;
  box-shadow: 0 1px 0 rgba(15,23,42,0.10) !important;
  border-bottom: 0 !important;
}

/* Kill any header overlays/gradients */
.site-header::before,
.site-header::after{
  content: none !important;
  background: none !important;
}

/* Some themes color the inner container — keep it transparent */
.site-header .header-container{
  background: transparent !important;
}

/* Make text readable on light header */
.site-header .site-logo{ color: var(--brand-text) !important; }
.site-header .header-actions .login-btn{
  color: var(--brand-text) !important;
  background: transparent !important;
}
.site-header .header-actions .login-btn:hover{
  background: rgba(15,23,42,0.06) !important;
}

/* Keep WhatsApp button green */
.site-header .whatsapp-btn{
  background-color: #25D366 !important; color:#fff !important;
}
/* Sticky header + slide hide/show + hairline (all devices) */
header.site-header,
#site-header.site-header,
.site-header{
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 1000;
  background: #faf9f6;
  transition: transform .24s ease;
  will-change: transform;
}

/* Hidden state (toggled by JS) */
.site-header.header--hidden{
  transform: translate3d(0,-110%,0);
}

/* Always show a very thin bottom line */
.site-header{
  position: sticky; /* ensures ::after anchors to header */
}
.site-header::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(15,23,42,0.12);
  pointer-events: none;
}

/* Make sure no old rule disables sticky on mobile */
@media (max-width: 768px){
  .site-header{
    position: sticky !important;
    top: 0 !important;
  }
}