/* Responsive CSS for all pages */

/* Base responsive settings */
html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* Responsive grid system */
.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

/* Responsive breakpoints */
/* Extra small devices (phones, 576px and down) */
@media (max-width: 576px) {
  .container {
    max-width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }
  
  h1 {
    font-size: 1.8rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  h3 {
    font-size: 1.3rem !important;
  }
  
  p {
    font-size: 0.95rem !important;
  }
  
  .hide-on-mobile {
    display: none !important;
  }
  
  .text-center-mobile {
    text-align: center !important;
  }
  
  .mt-sm-3 {
    margin-top: 1rem !important;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* Custom responsive utilities */
.responsive-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive spacing utilities */
@media (max-width: 768px) {
  .mb-md-0 {
    margin-bottom: 0 !important;
  }
  
  .mb-md-1 {
    margin-bottom: 0.25rem !important;
  }
  
  .mb-md-2 {
    margin-bottom: 0.5rem !important;
  }
  
  .mb-md-3 {
    margin-bottom: 1rem !important;
  }
  
  .mb-md-4 {
    margin-bottom: 1.5rem !important;
  }
  
  .mb-md-5 {
    margin-bottom: 3rem !important;
  }
}

/* Responsive layout helpers */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  flex-basis: 0;
  flex-grow: 1;
  max-width: 100%;
}

/* Responsive column classes */
@media (max-width: 768px) {
  .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  
  .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

@media (max-width: 576px) {
  .col-sm-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Responsive flex utilities */
.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

@media (max-width: 768px) {
  .flex-md-column {
    flex-direction: column !important;
  }
}

@media (max-width: 576px) {
  .flex-sm-column {
    flex-direction: column !important;
  }
}

/* Responsive text alignment */
@media (max-width: 768px) {
  .text-md-center {
    text-align: center !important;
  }
  
  .text-md-left {
    text-align: left !important;
  }
  
  .text-md-right {
    text-align: right !important;
  }
}

/* Responsive visibility classes */
@media (max-width: 768px) {
  .d-md-none {
    display: none !important;
  }
  
  .d-md-block {
    display: block !important;
  }
}

@media (max-width: 576px) {
  .d-sm-none {
    display: none !important;
  }
  
  .d-sm-block {
    display: block !important;
  }
}

/* Fix for images in responsive layouts */
.img-fluid {
  max-width: 100%;
  height: auto;
}

/* Responsive iframe/video container */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Force all images and sliders to have low z-index */
img, 
.slick-slider,
.slick-list,
.slick-track,
.slick-slide,
.carousel,
.carousel-inner,
.carousel-item,
.banner,
.banner-image,
.hero,
.hero-image,
.slider,
.slider-item,
[class*="slider"],
[class*="carousel"],
[class*="banner"],
[class*="hero"],
.swiper,
.swiper-wrapper,
.swiper-slide,
.owl-carousel,
.owl-stage-outer,
.owl-stage,
.owl-item {
  z-index: 0 !important; /* Force all content to be below navigation */
  position: relative;
}

/* Add padding to body for fixed header */
body {
  padding-top: 80px !important; /* Adjust based on header height */
}

/* Mobile Menu - Fixed position approach to avoid overlapping issues */
@media (max-width: 1023px) {
  /* Ensure body overflow doesn't hide menu */
  body, html {
    overflow-x: hidden;
    padding-top: 70px !important; /* Smaller padding for mobile */
  }
  
  /* Ensure header is fixed and always on top */
  #main-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  }
  
  /* Simple mobile menu */
  #mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    overflow: hidden;
    transition: transform 0.5s ease, opacity 0.5s ease;
    z-index: 9998;
  }
  
  /* When menu is open */
  #mobile-menu.scale-y-100,
  #mobile-menu.opacity-100 {
    transform: scaleY(1);
    opacity: 1;
  }
  
  /* Mobile logo sizing */
  .logo-image {
    height: 40px;
    width: auto;
  }
  
  /* Mobile menu padding */
  .nav-wrapper {
    padding: 1rem;
  }
}

/* Responsive Tables */
.responsive-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile stacked layouts */
@media (max-width: 768px) {
  .mobile-stack {
    display: flex !important;
    flex-direction: column !important;
  }
  
  .mobile-stack > * {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Mobile navigation */
@media (max-width: 768px) {
  .mobile-nav {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* FIXED HEADER OVERRIDE - Ensure header is always fixed */
#main-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9999 !important;
  background-color: white !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Add padding to body for fixed header */
body {
  padding-top: 80px !important;
}

@media (max-width: 1023px) {
  body {
    padding-top: 70px !important;
  }
} 