/**
 * Mobile-specific enhancements for Sohob Solutions website
 * Improves the mobile user experience with targeted styles
 */

/* Desktop-only button - visible on desktop, hidden on mobile */
.desktop-only-button {
  display: inline-flex;
}

/* Ensure the button is hidden on all mobile screens */
@media screen and (max-width: 767px) {
  .desktop-only-button,
  a.desktop-only-button,
  nav a.desktop-only-button,
  .flex.items-center a.desktop-only-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* Mobile navigation enhancements - ONLY applied to mobile screens */
@media (max-width: 1023px) {
  /* Hide the Free Consultation button in mobile nav */
  .mobile-hide {
    display: none !important;
  }
  /* Mobile menu styling */
  #mobile-menu-2 {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }

  #mobile-menu-2.hidden {
    display: none;
  }
  
  /* Improve tap target sizes on mobile */
  #mobile-menu-2 a {
    padding: 0.75rem 1rem;
    display: block;
  }
  
  /* Exception for products dropdown - keep flex layout */
  #mobile-menu-2 a[onclick*="toggleMobileProducts"] {
    display: flex !important;
  }
  
  /* Add animation to mobile menu */
  #mobile-menu-2:not(.hidden) {
    animation: slideDown 0.2s ease-out forwards;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Mobile-specific link styling */
  #mobile-menu-2 nav a {
    color: #374151; /* text-gray-700 */
    border-bottom: 1px solid #F3F4F6; /* border-gray-100 */
  }
  
  #mobile-menu-2 nav a:hover {
    background-color: #F9FAFB; /* hover:bg-gray-50 */
  }
}

/* General mobile improvements */
@media (max-width: 640px) {
  /* Make "Digital Products & Presence" appear on the same line */
  .desktop-only {
    display: none;
  }
  
  /* Add a space between "Products" and "&" */
  .mobile-inline {
    display: inline;
  }
  
  /* Products heading on one line for mobile */
  .products-heading {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  
  /* Hide elements with hidden-mobile class on mobile */
  .hidden-mobile {
    display: none !important;
  }
  
  /* Hide specific paragraphs on mobile */
  .hide-on-mobile {
    display: none !important;
  }
  
  /* Improve grid layout on mobile */
  @media (max-width: 640px) {
    .grid-cols-2 > div {
      padding: 0.75rem;
    }
    
    .grid-cols-2 > div h3 {
      font-size: 1.25rem;
      margin-bottom: 0.5rem;
    }
    
    .grid-cols-2 > div p {
      font-size: 0.875rem;
      line-height: 1.25rem;
    }
    
    .grid-cols-2 > div svg {
      width: 2rem;
      height: 2rem;
      margin-bottom: 0.5rem;
    }
  }
  
  /* Reduce space between hero and 'Designed for businesses' section */
  section.bg-white + section.bg-white,
  .mobile-cta-container + section.bg-white {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  /* Improve spacing on mobile */
  section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  
  /* Ensure buttons are large enough to tap */
  button, 
  .btn,
  a.btn,
  input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improve form fields on mobile */
  input, 
  select, 
  textarea {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }
  
  /* Improve hero section on mobile */
  .hero-section {
    padding-top: 1rem;
    text-align: center;
  }
  
  /* Fix for hero image and other images showing black background on mobile */
  @media (max-width: 768px) {
    /* Global fix for all images */
    img {
      background-color: transparent !important;
      background: none !important;
      object-fit: contain !important;
      mix-blend-mode: normal !important;
    }
    
    /* Specific fixes for hero image */
    .mobile-hero-image {
      background-color: white !important;
      background-image: none !important;
      -webkit-background-clip: initial !important;
      background-clip: initial !important;
      -webkit-mask-image: none !important;
      mask-image: none !important;
      filter: none !important;
    }
    
    /* Specific fixes for feature image */
    .mobile-feature-image {
      background-color: white !important;
      background-image: none !important;
      -webkit-background-clip: initial !important;
      background-clip: initial !important;
      -webkit-mask-image: none !important;
      mask-image: none !important;
      filter: none !important;
    }
    
    /* Override any potential background settings from other CSS */
    picture {
      background: transparent !important;
    }
    
    /* Force PNG images to render properly */
    img[src$=".png"] {
      background: white !important;
      mix-blend-mode: multiply !important;
    }
  }
  
  /* Ensure images don't overflow on mobile */
  img, 
  picture {
    max-width: 100%;
    height: auto;
  }
}

/* Fix for sticky header on mobile */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
}

/* Improve mobile scrolling */
html, body {
  -webkit-overflow-scrolling: touch;
}

/* Prevent content from being hidden under fixed elements */
main {
  padding-bottom: env(safe-area-inset-bottom, 0);
}
