.mobile-safe-btn {
  /* Base styles */
  touch-action: manipulation !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 9999 !important;
  cursor: pointer !important;
  
  /* Remove any hover conflicts */
  -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
  user-select: none !important;
  
  /* Responsive sizing */
  padding: 12px 25px;
  font-size: 0.9rem;
  min-height: auto;
  min-width: auto;
}

/* Tablet */
@media (max-width: 992px) {
  .mobile-safe-btn {
    padding: 10px 20px;
    font-size: 0.85rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .mobile-safe-btn {
    padding: 8px 14px;
    font-size: 0.75rem;
  }
}

/* Small mobile - proper touch targets */
@media (max-width: 576px) {
  .mobile-safe-btn {
    padding: 12px 16px;
    font-size: 0.75rem;
    min-height: 44px !important;
    min-width: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}




@media (max-width: 992px) {
    .hero-wrapper {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }
    
    .hero-slideshow {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .why-content {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }
    
    .why-image {
        order: -1;
    }
    
    /* OPTIMIZED DASHBOARD RESPONSIVENESS */
    .dashboard {
        max-width: 400px;
        height: 300px;
        margin: 0 auto;
        background: var(--secondary); /* Fallback background */
    }
    
    .dashboard-image {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Less processing than cover */
        object-position: center;
        transition: opacity 0.3s ease;
    }
    
    .logos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Fix service content for tablet */
    .service-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: left;
    }
    
    .service-description {
        padding-right: 0;
        width: 100%;
    }
    
    .service-description h2 {
        text-align: left;
        margin-bottom: 25px;
    }
    
    .service-description p {
        text-align: left;
        line-height: 1.7;
    }
    
    .before-after-container {
        max-width: none;
        width: 100%;
    }
    
    /* Fix before-after grid for tablet */
    .before-after {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    /* Fix benefits list for tablet */
    .benefits-list {
        grid-template-columns: 1fr 1fr;
        gap: 12px 20px;
    }
    
    .case-details {
        flex-direction: column;
        text-align: center;
    }
    
    .case-details img {
        width: 100px;
        height: 100px;
    }
    
    .case-info {
        text-align: center;
    }
    
    /* Header CTA button adjustments for tablet */
    .header-container .cta-button {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    /* Header layout improvements for mobile - keep items on same line */
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .header-container .cta-button {
        padding: 8px 14px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .logo {
        font-size: 1.5rem;
        flex-shrink: 1;
        min-width: 0;
    }
    
    .logo img {
        height: 32px;
    }
    
    nav ul {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  background-color: var(--primary);
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  transform: translateY(-100%);
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 999;
  pointer-events: none;  /* ADD THIS LINE */
}

nav ul.active {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  transform: translateY(0);
  visibility: visible;
  opacity: 1;
  pointer-events: auto;  /* ADD THIS LINE TOO */
}

    
    body.menu-open {
        overflow: hidden;
    }
    
    nav ul li {
        margin: 15px 0;
    }
    
    .hero {
        padding-top: 150px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .cta-button.secondary {
        margin-left: 0;
    }
    
    .hero-slideshow {
        height: 300px;
    }
    
    .slideshow-nav button {
        width: 35px;
        height: 35px;
    }
    
    .logos-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .service-card {
        padding: 25px 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .service-header {
        text-align: center;
        margin-bottom: 50px;
    }
    
    .service-header h1 {
        font-size: 2.2rem;
        text-align: center;
    }
    
    .service-header p {
        text-align: center;
        padding: 0 10px;
    }
    
    /* MOBILE SERVICE CONTENT FIXES */
    .service-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: left;
    }
    
    .service-description {
        padding: 0 15px;
    }
    
    .service-description h2 {
        font-size: 1.6rem;
        text-align: left;
        margin-bottom: 20px;
        line-height: 1.3;
    }
    
    .service-description p {
        font-size: 0.95rem;
        text-align: left;
        line-height: 1.6;
        margin-bottom: 18px;
    }
    
    /* MOBILE BEFORE/AFTER FIXES */
    .before-after-container {
        padding: 0 15px;
    }
    
    .before-after {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .before,
    .after {
        padding: 20px;
    }
    
    .before h3,
    .after h3 {
        position: static;
        display: inline-block;
        padding: 6px 12px;
        border-radius: 15px;
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .before img,
    .after img {
        height: 160px;
        margin-bottom: 15px;
    }
    
    .before ul,
    .after ul {
        margin-top: 0;
    }
    
    .before ul li,
    .after ul li {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    /* MOBILE SERVICE BENEFITS FIXES */
    .service-benefits {
        padding: 30px 20px;
        margin: 30px 15px 30px;
    }
    
    .service-benefits h3 {
        font-size: 1.4rem;
        margin-bottom: 25px;
    }
    
    .benefits-list {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: none;
    }
    
    .benefits-list li {
        font-size: 0.9rem;
    }
    
    /* OPTIMIZED MOBILE WHY CHOOSE US DASHBOARD */
    .why-image {
        padding: 0 20px;
        min-height: 200px; /* Prevent layout shift */
    }
    
    .dashboard {
        width: 100%;
        max-width: 320px; /* Smaller for mobile */
        height: 200px; /* Reduced height */
        margin: 0 auto;
        background: var(--secondary);
    }
    
    .dashboard-image {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Less processing than cover */
        object-position: center;
        /* Remove transitions on mobile for better performance */
    }
    
    .dashboard-overlay {
        padding: 15px;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
    }
    
    .metric {
        margin-bottom: 10px;
    }
    
    .metric-value {
        font-size: 1.8rem;
    }
    
    .metric-label {
        font-size: 0.8rem;
    }
    
    .case-study {
        padding: 40px 20px;
    }
    
    .case-details {
        padding: 15px;
    }
    
    .case-nav {
        padding: 0 10px;
    }
    
    .case-nav button {
        width: 40px;
        height: 40px;
    }
    
    /* Enhanced Modal Mobile Styles */
    .modal {
        padding: 20px;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-content {
        width: 100%;
        max-width: none;
        margin: 20px 0;
        padding: 30px 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .submit-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    section {
        padding: 70px 0;
    }
    
    /* Further header optimizations for small mobile */
    .header-container {
        justify-content: space-between;
        align-items: center;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .header-container .cta-button {
        padding: 6px 10px;
        font-size: 0.7rem;
        min-width: auto;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .logo img {
        height: 28px;
    }
    
    .mobile-toggle {
        font-size: 1.2rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero-slideshow {
        height: 250px;
    }
    
    .slide-caption {
        font-size: 1rem;
        padding: 20px 15px 15px;
    }
    
    .logos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Fix consultation button centering on mobile */
@media (max-width: 768px) {
    .cta-section {
        text-align: center;
    }
    
    .cta-section .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .cta-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        text-align: center;
    }
    
    /* Service detail consultation buttons */
    .service-detail .cta-button,
    .service-benefits .cta-button {
        display: block;
        margin: 20px auto 0;
        text-align: center;
        width: fit-content;
    }
}

@media (max-width: 576px) {
    .cta-button {
        width: 100%;
        max-width: 280px;
        margin: 15px auto;
        padding: 15px 20px;
    }
}

    
    /* SMALL MOBILE WHY CHOOSE US DASHBOARD OPTIMIZATION */
    .why-image {
        padding: 0 15px;
    }
    
    .dashboard {
        width: 100%;
        max-width: 280px;
        height: 160px; /* Even smaller */
        margin: 0 auto;
        background: var(--secondary);
    }
    
    .dashboard-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        /* Minimal properties for fast loading */
    }
    
    .dashboard-overlay {
        padding: 10px;
        gap: 15px;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .metric-label {
        font-size: 0.75rem;
    }
    
    .case-study {
        padding: 40px 20px;
    }
    
    .case-content h3 {
        font-size: 1.4rem;
    }
    
    .case-content p {
        font-size: 1rem;
    }
    
    .case-details {
        flex-direction: column;
        gap: 15px;
    }
    
    .case-details img {
        width: 80px;
        height: 80px;
    }
    
    .cta-section h2 {
        font-size: 2.2rem;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin: 10px 0;
        padding: 25px 15px;
        border-radius: 8px;
    }
    
    .modal h2 {
        font-size: 1.6rem;
    }
    
    .close-modal {
        top: 15px;
        right: 15px;
        font-size: 1.3rem;
    }
    
    /* SMALL MOBILE SERVICE CONTENT ADJUSTMENTS */
    .service-header {
        margin-bottom: 40px;
    }
    
    .service-header h1 {
        font-size: 2rem;
    }
    
    .service-content {
        gap: 25px;
    }
    
    .service-description {
        padding: 0 10px;
    }
    
    .service-description h2 {
        font-size: 1.4rem;
        text-align: left;
        line-height: 1.2;
    }
    
    .service-description p {
        font-size: 0.9rem;
        text-align: left;
        line-height: 1.5;
    }
    
    /* SMALL MOBILE BEFORE/AFTER ADJUSTMENTS */
    .before-after-container {
        padding: 0 10px;
    }
    
    .before-after {
        gap: 20px;
    }
    
    .before,
    .after {
        padding: 15px;
    }
    
    .before h3,
    .after h3 {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
    
    .before img,
    .after img {
        height: 140px;
    }
    
    .before ul li,
    .after ul li {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    /* SMALL MOBILE SERVICE BENEFITS ADJUSTMENTS */
    .service-benefits {
        padding: 25px 15px;
        margin: 25px 10px;
    }
    
    .service-benefits h3 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .benefits-list li {
        font-size: 0.85rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .header-container .cta-button {
        padding: 5px 8px;
        font-size: 0.65rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo img {
        height: 25px;
        margin-right: 5px;
    }
    
    .mobile-toggle {
        font-size: 1.1rem;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    /* EXTRA SMALL DASHBOARD OPTIMIZATIONS */
    .why-image {
        padding: 0 10px;
    }
    
    .dashboard {
        max-width: 260px;
        height: 140px;
        background: var(--secondary);
    }
    
    .dashboard-image {
        width: 100%;
        height: 100%;
        object-fit: scale-down; /* Even lighter processing */
    }
    
    .dashboard-overlay {
        padding: 8px;
        gap: 10px;
    }
    
    .metric-value {
        font-size: 1.3rem;
    }
    
    .metric-label {
        font-size: 0.7rem;
    }
    
    /* EXTRA SMALL SERVICE CONTENT ADJUSTMENTS */
    .service-header h1 {
        font-size: 1.8rem;
    }
    
    .service-description h2 {
        font-size: 1.3rem;
    }
    
    .service-description p {
        font-size: 0.85rem;
    }
    
    .before img,
    .after img {
        height: 120px;
    }
    
    .service-benefits {
        padding: 20px 10px;
        margin: 20px 5px;
    }
    
    .service-benefits h3 {
        font-size: 1.1rem;
    }
}

/* Optional: Hide image on very small screens if still problematic */
@media (max-width: 360px) {
    .dashboard-image {
        display: none; /* Hide image, show only overlay with metrics */
    }
    
    .dashboard {
        background: linear-gradient(135deg, var(--accent1), var(--accent2));
    }
    
    .dashboard-overlay {
        background: none; /* Remove overlay background since dashboard has it */
        position: static;
    }
}

/* Landscape phone orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .header-container .cta-button {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .hero {
        padding-top: 120px;
    }
    
    .hero-slideshow {
        height: 200px;
    }
    
    .service-content {
        gap: 20px;
    }
    
    .before img,
    .after img {
        height: 120px;
    }
    
    /* Dashboard landscape adjustments */
    .dashboard {
        height: 160px;
    }
    
    .dashboard-overlay {
        gap: 15px;
    }
}
/* Mobile-only centering for secondary CTA buttons */
@media (max-width: 768px) {
  /* Generic centering */
  .cta-button.secondary {
    display: inline-flex;              /* center content inside */ 
    align-items: center;               /* vertical centering */ 
    justify-content: center;           /* horizontal centering */ 
    margin: 0 auto;                    /* center within parent */ 
    text-align: center;                /* center text */ 
  }

  /* Ensure centering within key sections */
  .cta-section .cta-button.secondary,
  .service-detail .cta-button.secondary,
  .service-benefits .cta-button.secondary,
  .hero-buttons .cta-button.secondary {
    display: block;                    /* allow margin auto to take effect */ 
    width: fit-content;                /* shrink to content */ 
    margin: 12px auto;                 /* centered horizontally */ 
  }

  /* Small mobiles: optionally full-width but still centered */
  @media (max-width: 576px) {
    .cta-button.secondary {
      width: 100%;                     /* full width for tap target */ 
      max-width: 280px;                /* keep it neat */ 
      margin: 12px auto;               /* centered */ 
    }
  }
}
