/* =================================================
   STICKY BOOK BUTTON - FINAL FIX FOR ALL DEVICES
   Specifically addresses visibility issues on:
   - 360x640 devices (main focus)
   - iPhone SE (375x667)
   - Samsung Galaxy Fold (280x653 when folded)
   - All other small mobile devices
   ================================================= */

/* Ultra-high priority sticky button styles */
@media (max-width: 768px) {
  .sticky-book-button {
    /* Force positioning with !important to override any conflicts */
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    
    /* Visual styling with highest priority */
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%) !important;
    color: white !important;
    
    /* Layout and spacing */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    
    /* Typography */
    font-size: 1rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    
    /* Dimensions */
    padding: 1rem 1.5rem !important;
    min-height: 60px !important;
    max-height: 60px !important;
    
    /* Visual effects */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25) !important;
    border: none !important;
    outline: none !important;
    
    /* Ensure it's always on top - ULTIMATE PRIORITY Z-INDEX */
    z-index: 10000000 !important;
    
    /* Smooth interactions */
    transition: transform 0.2s ease, opacity 0.2s ease !important;
    
    /* Touch optimization */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    
    /* Remove any inherited spacing */
    transform: none !important;
  }
  
  .sticky-book-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.3) !important;
  }
  
  .sticky-book-button:active {
    transform: translateY(1px) !important;
    opacity: 0.9 !important;
  }
  
  .sticky-book-button i {
    font-size: 1.1rem !important;
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
  }
  
  /* Ensure all other floating elements are positioned correctly */
  .floating-social {
    bottom: 80px !important;
    z-index: 98 !important;
  }
  
  .video-controls {
    bottom: 160px !important;
    z-index: 95 !important;
  }
  
  .back-to-top {
    bottom: 80px !important;
    z-index: 98 !important;
  }
  
  /* Remove any potential white space or layout issues */
  body {
    margin-bottom: 0 !important;
  }
  
  /* Ensure no elements create white space above the button */
  .hero-section, .hero-content, .services-section {
    margin-bottom: 0 !important;
  }
}

/* Specific adjustments for small devices (480px and below) */
@media (max-width: 480px) {
  .sticky-book-button {
    padding: 0.95rem 1.25rem !important;
    font-size: 0.95rem !important;
    min-height: 58px !important;
    max-height: 58px !important;
  }
  
  .floating-social {
    bottom: 75px !important;
  }
  
  .video-controls {
    bottom: 150px !important;
  }
  
  /* Fix any layout issues in hero section */
  .hero-section {
    padding-bottom: 80px !important;
  }
}

/* CRITICAL fixes for 360px devices - addressing the white space issue */
@media (max-width: 360px) {
  .sticky-book-button {
    padding: 0.9rem 1rem !important;
    font-size: 0.9rem !important;
    min-height: 56px !important;
    max-height: 56px !important;
    /* Ensure no gaps or white space */
    margin: 0 !important;
    border-radius: 0 !important;
  }
  
  .sticky-book-button i {
    font-size: 1rem !important;
  }
  
  .floating-social {
    bottom: 70px !important;
    right: 0.5rem !important;
  }
  
  .video-controls {
    bottom: 140px !important;
  }
  
  /* CRITICAL: Fix layout spacing for 360px devices */
  .hero-section {
    padding-bottom: 70px !important;
    margin-bottom: 0 !important;
  }
  
  .hero-content {
    margin-bottom: 0 !important;
    padding-bottom: 1rem !important;
  }
  
  /* Remove any extra spacing that might cause white space */
  .services-section,
  .section {
    margin-top: 0 !important;
    padding-top: 1rem !important;
  }

}

/* Special handling for devices with unusual aspect ratios */
@media (max-width: 320px) {
  .sticky-book-button {
    padding: 0.85rem 0.75rem !important;
    font-size: 0.85rem !important;
    min-height: 52px !important;
    max-height: 52px !important;
  }
}

/* Landscape orientation fixes for small devices */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
  .sticky-book-button {
    padding: 0.75rem 1.25rem !important;
    font-size: 0.9rem !important;
    min-height: 50px !important;
    max-height: 50px !important;
  }
}

/* Ensure proper body spacing to accommodate sticky button */
@media (max-width: 768px) {
  body {
    padding-bottom: 80px !important;
    margin-bottom: 0 !important;
  }
  
  /* Ensure main content doesn't overlap */
  main, .main-content, #main-content {
    padding-bottom: 20px !important;
    margin-bottom: 0 !important;
  }
  
  /* Fix any sections that might create white space */
  section:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 1rem !important;
  }
}

/* Fix potential white space from other elements */
@media (max-width: 360px) {
  /* Ensure footer doesn't create white space */
  footer, .footer {
    margin-bottom: 0 !important;
    padding-bottom: 1rem !important;
  }
  
  /* Fix any containers that might cause spacing issues */
  .container {
    margin-bottom: 0 !important;
  }
  
  /* Ensure no floating elements interfere */
  .floating-elements, .floating-social, .floating-whatsapp {
    position: fixed !important;
  }
}

/* Safety override for any conflicting z-index issues */
@media (max-width: 768px) {
  .sticky-book-button {
    z-index: 2147483647 !important; /* Maximum possible z-index value */
  }
}

/* Accessibility improvements */
@media (max-width: 768px) {
  .sticky-book-button:focus {
    outline: 2px solid white !important;
    outline-offset: -2px !important;
  }
  
  .sticky-book-button:focus-visible {
    outline: 2px solid white !important;
    outline-offset: -2px !important;
  }
}

/* Print media - hide sticky button */
@media print {
  .sticky-book-button {
    display: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .sticky-book-button {
    border: 2px solid white !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .sticky-book-button {
    transition: none !important;
  }
  
  .sticky-book-button:hover {
    transform: none !important;
  }
  
  .sticky-book-button:active {
    transform: none !important;
  }
} 