.header-utility {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 999999;
  transition: var(--transition);
}

.header-utility .container {
  max-width: none !important;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .header-utility .container {
    padding: 0 20px;
  }
}

.header-utility.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  padding: 12px 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-utility {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 24px;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.brand-utility img {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.brand-utility img.logo-inverted {
  filter: invert(1) brightness(0.2);
}

.brand-utility span span {
  color: var(--primary);
}

@media (max-width: 768px) {
  .brand-utility img {
    height: 24px;
  }
}

.header-mobile-actions {
  display: none !important;
  align-items: center;
  gap: 12px;
}

.btn-mobile-filter {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 8px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}

.btn-mobile-filter i {
  font-size: 14px;
  color: var(--primary);
}

/* Desktop User Interaction Header Actions */
.header-desktop-layout {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: space-between;
  margin-left: 30px;
}

.nav-utility-new {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link-new {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.nav-link-new:hover {
  color: #000;
}

.nav-dropdown-icon {
  font-size: 8px;
  color: #64748b;
  margin-left: 6px;
  transition: transform 0.2s;
  opacity: 0.7;
}

.nav-dropdown-wrapper:hover .nav-dropdown-icon {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--primary);
}

/* Dropdown Logic */
.nav-dropdown-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  padding: 12px 0;
  z-index: 1000000; /* Higher than parent header to ensure visibility */
  margin-top: 10px;
  
  /* Hover intent / Grace period */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0.15s; /* Grace period on mouse out */
  display: block;
}

.nav-dropdown-wrapper:hover .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s; /* Immediate show */
}

/* Arrow indicator on top of dropdown */
.nav-dropdown-content::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-left: 1px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
  transform: rotate(45deg);
}
/* Invisible bridge to prevent losing hover when moving mouse down */
.nav-dropdown-wrapper::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 0;
  width: 100%;
  height: 20px;
  z-index: 1050;
}
.nav-dropdown-content a {
  display: block;
  padding: 10px 20px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-dropdown-content a:hover {
  background: #f8fafc;
  color: #0045A5;
  padding-left: 24px;
}

.dropdown-group-label {
  padding: 10px 20px 5px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.dropdown-group-label:not(:first-child) {
  border-top: 1px solid #f1f5f9;
  margin-top: 5px;
}

.header-actions-new {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-search-box {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 27px;
  border: 1px solid transparent;
  padding: 0 4px 0 20px;
  width: 320px;
  height: 54px; /* Even taller for 'full-height' effect */
  transition: all 0.2s ease;
}

.header-search-box:focus-within {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 69, 165, 0.1);
}

.header-search-input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  outline: none;
}

.header-search-input::placeholder {
  color: #94a3b8;
}

.header-search-btn {
  background: none;
  border: none;
  color: #64748b;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: 0.2s;
  font-size: 16px;
}

.header-search-btn:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.header-phone-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e6f4ea;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
}

.header-phone-btn:hover {
  background: #dcfce7;
  transform: scale(1.05);
}

