/* Mobile Layout Fix for Section Images */

/* General map container fixes for all screen sizes */
.map-container {
  position: relative;
  width: 100%;
  min-height: 300px;
  overflow: hidden;
  border-radius: 8px;
  background: #f5f5f5;
}

.map-container iframe,
#google-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Desktop specific map styles */
@media (min-width: 769px) {
  .map-container {
    min-height: 400px;
  }
  
  .map-container iframe,
  #google-map {
    height: 400px;
  }
}

/* Mobile Responsive - Ensure images are below text and full width */
@media (max-width: 768px) {
  /* Make all sections use flexbox on mobile for better control */
  .section-content { 
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 2rem; 
    padding: 0 1rem; 
  }
  
  /* Ensure text always comes first on mobile */
  .section-text { 
    order: 1 !important;
    width: 100% !important;
  }
  
  /* Ensure images always come second on mobile */
  .section-media { 
    order: 2 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Make images take full width */
  .section-media img,
  .section-media picture {
    width: 100% !important;
    max-width: none !important;
    display: block !important;
    margin: 0 auto !important;
  }
  
  /* Remove any side-by-side layout */
  #about .section-content,
  #services .section-content {
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Ensure proper order for all sections */
  #about .section-text { order: 1 !important; }
  #about .section-media { order: 2 !important; }
  
  #services .section-text { order: 1 !important; }
  #services .section-media { order: 2 !important; }
  
  /* Fix map display on mobile - prevent cutoff */
  .map-container {
    position: relative;
    width: 100% !important;
    overflow: hidden !important;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .map-container iframe,
  #google-map {
    width: 100% !important;
    height: 300px !important;
    border: none !important;
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  /* Fix map wrapper to prevent overflow issues */
  .map-wrapper {
    width: 100% !important;
    overflow: visible !important;
    position: relative !important;
  }
  
  /* Ensure contact grid doesn't overflow */
  .contact-grid {
    gap: 2rem !important;
    overflow: visible !important;
  }
  
  /* Center text in About, Services, and Hours sections on mobile */
  #about .section-text,
  #about .content-text,
  #about h2,
  #services .section-text,
  #services .content-text,
  #services h2,
  #hours .section-text,
  #hours .content-text,
  #hours h2,
  .business-hours-section h2,
  .business-hours-section .content-text,
  .business-hours-content {
    text-align: center !important;
  }
  
  /* Center the hours list items */
  .hours-list {
    text-align: center !important;
    list-style: none !important;
    padding-left: 0 !important;
  }
  
  .hours-list li {
    text-align: center !important;
    margin-bottom: 0.5rem;
  }
  
  /* Also center any paragraphs within these sections */
  #about p,
  #services p,
  #hours p,
  .business-hours-section p {
    text-align: center !important;
  }
}