/* ============================================
   Mobile Responsive Optimization
   InfiniteLoop Innovations
   ============================================ */

/* Base Mobile Improvements */
* {
  box-sizing: border-box;
}

/* Prevent horizontal scroll */
body {
  overflow-x: hidden !important;
  width: 100%;
}

#fh5co-wrapper,
#fh5co-page {
  overflow-x: hidden !important;
  width: 100%;
}

/* Mobile Typography */
@media (max-width: 768px) {
  h1 {
    font-size: 32px !important;
    line-height: 1.3 !important;
  }

  h2 {
    font-size: 28px !important;
    line-height: 1.4 !important;
  }

  h3 {
    font-size: 24px !important;
    line-height: 1.4 !important;
  }

  h4 {
    font-size: 20px !important;
    line-height: 1.5 !important;
  }

  p {
    font-size: 16px !important;
    line-height: 1.7 !important;
  }
}

/* Hero Section Mobile Optimization */
@media (max-width: 768px) {
  .fh5co-cover .desc {
    padding: 20px !important;
  }

  .fh5co-cover .desc h1 {
    font-size: 36px !important;
    margin-bottom: 15px !important;
  }

  .fh5co-cover .desc h2 {
    font-size: 18px !important;
    margin-bottom: 20px !important;
  }

  /* Hero buttons */
  .fh5co-cover .desc .btn {
    display: block !important;
    width: 100% !important;
    margin: 10px 0 !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
  }
}

/* Featured Product Section Mobile */
@media (max-width: 768px) {
  #our-solutions {
    padding: 40px 0 !important;
  }

  #our-solutions .col-md-8 {
    padding: 0 15px !important;
  }

  #our-solutions > div > div > div {
    padding: 30px 20px !important;
    border-radius: 15px !important;
  }

  #our-solutions h3 {
    font-size: 28px !important;
  }

  #our-solutions h4 {
    font-size: 18px !important;
  }

  #our-solutions p {
    font-size: 16px !important;
  }

  #our-solutions ul li {
    font-size: 15px !important;
    margin-bottom: 12px !important;
  }

  #our-solutions .btn,
  #our-solutions a[style*="padding"] {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    margin: 10px 0 !important;
  }
}

/* DoneDealPOS Feature Section Mobile */
@media (max-width: 768px) {
  #donedealpos-section {
    padding: 40px 0 !important;
  }

  #donedealpos-section .col-md-6 {
    padding: 0 20px !important;
  }

  #donedealpos-section > div {
    padding-right: 0 !important;
  }

  #donedealpos-section h2 {
    font-size: 32px !important;
  }

  #donedealpos-section h3 {
    font-size: 20px !important;
  }

  #donedealpos-section p {
    font-size: 16px !important;
    margin-bottom: 20px !important;
  }

  #donedealpos-section .btn {
    display: block !important;
    width: 100% !important;
    margin: 10px 0 !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
  }

  /* Product image mobile */
  #donedealpos-section img {
    margin-top: 30px !important;
    width: 100% !important;
  }
}

/* Feature Cards Mobile */
@media (max-width: 768px) {
  .feature-text {
    margin-bottom: 25px !important;
    padding: 25px 20px !important;
  }

  .feature-text h3 {
    font-size: 20px !important;
    margin-bottom: 12px !important;
  }

  .feature-text p {
    font-size: 15px !important;
  }
}

/* Services/Blog Cards Mobile */
@media (max-width: 768px) {
  .fh5co-blog,
  .services {
    margin-bottom: 30px !important;
  }

  .fh5co-blog .prod-title h3 a,
  .services h3 {
    font-size: 20px !important;
  }

  .fh5co-blog .prod-title p,
  .services p {
    font-size: 15px !important;
  }
}

/* Contact Form Mobile */
@media (max-width: 768px) {
  #fh5co-contact {
    padding: 40px 0 !important;
  }

  #fh5co-contact .section-title {
    font-size: 26px !important;
    margin-bottom: 15px !important;
  }

  #fh5co-contact .contact-info {
    font-size: 15px !important;
    margin-bottom: 30px !important;
  }

  #fh5co-contact .contact-info li {
    margin-bottom: 12px !important;
  }

  .form-control {
    font-size: 16px !important;
    padding: 12px 15px !important;
  }

  #fh5co-contact .btn {
    width: 100% !important;
    padding: 12px !important;
    font-size: 16px !important;
  }
}

/* Client Logos Mobile */
@media (max-width: 768px) {
  .client-logos .col-xs-6,
  .client-logos [class*="col-"] {
    width: 50% !important;
    float: left !important;
    padding: 10px !important;
  }

  .client-logos img {
    max-width: 120px !important;
    width: 100% !important;
    height: auto !important;
  }
}

/* Team Section Mobile */
@media (max-width: 768px) {
  #fh5co-content-section .col-md-6 {
    margin-bottom: 40px !important;
  }

  .fh5co-team figure img {
    max-width: 200px !important;
    margin: 0 auto !important;
  }

  .fh5co-team h3 {
    font-size: 22px !important;
  }

  .fh5co-team p {
    font-size: 15px !important;
  }
}

