/* Absa Mobile Optimizations CSS */

/* Base mobile optimizations */
html {
  font-size: 16px; /* Base font size for mobile */
  -webkit-text-size-adjust: 100%; /* Prevent font size adjustment after orientation changes in iOS */
}

body {
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* Improved touch targets for mobile */
/*button,*/
/*.btn,*/
/*a,*/
/*input[type="checkbox"],*/
/*input[type="radio"],*/
/*select {*/
/*  min-height: 44px; !* Minimum touch target size for accessibility *!*/
/*  min-width: 44px; !* For icon buttons and controls *!*/
/*}*/

/* Responsive typography */
@media (max-width: 767px) {
  h1 {
    font-size: 1.75rem !important;
  }
  h2 {
    font-size: 1.5rem !important;
  }
  h3 {
    font-size: 1.25rem !important;
  }
  h4 {
    font-size: 1.1rem !important;
  }
  p, li {
    font-size: 0.95rem !important;
  }
  .lead {
    font-size: 1.1rem !important;
  }
}

/* Fix for mobile header */
.site-mobile-menu {
  background-color: var(--hope);
  overflow-y: auto;
  max-height: 100vh;
}

.site-mobile-menu .site-nav-wrap a {
  color: var(--serene);
  padding: 10px 20px;
  display: block;
  /*border-bottom: 1px solid rgba(255, 255, 255, 0.1);*/
}

.site-mobile-menu .site-nav-wrap a:hover {
  color: var(--grey-04);
}

.site-mobile-menu .site-nav-wrap li.active > a {
  color: var(--serene);
  font-weight: bold;
}

/* Enhanced card display on mobile */
@media (max-width: 767px) {
  .card {
    margin-bottom: 20px;
  }
  .card-body {
    padding: 1rem;
  }
  .card-header {
    padding: 0.75rem 1rem;
  }
  .card-footer {
    padding: 0.75rem 1rem;
  }
  
  /* Stack buttons on mobile */
  .hero-buttons .btn {
    display: block;
    width: 100%;
    margin-right: 0 !important;
    margin-bottom: 10px;
  }
}

/* Improved form elements on mobile */
@media (max-width: 767px) {
  .form-container {
    padding: 1rem !important;
  }
  
  fieldset {
    padding: 15px !important;
    margin-bottom: 15px !important;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
  
  .form-control {
    font-size: 16px; /* Prevent iOS zoom on focus */
  }
  
  /* Better spacing for mobile forms */
  label {
    margin-bottom: 5px;
    display: block;
  }
}

/* Optimize hero sections for mobile */
@media (max-width: 767px) {
  .hero {
    padding: 50px 0 !important;
    text-align: center;
  }
  
  .hero-content {
    padding: 15px 0 !important;
  }
  
  /* Ensure proper spacing for hero content */
  .hero-content p {
    margin-bottom: 20px !important;
  }
}

/* Table optimizations for mobile */
@media (max-width: 767px) {
  .table-responsive {
    border: 0;
  }
  
  .custom-table thead {
    display: none; /* Hide table headers on small screens */
  }
  
  .custom-table tbody tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid var(--grey-24);
    border-radius: 4px;
  }
  
  .custom-table tbody td {
    display: block;
    text-align: right;
    padding: 10px;
    position: relative;
    border-bottom: 1px solid var(--grey-08);
  }
  
  .custom-table tbody td:last-child {
    border-bottom: none;
  }
  
  .custom-table tbody td:before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--hope);
  }
}

/* Footer optimization for mobile */
@media (max-width: 767px) {
  .footer-section {
    padding: 40px 0 20px;
    text-align: center;
  }
  
  .footer-section .col-md-3 {
    margin-bottom: 30px;
  }
  
  .footer-section h3 {
    margin-bottom: 15px;
  }
}

/* Fix spacing issues for mobile */
@media (max-width: 767px) {
  .site-section {
    padding: 40px 0 !important;
  }
  
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .row {
    margin-left: -15px;
    margin-right: -15px;
  }
  
  [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Improve spacing between sections */
  .section-heading {
    margin-bottom: 20px;
  }
  
  .section-heading:after {
    bottom: -8px;
    width: 40px;
  }
}

/* Optimize images for mobile */
@media (max-width: 767px) {
  img {
    max-width: 100%;
    height: auto;
  }
  
  .img-fluid {
    margin-bottom: 0;
  }
}

/* Navigation adjustments for mobile */
@media (max-width: 767px) {
  .site-navbar {
    padding: 10px 0;
  }
  
  .site-logo img {
    height: 80px; /* Increase as needed */
    width: auto;   /* Keeps the aspect ratio */
    content: url("../../images/logo-secondary.svg");
}

  
  /* Ensure the hamburger menu is easily tappable */
  .js-menu-toggle {
    padding: 10px;
    display: inline-block;
  }
}

/* Mobile-friendly lists */
@media (max-width: 767px) {
  .list-unstyled li {
    padding: 8px 0;
  }
}

/* Fix mobile viewport height issues */
@media (max-width: 767px) {
  .vh-100 {
    height: auto !important;
    min-height: 50vh;
  }
}

/* Optimize inputs for mobile */
@media (max-width: 767px) {
  input[type="date"], 
  input[type="time"], 
  input[type="datetime-local"], 
  input[type="month"] {
    -webkit-appearance: none; /* Remove default styling on iOS */
  }
}

/* Add momentum scrolling for iOS */
.scrollable {
  -webkit-overflow-scrolling: touch;
}

/* Fix for fixed positioning on iOS */
.ios-fixed {
  -webkit-transform: translateZ(0);
}

/* Ensure proper image scaling */
img {
  max-width: 100%;
  height: auto;
}
