/* Redesigned Premium Top Utility Bar */
.top-bar {
  background: linear-gradient(135deg, #04382B 0%, #064E3B 55%, #0B6E53 100%);
  color: #FFFFFF;
  padding: 0.45rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1005;
}

.top-bar-content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 32px;
}

.top-bar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 auto;
}

.top-bar-right {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

html[dir="rtl"] .top-bar-right {
  right: auto;
  left: 0;
}

@media (max-width: 860px) {
  .top-bar {
    display: none !important; /* Hide green top utility bar on mobile views */
  }
}

.top-bar-nav-link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.1px;
}

.top-bar-nav-link svg {
  width: 14px;
  height: 14px;
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.top-bar-nav-link:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.top-bar-nav-link:hover svg {
  transform: scale(1.1);
  opacity: 1;
}

.top-bar-nav-link.active {
  background: #FFFFFF;
  color: #064E3B;
  border-color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.top-bar-nav-link.active svg {
  color: #064E3B;
  stroke: #064E3B;
}

/* Post Free Listing Button */
.top-bar-post-free-btn {
  background: linear-gradient(135deg, #F2A71B 0%, #F59E0B 100%);
  color: #064E3B;
  border: 1px solid #FCD34D;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(242, 167, 27, 0.3);
}

.top-bar-post-free-btn:hover {
  background: #FFFFFF;
  color: #064E3B;
  border-color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.4);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Language Selector Dropdown */
.lang-selector-wrapper {
  position: relative;
  display: inline-block;
}

.lang-selector-btn {
  background: rgba(0, 0, 0, 0.28);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.22s ease;
  backdrop-filter: blur(4px);
}

.lang-selector-btn:hover {
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 160px;
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid rgba(6, 78, 59, 0.15);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  padding: 6px;
  z-index: 1200;
  animation: dropdownPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownPop {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html[dir="rtl"] .lang-dropdown-menu {
  right: auto;
  left: 0;
}

.lang-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #0F172A;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

html[dir="rtl"] .lang-dropdown-item {
  text-align: right;
}

.lang-dropdown-item:hover {
  background: #F1F5F9;
  color: #064E3B;
}

.lang-dropdown-item.active {
  background: #ECFDF5;
  color: #059669;
  font-weight: 800;
}

/* Site Main Header */
header.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #FFFFFF;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 3px solid #239c32;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
}

/* Brand Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-word {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: #083818;
  line-height: 1;
  letter-spacing: -0.02em;
}

.logo-word span {
  color: #008A3C;
}

.logo-tagline {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: #16A34A;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
  font-weight: 700;
}

/* Navigation Links (Centered) */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin: 0 auto;
}

.main-nav ul {
  display: flex;
  gap: clamp(1.2rem, 2.2vw, 3rem);
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  flex-wrap: nowrap;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--forest-dk);
  position: relative;
  padding: 6px 4px;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.main-nav a:hover {
  color: var(--forest);
}

.main-nav a.active {
  color: var(--forest-dk);
  font-weight: 800;
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--forest);
  border-radius: 4px;
}

/* Highlighted Advertise Link Styling */
.main-nav a.nav-advertise-highlight {
  color: #D97706 !important;
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  padding: 5px 12px !important;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
  transition: all 0.25s ease;
}

.main-nav a.nav-advertise-highlight:hover {
  background: #FDE68A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.main-nav .nav-adv-badge {
  font-size: 0.65rem;
  background: #F59E0B;
  color: #FFFFFF;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0.03em;
  animation: pulseBadge 2s infinite ease-in-out;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

.dealer-nav-badge {
  background-color: var(--marigold);
  color: var(--forest-dk);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  margin-left: 0.25rem;
  font-weight: 800;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.btn-header-profile {
  background: var(--forest-dk) !important;
  color: var(--paper) !important;
  border: 2px solid var(--marigold) !important;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-header-profile:hover {
  background: var(--forest) !important;
  color: var(--marigold) !important;
  border-color: var(--marigold) !important;
  transform: translateY(-1px);
}


.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--forest-dk);
  background: var(--paper);
  color: var(--forest-dk);
  border-radius: 50%;
  position: relative;
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--rani);
  color: white;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile & Laptop Breakpoints */
@media (max-width: 1280px) {
  .logo-tagline {
    display: none;
  }

  .main-nav ul {
    gap: 0.6rem;
  }

  .main-nav a {
    font-size: 0.78rem;
  }
}

.mobile-hamburger-btn {
  display: none;
  background: var(--paper);
  border: 2px solid var(--forest-dk);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--forest-dk);
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: 0.5rem;
}

.mobile-nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #FFFFFF;
  border-bottom: 3px solid #064E3B;
  padding: 1rem 1.25rem 1.5rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  flex-direction: column;
  gap: 0.25rem;
  z-index: 10000;
  max-height: calc(82vh - 60px);
  max-height: calc(82dvh - 60px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mobile-nav-drawer::-webkit-scrollbar {
  display: none;
}

.mobile-nav-drawer.open {
  display: flex !important;
}

.mobile-nav-drawer a {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1E293B;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: none;
  transition: all 0.2s ease;
}

.mobile-nav-drawer a:hover,
.mobile-nav-drawer a:active,
.mobile-nav-drawer a.active {
  background-color: #ECFDF5;
  color: #059669;
}

@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  .mobile-hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .btn-hide-mobile {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  #logout-btn,
  #open-auth-login-btn,
  #open-auth-signup-btn,
  .desktop-auth-btn {
    display: none !important;
  }

  .header-inner {
    padding: 8px 0;
    gap: 0.5rem;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
  }

  .logo-word {
    font-size: 1.15rem;
  }

  .header-actions {
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
  }

  .btn-header-profile {
    padding: 5px 8px;
    font-size: 0.72rem;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
  }

  .top-bar-pill {
    white-space: nowrap;
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .unit-selector,
  .currency-selector {
    padding: 0.15rem 0.3rem;
    font-size: 0.65rem;
  }

  .top-bar-content {
    gap: 0.25rem;
  }

  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 60px !important;
    background: rgba(15, 26, 18, 0.97) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4) !important;
    z-index: 9999 !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 4px calc(env(safe-area-inset-bottom, 0px)) !important;
    overflow: visible !important;
  }

  /* Prevent body bottom gap - footer handles bottom clearance */
  body {
    padding-bottom: 0 !important;
  }

  /* Position floating AI Chatbot Launcher above bottom navbar on mobile */
  #ai-chatbot-widget-container {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    z-index: 9990 !important;
  }

  #toggle-ai-chat-btn {
    width: 46px !important;
    height: 46px !important;
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.45) !important;
  }

  #toggle-ai-chat-btn svg {
    width: 22px !important;
    height: 22px !important;
  }

  #ai-chatbot-drawer {
    width: calc(100vw - 20px) !important;
    max-width: 390px !important;
    right: 10px !important;
    bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
    height: 74vh !important;
    max-height: calc(100dvh - 90px) !important;
    border-radius: 16px !important;
    z-index: 10000 !important;
  }
}