/* Navigation Mobile */
@media (max-width: 768px) {
  #fh5co-logo img {
    height: 80px !important;
    width: 80px !important;
  }

  /* Hide desktop menu */
  #fh5co-menu-wrap {
    display: none !important;
  }

  /* Offcanvas Menu */
  #offcanvas-menu {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 280px !important;
    height: 100vh !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    padding-top: 80px !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease-in-out !important;
  }

  /* When menu is open */
  body.fh5co-offcanvas #offcanvas-menu {
    left: 0 !important;
  }

  /* Overlay when menu is open */
  body.fh5co-offcanvas::before {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 9998 !important;
  }

  [data-theme="dark"] #offcanvas-menu {
    background: rgba(26, 32, 44, 0.98) !important;
  }

  /* Menu items styling */
  #offcanvas-menu ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  #offcanvas-menu ul li {
    width: 100% !important;
    display: block !important;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1) !important;
    float: none !important;
  }

  #offcanvas-menu ul li a {
    font-size: 18px !important;
    padding: 18px 30px !important;
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    color: #333 !important;
    text-decoration: none !important;
    transition: all 0.3s !important;
  }

  [data-theme="dark"] #offcanvas-menu ul li a {
    color: #fff !important;
  }

  #offcanvas-menu ul li a:hover,
  #offcanvas-menu ul li.active a {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
  }

  /* Hamburger menu toggle */
  .js-fh5co-nav-toggle {
    display: block !important;
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 99999 !important;
    width: 50px !important;
    height: 50px !important;
    background: #667eea !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    padding: 12px !important;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3) !important;
  }

  .js-fh5co-nav-toggle i {
    position: relative !important;
    display: block !important;
    width: 26px !important;
    height: 2px !important;
    background: #fff !important;
    margin: 0 auto !important;
    transition: all 0.3s !important;
  }

  .js-fh5co-nav-toggle i::before,
  .js-fh5co-nav-toggle i::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    width: 100% !important;
    height: 2px !important;
    background: #fff !important;
    transition: all 0.3s !important;
  }

  .js-fh5co-nav-toggle i::before {
    top: -8px !important;
  }

  .js-fh5co-nav-toggle i::after {
    bottom: -8px !important;
  }

  /* Active state (menu open) */
  body.fh5co-offcanvas .js-fh5co-nav-toggle i {
    background: transparent !important;
  }

  body.fh5co-offcanvas .js-fh5co-nav-toggle i::before {
    top: 0 !important;
    transform: rotate(45deg) !important;
  }

  body.fh5co-offcanvas .js-fh5co-nav-toggle i::after {
    bottom: 0 !important;
    transform: rotate(-45deg) !important;
  }

  /* Header positioning */
  #fh5co-header-section {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9997 !important;
  }

  .nav-header {
    position: relative !important;
  }

  /* Adjust body when menu is open */
  body.fh5co-offcanvas {
    overflow: hidden !important;
  }

  /* Content push when menu opens */
  body.fh5co-offcanvas #fh5co-page {
    transform: translateX(0) !important;
  }

  /* Add padding to body for fixed header */
  .fh5co-hero:first-of-type {
    margin-top: 70px !important;
  }

  /* Ensure hero section is visible */
  body {
    padding-top: 0 !important;
  }
}

/* WhatsApp Button Mobile */
@media (max-width: 768px) {
  .float,
  .whatsapp-float {
    width: 50px !important;
    height: 50px !important;
    bottom: 20px !important;
    right: 15px !important;
  }

  .float i,
  .whatsapp-float i {
    font-size: 24px !important;
  }

  .chat-with-us {
    display: none !important;
  }
}

/* Dark Mode Toggle Mobile */
@media (max-width: 768px) {
  .dark-mode-toggle {
    top: 70px !important;
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
  }

  .dark-mode-toggle i {
    font-size: 1.2rem !important;
  }
}

/* Blobs and Decorative Elements Mobile */
@media (max-width: 768px) {
  .blob,
  .accent-shape {
    opacity: 0.3 !important;
    filter: blur(30px) !important;
  }

  .blob-1,
  .accent-shape-1 {
    width: 200px !important;
    height: 200px !important;
  }

  .blob-2,
  .accent-shape-2 {
    width: 250px !important;
    height: 250px !important;
  }

  .blob-3,
  .accent-shape-3 {
    width: 150px !important;
    height: 150px !important;
  }
}

/* Content Section Mobile */
@media (max-width: 768px) {
  #content {
    padding: 30px 15px !important;
  }

  #centered-text {
    font-size: 16px !important;
    padding: 0 10px !important;
  }
}

/* Mission Section Mobile */
@media (max-width: 768px) {
  #fh5co-portfolio .heading-section h2 {
    font-size: 28px !important;
    margin-bottom: 15px !important;
  }

  #fh5co-portfolio .heading-section p {
    font-size: 16px !important;
  }
}

