/*!
 * Hanell International - Mobile Responsiveness Styles
 * Developer: Brian Guvava | Company: BLAXIUM (https://blaxium.com)
 * Project: Hanell International Website Redesign v1.0.0
 * Last Updated: June 30, 2025
 * 
 * REQ-010: Mobile Responsiveness - Comprehensive mobile optimization
 * This file ensures perfect functionality across all device sizes
 */

/* =============================================================================
   MOBILE-FIRST BASE STYLES
   ============================================================================= */

/* Touch-friendly sizing for mobile devices */
html {
  font-size: 16px; /* Base font size for mobile */
  touch-action: manipulation; /* Prevent double-tap zoom */
  -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
  -ms-text-size-adjust: 100%;
}

body {
  /* Mobile-optimized body */
  min-height: 100vh;
  min-height: -webkit-fill-available; /* iOS Safari fix */
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Mobile viewport fix for iOS */
.mobile-100vh {
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* =============================================================================
   TOUCH-FRIENDLY INTERACTIVE ELEMENTS
   ============================================================================= */

/* Minimum touch target size (44px x 44px as per accessibility guidelines) */
.btn,
.nav-link,
.mobile-menu-toggle,
.scroll-to-top,
button,
input[type="button"],
input[type="submit"],
a {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; /* Remove blue highlight on tap */
}

/* Enhanced touch feedback */
.btn:active,
.nav-link:active,
button:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Remove default button appearance on mobile */
button,
input[type="button"],
input[type="submit"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: var(--radius-md);
}

/* =============================================================================
   MOBILE NAVIGATION ENHANCEMENTS
   ============================================================================= */

/* Mobile menu enhancements */
@media (max-width: 991px) {
  .navbar-nav {
    width: 100%;
  }
  
  .mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }
  
  .mobile-menu--open {
    transform: translateX(0);
  }
  
  .mobile-menu-toggle {
    display: flex;
    background: none;
    border: none;
    padding: var(--spacing-sm);
    cursor: pointer;
    z-index: calc(var(--z-modal) + 1);
  }
  
  /* Mobile menu items */
  .mobile-menu .nav-link {
    min-height: 56px; /* Larger touch targets on mobile */
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  /* Mobile dropdown menus */
  .mobile-menu .dropdown {
    width: 100%;
  }
  
  .mobile-menu .dropdown-menu {
    position: static;
    display: none;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }
  
  .mobile-menu .dropdown.show .dropdown-menu {
    display: block;
  }
  
  .mobile-menu .dropdown-item {
    min-height: 48px;
    padding: var(--spacing-sm) var(--spacing-xl);
    font-size: var(--font-size-base);
  }
}

/* =============================================================================
   RESPONSIVE TYPOGRAPHY
   ============================================================================= */

/* Mobile typography scaling */
@media (max-width: 576px) {
  :root {
    --font-size-xs: 0.7rem;   /* 11px */
    --font-size-sm: 0.8rem;   /* 13px */
    --font-size-base: 0.9rem; /* 14px */
    --font-size-lg: 1rem;     /* 16px */
    --font-size-xl: 1.1rem;   /* 18px */
    --font-size-2xl: 1.3rem;  /* 21px */
    --font-size-3xl: 1.6rem;  /* 26px */
    --font-size-4xl: 2rem;    /* 32px */
    --font-size-5xl: 2.4rem;  /* 38px */
    --font-size-6xl: 3rem;    /* 48px */
  }
  
  /* Adjust line heights for mobile */
  h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
  }
  
  p {
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
  }
}

/* Tablet typography adjustments */
@media (min-width: 577px) and (max-width: 991px) {
  :root {
    --font-size-xs: 0.75rem;  /* 12px */
    --font-size-sm: 0.85rem;  /* 14px */
    --font-size-base: 0.95rem; /* 15px */
    --font-size-lg: 1.05rem;  /* 17px */
    --font-size-xl: 1.15rem;  /* 18px */
    --font-size-2xl: 1.4rem;  /* 22px */
    --font-size-3xl: 1.8rem;  /* 29px */
    --font-size-4xl: 2.2rem;  /* 35px */
    --font-size-5xl: 2.6rem;  /* 42px */
    --font-size-6xl: 3.2rem;  /* 51px */
  }
}

/* =============================================================================
   RESPONSIVE SPACING & LAYOUT
   ============================================================================= */

/* Mobile spacing adjustments */
@media (max-width: 576px) {
  :root {
    --spacing-xs: 0.2rem;   /* 3px */
    --spacing-sm: 0.4rem;   /* 6px */
    --spacing-md: 0.8rem;   /* 13px */
    --spacing-lg: 1.2rem;   /* 19px */
    --spacing-xl: 1.6rem;   /* 26px */
    --spacing-2xl: 2rem;    /* 32px */
    --spacing-3xl: 2.4rem;  /* 38px */
    --spacing-4xl: 3.2rem;  /* 51px */
    --spacing-5xl: 4rem;    /* 64px */
  }
  
  .container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }
  
  .section {
    padding: var(--spacing-3xl) 0;
  }
  
  .section-sm {
    padding: var(--spacing-2xl) 0;
  }
  
  .section-lg {
    padding: var(--spacing-4xl) 0;
  }
}