.header-login-btn {
  text-decoration: none;
  background: #f1f5f9;
  color: #1e293b;
  padding: 0 24px;
  height: 54px; /* Synced with search bar */
  display: flex;
  align-items: center;
  border-radius: 27px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.header-login-btn:hover {
  background: #e2e8f0;
}

/* Default: Hide mobile-only elements on large screens */
@media (min-width: 992px) {
  .mobile-nav-header,
  .mobile-nav-footer,
  .mobile-nav-label {
    display: none !important;
  }
}

/* --- Mobile Menu --- */
.mobile-toggle {
  display: none !important;
  background: #f1f5f9;
  border: none;
  font-size: 20px;
  color: #1e293b;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mobile-toggle:active {
  transform: scale(0.9);
}

@media (max-width: 991px) {
  .header-inner {
    padding: 8px 0;
  }
  
  .header-desktop-layout {
    margin-left: 0;
    justify-content: flex-end;
  }

  .header-actions-new {
    display: none; /* Hide search/login from top bar on mobile */
  }

  .header-mobile-actions {
    display: flex !important;
    gap: 8px;
    flex: 1;
    order: 3; /* Hamburger on RIGHT */
    justify-content: flex-end;
  }
  
  .mobile-toggle {
    display: flex !important;
  }

  .brand-utility {
    flex: 2;
    justify-content: center;
    order: 2; /* Logo in middle */
  }

  .header-desktop-layout {
    flex: 1;
    margin-left: 0;
    justify-content: flex-start;
    order: 1;
  }

  .nav-utility-new {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    padding: 60px 0 !important; /* Increased top offset */
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
    gap: 0;
    align-items: stretch;
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
  }

  .nav-utility-new.active {
    left: 0;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-header {
    display: flex !important;
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 2500;
    pointer-events: none;
  }

  .nav-title { display: none !important; }

  .nav-close {
    background: #f1f5f9;
    border: none;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    color: #1e293b;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    visibility: visible !important;
    opacity: 1 !important;
  }

  .nav-close:hover {
    background: #e2e8f0;
    transform: scale(1.1);
  }

  .nav-link-new {
    color: #1e293b;
    padding: 12px 20px;
    margin: 8px 32px; /* Increased vertical and horizontal spacing */
    background: #f0f7ff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px; /* Slightly more rounded */
    display: flex;
    align-items: center;
    text-decoration: none;
    border-bottom: none;
    transition: all 0.2s;
  }

  .nav-link-new i {
    display: inline-block !important;
    width: 20px;
  }

  /* Show the categories label on mobile only */
  .mobile-nav-label {
    display: block !important;
  }

  .nav-link-new:hover {
    background: #f8fafc;
  }

  .nav-link-new i {
    display: none; /* Hide dropdown arrows etc on mobile */
  }

  .mobile-nav-footer {
    padding: 24px;
    margin-top: auto;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
  }

  .btn-mobile-login {
    display: block;
    width: 100%;
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
  }
  .nav-user-meta-desktop,
  .logout-link-desktop {
    display: none;
  }

  .nav-dropdown-content {
    position: static;
    display: block;
    max-height: 0; /* Collapsed by default */
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0 32px;
    background: transparent;
    min-width: auto;
    transform: none; /* Disable desktop transitions */
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  }
  .nav-dropdown-wrapper.active-mobile .nav-dropdown-content {
    max-height: 500px; /* Large enough for content */
    opacity: 1;
    visibility: visible;
    padding-bottom: 15px;
  }
  .nav-dropdown-content::before { display: none; }
  .nav-dropdown-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-dropdown-wrapper > .nav-link-new {
    margin-bottom: 0px;
    position: relative;
    cursor: pointer;
  }
  .nav-dropdown-wrapper.active-mobile > .nav-link-new {
    background: #f8fafc;
    color: var(--primary);
  }
  .nav-dropdown-content a {
    background: transparent;
    border: none;
    margin-bottom: 4px;
    font-size: 13px;
    padding: 10px 15px 10px 48px; /* Indented */
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8; /* Gray/Slate text */
  }
  .nav-dropdown-content a:hover {
    color: var(--primary);
  }
  .nav-dropdown-content a::before {
    display: none; /* No arrows */
  }
  .nav-dropdown-icon {
    display: inline-block !important;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.3s ease;
  }
  .nav-dropdown-wrapper.active-mobile .nav-dropdown-icon {
    transform: translateY(-50%) rotate(180deg);
  }
  /* Disable desktop bridge and hover effects on mobile */
  .nav-dropdown-wrapper::after { display: none; }
  .nav-dropdown-wrapper:hover .nav-dropdown-content {
     opacity: 0;
     visibility: hidden;
     max-height: 0;
  }
  .nav-dropdown-wrapper.active-mobile:hover .nav-dropdown-content {
     opacity: 1;
     visibility: visible;
     max-height: 500px;
  }
}

/* --- Footer Styles --- */
.footer-market-clean {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 80px 0 40px;
}

.footer-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px;
  margin-bottom: 60px;
}

.footer-col-practical h4 {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.footer-col-practical ul {
  list-style: none;
  padding: 0;
}

.footer-col-practical ul li {
  margin-bottom: 14px;
}

.footer-col-practical ul li a {
  text-decoration: none;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}

.footer-col-practical ul li a:hover {
  color: var(--primary);
  padding-left: 4px;
}

.footer-bottom-practical {
  border-top: 1px solid var(--border-light);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom-practical p {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 991px) {
  .footer-grid-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}

@media (max-width: 576px) {
  .footer-grid-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .footer-bottom-practical {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}
