/*--------------------------------------
   responsive.css — Rarepage Technologies
   Mega menu alignment + full responsive fixes
   All breakpoints: 1500px, 1200px, 992px, 768px, 576px, 375px
----------------------------------------*/

/* ============================================================
   1. MEGA MENU — ALIGNMENT FIX
   Problem: mega menu was centered on the nav column (right side),
   making "Web Design & Dev" column land far off the left edge.
   Fix: anchor the mega menu to the left edge of the container,
   aligned with the "Services" link, not the entire nav bar.
   ============================================================ */

/* The nav wrapper must be position:relative so the mega menu
   can escape the inline-block list item and attach to the nav */
.header-bottom .container {
  position: relative;
}

/* Make the nav itself position:static so mega menu positions
   relative to the container, not the nav */
nav.d-none.d-lg-block {
  position: static;
}

/* Reset the main-menu so mega menu can break out cleanly */
.main-menu {
  position: static;
}

/* The Services li must be static so mega-menu escapes it */
.main-menu-item.has-mega-menu {
  position: static;
}

/* Mega menu: anchor from left of container, spanning full width
   The "Services" link sits roughly in the horizontal centre;
   we push from the left so col-1 (Web Design) is leftmost */
.mega-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  transform: none;          /* remove the old translateX(-50%) */
  width: 100%;
  max-width: 960px;
  /* Push from left so left edge of mega menu aligns with the
     logo/container left edge; adjust the value if you want it
     shifted right to sit under "Services" more precisely */
  margin-left: 0;
  margin-right: auto;
  z-index: 9999;
}

/* Keep hover behaviour intact */
.main-menu li:hover .mega-menu {
  visibility: visible;
  margin-top: 0;
  opacity: 1;
}

/* The inner flex row stays the same but restrict width so
   4 columns don't stretch too wide */
.mega-menu-inner {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
}

.mega-menu-col {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 16px;
}

.mega-menu-col:first-child {
  padding-left: 0;
}

.mega-menu-col:last-child {
  padding-right: 0;
  border-right: none;
}


/* ============================================================
   2. HEADER — GENERAL RESPONSIVE
   ============================================================ */