/* Tablet spacing */
@media (min-width: 577px) and (max-width: 991px) {
  .container {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }
  
  .section {
    padding: var(--spacing-4xl) 0;
  }
}

/* =============================================================================
   MOBILE FORM OPTIMIZATIONS
   ============================================================================= */

/* Mobile form improvements */
@media (max-width: 768px) {
  .form-control {
    min-height: 48px; /* Touch-friendly form inputs */
    font-size: 16px; /* Prevent zoom on iOS */
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .form-select {
    min-height: 48px;
    font-size: 16px;
  }
  
  .btn {
    min-height: 48px;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--font-size-base);
    width: 100%; /* Full width buttons on mobile */
    margin-bottom: var(--spacing-sm);
  }
  
  .btn + .btn {
    margin-left: 0;
  }
  
  /* Form groups stacking */
  .row .col-md-6:not(:last-child) {
    margin-bottom: var(--spacing-md);
  }
  
  /* Input groups */
  .input-group {
    flex-direction: column;
  }
  
  .input-group .form-control,
  .input-group .btn {
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
  }
  
  .input-group .btn {
    margin-bottom: 0;
  }
}

/* =============================================================================
   MOBILE GRID SYSTEM ENHANCEMENTS
   ============================================================================= */

/* Enhanced mobile grid */
@media (max-width: 576px) {
  .row {
    margin-left: calc(-1 * var(--spacing-sm));
    margin-right: calc(-1 * var(--spacing-sm));
  }
  
  .row > * {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }
  
  /* Mobile-specific utilities */
  .mobile-center {
    text-align: center !important;
  }
  
  .mobile-full-width {
    width: 100% !important;
  }
  
  .mobile-hidden {
    display: none !important;
  }
  
  .mobile-visible {
    display: block !important;
  }
}

/* =============================================================================
   MOBILE CARD COMPONENTS
   ============================================================================= */

/* Mobile card optimizations */
@media (max-width: 768px) {
  .card {
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-lg);
  }
  
  .card-body {
    padding: var(--spacing-lg);
    text-align: center;
  }
  
  .card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: center;
  }
  
  .card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: center;
  }
  
  /* Service cards mobile layout */
  .service-card {
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
  }
  
  .service-icon {
    width: 60px;
    height: 60px;
    font-size: var(--font-size-2xl);
    margin: 0 auto var(--spacing-lg);
  }
}

/* =============================================================================
   MOBILE HEADER & NAVIGATION
   ============================================================================= */

