/*
  RRwisdomhomes Mobile Stylesheet
  This file contains all mobile-specific and small-screen CSS overrides for the RRwisdomhomes website.
  Extracted from style.css for clarity and maintainability.
*/

/* --- Global Mobile Resets --- */
@media (max-width: 767px) {
  /* Reset any inherited margins/padding that might cause left shift */
  * {
    box-sizing: border-box;
  }

  html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  /* Ensure all content containers are centered */
  .overlay-content, .wide-section, section, header {
    margin-left: auto !important;
    margin-right: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
  }
}

/* --- Mobile: max-width 767px --- */
@media (max-width: 767px) {
  /* Ensure proper centering for all content */
  body {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mobile-nav-toggle {
    display: block !important; /* Show hamburger icon on mobile */
    z-index: 1300 !important; /* High z-index to appear above everything */
    position: fixed !important; /* Fixed position to follow scrolling */
    bottom: 1.5rem !important; /* Position at bottom right corner */
    right: 1.5rem !important; /* Position at bottom right corner */
    top: auto !important; /* Override the top positioning */
    left: auto !important; /* Override any left positioning */
    width: 50px !important; /* Larger touch target */
    height: 50px !important; /* Larger touch target */
    background: rgba(255, 255, 255, 0.9) !important; /* Semi-transparent white background */
    border-radius: 50% !important; /* Circular background */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important; /* Shadow for visibility */
    border: 2px solid var(--primary) !important; /* Border matching theme */
    backdrop-filter: blur(10px) !important; /* Modern glass effect */
  }
  .main-nav-desktop {
    display: none; /* Hide desktop nav on mobile */
  }

  /* Ensure header background is properly centered */
  header {
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  /* Ensure logo doesn't interfere with hamburger */
  .logo-header {
    z-index: 1; /* Lower than hamburger button */
    margin: 0 auto !important; /* Center the logo */
    display: block !important;
  }
}

/* --- Mobile: max-width 900px --- */
@media (max-width: 900px) {
  .why-row {
    flex-direction: column;
    align-items: center;
  }
  .wide-section {
    max-width: 95vw !important;
    margin: 2rem auto !important;
    overflow: visible !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    display: block !important;
  }
}

/* --- Mobile: max-width 700px (multiple blocks) --- */
@media (max-width: 700px) {
  .wide-section {
    max-width: 95vw !important;
    margin: 2rem auto !important;
    overflow: visible !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
    display: block !important;
  }

  .overlay-content {
    max-width: 97vw;
    width: 96%;
    padding: 1.25rem 1rem;
    min-width: unset;
    border-radius: 20px;
    max-height: none !important; /* Allow content to expand fully */
    min-height: auto;
    margin: 2vh auto !important; /* Reduce top/bottom margins */
    overflow: visible !important; /* Allow content to show */
    box-sizing: border-box;
    display: block !important;
    text-align: center;
    position: static !important; /* Prevent positioning conflicts */
  }

  .contact-info-section {
    border-radius: 16px;
  }

  .contact-lock-overlay p {
    font-size: 0.9em;
    padding: 0.75rem 1.5rem;
  }
  
  .overlay-content h2 {
    font-size: 1.3em;
    text-align: center;
  }
  
  .overlay-content p {
    font-size: 0.9em;
    word-wrap: break-word;
    line-height: 1.4;
  }
  
  .why-row {
    flex-direction: column;
    align-items: center;
  }
  
  .why-item {
    width: 100%;
    margin: 0.5rem 0;
  }
  
  form {
    width: 100%;
    gap: 1.25rem;
  }
  
  .form-group {
    margin-bottom: 0;
  }

  input, textarea {
    padding: 0.75em 0.65em;
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
    min-width: 0;
    text-align: left;
    border-radius: 6px;
    border-width: 2px;
  }

  /* Mobile styles for qualifying questions */
  .qualifying-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem 1rem;
    border-radius: 10px;
  }

  .questions-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .section-intro {
    font-size: 0.9em;
    margin-bottom: 1.25rem;
  }

  .form-question {
    margin-bottom: 0;
  }

  .form-question:hover {
    transform: none;
  }

  .form-question label {
    font-size: 0.9em;
    margin-bottom: 0.5rem;
    text-align: left;
  }

  .form-question select {
    padding: 0.75em 0.65em;
    font-size: 0.9em;
    text-align: left;
    border-radius: 6px;
    padding-right: 2.25rem;
  }

  .contact-info-section {
    margin-top: 1.5rem;
    padding: 1.5rem 1rem 2rem 1rem; /* Extra bottom padding for submit button */
    border-radius: 10px;
    min-height: auto; /* Allow natural height */
  }

  /* Ensure submit button area is always accessible */
  #submit-button {
    margin-top: 1.5rem !important;
    margin-bottom: 1rem !important; /* Extra space below button */
    padding: 0.9rem 1.5rem !important;
    min-height: 44px !important; /* iOS touch target minimum */
  }

  .section-divider {
    margin-bottom: 1.5rem;
  }

  .section-divider span {
    font-size: 0.8em;
    padding: 0.4rem 1rem;
  }

  input:focus, textarea:focus, select:focus {
    /* No transform to prevent shifting */
  }

  .cta-button, button {
    padding: 0.9rem 1.5rem;
    font-size: 1em;
    border-radius: 8px;
    margin-top: 1.25rem;
  }

  .cta-button:hover, button:hover {
    transform: translateY(-1px);
  }

  .overlay-content h2 {
    font-size: 1.5em;
    margin-bottom: 1.25rem;
  }

  .value-proposition {
    font-size: 1em;
  }

  .privacy-message {
    flex-direction: column;
    padding: 0.875rem 1rem;
    gap: 0.5rem;
  }

  .privacy-text {
    font-size: 0.85em;
  }

  /* Mobile specific slogan visibility */
  .slogan-desktop {
    display: none !important; /* Hide desktop slogan on mobile */
  }

  .slogan-mobile {
    display: block !important; /* Show mobile slogan on mobile */
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.3rem; /* Reduce padding for smaller screens */
    font-size: 0.85rem; /* Reduce font size for readability */
  }

  /* Ensure video background works well on mobile */
  .video-background {
    min-height: 100vh;
    position: relative;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .video-background video {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    display: block;
  }

  /* Prevent body scroll when form is open to avoid cutoff issues */
  body.form-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
  }

  /* Ensure all sections are properly centered */
  section {
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Improve mobile navigation menu */
  .mobile-nav-menu {
    padding: 2rem 1rem;
  }

  .mobile-nav-menu .main-nav a {
    font-size: 1.2rem;
    padding: 1rem 0;
    display: block;
    text-align: center;
  }

  /* Ensure success message overlay works on mobile */
  .success-message-overlay {
    padding: 1.5rem !important;
    margin: 1rem !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    position: fixed !important;
  }

  .success-message-content h3 {
    font-size: 1.3rem !important;
  }

  .success-message-content p {
    font-size: 1rem !important;
  }

  /* Ensure proper spacing for very small screens */
  body {
    padding: 0;
    margin: 0;
  }

  /* Improve readability on very small screens */
  section {
    padding: 1rem;
  }

  /* Prevent form cutoff on small screens */
  .overlay-content {
    padding-bottom: 3rem !important; /* Extra padding at bottom */
    margin-bottom: 4rem !important; /* Extra margin to ensure visibility */
  }

  /* Ensure submit button is never cut off */
  form[name="cash-offer"] {
    padding-bottom: 2rem !important;
  }

  /* Additional safety for very small viewports */
  @media (max-height: 600px) {
    .overlay-content {
      max-height: calc(100vh - 6rem) !important;
      overflow-y: auto !important;
      margin: 1rem auto !important;
    }

    .contact-info-section {
      padding-bottom: 3rem !important;
    }
  }

  /* Make sure headers don't get cut off */
  h1, h2, h3 {
    word-wrap: break-word;
    hyphens: auto;
  }

  /* Ensure form elements are properly sized */
  .contact-form {
    gap: 1rem;
  }
}

/* --- Extra small screens: max-width 480px --- */
@media (max-width: 480px) {
  /* Force centering for all content */
  * {
    box-sizing: border-box !important;
  }

  body, html {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important; /* Prevent horizontal scroll */
  }

  .overlay-content {
    width: 98% !important;
    max-width: 98vw !important;
    padding: 1rem 0.75rem !important;
    margin: 1rem auto !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
  }

  .wide-section {
    max-width: 98vw !important;
    margin: 1rem auto !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
    display: block !important;
  }

  .overlay-content h2 {
    font-size: 1.2rem !important;
  }

  .cta-button, button {
    width: 100% !important;
    padding: 0.8rem 1rem !important;
    font-size: 0.95rem !important;
  }

  /* Improve mobile nav button positioning - now at bottom right */
  .mobile-nav-toggle {
    bottom: 1rem !important; /* Even lower for very small screens */
    right: 1rem !important;
    width: 45px !important;
    height: 45px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid var(--primary) !important;
  }

  .mobile-nav-toggle span {
    height: 2px !important;
    margin-bottom: 4px !important;
    background: var(--primary) !important; /* Make lines visible */
  }

  /* Ensure success message is centered on very small screens */
  .success-message-overlay {
    max-width: 90vw !important;
    width: 90vw !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
} 