/* ========================================
   MOBILE OPTIMIZATION - PERFECT LAYOUT
   ======================================== */

/* Header Optimization - All Mobile Devices */
@media (max-width: 991.98px) {
  :root {
    --header-height: 64px;
  }
  
  #header {
    padding: 0.5rem 1rem;
  }
  
  .bg-header {
    padding: 0.5rem 0.75rem !important;
    border-radius: 40px;
  }
  
  .navbar-brand {
    gap: 0.5rem;
  }
  
  .navbar-brand img {
    width: 36px;
    height: 36px;
  }
  
  .navbar-brand span {
    font-size: 1.1rem;
    font-weight: 600;
  }
}

/* Extra Small Mobile (< 480px) */
@media (max-width: 479.98px) {
  :root {
    --header-height: 52px;
  }
  
  #header {
    padding: 0.35rem 0.65rem;
  }
  
  .bg-header {
    padding: 0.35rem 0.5rem !important;
    border-radius: 32px;
  }
  
  .navbar-brand {
    gap: 0.35rem;
  }
  
  .navbar-brand img {
    width: 28px;
    height: 28px;
  }
  
  .navbar-brand span {
    font-size: 0.9rem;
    font-weight: 600;
  }
  
  .navbar-nav {
    gap: 0.5rem !important;
  }
  
  .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem !important;
  }
  
  .btn-accent {
    padding: 0.5rem 0.9rem !important;
    font-size: 0.85rem;
  }
}

/* Small Mobile (480-575px) */
@media (max-width: 575.98px) and (min-width: 480px) {
  .navbar-brand span {
    font-size: 1.05rem;
  }
  
  .nav-link {
    font-size: 0.9rem;
  }
}

/* General Mobile Optimization (< 768px) */
@media (max-width: 767.98px) {
  /* Sections - Compact Spacing */
  .section {
    padding: clamp(1.5rem, 4vh, 2.5rem) 0 !important;
  }
  
  .r-container {
    padding: 0 1rem !important;
  }
  
  /* Container Fluid */
  .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Typography */
  h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
  }
  
  h2 {
    font-size: clamp(1.3rem, 4.5vw, 2rem);
  }
  
  h3 {
    font-size: clamp(1.1rem, 4vw, 1.75rem);
  }
  
  /* Buttons */
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
  
  /* Cards and Components */
  .card-stat {
    padding: 1.5rem;
  }
  
  .accordion-button {
    padding: 1rem;
    font-size: 0.95rem;
  }
  
  .accordion-body {
    padding: 1rem;
    font-size: 0.9rem;
  }
}

/* Extra Small Mobile Specific (< 480px) */
@media (max-width: 479.98px) {
  /* Sections - Ultra Compact */
  .section {
    padding: clamp(2rem, 5vh, 3rem) 0 !important;
  }
  
  .r-container {
    padding: 0 0.875rem !important;
  }
  
  /* Container Fluid */
  .container-fluid {
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
  }
  
  /* Row Gaps */
  .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
  }
  
  /* Typography */
  h1 {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
    line-height: 1.2;
  }
  
  h2 {
    font-size: clamp(1.4rem, 6vw, 2rem);
    line-height: 1.2;
  }
  
  h3 {
    font-size: clamp(1.5rem, 6.5vw, 2.1rem);
    line-height: 1.3;
    margin-bottom: 1rem;
  }

  /* Ensure black heading matches blue heading size */
  h3.text {
    font-size: clamp(1.5rem, 5vw, 1.85rem) !important;
    line-height: 1.7 !important;
  }
  
  h3.text span.active {
    font-size: inherit !important;
  }
  
  p {
    font-size: clamp(0.85rem, 2vw, 1rem);
    line-height: 1.5;
  }
  
  /* Buttons */
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1.05rem;
    border-radius: 25px;
    font-weight: 500;
  }
  
  .btn-accent {
    padding: 0.75rem 1.5rem !important;
    font-size: 1.05rem !important;
  }
  
  .btn-accent-4 {
    font-size: 1.05rem !important;
  }
  
  /* Cards */
  .card-stat {
    padding: 1.25rem;
    gap: 0.5rem;
  }
  
  /* Offer items - add spacing */
  .offer {
    margin-bottom: 1.5rem !important;
    padding: 1rem 0 !important;
  }
  
  .offer h5 {
    margin-bottom: 0.75rem !important;
  }
  
  .offer .p-accordion {
    margin-top: 0.5rem !important;
  }
  
  .card-stat h3 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
  
  /* Accordion */
  .accordion-button {
    padding: 1rem;
    font-size: clamp(1.4rem, 6vw, 2rem);
    line-height: 1.3;
    font-weight: 500;
  }
  
  .accordion-body {
    padding: 1rem;
    font-size: clamp(0.95rem, 4vw, 1.1rem);
    line-height: 1.6;
  }
  
  /* Forms */
  .form-control {
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
  }
  
  /* Images */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Hide decorative testimonial images on mobile */
  .img-testimonial {
    display: none !important;
  }
  
  /* Testimonials Swiper */
  .swiperTestimonials {
    width: 100%;
    padding: 0 1rem;
  }
  
  .swiperTestimonials .swiper-slide {
    height: auto;
    display: flex;
    align-items: center;
  }
  
  .swiperTestimonials .card-testimonial {
    min-height: 300px;
  }
  
  .swiperTestimonials .swiper-pagination {
    bottom: -2rem;
  }
  
  .swiperTestimonials .swiper-pagination-bullet {
    background: #d0d0d0;
    opacity: 1;
  }
  
  .swiperTestimonials .swiper-pagination-bullet-active {
    background: #000000;
    opacity: 1;
  }
  
  /* Gaps and Spacing */
  .gap-3 {
    gap: 1rem !important;
  }
  
  .gap-4 {
    gap: 1.5rem !important;
  }
  
  .gap-5 {
    gap: 2rem !important;
  }
  
  /* Margins */
  .mb-3 {
    margin-bottom: 0.75rem !important;
  }
  
  .mt-4 {
    margin-top: 0.75rem !important;
  }
  
  /* Partners Section */
  .logo-partner {
    max-height: 100px;
    width: auto;
    object-fit: contain;
    min-width: 160px;
    height: 100px;
  }
  
  /* Fix for logo container */
  .marquee-container {
    overflow: hidden;
    min-height: 110px;
  }
  
  .marquee-container img {
    height: 100px;
    width: auto;
    object-fit: contain;
    margin: 0 1rem;
  }

  /* Reduce gap between items on very small screens */
  .marquee-item {
    margin-right: 1rem;
  }
  
  /* Stats Grid */
  .card-stat h3 {
    font-size: clamp(1.5rem, 5.5vw, 2rem) !important;
  }
  
  /* News Cards */
  .card-news {
    padding: 1rem;
  }
  
  .card-news h5 {
    font-size: 0.95rem;
  }
  
  .text-news {
    font-size: 0.85rem;
  }
  
  /* CTA Section */
  .cta-img {
    display: none !important;
  }
  
  .bg-cta {
    padding: 2rem 1.25rem !important;
    border-radius: 20px !important;
    text-align: center;
  }
  
  .bg-cta h2 {
    font-size: clamp(1.6rem, 6.5vw, 2.2rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem !important;
    max-width: 100% !important;
  }
  
  .bg-cta p {
    font-size: clamp(1rem, 4.2vw, 1.2rem) !important;
    line-height: 1.5 !important;
    margin-bottom: 1.5rem !important;
    max-width: 100% !important;
  }
  
  .bg-cta .w-max-content {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .bg-cta .btn {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center;
  }
}