/* Mobile header adjustments */
@media (max-width: 991px) {
  .header {
    --header-height-mobile: 60px;
  }
  
  .navbar {
    padding: var(--spacing-sm) 0;
  }
  
  .navbar-brand .logo {
    height: 35px;
  }
  
  /* Mobile menu overlay */
  .mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
  }
  
  .mobile-menu-backdrop--active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Prevent body scroll when mobile menu is open */
  .mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* =============================================================================
   MOBILE FOOTER OPTIMIZATIONS
   ============================================================================= */

/* Mobile footer layout */
@media (max-width: 768px) {
  .footer {
    text-align: center;
  }
  
  .footer .row > div {
    margin-bottom: var(--spacing-xl);
  }
  
  .footer-links {
    text-align: center;
  }
  
  .footer-legal {
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
    margin-top: var(--spacing-lg);
  }
  
  .newsletter-form {
    max-width: 300px;
    margin: 0 auto;
  }
}

/* =============================================================================
   MOBILE SCROLL INDICATORS
   ============================================================================= */

/* Mobile scroll indicators */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: var(--font-size-lg);
  }
  
  .scroll-progress {
    height: 3px;
  }
  
  .scroll-progress-bar {
    height: 100%;
  }
}

/* =============================================================================
   MOBILE ANIMATIONS & PERFORMANCE
   ============================================================================= */

/* Reduced motion for mobile users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .scroll-progress-bar {
    transition: none;
  }
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
  /* Reduce complex animations on mobile */
  .parallax-element {
    transform: none !important;
  }
  
  /* Simplify shadows on mobile */
  .card,
  .btn,
  .header--sticky {
    box-shadow: var(--shadow-sm) !important;
  }
  
  /* Optimize transforms for mobile */
  .hover-lift:hover {
    transform: translateY(-2px);
  }
  
  .hover-scale:hover {
    transform: scale(1.02);
  }
}

/* =============================================================================
   MOBILE ACCESSIBILITY ENHANCEMENTS
   ============================================================================= */

/* Mobile accessibility improvements */
@media (max-width: 768px) {
  /* Focus indicators for touch devices */
  .btn:focus,
  .form-control:focus,
  .nav-link:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
  }
  
  /* Skip links for mobile */
  .skip-to-content:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: var(--z-tooltip);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-primary);
    color: var(--color-white);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
  }
  
  /* Screen reader improvements */
  .sr-only-mobile {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

/* =============================================================================
   DEVICE-SPECIFIC OPTIMIZATIONS
   ============================================================================= */

/* iPhone SE and small devices */
@media (max-width: 375px) {
  .container {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }
  
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  
  .section-title {
    font-size: var(--font-size-2xl);
  }
  
  .btn {
    font-size: var(--font-size-sm);
    padding: var(--spacing-sm);
  }
}

/* Large mobile devices */
@media (min-width: 414px) and (max-width: 767px) {
  .hero-title {
    font-size: var(--font-size-4xl);
  }
  
  .section-title {
    font-size: var(--font-size-3xl);
  }
}

/* Tablet portrait */
@media (min-width: 768px) and (max-width: 991px) and (orientation: portrait) {
  .hero-section {
    min-height: 80vh;
  }
  
  .hero-title {
    font-size: var(--font-size-4xl);
  }
  
  .service-card {
    padding: var(--spacing-xl) var(--spacing-lg);
  }
}

/* Tablet landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .hero-section {
    min-height: 100vh;
  }
  
  .mobile-menu {
    width: 350px;
  }
}

/* =============================================================================
   PRINT STYLES FOR MOBILE
   ============================================================================= */

@media print {
  .mobile-menu,
  .mobile-menu-toggle,
  .scroll-to-top,
  .scroll-progress {
    display: none !important;
  }
  
  .container {
    max-width: none !important;
    padding: 0 !important;
  }
  
  .section {
    page-break-inside: avoid;
  }
  
  .card {
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #000;
  }
}
