/* Mobile Responsive Styles - Separate file to keep main styles.css safe */

/* Hide Home link on desktop, only show on mobile */
.mobile-home-link {
  display: none !important;
}

/* Mobile responsive breakpoints */
@media screen and (max-width: 1024px) {
  /* Hide slogan on mobile */
  .top-bar-slogan,
  #topBarTypewriter {
    display: none !important;
  }

  /* Hide desktop navigation on mobile */
  .desktop-nav {
    display: none !important;
  }

  /* Show logo on mobile with better visibility */
  .header-logo {
    display: block !important;
    position: fixed;
    top: 15px;
    left: 20px;
    z-index: 1001;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }

  .header-logo-img {
    height: 40px;
    width: auto;
    display: block;
    max-width: 140px;
  }

  /* Position hamburger menu button on right side */
  .menu-toggle {
    display: block !important;
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 1001;
    background: white;
    border: none;
    padding: 12px;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: 48px;
    height: 48px;
  }

  .menu-toggle svg {
    width: 24px;
    height: 24px;
    stroke: #006633;
  }

  /* Fix top bar on mobile - remove slogan section */
  .top-bar {
    padding: 10px 15px;
  }

  .top-bar-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .top-bar-left {
    display: none !important;
  }

  /* Make phone numbers bolder and bigger */
  .top-bar-right {
    width: 100%;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 8px;
    justify-content: flex-end;
    display: flex;
  }

  .top-bar-right a {
    font-size: 13px;
    font-weight: 600;
  }

  /* Hide email and its divider on mobile */
  .top-bar-right a[href^="mailto"] {
    display: none !important;
  }

  .top-bar-right a[href^="mailto"] + .divider {
    display: none !important;
  }

  /* Sidebar mobile behavior with smooth animation */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  /* Fixed styling for mobile Home link at top of sidebar menu */
  .mobile-home-link {
    display: flex !important;
    padding: 0 20px !important;
    margin-bottom: 15px !important;
  }

  /* Target the actual anchor element inside mobile-home-link */
  .mobile-home-link a,
  .mobile-home-link .home-link {
    display: flex !important;
    align-items: center;
    gap: 10px;
    color: white !important;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 20px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
  }

  /* Ensure Home link text is always white in all states */
  .mobile-home-link a:link,
  .mobile-home-link a:visited,
  .mobile-home-link a:active,
  .mobile-home-link .home-link:link,
  .mobile-home-link .home-link:visited,
  .mobile-home-link .home-link:active {
    color: white !important;
  }

  .mobile-home-link a:hover,
  .mobile-home-link .home-link:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateX(4px);
    color: white !important;
  }

  .mobile-home-link svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
    stroke: white !important;
  }

  /* Add overlay when menu is open */
  body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  /* Show overlay when sidebar is active */
  .sidebar.active ~ body::after,
  body.menu-open::after {
    opacity: 1;
    pointer-events: auto;
  }

  /* Adjust main content padding on mobile */
  .main-content {
    margin-left: 0 !important;
    padding: 10px;
  }

  /* Hero section mobile optimization - fix overlapping elements */
  .hero {
    padding: 60px 15px 40px;
    margin-top: 60px;
  }

  .hero h1 {
    font-size: 28px;
    margin-bottom: 15px;
  }

  .hero p {
    font-size: 14px;
    margin-bottom: 20px;
  }

  /* Hide carousel arrows on mobile to prevent overlap */
  .carousel-btn {
    display: none !important;
  }

  /* Adjust carousel dots position on mobile */
  .carousel-dots {
    bottom: 15px !important;
    gap: 8px;
  }

  .carousel-dots .dot {
    width: 8px;
    height: 8px;
  }

  /* Adjust hero content positioning */
  .hero-content {
    position: relative;
    z-index: 2;
    padding: 20px 15px;
  }

  /* Make hero buttons stack on mobile */
  .cta-buttons {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .cta-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* Services grid stacks on mobile */
  .services-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }

  /* Redesigned about section for mobile - image at top, clean text below */
  .about-section {
    padding: 30px 20px !important;
  }

  .about-content {
    flex-direction: column-reverse !important;
    gap: 0 !important;
    display: flex !important;
  }

  /* Hide section number on mobile */
  .about-text .section-label {
    display: none !important;
  }

  /* Image at top, full width */
  .about-image {
    width: 100% !important;
    margin-left: 0 !important;
    margin-bottom: 25px !important;
    text-align: center;
    float: none !important;
  }

  .about-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    margin: 0 !important;
    float: none !important;
    display: block !important;
  }

  /* Text below image */
  .about-text {
    width: 100% !important;
    padding-right: 0 !important;
    float: none !important;
    clear: both !important;
  }

  .section-title {
    font-size: 22px !important;
    line-height: 1.3 !important;
    margin-bottom: 18px !important;
    font-weight: 700 !important;
  }

  .about-text p {
    font-size: 14px !important;
    line-height: 1.7 !important;
    margin-bottom: 15px !important;
    color: #555 !important;
  }

  /* Footer stacks on mobile */
  .footer-content {
    flex-direction: column;
    gap: 20px;
  }

  .footer-column {
    width: 100%;
  }

  /* Stats section on mobile */
  .stats {
    flex-direction: column;
    gap: 20px;
  }

  .stat-item {
    width: 100%;
  }

  /* Adding solar pump page mobile responsiveness */
  /* Solar pump hero section - image at top, then clean text below */
  .solar-pump-hero {
    flex-direction: column-reverse !important; /* Reverse to put image first */
    padding: 80px 20px 30px !important;
    gap: 0 !important; /* Remove gap for tighter layout */
    display: flex !important; /* Ensure flex display is applied */
  }

  .solar-pump-hero-image {
    width: 100% !important;
    margin-left: 0 !important;
    margin-bottom: 25px !important; /* Add space between image and text */
    float: none !important; /* Remove any float that prevents stacking */
  }

  .solar-pump-hero-image img {
    /* Making hero image bigger on mobile */
    width: 100% !important;
    max-height: 400px !important; /* Increase from default to make image taller */
    object-fit: cover !important; /* Ensure image fills space properly */
    height: auto !important;
    border-radius: 12px; /* Slightly more rounded corners */
    display: block;
  }

  .solar-pump-hero-content {
    width: 100% !important;
    padding-right: 0 !important;
    text-align: left;
    float: none !important; /* Remove any float that prevents stacking */
  }

  .solar-pump-hero h1 {
    font-size: 24px !important; /* Match reference image size */
    line-height: 1.3 !important;
    margin-bottom: 15px !important; /* More space after heading */
    font-weight: 700 !important;
    /* Revert color - let it use default from main CSS */
  }

  .solar-pump-hero .hero-subtitle {
    font-size: 16px !important;
    margin-bottom: 15px !important;
    font-weight: 600 !important;
    /* Revert color - let it use default from main CSS */
  }

  .solar-pump-hero .hero-description {
    font-size: 14px !important;
    line-height: 1.7 !important; /* Better line height for readability */
    /* Revert color - let it use default from main CSS */
  }

  /* Solar pump challenge section mobile */
  .solar-pump-challenge .container,
  .solar-pump-solutions .container,
  .supplier-info .container {
    flex-direction: column !important;
    padding: 30px 20px !important;
  }

  .challenge-content,
  .supplier-content {
    width: 100% !important;
    margin-bottom: 20px;
  }

  .challenge-image,
  .supplier-image {
    width: 100% !important;
  }

  .challenge-image img,
  .supplier-image img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
  }

  /* Solar pump solutions grid on mobile */
  .solutions-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Solar pump benefits grid on mobile */
  .benefits-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Solar pump section headings on mobile */
  .solar-pump-challenge h2,
  .solar-pump-solutions h2,
  .supplier-info h2,
  .solar-pump-benefits h2 {
    font-size: 24px !important;
    line-height: 1.3 !important;
    margin-bottom: 15px !important;
  }

  .solar-pump-challenge p,
  .solar-pump-solutions p,
  .supplier-info p,
  .solar-pump-benefits p {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }

  /* CTA buttons on solar pump pages */
  .supplier-cta {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .supplier-cta .btn {
    width: 100% !important;
    text-align: center;
  }
}

/* Extra small mobile devices */
@media screen and (max-width: 480px) {
  /* Adjust logo and menu button sizes for small screens */
  .header-logo {
    top: 10px;
    left: 10px;
    padding: 8px 12px;
  }

  .header-logo-img {
    height: 35px;
    max-width: 120px;
  }

  .menu-toggle {
    top: 10px;
    right: 10px;
    padding: 10px;
    width: 44px;
    height: 44px;
  }

  /* Make phone numbers slightly smaller on very small screens */
  .top-bar {
    font-size: 10px;
    padding: 8px 10px;
  }

  .top-bar-right {
    font-size: 12px;
  }

  .top-bar-right a {
    font-size: 12px;
    font-weight: 600;
  }

  .hero h1 {
    font-size: 24px;
  }

  .sidebar {
    width: 260px;
  }
}
