/* HAD Consultants - Mobile Responsive Fixes */

/* ============= Logo Fixes ============= */
/* Desktop logo */
.header1-logo-main img {
  max-height: 60px;
  height: auto;
  width: auto;
}

/* Mobile logo */
.had-logo-mobile {
  max-height: 40px !important;
  height: auto !important;
  width: auto !important;
}

/* Remove duplicate logo visibility */
.header1-logo-block,
.header1-logo-white {
  display: none !important;
}

/* ============= Mobile Navigation Fixes ============= */
/* Mobile menu container */
@media (max-width: 991px) {
  /* Mobile header adjustments */
  .vl-header-area1 {
    padding: 10px 0;
    background-color: #fff !important;
  }
  
  /* Fix header background */
  #vl-header-sticky,
  .header1-bg {
    background-color: #fff !important;
  }
  
  /* Hide desktop-only elements on mobile */
  .vl-header1-right,
  .header1-social-wedget,
  .vl-search-top {
    display: none !important;
  }
  
  /* Mobile logo container */
  .vl-logo {
    display: flex;
    align-items: center;
  }
  
  /* Mobile menu button */
  .vl-header-action-item {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
  
  .vl-offcanvas-toggle {
    font-size: 24px;
    padding: 8px 12px;
    background: transparent;
    border: 2px solid #333;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none !important;
    box-shadow: none !important;
  }
  
  .vl-offcanvas-toggle:hover {
    background-color: #333;
    color: #fff;
  }
  
  .vl-offcanvas-toggle:focus {
    outline: none !important;
    box-shadow: none !important;
  }
  
  /* Fix hamburger icon */
  .vl-offcanvas-toggle i {
    font-size: 20px;
    line-height: 1;
  }
  
  /* Offcanvas menu */
  .vl-offcanvas {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transition: all 0.3s ease;
    overflow-y: auto;
  }
  
  .vl-offcanvas.vl-offcanvas-open,
  .vl-offcanvas.active {
    right: 0;
  }
  
  .vl-offcanvas-wrapper {
    padding: 20px;
  }
  
  /* Mobile menu styling */
  .vl-offcanvas-menu {
    margin-bottom: 30px;
  }
  
  .vl-offcanvas-menu nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .vl-offcanvas-menu nav ul li {
    border-bottom: 1px solid #eee;
  }
  
  .vl-offcanvas-menu nav ul li a {
    display: block;
    padding: 15px 0;
    color: var(--vtc-text-title-1);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
  }
  
  .vl-offcanvas-menu nav ul li a:hover {
    color: var(--vtc-bg-main1);
  }
  
  /* Submenu styling */
  .vl-offcanvas-menu nav ul li.has-dropdown > a {
    position: relative;
    padding-right: 40px;
  }
  
  .vl-offcanvas-menu nav ul li button.vl-menu-close {
    position: absolute;
    right: 0;
    top: 15px;
    background: none;
    border: none;
    font-size: 14px;
    color: #666;
    padding: 0 15px;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .vl-offcanvas-menu nav ul li.active button.vl-menu-close {
    transform: rotate(90deg);
  }
  
  .vl-offcanvas-menu nav ul li .sub-menu {
    display: none;
    padding-left: 20px;
    background: #f8f8f8;
  }
  
  .vl-offcanvas-menu nav ul li .sub-menu li {
    border-bottom: 1px solid #e5e5e5;
  }
  
  .vl-offcanvas-menu nav ul li .sub-menu li:last-child {
    border-bottom: none;
  }
  
  .vl-offcanvas-menu nav ul li .sub-menu li a {
    font-size: 14px;
    padding: 12px 0;
  }
  
  /* Overlay */
  .vl-offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
  }
  
  .vl-offcanvas-overlay.vl-offcanvas-overlay-open,
  .vl-offcanvas-overlay.active {
    display: block;
  }
}

/* ============= General Mobile Responsiveness ============= */
@media (max-width: 767px) {
  /* Container adjustments */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Header top - hide on mobile */
  .header1-top {
    display: none !important;
  }
  
  /* Header adjustments */
  .header1-bg {
    padding: 10px 0;
  }
  
  /* Mobile header specific fixes */
  .vl-header-area1 {
    background-color: #fff !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
  }
  
  /* Ensure proper header height and alignment */
  .vl-header-area1 .row {
    min-height: 60px;
    align-items: center;
  }
  
  /* Mobile logo adjustments */
  .vl-logo a {
    display: block;
    line-height: 1;
  }
  
  .vl-logo img {
    max-height: 40px !important;
    width: auto;
  }
  
  /* Typography adjustments */
  h1, .font-72, .font-lg-72, .font-md-60 {
    font-size: 36px !important;
    line-height: 42px !important;
  }
  
  h2, .font-60, .font-lg-60, .font-md-48 {
    font-size: 28px !important;
    line-height: 34px !important;
  }
  
  h3, .font-48, .font-lg-48, .font-md-36 {
    font-size: 24px !important;
    line-height: 30px !important;
  }
  
  h4, .font-36, .font-lg-36, .font-md-28 {
    font-size: 20px !important;
    line-height: 26px !important;
  }
  
  h5, .font-24, .font-lg-24 {
    font-size: 18px !important;
    line-height: 24px !important;
  }
  
  p, .font-18 {
    font-size: 16px !important;
    line-height: 24px !important;
  }
  
  /* Button adjustments */
  .btn, .theme-btn {
    padding: 12px 24px;
    font-size: 16px;
  }
  
  /* Section spacing */
  .section-padding {
    padding: 40px 0;
  }
  
  .padding-top {
    padding-top: 40px;
  }
  
  .padding-bottom {
    padding-bottom: 40px;
  }
  
  /* Card and box adjustments */
  .service-box,
  .team-box,
  .project-box {
    margin-bottom: 30px;
  }
  
  /* Form adjustments */
  .form-control,
  .form-select {
    font-size: 16px;
    padding: 12px 15px;
  }
  
  /* Footer adjustments */
  .footer-widget {
    margin-bottom: 30px;
  }
  
  .footer-social a {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* ============= Tablet Specific ============= */
@media (min-width: 768px) and (max-width: 991px) {
  /* Header adjustments */
  .header1-top {
    font-size: 14px;
  }
  
  /* Typography adjustments */
  h1 {
    font-size: 48px;
    line-height: 54px;
  }
  
  h2 {
    font-size: 36px;
    line-height: 42px;
  }
  
  h3 {
    font-size: 28px;
    line-height: 34px;
  }
  
  /* Grid adjustments */
  .col-md-6 {
    margin-bottom: 30px;
  }
}

/* ============= Small Mobile Specific ============= */
@media (max-width: 575px) {
  /* Extra small device adjustments */
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Typography */
  h1 {
    font-size: 28px !important;
    line-height: 34px !important;
  }
  
  h2 {
    font-size: 24px !important;
    line-height: 30px !important;
  }
  
  /* Buttons */
  .btn-group-vertical .btn {
    margin-bottom: 10px;
  }
  
  /* Cards */
  .card {
    margin-bottom: 20px;
  }
}

/* ============= Utility Classes for Mobile ============= */
@media (max-width: 991px) {
  /* Text alignment */
  .text-md-left,
  .text-lg-left,
  .text-md-right,
  .text-lg-right {
    text-align: center !important;
  }
  
  /* Margin and padding utilities */
  .mt-md-0,
  .mt-lg-0 {
    margin-top: 20px !important;
  }
  
  .mb-md-0,
  .mb-lg-0 {
    margin-bottom: 20px !important;
  }
  
  /* Display utilities */
  .d-md-none {
    display: none !important;
  }
  
  .d-md-block {
    display: block !important;
  }
}

/* ============= Fix Specific Issues ============= */
/* Fix overlapping elements */
.vl-offcanvas-header {
  margin-bottom: 40px !important;
}

/* Ensure proper z-index hierarchy */
.vl-header-area1 {
  z-index: 1000;
}

.vl-offcanvas {
  z-index: 1100;
}

.vl-offcanvas-overlay {
  z-index: 1050;
}

/* Force remove any blue backgrounds on header */
header,
.vl-header-area1,
#vl-header-sticky,
.header-tranperent,
.header1-bg {
  background-color: #fff !important;
  background-image: none !important;
}

/* Ensure header styling on mobile */
@media (max-width: 991px) {
  header {
    background: #fff !important;
  }
  
  .vl-header-area1.header-tranperent {
    background: #fff !important;
  }
  
  /* Remove any potential dark backgrounds */
  .vl-header-area1::before,
  .vl-header-area1::after,
  header::before,
  header::after {
    display: none !important;
  }
}

/* Prevent horizontal scroll */
body {
  overflow-x: hidden;
}

.row {
  margin-left: -15px;
  margin-right: -15px;
}

/* Mobile menu icon fix */
.fa-bars-staggered::before {
  content: "\f0c9";
}

/* ============= Additional Mobile Fixes ============= */
/* Hero section mobile optimization */
@media (max-width: 767px) {
  .hero-section,
  .banner-section {
    min-height: 400px;
    padding: 60px 0;
  }
  
  .hero-content h1 {
    margin-bottom: 20px;
  }
  
  .hero-content p {
    margin-bottom: 30px;
  }
  
  /* Service boxes mobile layout */
  .service-box {
    padding: 30px 20px;
    text-align: center;
  }
  
  .service-box .icon {
    margin: 0 auto 20px;
  }
  
  /* Team member cards */
  .team-member {
    text-align: center;
    margin-bottom: 40px;
  }
  
  .team-member img {
    max-width: 200px;
    margin: 0 auto;
  }
  
  /* Project cards */
  .project-card {
    margin-bottom: 30px;
  }
  
  /* CTA sections */
  .cta-section {
    padding: 40px 0;
    text-align: center;
  }
  
  .cta-section .btn {
    display: inline-block;
    margin: 10px 5px;
  }
  
  /* Contact info */
  .contact-info-box {
    text-align: center;
    margin-bottom: 30px;
  }
  
  .contact-info-box .icon {
    margin: 0 auto 15px;
  }
  
  /* Forms on mobile */
  .contact-form .form-group {
    margin-bottom: 20px;
  }
  
  .contact-form input,
  .contact-form textarea,
  .contact-form select {
    width: 100%;
  }
}

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Fix any overflow issues */
* {
  max-width: 100vw;
}

.container,
.container-fluid {
  overflow-x: hidden;
}

/* Mobile menu dropdown fixes */
@media (max-width: 991px) {
  .vl-offcanvas-menu .has-dropdown > a::after {
    content: none;
  }
  
  .vl-offcanvas-menu .vl-menu-close {
    display: inline-block;
  }
  
  /* Ensure dropdowns work in mobile */
  .vl-offcanvas-menu .sub-menu {
    position: static;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}

/* ============= AGGRESSIVE Mobile Header Fixes ============= */
/* Override any blue/dark backgrounds with maximum specificity */
@media (max-width: 991px) {
  body header,
  body .vl-header-area1,
  body #vl-header-sticky,
  body .header-tranperent,
  body .header1-bg,
  html body header.vl-header-area1#vl-header-sticky {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
  }
  
  /* Remove any overlay or pseudo elements that might add color */
  header *,
  .vl-header-area1 * {
    background-color: transparent !important;
  }
  
  /* Keep logo and menu button visible */
  .vl-logo,
  .vl-header-action-item,
  .vl-offcanvas-toggle {
    background-color: transparent !important;
  }
  
  /* Ensure text is dark on white background */
  header,
  header * {
    color: #333 !important;
  }
  
  /* Exception for hover states */
  .vl-offcanvas-toggle:hover {
    background-color: #333 !important;
    color: #fff !important;
  }
  
  /* Fix duplicate logos in mobile menu */
  .vl-offcanvas-logo a:not(:first-child) {
    display: none !important;
  }
  
  /* Remove any cloned or duplicate logos */
  .vl-offcanvas-header .vl-logo:not(:first-child),
  .vl-offcanvas-logo a + a,
  .vl-offcanvas-logo img + img {
    display: none !important;
  }
  
  /* Ensure mobile menu logo is properly sized */
  .vl-offcanvas-logo {
    height: auto;
  }
  
  .vl-offcanvas-logo img {
    max-height: 50px !important;
    width: auto !important;
  }
  
  /* Ultimate fix for any logo duplication in mobile menu */
  .vl-offcanvas-logo {
    position: relative;
  }
  
  .vl-offcanvas-logo::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 1;
    display: none;
  }
  
  /* Show only the first logo element */
  .vl-offcanvas-logo > *:not(:first-child) {
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }
}