@media (max-width: 480px) {
  .user-header-name-text,
  .lang-code-text {
    display: none !important; /* Hide long text labels on tiny screens so header buttons fit nicely */
  }

  .header-inner {
    padding: 6px 0;
    gap: 0.35rem;
  }

  .logo-mark {
    width: 28px;
    height: 28px;
  }

  .logo-word {
    font-size: 1.05rem;
  }

  .btn-header-profile,
  .btn-header-lang {
    padding: 4px 6px !important;
    font-size: 0.72rem !important;
  }

  .mobile-hamburger-btn {
    padding: 5px 8px !important;
    margin-left: 2px !important;
  }
}

@media (max-width: 360px) {
  .header-inner {
    padding: 4px 0 !important;
    gap: 3px !important;
  }

  .logo {
    gap: 5px !important;
  }

  .logo-mark {
    width: 25px !important;
    height: 25px !important;
  }

  .logo-word {
    font-size: 0.92rem !important;
  }

  .logo-tagline {
    font-size: 0.48rem !important;
  }

  .header-actions {
    gap: 3px !important;
  }

  .btn-header-profile,
  .btn-header-lang {
    padding: 3px 5px !important;
    font-size: 0.68rem !important;
  }

  .mobile-hamburger-btn {
    padding: 4px 6px !important;
    margin-left: 0 !important;
  }

  .mobile-bottom-nav {
    height: 52px !important;
    padding: 2px 2px calc(2px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-nav-label {
    font-size: 0.58rem !important;
    letter-spacing: -0.2px !important;
  }

  .mobile-nav-icon {
    width: 20px !important;
    height: 20px !important;
  }

  .mobile-nav-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .mobile-nav-sell-btn {
    top: -15px !important;
    width: 44px !important;
    height: 44px !important;
  }

  .sell-label {
    font-size: 0.58rem !important;
    margin-bottom: 3px !important;
  }

  #ai-chatbot-widget-container {
    bottom: 58px !important;
    right: 6px !important;
  }

  #toggle-ai-chat-btn {
    width: 40px !important;
    height: 40px !important;
  }

  #toggle-ai-chat-btn svg {
    width: 18px !important;
    height: 18px !important;
  }

  #ai-chatbot-drawer {
    width: calc(100vw - 10px) !important;
    max-width: 307px !important;
    right: -2px !important;
    bottom: 52px !important;
    height: calc(100dvh - 65px) !important;
    max-height: 460px !important;
  }
}