/* Header top bar: stack on mobile */
@media (max-width: 991px) {
  .header-top .row {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  .header-top .select-box {
    justify-content: center !important;
  }
}

/* Logo sizing */
@media (max-width: 767px) {
  .brand-logo img {
    max-height: 52px !important;
  }
}

/* Sticky header: reduce padding on mobile */
@media (max-width: 767px) {
  .is-sticky {
    padding: 8px 0;
  }
  .is-sticky .btn-warning {
    padding: 10px 14px;
  }
}

/* Desktop nav spacing tight on mid-range screens */
@media screen and (min-width: 992px) and (max-width: 1200px) {
  .main-menu-item + .main-menu-item {
    margin-left: 18px;
  }
  .main-menu-link {
    font-size: 14px;
  }
  .main-menu .btn-warning {
    margin-left: 10px;
    padding: 12px 16px;
    font-size: 13px;
  }
}

@media screen and (min-width: 1201px) and (max-width: 1399px) {
  .main-menu-item + .main-menu-item {
    margin-left: 36px;
  }
}


/* ============================================================
   3. MEGA MENU — RESPONSIVE COLLAPSE
   On tablet / mobile the mega menu is hidden (the offcanvas
   mobile nav takes over). We just need to make sure it never
   leaks out at intermediate widths.
   ============================================================ */

@media (max-width: 991px) {
  .mega-menu {
    display: none !important;
  }
}

/* Mega menu narrower on 992-1200 viewports */
@media screen and (min-width: 992px) and (max-width: 1199px) {
  .mega-menu {
    max-width: 780px;
    padding: 20px 20px 14px;
  }
  .mega-menu-col {
    padding: 0 10px;
  }
  .mega-menu-col-title {
    font-size: 11px;
  }
  .mega-menu-col ul li a {
    font-size: 12.5px;
    padding: 5px 0;
  }
}

/* Mega menu on large desktops: comfortable sizing */
@media screen and (min-width: 1200px) and (max-width: 1399px) {
  .mega-menu {
    max-width: 860px;
  }
}

@media screen and (min-width: 1400px) {
  .mega-menu {
    max-width: 960px;
  }
}


/* ============================================================
   4. OFFCANVAS MOBILE MENU — SERVICES SECTION
   Add a "Services" expandable group in the offcanvas so mobile
   users can still access all service pages
   ============================================================ */

.offcanvas-menu > ul > li > ul {
  padding-left: 14px;
}

.offcanvas-menu > ul > li > ul li a {
  font-size: 14px;
  padding: 6px 12px;
  color: #02126a;
  display: block;
}

.offcanvas-menu > ul > li > ul li a:hover {
  color: #1a5fb4;
}


/* ============================================================
   5. HERO SECTION
   ============================================================ */

@media (max-width: 991px) {
  .hero-section {
    margin-bottom: 0;
    padding: 40px 0 60px;
  }
  .hero-content {
    text-align: center;
  }
  .hero-checklist {
    grid-template-columns: 1fr 1fr !important;
    justify-items: start;
  }
}

@media (max-width: 575px) {
  .hero-checklist {
    grid-template-columns: 1fr !important;
  }
  .hero-section {
    padding: 28px 0 48px;
  }
  /* Hero heading font shrink */
  .hero-content .title {
    font-size: 28px !important;
  }
}

/* Hero form card */
@media (max-width: 767px) {
  .hero-form-card {
    padding: 24px 18px !important;
    margin-top: 32px;
  }
}


/* ============================================================
   6. SECTION TITLES & TYPOGRAPHY
   ============================================================ */

@media (max-width: 767px) {
  .section-title .title,
  .section-title h2,
  .section-title h3 {
    font-size: 26px !important;
    line-height: 1.3;
  }
  .section-title p {
    font-size: 15px;
  }
}

@media (max-width: 575px) {
  .section-title .title,
  .section-title h2,
  .section-title h3 {
    font-size: 22px !important;
  }
}


/* ============================================================
   7. BRAND / LOGO SECTION
   ============================================================ */

@media (max-width: 767px) {
  .brand-section .row {
    justify-content: center;
  }
  .brand-logo-item {
    margin-bottom: 20px;
  }
}


/* ============================================================
   8. SERVICE CARDS
   ============================================================ */

@media (max-width: 767px) {
  .service-card {
    margin-bottom: 24px;
  }
}


/* ============================================================
   9. ABOUT / COUNTER SECTION
   ============================================================ */

@media (max-width: 767px) {
  .counter-up-wrap {
    text-align: center;
  }
  .counter-up-item {
    margin-bottom: 20px;
  }
}


/* ============================================================
   10. TEAM SECTION
   ============================================================ */

@media (max-width: 575px) {
  .team-member {
    margin-bottom: 30px;
  }
}


/* ============================================================
   11. TESTIMONIAL / SWIPER
   ============================================================ */

@media (max-width: 767px) {
  .testimonial-section {
    padding: 50px 0;
  }
  .testimonial-slider {
    padding: 0 10px;
  }
}


/* ============================================================
   12. BLOG / CASE STUDIES SECTION
   ============================================================ */

@media (max-width: 767px) {
  .case-result-cards {
    grid-template-columns: 1fr !important;
  }
  .blog-post-item {
    margin-bottom: 30px;
  }
}


/* ============================================================
   13. FOUNDER CARD
   ============================================================ */

@media (max-width: 767px) {
  .founder-card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 20px !important;
    padding: 24px 18px !important;
  }
  .founder-photo {
    width: 110px !important;
    height: 110px !important;
  }
}


/* ============================================================
   14. FINAL CTA SECTION
   ============================================================ */

@media (max-width: 991px) {
  .cta-contact-grid {
    grid-template-columns: 1fr !important;
  }
  .final-cta-section {
    padding: 50px 0;
  }
  .final-cta-section h3 {
    font-size: 22px !important;
  }
}

@media (max-width: 575px) {
  .cta-message-form {
    padding: 20px 14px !important;
  }
}


/* ============================================================
   15. FOOTER
   ============================================================ */

@media (max-width: 767px) {
  .footer-widget {
    margin-bottom: 0;
  }
  .footer-menu {
    padding-left: 0;
  }
  .footer-bottom {
    text-align: center;
  }
  .footer-bottom .row > div {
    margin-bottom: 10px;
  }
}

