/* Responsive Styles for Persmon Technologies */

/* Large Devices (Desktops, less than 1200px) */
@media (max-width: 1199.98px) {
  .container {
    max-width: 960px;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  h4 {
    font-size: 1.3rem;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  p,
  li,
  a {
    font-size: 1rem;
  }
}

/* Medium Devices (Tablets: 769px to 991.98px) */
@media (min-width: 769px) and (max-width: 991.98px) {
  .container {
    max-width: 720px;
  }

  section {
    padding: 4rem 0;
  }

  .hero {
    min-height: 100vh;
  }

  .hero-container {
    flex-direction: column;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
    margin-bottom: 3rem;
    padding-right: 0;
  }

  .hero-globe {
    margin-left: 0;
  }

  .ai-data-sphere {
    width: 250px;
    height: 250px;
  }

  .why-choose-us h2,
  .why-choose-us .section-intro {
    text-align: center;
  }

  .feature {
    text-align: center;
  }

  .feature .icon {
    margin: 0 auto 1rem auto;
  }

  .about-grid,
  .contact-grid,
  .mv-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-content {
    order: 1;
  }

  .about-image {
    order: 2;
  }

  .timeline:before {
    left: 30px;
  }

  .year {
    left: 30px;
    width: 90px;
    height: 90px;
    font-size: 1.3rem;
  }

  .event {
    width: calc(100% - 120px);
    margin-left: 120px !important;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  /* Improve button display on tablets */
  .cta-buttons {
    max-width: 450px;
    margin: 0 auto;
    justify-content: center;
  }

  .nav-toggle {
    display: flex;
  }

  body.nav-open {
    overflow: hidden;
  }

  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
  }

  .overlay.active {
    display: block;
  }

  /* Center services hero on tablets (769px - 991.98px) */
  .services-hero .hero-content {
    grid-template-columns: 1fr !important;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    padding-right: 0;
  }
  .services-hero .hero-left {
    padding-right: 0;
  }
  .services-hero .hero-right {
    justify-content: center;
    margin-top: 1.5rem;
  }
  .services-hero .hero-cta {
    justify-content: center;
  }
  .services-hero .hero-left h1 {
    font-size: 2.4rem;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  /* Contact page specific styles for tablet view */
  .contact-info {
    padding-bottom: 2rem;
    border-bottom: 1px solid #eaeaea;
  }

  .contact-form {
    padding-top: 2rem;
  }

  .contact-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .map-container {
    height: 350px;
  }

  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  h3 {
    font-size: 1.4rem;
  }

  /* Improve text readability on tablets */
  p,
  li {
    font-size: 1rem;
    line-height: 1.6;
  }

  /* Adjust form element font sizes for better touch interactions */
  input,
  textarea,
  select,
  button {
    font-size: 1rem;
  }
}

/* Small Devices (Landscape Phones, less than 768px) */
@media (max-width: 767.98px) {
  .container {
    max-width: 540px;
  }

  header .container {
    padding: 1rem 15px;
  }

  /* Reduce logo text size for mobile */
  .logo-text {
    font-size: 1.1rem;
  }

  .logo img {
    max-height: 40px;
  }

  h1 {
    font-size: 2.2rem;
    line-height: 1.3;
  }

  h2 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 1.2rem;
  }

  h3 {
    font-size: 1.4rem;
  }

  p,
  li {
    font-size: 1rem;
    line-height: 1.6;
  }

  .section-intro {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }

  /* Make form fields and buttons more touch-friendly */
  .form-group label {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 0.8rem;
    font-size: 1rem;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

  .hero p {
    font-size: 1.2rem;
  }

  /* Nav styles already defined in tablet media query */

  .cta-buttons {
    flex-direction: column;
    gap: 1rem;
    max-width: 80%;
    margin: 0 auto;
    width: 100%;
  }

  .cta-buttons .btn {
    width: 100%;
    margin: 0;
    font-size: 1rem;
    padding: 0.9rem 1.5rem;
  }

  .services-grid,
  .values-grid,
  .case-studies-grid,
  .insights-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    margin-bottom: 4rem;
  }

  .year {
    width: 70px;
    height: 70px;
    font-size: 1.1rem;
  }

  .event {
    width: calc(100% - 100px);
    margin-left: 100px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .footer-column p,
  .footer-column a,
  .footer-column li {
    font-size: 0.9rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom p,
  .footer-bottom a {
    font-size: 0.85rem;
  }

  .legal-links {
    margin-top: 1rem;
  }

  .legal-links a {
    margin: 0 0.75rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature {
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  }

  .feature h3 {
    font-size: 1.3rem;
  }

  .feature p {
    font-size: 0.9rem;
  }

  /* Improve view all buttons */
  .view-all-services,
  .view-all-cases {
    text-align: center;
    margin-top: 2rem;
  }

  .view-all-services .btn,
  .view-all-cases .btn,
  .cta .btn {
    width: 80%;
    max-width: 300px;
  }

  /* Center services hero on small devices (mobile) */
  .services-hero .hero-content {
    display: block;
    max-width: 92%;
    margin: 0 auto;
    text-align: center;
    padding-right: 0;
  }
  .services-hero .hero-left {
    padding-right: 0;
  }
  .services-hero .hero-right {
    justify-content: center;
    margin: 1rem auto 0 auto;
  }
  .services-hero .hero-cta {
    justify-content: center;
  }
  .services-hero .hero-left h1 {
    font-size: 1.9rem;
  }

  /* Contact page specific styles for mobile view */
  .contact-methods {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-item {
    display: flex;
    align-items: flex-start;
    padding: 1.2rem;
    background-color: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
  }

  .contact-item .icon {
    flex: 0 0 50px;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 1rem;
    margin-bottom: 0;
    text-align: center;
  }

  /* Contact hero mobile optimization */
  .contact-hero {
    padding: 4rem 0 3rem !important;
    min-height: auto;
  }

  .contact-hero .container {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    text-align: center;
    padding: 0 1rem;
  }

  .contact-hero-content {
    padding-right: 0 !important;
  }

  .contact-hero-content h1 {
    font-size: 2.2rem !important;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .contact-hero-content p {
    font-size: 1.1rem !important;
    margin-bottom: 2rem;
    line-height: 1.5;
  }

  .hero-cta {
    flex-direction: column !important;
    align-items: center;
    gap: 1rem;
    justify-content: center !important;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 280px;
    font-size: 0.95rem;
    padding: 0.9rem 1.5rem;
  }

  /* Contact stats mobile */
  .contact-stats {
    gap: 1.5rem !important;
    max-width: 100%;
  }

  .stat-card {
    padding: 1.5rem 1.2rem !important;
    gap: 1rem !important;
    background: rgba(255, 255, 255, 0.2) !important;
  }

  /* Contact form mobile optimization */
  .contact-form {
    padding: 0;
  }

  .contact-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .contact-form-section {
    padding: 2rem 1.5rem !important;
    margin-top: 2rem;
    border-radius: 15px !important;
  }

  .form-container h3 {
    font-size: 1.6rem !important;
    text-align: center;
    margin-bottom: 1rem;
  }

  .form-container > p {
    text-align: center;
    font-size: 1rem !important;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .form-group {
    margin-bottom: 1.2rem;
  }

  .form-group label {
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    border-radius: 10px;
    border: 2px solid #e1e5e9;
    background: #f8fafc;
    width: 100%;
    box-sizing: border-box;
  }

  .form-group textarea {
    min-height: 100px;
    resize: vertical;
  }

  .submit-btn {
    width: 100% !important;
    margin-top: 1rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 10px;
  }

  .checkbox-group {
    font-size: 0.9rem;
    margin-top: 1rem;
  }

  /* Contact info cards mobile */
  .contact-info-cards {
    gap: 1.5rem !important;
    margin-bottom: 2rem;
  }

  .info-card {
    padding: 2rem 1.5rem !important;
    text-align: center;
    border-radius: 15px !important;
  }

  .card-icon {
    width: 70px !important;
    height: 70px !important;
    font-size: 1.8rem !important;
    margin: 0 auto 1.2rem !important;
    border-radius: 15px !important;
  }

  .info-card h3 {
    font-size: 1.2rem !important;
    margin-bottom: 0.6rem;
  }

  .info-card p {
    font-size: 1rem !important;
    margin-bottom: 0.4rem;
  }

  .card-subtitle {
    font-size: 0.85rem !important;
  }

  /* Contact tabs mobile */
  .tab-controls {
    flex-direction: column !important;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
  }

  .tab-btn {
    width: 100% !important;
    max-width: 280px;
    font-size: 0.95rem;
    padding: 0.9rem 1.5rem;
    border-radius: 25px;
  }

  .tab-content {
    padding: 2rem 1.5rem !important;
    border-radius: 15px !important;
  }

  .tab-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .tab-text {
    text-align: center;
  }

  .tab-text h3 {
    font-size: 1.4rem !important;
    margin-bottom: 1rem;
  }

  .tab-text p {
    font-size: 0.95rem !important;
    margin-bottom: 1.5rem;
    line-height: 1.6;
  }

  .contact-details-list {
    margin-bottom: 2rem;
  }

  .contact-details-list li {
    padding: 0.8rem !important;
    margin-bottom: 1rem;
    border-radius: 8px !important;
    background: #f8fafc !important;
  }

  .visual-card {
    padding: 2rem 1.5rem !important;
    margin-top: 1.5rem;
    border-radius: 15px !important;
  }

  .visual-card i {
    font-size: 2.5rem !important;
    margin-bottom: 1rem;
  }

  .visual-card h4 {
    font-size: 1.3rem !important;
  }

  .visual-card p {
    font-size: 0.95rem !important;
  }

  /* Map section mobile */
  .map-info {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .location-details {
    padding: 2rem 1.5rem !important;
    border-radius: 15px !important;
    order: 1;
  }

  .location-details h3 {
    font-size: 1.6rem !important;
    text-align: center;
    margin-bottom: 1.5rem;
  }

  .address-info {
    margin-bottom: 2rem;
  }

  .address-item {
    padding: 0.8rem !important;
    margin-bottom: 1rem;
    border-radius: 8px !important;
    background: white !important;
  }

  .directions-btn {
    width: 100% !important;
    max-width: 250px;
    margin: 1.5rem auto 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    padding: 0.9rem 1.5rem;
  }

  .map-frame {
    order: 2;
    border-radius: 15px !important;
  }

  .map-container {
    height: 280px;
    margin-top: 1rem;
  }

  .map-frame iframe {
    height: 280px !important;
    border-radius: 15px;
  }

  .map-section h2 {
    text-align: center;
    font-size: 1.8rem !important;
  }

  /* FAQ section mobile */
  .faq-container {
    padding: 0 0.5rem;
  }

  .faq-section .faq-item {
    padding: 0;
    margin-bottom: 1rem;
    border-radius: 12px !important;
  }

  .faq-section .faq-question {
    font-size: 1rem !important;
    padding: 1.2rem !important;
    border-radius: 12px 12px 0 0 !important;
  }

  .faq-question h3 {
    font-size: 1rem !important;
    line-height: 1.4;
  }

  .faq-section .faq-answer {
    font-size: 0.9rem !important;
    padding: 0 1.2rem !important;
    line-height: 1.5;
  }

  .faq-item.active .faq-answer {
    padding: 1.2rem !important;
  }

  /* Social contact mobile */
  .social-contact {
    margin-top: 2rem;
    text-align: center;
  }

  .social-contact .social-icons {
    justify-content: center;
    gap: 1rem;
  }

  .social-contact .social-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  /* Services page specific mobile improvements */
  .services-hero-content h1 {
    font-size: 2.2rem !important;
    line-height: 1.2;
  }

  .services-hero-content p {
    font-size: 1rem !important;
    margin-bottom: 1.5rem;
  }

  .services-hero .hero-cta {
    flex-direction: column;
    gap: 0.8rem;
  }

  .services-hero .hero-cta .btn {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  .divisions-grid {
    gap: 1.2rem !important;
  }

  .division-card {
    padding: 1.5rem !important;
  }

  .division-card h3 {
    font-size: 1.25rem;
  }

  .division-card p {
    font-size: 0.95rem;
  }

  .benefit-card {
    padding: 1.5rem !important;
  }

  .benefit-card h3 {
    font-size: 1.2rem;
  }

  .benefit-card p {
    font-size: 0.9rem;
  }

  .detail-text h2 {
    font-size: 1.6rem !important;
  }

  .detail-text p {
    font-size: 0.95rem !important;
  }

  .feature-item {
    font-size: 0.9rem !important;
    padding: 0.8rem !important;
  }

  /* About page tablet optimizations */
  .about-hero .container {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    text-align: center;
    padding: 0 1.5rem;
  }

  .about-hero-content {
    padding-right: 0 !important;
  }

  .hero-cta {
    justify-content: center !important;
    gap: 1rem !important;
  }

  .hero-cta .btn {
    min-width: 180px !important;
  }

  .about-stats {
    gap: 2rem !important;
  }

  .stat-card {
    padding: 1.75rem !important;
  }

  .content-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .team-images-section {
    order: -1;
    padding: 1.5rem !important;
  }

  .team-image-container {
    height: 300px !important;
  }

  .team-image-primary {
    width: 220px !important;
    height: 250px !important;
  }

  .team-image-overlay {
    width: 140px !important;
    height: 170px !important;
    right: -15px !important;
    top: 20px !important;
  }

  /* Organizational structure tablet */
  .team-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }

  .divisions-overview {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }

  .org-stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Partners grid tablet */
  .partners-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem !important;
  }
}

/* Extra Small Devices (Portrait Phones, less than 576px) */
@media (max-width: 575.98px) {
  /* Make logo text even smaller on very small screens */
  .logo-text {
    font-size: 0.95rem;
  }

  .logo img {
    max-height: 35px;
    margin-right: 6px;
  }

  /* Keep the company name on one line by reducing its font-size responsively
     instead of truncating. This scales between 0.8rem and 1rem based on viewport. */
  .logo-text {
    display: inline-block !important;
    white-space: nowrap !important; /* prevent wrapping */
    font-size: clamp(0.8rem, 4.5vw, 1rem) !important; /* responsive reduction */
    max-width: calc(
      100% - 70px
    ) !important; /* leave space for logo/hamburger */
    overflow: visible !important; /* allow layout to flow when space permits */
    text-overflow: clip !important;
    vertical-align: middle;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.3;
  }

  h2 {
    font-size: 1.6rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.3rem;
  }

  h4 {
    font-size: 1.1rem;
  }

  /* Ensure paragraph text is readable on small screens */
  p,
  li {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .btn {
    font-size: 0.95rem;
    padding: 0.7rem 1.5rem;
  }

  /* Contact page extra small device optimizations */
  .contact-hero {
    padding: 3rem 0 2.5rem !important;
  }

  .contact-hero-content h1 {
    font-size: 1.8rem !important;
    line-height: 1.2;
  }

  .company-name {
    font-size: 2rem !important;
    margin-bottom: 1.2rem !important;
  }

  .contact-hero-content p {
    font-size: 1rem !important;
    margin-bottom: 1.5rem;
  }

  .hero-cta .btn {
    font-size: 0.9rem;
    padding: 0.8rem 1.2rem;
  }

  .stat-card {
    padding: 1.2rem 1rem !important;
    gap: 0.8rem !important;
  }

  .stat-icon {
    width: 45px !important;
    height: 45px !important;
    font-size: 1.1rem !important;
  }

  .stat-info h3 {
    font-size: 1.4rem !important;
  }

  .stat-info p {
    font-size: 0.85rem !important;
  }

  .section-transition {
    padding: 3rem 0 !important;
  }

  .section-heading {
    font-size: 1.6rem !important;
  }

  .section-description {
    font-size: 0.95rem !important;
    padding: 0;
  }

  .info-card {
    padding: 1.5rem 1rem !important;
  }

  .card-icon {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.5rem !important;
    margin: 0 auto 1rem !important;
  }

  .info-card h3 {
    font-size: 1.1rem !important;
  }

  .info-card p {
    font-size: 0.95rem !important;
  }

  .card-subtitle {
    font-size: 0.8rem !important;
  }

  .contact-form-section {
    padding: 1.5rem 1rem !important;
  }

  .form-container h3 {
    font-size: 1.4rem !important;
  }

  .form-container > p {
    font-size: 0.95rem !important;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.8rem 1rem;
    font-size: 16px !important; /* Prevents zoom on iOS */
  }

  .submit-btn {
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }

  .tab-btn {
    font-size: 0.9rem;
    padding: 0.8rem 1.2rem;
  }

  .tab-content {
    padding: 1.5rem 1rem !important;
  }

  .tab-text h3 {
    font-size: 1.2rem !important;
  }

  .tab-text p {
    font-size: 0.9rem !important;
  }

  .contact-details-list li {
    padding: 0.7rem !important;
    margin-bottom: 0.8rem;
  }

  .visual-card {
    padding: 1.5rem 1rem !important;
  }

  .visual-card i {
    font-size: 2rem !important;
  }

  .visual-card h4 {
    font-size: 1.1rem !important;
  }

  .visual-card p {
    font-size: 0.9rem !important;
  }

  .location-details {
    padding: 1.5rem 1rem !important;
  }

  .location-details h3 {
    font-size: 1.4rem !important;
  }

  .address-item {
    padding: 0.7rem !important;
  }

  .directions-btn {
    font-size: 0.9rem;
    padding: 0.8rem 1.2rem;
  }

  .map-frame iframe {
    height: 250px !important;
  }

  .faq-question {
    padding: 1rem !important;
  }

  .faq-question h3 {
    font-size: 0.95rem !important;
  }

  .faq-answer {
    padding: 0 1rem !important;
  }

  .faq-item.active .faq-answer {
    padding: 1rem !important;
  }

  .faq-answer p {
    font-size: 0.85rem !important;
  }

  /* Floating buttons repositioning for better mobile UX */
  .whatsapp-bubble {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.2rem !important;
    bottom: 15px !important;
    right: 15px !important;
  }

  .chatbot-trigger {
    width: 50px !important;
    height: 50px !important;
    bottom: 75px !important;
    right: 15px !important;
  }

  .scroll-to-top {
    width: 45px !important;
    height: 45px !important;
    bottom: 135px !important;
    right: 15px !important;
  }

  /* Container padding for small screens */
  .container {
    padding: 0 0.75rem !important;
  }

  /* Form help text mobile optimization */
  .form-help-text {
    font-size: 0.8rem;
    margin-top: 0.3rem;
    line-height: 1.3;
    color: #666;
  }

  /* Make sure touch targets are large enough */
  .form-group input,
  .form-group select,
  .form-group textarea,
  .btn {
    min-height: 44px; /* Apple's recommended minimum touch target size */
  }

  /* Better spacing for mobile forms */
  .form-success-message {
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    border-radius: 12px !important;
  }

  .form-success-message i {
    font-size: 2.5rem !important;
  }

  .form-success-message h4 {
    font-size: 1.2rem !important;
  }

  .form-success-message p {
    font-size: 0.9rem !important;
  }

  /* About page specific mobile optimizations */
  .about-intro {
    padding: 4rem 0 !important;
  }

  .who-we-are-modern {
    padding: 4rem 0 !important;
  }

  .content-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    margin-top: 2rem !important;
  }

  .content-card,
  .expertise-card {
    padding: 1.5rem !important;
    margin-bottom: 1rem;
  }

  .content-card .card-title,
  .expertise-card .card-title {
    font-size: 1.2rem !important;
  }

  .content-card .card-text,
  .expertise-card .card-text {
    font-size: 0.95rem !important;
  }

  .team-images-section {
    padding: 1rem !important;
    order: -1;
  }

  .team-image-container {
    height: 250px !important;
    justify-content: center;
  }

  .team-image-primary {
    width: 180px !important;
    height: 200px !important;
  }

  .team-image-overlay {
    width: 120px !important;
    height: 140px !important;
    right: -10px !important;
    top: 15px !important;
  }

  /* Organizational structure mobile optimization */
  .organizational-structure .section-heading {
    font-size: 1.8rem !important;
  }

  .team-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .team-card {
    margin-bottom: 1rem;
  }

  .team-card-img {
    height: 200px !important;
  }

  .team-card-img .initials {
    width: 80px !important;
    height: 80px !important;
    font-size: 24px !important;
  }

  .team-card-info {
    padding: 1.5rem !important;
  }

  .team-card-info h4 {
    font-size: 1.1rem !important;
  }

  .team-card-info .title {
    font-size: 0.9rem !important;
  }

  .team-card-info .description-text {
    font-size: 0.85rem !important;
  }

  /* Division cards mobile optimization */
  .divisions-overview {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .division-card {
    padding: 1.5rem !important;
    margin-bottom: 1rem;
  }

  .division-header {
    flex-direction: column !important;
    text-align: center !important;
    gap: 1rem !important;
  }

  .division-avatar {
    margin: 0 auto !important;
  }

  .division-title {
    font-size: 1.1rem !important;
  }

  .division-director,
  .division-role {
    font-size: 0.9rem !important;
  }

  .division-description {
    font-size: 0.85rem !important;
    text-align: center !important;
  }

  /* Organization stats grid */
  .org-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .stat-item {
    padding: 1rem !important;
  }

  .stat-number {
    font-size: 1.5rem !important;
  }

  .stat-label {
    font-size: 0.8rem !important;
  }

  /* Journey timeline mobile */
  .journey-timeline {
    height: 400px !important;
  }

  .timeline-scroll-container {
    width: 300% !important;
    animation-duration: 30s !important;
  }

  .node {
    width: 140px !important;
    margin-left: -70px !important;
  }

  .node .circle {
    width: 70px !important;
    height: 70px !important;
    font-size: 20px !important;
  }

  .node .circle .fa {
    font-size: 24px !important;
  }

  .node .label {
    padding: 8px !important;
  }

  .node .year {
    font-size: 0.9rem !important;
  }

  .node .title {
    font-size: 0.75rem !important;
  }

  /* Partners grid mobile */
  .partners-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .partner {
    padding: 1rem !important;
  }

  .partner img {
    max-width: 80px !important;
    max-height: 60px !important;
  }

  /* Additional mobile improvements for better UX */
  .modern-title {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }

  .modern-title .dimmed {
    font-size: inherit !important;
  }

  .section-header {
    margin-bottom: 2rem !important;
    text-align: center;
  }

  .section-heading {
    font-size: 1.8rem !important;
    margin-bottom: 1rem !important;
  }

  .section-intro {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
    padding: 0 1rem;
  }

  /* Mission Vision mobile improvements */
  .mission-vision {
    padding: 4rem 0 !important;
  }

  .mission-vision-modern {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .mission-vision-content {
    padding-left: 0 !important;
    text-align: center;
  }

  .mission-section,
  .vision-section {
    margin-bottom: 2rem !important;
  }

  .mission-header,
  .vision-header {
    flex-direction: column !important;
    text-align: center !important;
    margin-bottom: 1rem !important;
  }

  .mission-header .icon,
  .vision-header .icon {
    margin-right: 0 !important;
    margin-bottom: 1rem !important;
  }

  .mission-header h2,
  .vision-header h2 {
    font-size: 1.5rem !important;
  }

  /* Core values mobile improvements */
  .core-values {
    padding: 5rem 0 !important;
  }

  .core-values h2 {
    font-size: 2rem !important;
    margin-bottom: 3rem !important;
  }

  /* CTA section mobile */
  .cta {
    padding: 4rem 0 !important;
  }

  .cta h2 {
    font-size: 1.8rem !important;
    margin-bottom: 1rem !important;
  }

  .cta p {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
    padding: 0 1rem;
  }

  .cta-buttons {
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: center;
  }

  .cta-buttons .btn {
    width: 100% !important;
    max-width: 280px !important;
  }

  /* Floating action buttons mobile optimization */
  .whatsapp-bubble {
    bottom: 80px !important;
    right: 15px !important;
    width: 50px !important;
    height: 50px !important;
  }

  .chatbot-trigger {
    bottom: 20px !important;
    right: 15px !important;
    width: 50px !important;
    height: 50px !important;
  }

  .scroll-to-top {
    bottom: 140px !important;
    right: 15px !important;
    width: 45px !important;
    height: 45px !important;
  }

  /* Chatbot mobile optimization */
  .chatbot-container {
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 100px) !important;
    right: 10px !important;
    bottom: 70px !important;
  }

  .chatbot-header {
    padding: 15px !important;
  }

  .chatbot-title h3 {
    font-size: 1rem !important;
  }

  .chatbot-input input {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
}

/* Mobile floating action buttons - enforce consistent stacking, spacing and z-index
   This override consolidates conflicting rules and ensures buttons don't overlap on
   very small screens (portrait phones). */
@media (max-width: 575.98px) {
  /* Align all floating triggers to the same right gutter */
  .chatbot-trigger,
  .whatsapp-bubble,
  .scroll-to-top {
    right: 15px !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15) !important;
  }

  /* Lowest element: scroll-to-top */
  .scroll-to-top {
    bottom: 135px !important; /* highest from bottom so it sits above others */
    width: 45px !important;
    height: 45px !important;
    z-index: 1001 !important;
  }

  /* Middle element: WhatsApp bubble */
  .whatsapp-bubble {
    bottom: 75px !important;
    width: 50px !important;
    height: 50px !important;
    z-index: 1002 !important;
  }

  /* Top-most sticky trigger: chatbot button */
  .chatbot-trigger {
    bottom: 15px !important;
    width: 50px !important;
    height: 50px !important;
    z-index: 1003 !important;
  }

  /* Chat container (when opened) should appear above all buttons */
  .chatbot-container {
    right: 15px !important;
    bottom: calc(
      135px + 16px
    ) !important; /* place container above the stacked buttons */
    width: calc(100vw - 30px) !important;
    max-width: 480px !important;
    z-index: 1004 !important;
  }

  /* Make sure tooltips/popovers don't get clipped */
  .whatsapp-tooltip,
  .chatbot-badge {
    z-index: 1010 !important;
  }
}

/* Ensure hero CTA text stays on a single line on narrow screens.
   Targets only hero buttons so we don't change global button sizing.
   Adjust font-size and padding slightly to avoid wrapping on very small viewports. */
@media (max-width: 767.98px) {
  .hero .cta-buttons .btn {
    white-space: nowrap !important;
    width: auto !important; /* allow button to size to its content */
    max-width: 90% !important; /* keep some gutter on very small screens */
    font-size: 0.95rem !important; /* small reduction to help fit */
    padding-left: 1.1rem !important;
    padding-right: 1.1rem !important;
  }
}

@media (max-width: 575.98px) {
  .hero .cta-buttons .btn {
    white-space: nowrap !important;
    width: auto !important;
    max-width: 92% !important;
    font-size: 0.9rem !important; /* further reduce on very small screens */
    padding-left: 0.95rem !important;
    padding-right: 0.95rem !important;
  }
}
