html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Retina Display Font Adjustments */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
span,
li,
div,
input,
button,
textarea {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* =========================================
   DESKTOP NAVIGATION
   ========================================= */
@media (min-width: 992px) {
  .menu-icon {
    display: none !important;
  }

  .header-section .nav.navbar-nav>li>a {
    padding-left: 12px !important;
    padding-right: 12px !important;
    font-weight: 600 !important;
    font-size: 14px;
    display: flex;
    align-items: center;
    height: 100%;
  }

  .col-sm-10 .main-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    height: auto;
    min-height: 60px;
  }

  #menu {
    order: 1;
    float: none !important;
    width: auto !important;
    display: block !important;
    height: auto !important;
  }

  #menu ul.navbar-nav {
    display: flex;
    align-items: center;
    margin: 0;
    height: 100%;
  }

  .navbar-nav.top-nav {
    order: 2;
    float: none !important;
    margin-left: 20px !important;
    display: flex !important;
    align-items: center;
    height: 100%;
    margin-bottom: 0 !important;
  }

  .nav-cta-item {
    margin: 0 !important;
    display: flex;
    align-items: center;
  }

  .nav-cta-item .modern-cta-btn {
    padding: 9px 20px !important;
    font-size: 13px !important;
    border-radius: 4px;
    position: relative;
    top: 0;
    transform: none;
    margin-bottom: 0;
    background-color: #8ec351 !important;
    color: #fff !important;
    transition: opacity 0.3s ease;
  }

  .nav-cta-item .modern-cta-btn:hover {
    opacity: 0.8 !important;
    color: #fff !important;
    text-decoration: none;
  }

  .nav-cta-item .modern-cta-btn i {
    color: #fff !important;
    margin-right: 5px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0px;
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
  text-align: start;
}

.nutax-sidebar-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.08);
}