@media (max-width: 575px) {
  .footer-logo img {
    width: 100%;
    max-height: none;
  }
}


/* ============================================================
   16. CONTACT PAGE
   ============================================================ */

@media (max-width: 767px) {
  .contact-form-wrap,
  .contact-info-wrap {
    margin-bottom: 30px;
  }
}


/* ============================================================
   17. INNER SERVICE PAGES (detail pages)
   ============================================================ */

@media (max-width: 767px) {
  .service-details-content {
    margin-top: 30px;
  }
  .service-details-sidebar {
    margin-top: 30px;
  }
}


/* ============================================================
   18. PAGE BANNER / BREADCRUMB
   ============================================================ */

@media (max-width: 767px) {
  .page-banner-section {
    padding: 60px 0 40px;
  }
  .page-banner-content .title {
    font-size: 28px !important;
  }
}

@media (max-width: 575px) {
  .page-banner-content .title {
    font-size: 22px !important;
  }
  .breadcrumb-item {
    font-size: 13px;
  }
}


/* ============================================================
   19. GLOBAL UTILITIES
   ============================================================ */

/* Prevent horizontal overflow on all screens */
body {
  overflow-x: hidden;
}

/* Images always stay within their containers */
img {
  max-width: 100%;
  height: auto;
}

/* Buttons: full-width on very small screens */
@media (max-width: 400px) {
  .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .hero-content .btn,
  .page-banner-content .btn {
    width: auto;
  }
}