/* CTA Section Mobile */
@media (max-width: 768px) {
  .fh5co-hero .desc h2 {
    font-size: 32px !important;
    margin-bottom: 15px !important;
  }

  .fh5co-hero .desc p {
    font-size: 18px !important;
    margin-bottom: 20px !important;
  }

  .fh5co-hero .desc .btn {
    display: block !important;
    width: 100% !important;
    margin: 10px 0 !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
  }
}

/* Footer Mobile */
@media (max-width: 768px) {
  #footer {
    padding: 30px 0 !important;
  }

  #footer p {
    font-size: 14px !important;
  }

  .fh5co-social-icons a {
    width: 40px !important;
    height: 40px !important;
    margin: 0 8px !important;
  }
}

/* Projects Page - Feature Section Mobile */
@media (max-width: 768px) {
  .section#about {
    padding: 40px 0 !important;
  }

  .section#about .left-text-content {
    padding-right: 0 !important;
    margin-bottom: 30px !important;
  }

  .section#about .section-heading span {
    font-size: 12px !important;
  }

  .section#about h2 {
    font-size: 32px !important;
  }

  .section#about h3 {
    font-size: 20px !important;
  }

  .section#about p {
    font-size: 16px !important;
    margin-bottom: 20px !important;
  }

  .section#about .btn {
    width: 100% !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
  }

  .section#about .right-content img {
    margin-top: 20px !important;
  }
}

/* Projects Page - Features Grid Mobile */
@media (max-width: 768px) {
  section[style*="padding: 80px 0"] {
    padding: 40px 0 !important;
  }

  section .col-md-4 {
    margin-bottom: 25px !important;
  }

  section .col-md-4 > div {
    padding: 25px 20px !important;
  }

  section .col-md-4 h3 {
    font-size: 20px !important;
    margin-bottom: 12px !important;
  }

  section .col-md-4 p {
    font-size: 15px !important;
  }
}

/* About Page Mobile */
@media (max-width: 768px) {
  #fh5co-feature-product .feature-text {
    padding: 20px !important;
    text-align: left !important;
  }

  #fh5co-feature-product .feature-text p {
    font-size: 16px !important;
    line-height: 1.7 !important;
  }
}

/* Responsive Images */
@media (max-width: 768px) {
  img.img-responsive {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
  }

  /* Specific image containers */
  .right-content .thumb img,
  .right-content img {
    border-radius: 12px !important;
  }
}

/* Ensure sections don't overflow */
@media (max-width: 768px) {
  section,
  .container,
  .container-fluid {
    overflow-x: hidden !important;
  }

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

  [class*="col-"] {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
  a,
  button,
  .btn {
    min-height: 44px !important;
    min-width: 44px !important;
  }

  /* Navigation links */
  .sf-menu a {
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
  }
}

/* Fix text overflow */
@media (max-width: 768px) {
  h1, h2, h3, h4, h5, h6, p, li, span {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
}

/* Loading screen mobile */
@media (max-width: 768px) {
  .loader-text {
    font-size: 1rem !important;
  }

  .loader-spinner {
    width: 50px !important;
    height: 50px !important;
  }
}

/* Particles.js mobile optimization */
@media (max-width: 768px) {
  #particles-js {
    display: none !important;
  }
}

/* Improve spacing consistency */
@media (max-width: 768px) {
  .row-bottom-padded-md {
    padding-bottom: 30px !important;
  }

  [style*="padding: 80px"] {
    padding: 40px 20px !important;
  }

  [style*="padding: 60px"] {
    padding: 30px 15px !important;
  }

  [style*="margin-bottom: 60px"] {
    margin-bottom: 30px !important;
  }
}

/* Better mobile menu */
@media (max-width: 768px) {
  .js-fh5co-nav-toggle {
    z-index: 9999 !important;
  }

  .fh5co-nav-toggle {
    width: 44px !important;
    height: 44px !important;
    cursor: pointer !important;
  }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Improve readability */
@media (max-width: 768px) {
  body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}

/* Fix gradient backgrounds on mobile */
@media (max-width: 768px) {
  [style*="linear-gradient"] {
    background-attachment: scroll !important;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Performance optimization for mobile */
@media (max-width: 768px) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-zoom {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Reduce motion for better performance */
  * {
    animation-duration: 0.5s !important;
    transition-duration: 0.3s !important;
  }
}

/* Fix modal/overlay issues */
@media (max-width: 768px) {
  .modal,
  .overlay {
    max-width: 95vw !important;
    margin: 10px auto !important;
  }
}

/* Tablet breakpoint (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .fh5co-cover .desc h1 {
    font-size: 42px !important;
  }

  .fh5co-cover .desc h2 {
    font-size: 20px !important;
  }

  .feature-text,
  .services,
  .fh5co-blog {
    margin-bottom: 30px !important;
  }
}

/* Small mobile devices (max 375px) */
@media (max-width: 375px) {
  .fh5co-cover .desc h1 {
    font-size: 28px !important;
  }

  .fh5co-cover .desc h2 {
    font-size: 16px !important;
  }

  .btn {
    padding: 10px 15px !important;
    font-size: 14px !important;
  }

  h2 {
    font-size: 24px !important;
  }

  h3 {
    font-size: 20px !important;
  }
}