.sidebar-image-wrapper img {
  object-fit: cover;
  height: 190px;
  width: 100%;
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */

@media (max-width: 991px) {

  /* --- Top Bar --- */
  .topbar .topbar-left-items,
  .topbar .topbar-right-items {
    float: none !important;
    width: 100%;
    text-align: center;
    display: block;
    height: auto !important;
  }

  .call-us-text,
  .social-icon {
    display: none !important;
  }

  .topbar-right-items .toplist li.lineright {
    display: inline-block !important;
    float: none !important;
    /* Spacing fix for longer text */
    padding: 5px 10px !important;
  }

  .topbar-right-items .toplist li a {
    white-space: nowrap;
    /* Prevent breaking the link text itself mid-word if possible */
  }

  /* --- HEADER LAYOUT --- */
  .header-section .mod-menu .row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    padding: 10px 0 !important;
  }

  /* 1. Logo (Left) */
  .header-section .col-sm-2 {
    width: auto !important;
    flex: 0 0 auto !important;
    padding-left: 30px !important;
    padding-right: 0 !important;
    text-align: left !important;
    margin: 0 !important;
    display: block !important;
  }

  .header-section .logo {
    display: block !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    width: auto !important;
  }

  .logo img {
    max-width: 140px;
    height: auto;
    margin: 0 !important;
    display: block !important;
  }

  /* 2. Navigation Wrapper (Right) */
  .header-section .col-sm-10 {
    width: auto !important;
    flex: 1 1 auto !important;
    padding-right: 15px !important;
    text-align: right !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    padding-left: 0 !important;
  }

  .main-nav {
    width: auto !important;
    display: block !important;
  }

  .nav.navbar-nav.top-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin: 0 !important;
    width: auto !important;
    float: none !important;
  }

  /* 3. CTA & Menu Icon */
  .nav-cta-item {
    display: inline-block !important;
    margin: 0 10px 0 0 !important;
  }

  .nav-cta-item .modern-cta-btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
    background-color: #8ec351 !important;
    color: #fff !important;
    transition: opacity 0.3s ease;
  }

  .nav-cta-item .modern-cta-btn:hover {
    opacity: 0.8 !important;
  }

  .cta-icon {
    display: none !important;
  }

  .menu-icon {
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    display: inline-block !important;
  }

  /* --- DROPDOWN MENU ENHANCEMENTS --- */
  #menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1f2937 !important;
    /* Slightly lighter dark theme */
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: left !important;
    border-top: 2px solid #8ec351;
    /* Theme accent line */
  }

  #menu ul {
    float: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  #menu ul li {
    float: none !important;
    width: 100% !important;
    display: block !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    position: relative !important;
    text-align: left !important;
  }

  #menu ul li a {
    display: block !important;
    padding: 16px 20px !important;
    text-align: left !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    color: #f3f4f6 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: normal !important;
    /* Allow wrapping */
    transition: background-color 0.2s;
  }

  #menu ul li a:active,
  #menu ul li a:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #8ec351 !important;
  }

  #menu ul li .arrow {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    margin: 0 !important;
    width: 50px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    float: none !important;
    text-align: center !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle border */
    color: #fff !important;
    font-size: 16px !important;
    z-index: 10 !important;
    cursor: pointer;
  }

  /* Submenu indentation */
  #menu ul li ul li a {
    padding-left: 35px !important;
    font-size: 15px !important;
    color: #d1d5db !important;
    background-color: #111827 !important;
    /* Darker for depth */
  }

  #menu ul li ul li ul li a {
    padding-left: 50px !important;
    font-size: 14px !important;
  }

  /* --- HERO SLIDER: REMOVED BUTTON ON MOBILE --- */

  .rev_slider_wrapper,
  .rev_slider {
    min-height: 500px !important;
    height: 500px !important;
  }

  /* 
     GLOBAL OVERRIDE for ALL Slider text layers on mobile.
  */
  .rev_slider .tp-caption,
  .mobile-hero-label,
  .mobile-hero-title,
  .mobile-hero-desc {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
    width: 90% !important;
    max-width: 90% !important;
    white-space: normal !important;
    text-align: center !important;
    transform: none !important;
    /* Removed opacity/visibility overrides to let slider handle transitions */
    height: auto !important;
    padding: 0 !important;
    padding-bottom: 20px !important;
  }

  /* HIDE BUTTON ON MOBILE */
  .mobile-hero-btn,
  .rev_slider .sbut3 {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Force Clean Coordinate System */
  .tp-mask-wrap,
  .tp-loop-wrap,
  .tp-parallax-wrap {
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    position: absolute !important;
    overflow: visible !important;
  }

  /* 1. Main Title (MOVED TO TOP) */
  .mobile-hero-title {
    top: 50px !important;
    /* New Top */
    font-size: 26px !important;
    line-height: 38px !important;
    z-index: 100 !important;
    font-weight: 700 !important;
    word-wrap: break-word !important;
    padding-bottom: 5px !important;
  }

  .rev_slider .tp-caption[style*="font-size: 80px"],
  .rev_slider .tp-caption[style*="font-size: 24px"],
  .rev_slider .tp-caption[style*="font-size: 26px"] {
    top: 50px !important;
    font-size: 26px !important;
    line-height: 38px !important;
  }

  /* 2. Top Label (MOVED below Title) */
  .mobile-hero-label {
    top: 115px !important;
    font-size: 14px !important;
    line-height: 22px !important;
    z-index: 100 !important;
    text-transform: none !important;
  }

  .rev_slider .tp-caption[style*="font-size: 14px"],
  .rev_slider .tp-caption[style*="font-size: 12px"] {
    top: 115px !important;
    line-height: 22px !important;
  }

  /* 3. Description (MOVED below Label) */
  .mobile-hero-desc {
    top: 180px !important;
    font-size: 14px !important;
    line-height: 26px !important;
    z-index: 99 !important;
    word-wrap: break-word !important;
  }

  .rev_slider .tp-caption[style*="font-size: 13px"],
  .rev_slider .tp-caption[style*="font-size: 18px"] {
    top: 180px !important;
    line-height: 26px !important;
  }

  .tparrows {
    display: none !important;
  }

  /* --- TESTIMONIALS MOBILE FIX --- */
  .ce-feature-box-56 .text-box {
    width: 100% !important;
    float: none !important;
    padding: 40px 20px !important;
    /* Reduced padding */
    text-align: center !important;
    margin: 0 auto !important;
  }

  .ce-feature-box-56 .text-box *,
  .ce-feature-box-56 .text-box p,
  .ce-feature-box-56 .text-box h5,
  .ce-feature-box-56 .text-box span {
    text-align: center !important;
  }

  .ce-feature-box-56 .text-box .quote-icon {
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: -30px !important;
  }

  .text-inner.align-left {
    text-align: center !important;
  }

  /* Reset Testimonial Column Constraints */
  .item .col-md-6.col-md-offset-6,
  .item .col-sm-offset-4 {
    margin-left: 0 !important;
    width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    float: none !important;
  }

  /* CTA Section Padding Mobile Fix */
  .sec-padding-4 {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }

}

@media (max-width: 768px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
}