/* Container padding on very small devices */
@media (max-width: 375px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* AOS fade-up can cause layout shift on mobile — soften it */
@media (max-width: 575px) {
  [data-aos] {
    transition-duration: 0.3s !important;
  }
}


/* ============================================================
   20. AUDIT / COUNTER SECTION (index page)
   ============================================================ */

@media (max-width: 767px) {
  .audit-section {
    padding: 40px 0;
  }
  .audit-section .section-title h3 {
    font-size: 22px !important;
  }
}


/* ============================================================
   21. SCROLL-UP BUTTON
   ============================================================ */

@media (max-width: 575px) {
  .scroll-up {
    bottom: 20px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}


/* ============================================================
   22. HAMBURGER MENU — MOBILE OVERFLOW FIX
   ============================================================ */

/* Prevent hamburger from going outside viewport on small screens */
@media (max-width: 991px) {
  .header-bottom .row {
    flex-wrap: nowrap;
    align-items: center;
  }
  .offcanvas-toggler {
    margin-left: 8px !important;
    margin-right: 4px;
    flex-shrink: 0;
  }
  /* Ensure the col-auto doesn't overflow */
  .header-bottom .col-auto {
    padding-right: 8px;
    flex-shrink: 0;
  }
  /* Logo col should not overflow */
  .header-bottom .col {
    min-width: 0;
    overflow: hidden;
  }
  .brand-logo img {
    max-width: 160px;
    width: auto;
  }
}

@media (max-width: 576px) {
  .offcanvas-toggler {
    margin-left: 6px !important;
    width: 42px !important;
    height: 42px !important;
  }
  /* Hide the "Get a Free Quote" button on very small screens to avoid overflow */
  .header-bottom .d-sm-inline-block.d-lg-none {
    display: none !important;
  }
  .brand-logo img {
    max-width: 140px;
  }
}


/* ============================================================
   23. DIGITAL MARKETING PAGE CTA SECTION — RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {
  .dm-cta-section .cta-contact-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .dm-cta-section { padding: 50px 0 !important; }
}

@media (max-width: 767px) {
  .dm-cta-section h2 { font-size: 1.5rem !important; }
  .dm-cta-section .cta-form-card { padding: 22px 16px !important; }
}

@media (max-width: 480px) {
  .dm-cta-section { padding: 40px 0 !important; }
  .dm-cta-section h2 { font-size: 1.3rem !important; }
}


/* ============================================================
   24. GENERAL SERVICE PAGE HERO — RESPONSIVE
   ============================================================ */

@media (max-width: 767px) {
  .service-hero-section { padding: 50px 0 40px; }
  .service-hero-section h1 { font-size: 26px !important; }
  .service-hero-section h2 { font-size: 24px !important; }
  .hero-checks { grid-template-columns: 1fr !important; }
  .highlight-grid { grid-template-columns: 1fr !important; }
  .process-grid,
  .process-grid-2 { grid-template-columns: 1fr !important; }
}

@media (max-width: 576px) {
  .service-hero-section h1 { font-size: 22px !important; }
  .service-hero-section h2 { font-size: 20px !important; }
}


/* ============================================================
   25. ABOUT-US PAGE — CTA SECTION RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {
  .cta-final-section .row.g-5 { gap: 0; }
  .cta-final-section .col-lg-6 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 767px) {
  .cta-final-section { padding: 48px 0; }
  .cta-final-section h2 { font-size: 22px !important; }
}


/* ============================================================
   26. PARTNERSHIP PAGE — RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {
  .partnership-steps-section .col-lg-5,
  .partnership-steps-section .col-lg-7 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .partnership-steps-section .about-content {
    margin-top: 32px;
  }
}

@media (max-width: 767px) {
  .partnership-intro-section { padding: 48px 0; }
  .partnership-benefits-section { padding: 48px 0; }
  .partnership-steps-section { padding: 48px 0; }
  .partnership-form-section { padding: 48px 0; }
  .step-item { padding: 14px 0; }
}


/* ============================================================
   27. FOOTER RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {
  .footer-row {
    flex-wrap: wrap;
  }
  .footer-row .footer-col {
    flex: 0 0 50%;
    max-width: 50%;
    margin-bottom: 32px;
  }
  .footer-row .footer-col:nth-child(1) {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 575px) {
  /* Remove all extra spacing in footer on mobile */
  .footer-card {
    padding: 40px 0 20px;
  }
  .footer-row {
    gap: 0;
  }
  .footer-row .footer-col {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(39, 53, 129, 0.4);
    text-align: center;
  }
  .footer-row .footer-col:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .footer-row .footer-col .footer-widget {
    padding: 0 15px;
  }

  /* Logo: full width on mobile */
  .footer-widget .footer-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
    border-radius: 12px;
  }
  .footer-widget .footer-logo img {
    width: 100%;
    height: auto;
  }

  /* Center address list */
  .adress {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .adress li {
    font-size: 14px;
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  /* Center widget titles and their underline decorators */
  .footer-widget .title {
    text-align: center;
    font-size: 18px;
  }
  .footer-widget .title::before {
    left: 50%;
    transform: translateX(-50%);
  }
  .footer-widget .title::after {
    left: calc(50% + 22px);
    transform: translateX(-50%);
  }

  /* Center footer menu links */
  .footer-menu {
    text-align: center;
  }
  .footer-link {
    font-size: 14px;
    justify-content: center;
  }

  /* Center follow text and social icons */
  .footer-widget .follow-text {
    text-align: center;
  }
  .footer-social {
    justify-content: center;
  }

  /* Copyright */
  .copy-right-section p {
    font-size: 12px;
    text-align: center;
  }

  /* Remove bottom gap after footer */
  .footer-section {
    margin-bottom: 0;
    padding-bottom: 0;
  }
}


/* ============================================================
   28. CAREER PAGE — RESPONSIVE
   ============================================================ */

@media (max-width: 767px) {
  .career-hero-section { padding: 50px 0; }
  .career-hero-section h1,
  .career-hero-section h2 { font-size: 26px !important; }
  .jobs-section { padding: 48px 0; }
  .job-card { padding: 20px 16px; }
}


/* ============================================================
   29. GRAPHIC DESIGN SERVICE PAGES — RESPONSIVE
   ============================================================ */

@media (max-width: 767px) {
  .logo-hero-section h1,
  .banner-hero-section h1,
  .flyer-hero-section h1 { font-size: 26px !important; }
  .showcase-grid { grid-template-columns: 1fr !important; }
}


/* ============================================================
   30. HERO SECTION — ALL PAGES GENERAL
   ============================================================ */

@media (max-width: 767px) {
  section[class*="hero"] h1 { font-size: 26px !important; }
  section[class*="hero"] h2 { font-size: 22px !important; }
}

@media (max-width: 480px) {
  section[class*="hero"] h1 { font-size: 22px !important; }
  section[class*="hero"] h2 { font-size: 20px !important; }
}


/* ============================================================
   31. TABLES — RESPONSIVE OVERFLOW
   ============================================================ */

table {
  width: 100%;
  overflow-x: auto;
  display: block;
}

@media (max-width: 767px) {
  table { font-size: 13px; }
}


/* ============================================================
   32. MOBILE FIXES — ALL PAGES
   ============================================================ */

/* ────────────────────────────────────────────────
   FIX 1: Working process — text not cut by cloud bg
   Force each card to full width + increase bottom
   padding so text clears the wave decoration
──────────────────────────────────────────────── */
@media (max-width: 767px) {
  .working-process-section {
    padding-bottom: 120px !important;
  }
  .working-process-section .col-sm-6 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .working-process .working-process-list {
    text-align: center !important;
    padding: 0 12px !important;
    overflow: visible !important;
  }
  .working-process .working-process-list .icon {
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 12px !important;
  }
  .working-process .working-process-list p,
  .working-process .working-process-list .process-desc {
    white-space: normal !important;
    overflow: visible !important;
    word-break: break-word !important;
    display: block !important;
    color: #fff;
  }
  .working-process .working-process-list .arrow-shape {
    display: none !important;
  }
  .working-process .working-process-list:nth-child(odd) {
    margin-top: 0 !important;
  }
}

/* ────────────────────────────────────────────────
   FIX 2: Service icons centered + tight spacing
──────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Reset card to column, centered, remove big left padding */
  .service-card {
    text-align: center !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 20px 16px !important;
  }
  /* Icon: margin auto on both sides = perfectly centered in column */
  .service-icon {
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 14px !important;
    width: 90px !important;
    height: 90px !important;
    float: none !important;
    display: flex !important;
  }
  /* Reduce space between paragraph and button */
  .service-content p {
    margin-bottom: 12px !important;
  }
  /* Reduce gap between service cards */
  .col-md-6.mb-7 {
    margin-bottom: 16px !important;
  }
  /* Tight section padding */
  .service-section {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
  }
}

/* ────────────────────────────────────────────────
   FIX 2: About-object icon centered on mobile
   ($ icon, headphone icon etc. in "Why Choose Us")
──────────────────────────────────────────────── */
@media (max-width: 575px) {
  .about-object-list {
    align-items: center !important;
  }
  .about-object-list .icon {
    margin-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 16px !important;
    flex-shrink: 0 !important;
  }
  .about-object-content {
    text-align: center !important;
  }
}

/* ────────────────────────────────────────────────
   FIX 4: Tight top/bottom spacing on ALL sections
──────────────────────────────────────────────── */
@media (max-width: 575px) {
  .section-pb-150 { padding-bottom: 32px !important; }
  .section-pt-150 { padding-top: 32px !important; }
  .section-pb      { padding-bottom: 24px !important; }
  .section-pt      { padding-top: 24px !important; }
  .founder-section  { padding: 32px 0 !important; }
  .footer-card      { padding: 32px 0 16px !important; }
  .hero-form-card   { margin-top: 24px !important; }

  /* Kill extra margins/padding on ALL sections */
  section,
  .about-section,
  .audit-section,
  .service-section,
  .brand-section,
  .case-studies-section,
  .faq-section,
  .cta-band,
  .final-cta-section,
  .working-process-section,
  .hero-section,
  .audit-section {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
  }
  /* working process needs extra bottom for cloud wave */
  .working-process-section {
    padding-bottom: 100px !important;
  }
  /* mb-7 between cards reduced everywhere */
  .mb-7 {
    margin-bottom: 14px !important;
  }

  /* WhatsApp & scroll-up exactly parallel */
  .whatsapp-float {
    bottom: 60px !important;
    left: 30px !important;
    width: 50px !important;
    height: 50px !important;
  }
  .whatsapp-float svg {
    width: 28px !important;
    height: 28px !important;
  }
  #scrollUp {
    bottom: 60px !important;
    right: 30px !important;
    width: 50px !important;
    height: 50px !important;
    line-height: 50px !important;
  }
}
