/* ========================================
   Mobile Responsive Enhancements
   For Nationwide Boat Shipping Website
   ======================================== */

/* Base mobile improvements */
@media (max-width: 768px) {
  
  /* Typography improvements */
  body {
    font-size: 16px;
    line-height: 1.6;
  }
  
  h1 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.8rem;
  }
  
  h3 {
    font-size: 1.3rem;
    line-height: 1.3;
  }
  
  h4 {
    font-size: 1.1rem;
  }
  
  /* Padding and spacing */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  section {
    padding: 30px 0;
  }
  
  /* Images responsive */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Buttons */
  .btn {
    display: block;
    width: 100%;
    margin-bottom: 10px;
  }
  
  .btn-lg {
    padding: 12px 20px;
    font-size: 16px;
  }
  
  /* Tables - make scrollable */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Forms */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px; /* Prevents iOS zoom on focus */
    width: 100%;
    max-width: 100%;
  }
  
  /* Navigation improvements */
  .navbar-collapse {
    max-height: none;
  }
  
  .navbar-nav {
    margin: 0;
  }
  
  .navbar-nav > li > a {
    padding: 15px;
    font-size: 16px;
  }
  
  /* Hero sections */
  #intro,
  #hero-block {
    min-height: 400px;
  }
  
  .carousel-caption-center {
    padding: 20px;
  }
  
  /* Feature sections */
  .featured {
    padding: 30px 0;
  }
  
  .featured .col-sm-4,
  .featured .col-sm-6,
  .featured .col-sm-8 {
    margin-bottom: 20px;
  }
  
  /* Footer */
  footer .col-sm-3 {
    margin-bottom: 20px;
    text-align: center;
  }
  
  /* Hide elements that don't work well on mobile */
  .hidden-xs {
    display: none !important;
  }
  
  /* Card-style content boxes */
  .card,
  .service-box {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  /* Video embeds */
  .video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
  }
  
  .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* Small mobile devices (phones in portrait) */
@media (max-width: 576px) {
  
  body {
    font-size: 14px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  h3 {
    font-size: 1.1rem;
  }
  
  .btn-lg {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  /* Reduce padding on small screens */
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  section {
    padding: 20px 0;
  }
  
  /* Hero adjustments */
  #intro,
  #hero-block {
    min-height: 350px;
  }
  
  /* Navigation */
  .navbar-brand {
    font-size: 18px;
    padding: 10px 15px;
  }
  
  .navbar-nav > li > a {
    padding: 12px 15px;
    font-size: 14px;
  }
}

/* Tablet devices (landscape phones and portrait tablets) */
@media (min-width: 577px) and (max-width: 991px) {
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.7rem;
  }
  
  .btn {
    display: inline-block;
    width: auto;
  }
  
  /* Hero sections */
  #intro,
  #hero-block {
    min-height: 500px;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  
  #intro,
  #hero-block {
    min-height: 300px;
  }
  
  .navbar-header {
    float: none;
  }
  
  .navbar-toggle {
    display: block;
  }
  
  .navbar-collapse {
    border-top: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  }
  
  .navbar-collapse.collapse {
    display: none !important;
  }
  
  .navbar-collapse.collapse.in {
    display: block !important;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  
  /* Increase touch target sizes */
  a,
  button,
  .btn,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
  }
  
  /* Remove hover effects that don't work on touch */
  a:hover,
  button:hover,
  .btn:hover {
    opacity: 0.9;
  }
}

/* Back to top button - keep square on all screen sizes */
@media (max-width: 768px) {
  .back-to-top {
    width: 50px !important;
    height: 50px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
  }
  
  .back-to-top .fa {
    margin: 0 !important;
    font-size: 20px !important;
  }
}

/* Print styles */
@media print {
  
  .navbar,
  .footer,
  .preloader,
  .back-to-top,
  .hero-mobile-call {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  h1 {
    font-size: 24pt;
  }
  
  h2 {
    font-size: 20pt;
  }
  
  a {
    text-decoration: underline;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
  
  /* Skip to main content link */
  .skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
  }
  
  .skip-to-main:focus {
    left: 0;
    top: 0;
    background: #000;
    color: #fff;
    padding: 10px;
  }
  
  /* Focus styles */
  a:focus,
  button:focus,
  input:focus,
  textarea:focus,
  select:focus {
    outline: 3px solid #48A5FF;
    outline-offset: 2px;
  }
}

/* Performance optimizations */
@media (max-width: 768px) {
  
  /* Reduce animations on mobile for performance */
  *,
  *::before,
  *::after {
    animation-duration: 0.5s !important;
    transition-duration: 0.3s !important;
  }
  
  /* Optimize images */
  img {
    image-rendering: -webkit-optimize-contrast;
  }
}