/* Base Mobile Bottom Navigation (Hidden on Desktop > 768px) */
@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* Nav Item Buttons */
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #94a3b8;
  padding: 4px 0 2px;
  cursor: pointer;
  gap: 2px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  height: 100%;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-item.active {
  color: #f2a71b !important;
}

.mobile-nav-item.active .mobile-nav-icon {
  color: #f2a71b !important;
  transform: translateY(-1px);
}

.mobile-nav-item.active .mobile-nav-icon svg {
  stroke: #f2a71b !important;
  filter: drop-shadow(0 0 6px rgba(242, 167, 27, 0.65));
}

.mobile-nav-item.active .mobile-nav-label {
  color: #f2a71b !important;
  font-weight: 700 !important;
}

.mobile-nav-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: inherit;
  transition: all 0.2s ease;
}

.mobile-nav-badge-dot {
  position: absolute;
  top: 0px;
  right: -2px;
  width: 7px;
  height: 7px;
  background-color: #f2a71b;
  border-radius: 50%;
  border: 1.5px solid #0f1a12;
}

.mobile-nav-label {
  font-family: 'Plus Jakarta Sans', var(--font-body, sans-serif);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  color: inherit;
}

/* Central Elevated "Sell" Floating Button Wrapper */
.mobile-nav-sell-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  height: 100%;
  padding-bottom: 3px;
  overflow: visible !important;
}

.mobile-nav-sell-btn {
  position: absolute;
  top: -16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  /* Theme Gold & Green Gradient Ring */
  background: linear-gradient(135deg, #f2a71b 0%, #22c55e 50%, #15803d 100%);
  padding: 3px;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.45), 0 2px 8px rgba(0, 0, 0, 0.5);
  border: none;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-sell-btn:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 20px rgba(242, 167, 27, 0.6), 0 4px 12px rgba(0, 0, 0, 0.6);
}

.mobile-nav-sell-btn:active {
  transform: translateY(0px) scale(0.92);
}

.sell-btn-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #0b3b24;
  /* Dark emerald matching theme */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: background-color 0.2s ease;
}

.mobile-nav-sell-btn:hover .sell-btn-inner,
.mobile-nav-sell-btn.active .sell-btn-inner {
  background-color: #15803d;
}

.sell-label {
  margin-top: auto;
  margin-bottom: 3px;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

.mobile-nav-sell-wrapper:hover .sell-label,
.mobile-nav-sell-btn.active ~ .sell-label {
  color: #22c55e !important;
}