/* ==========================================================================
   WEB TECH SOLUTIONS - MOBILE OPTIMIZATION
   Loaded LAST on every page. Desktop (>=992px) is not touched.
   Breakpoints: 991 (tablet) / 767 (large phone) / 575 (phone) / 380 (small)
   ========================================================================== */

/* ---------- 1. Global safety (all screens <= 991px) ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 991px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }
  /* theme sets .overflow-x-visible on <body>; clip anything that sneaks out */
  body,
  body.overflow-x-visible {
    overflow-x: hidden !important;
    position: relative;
  }
  @supports (overflow: clip) {
    html,
    body,
    body.overflow-x-visible {
      overflow-x: clip !important;
    }
  }

  img,
  svg,
  video,
  iframe {
    max-width: 100%;
  }
  img {
    height: auto;
  }

  h1, h2, h3, h4, h5, h6, p, li, a, span {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .container {
    padding-left: 18px;
    padding-right: 18px;
    max-width: 100%;
  }

  /* wow.js slide-in animations push elements outside the screen */
  .wow,
  .wow.fadeInRight,
  .wow.fadeInLeft,
  .wow.fadeInUp,
  .wow.fadeInDown {
    animation-name: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* comfortable tap targets */
  a.wpr-btn,
  .wpr-btn,
  button,
  .btn,
  input[type="submit"] {
    min-height: 46px;
  }
}

/* ---------- 2. Forms (stop iOS zoom on focus, easy to tap) ---------- */
@media (max-width: 991px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
    max-width: 100%;
  }
  .single-input input,
  .single-input select,
  .single-input textarea {
    min-height: 48px;
    width: 100%;
  }
  .single-input textarea {
    min-height: 110px;
  }
  .single-input label {
    font-size: 13px;
  }
  #contact-form button,
  #contact-form .wpr-btn,
  #contact-form input[type="submit"] {
    width: 100%;
    min-height: 54px;
  }
}

/* ---------- 3. Header + mobile menu ---------- */
@media (max-width: 991px) {
  .header-style-one .header-top-inner {
    padding: 8px 12px;
    gap: 8px;
  }
  .header-style-one .header-top-inner .text {
    font-size: 11px;
    line-height: 1.35;
    letter-spacing: 0.4px;
    text-align: center;
    margin: 0;
  }
  .header-style-one .header-top-inner .left-icon img,
  .header-style-one .header-top-inner .right-icon img {
    width: 16px;
    height: auto;
  }
  .header-style-one-wrapper {
    align-items: center;
  }
  .logo-area .logo img {
    max-width: 150px;
    width: 100%;
    height: auto;
  }
  .header-style-one .button-area-start .wpr-btn.btn-primary {
    display: none !important; /* CTA is inside the mobile menu / hero */
  }
  #menu-btn,
  .menu-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    cursor: pointer;
  }

  /* slide-in menu panel */
  .side-bar,
  #side-bar,
  .mobile-menu-main {
    max-width: 100%;
  }
  .side-bar {
    width: min(100%, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .mobile-menu-main .main-element,
  .mobile-menu-main .sub-menu,
  .mobile-menu-main a {
    display: block;
    padding-top: 14px;
    padding-bottom: 14px;
    font-size: 16px;
    min-height: 48px;
  }
}

/* ---------- 4. Floating WhatsApp button ---------- */
@media (max-width: 767px) {
  .whatsapp-float {
    width: 52px !important;
    height: 52px !important;
    right: 14px !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 999;
  }
  .whatsapp-float img,
  .whatsapp-float svg,
  .whatsapp-float i {
    max-width: 28px;
    max-height: 28px;
  }
  .back-to-top,
  .progress-wrap {
    right: 14px !important;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* ---------- 5. HOME HERO ---------- */
@media (max-width: 767px) {
  .wpr-banner-area.wts-full-hero {
    min-height: 0 !important;
    min-height: min(640px, 100svh) !important;
    padding: 56px 0 56px !important;
  }
  .wts-full-hero .wts-hero-bg {
    z-index: -3;
    background-image: url("../images/banner-mobile.webp") !important;
    background-size: cover !important;
    background-position: 68% center !important;
    animation: none !important;
    will-change: auto !important;
  }
  /* mobile uses the CSS background (lighter file + readable overlay) */
  .wts-full-hero .wts-hero-bg img {
    display: none !important;
  }
  .wts-full-hero .wts-hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(246, 247, 249, 0.96) 0%,
      rgba(246, 247, 249, 0.9) 55%,
      rgba(246, 247, 249, 0.78) 100%
    ) !important;
  }
  .wts-full-hero .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  .wts-full-hero .wts-hero-title {
    font-size: clamp(30px, 9vw, 42px) !important;
    line-height: 1.12;
    letter-spacing: -1px;
    margin-bottom: 18px;
  }
  .wts-full-hero .wts-title-gap {
    margin-top: 14px;
  }
  .wts-full-hero .wts-eyebrow {
    font-size: 11px;
    margin-bottom: 18px;
  }
  .wts-full-hero .wts-arrow-track {
    margin: 14px 0 22px;
  }
  .wts-full-hero .wts-hero-btn {
    min-height: 58px;
    font-size: 15px !important;
    border-radius: 12px;
  }
  .wts-full-hero .wts-gradient-icon {
    width: 42px;
    height: 42px;
  }
}
@media (max-width: 380px) {
  .wts-full-hero .wts-hero-title {
    font-size: 28px !important;
  }
  .wts-full-hero .wts-hero-btn {
    font-size: 14px !important;
    padding: 12px 14px;
  }
}

/* ---------- 6. Section frames (theme "square-dot" corner boxes) ---------- */
@media (max-width: 767px) {
  .section-inner,
  .section-inner.bg-white {
    border-radius: 0;
  }
  .square-shape {
    width: 6px !important;
    height: 6px !important;
  }
  .square-shape.top-right,
  .square-shape.bottom-right {
    right: -3px !important;
  }
  .square-shape.top-left,
  .square-shape.bottom-left {
    left: -3px !important;
  }
  .section-top-area {
    padding: 36px 20px 26px !important;
  }
  .section-title {
    font-size: clamp(26px, 7.4vw, 34px) !important;
    line-height: 1.18 !important;
    letter-spacing: -0.5px;
  }
  .sub-title {
    font-size: 12px;
  }
  .mb--16 {
    margin-bottom: 12px !important;
  }
}

/* ---------- 7. Brand / vision marquee ---------- */
@media (max-width: 767px) {
  .wpr-brand-area .section-inner {
    display: flex;
    align-items: center;
    overflow: hidden;
  }
  .wpr-brand-area .left-text {
    flex: 0 0 auto;
    padding: 0 14px;
  }
  .wpr-brand-area .left-text p {
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
  }
  .wpr-brand-area .right-marquee-area {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
  }
  .wpr-brand-area .brand-wrapper img {
    height: 34px;
    width: auto;
    max-width: none;
  }
}

/* ---------- 8. About block (stats list + image) ---------- */
@media (max-width: 767px) {
  .about-bottom-content {
    display: flex;
    flex-direction: column;
  }
  .about-bottom-content .left-area,
  .about-bottom-content .right-area {
    width: 100%;
    max-width: 100%;
  }
  .about-bottom-content .top-description {
    font-size: 13px !important;
    line-height: 1.8;
    padding: 20px !important;
  }
  .about-bottom-content li.with-icon {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px !important;
  }
  .about-bottom-content .icon {
    flex: 0 0 52px;
  }
  .about-bottom-content .icon img {
    width: 52px;
    height: 52px;
  }
  .about-bottom-content .text .title {
    font-size: 26px;
    margin-bottom: 4px;
  }
  .about-bottom-content .text .desc {
    font-size: 14px;
    margin: 0;
  }
  .about-bottom-content .image-area {
    position: relative;
  }
  .about-bottom-content .image-area img:first-child {
    width: 100%;
    height: 260px;
    object-fit: cover;
  }
  .image-shape-right-bottom {
    max-width: 38%;
  }
}

/* ---------- 9. SERVICES (home + service page) - hover cards -> always-open cards ---------- */
@media (max-width: 991px) {
  .wpr-services-area .section-bottom-content {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 14px;
    padding: 0 14px 18px;
    border-width: 0;
  }
  .wpr-services-area .section-bottom-content .service-wrapper,
  .wpr-services-area .section-bottom-content .service-wrapper:nth-child(3),
  .wpr-services-area .section-bottom-content .service-wrapper:nth-child(4) {
    flex: 0 0 auto;
    flex-basis: auto;
    width: 100%;
    min-height: 380px;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #0b1017;
  }
  /* image fills the card */
  .wpr-services-area .section-bottom-content .service-wrapper .image-area {
    position: absolute;
    inset: 0;
  }
  .wpr-services-area .section-bottom-content .service-wrapper .image-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none !important;
  }
  /* the white "cover" layer becomes a dark readable gradient */
  .wpr-services-area .section-bottom-content .service-wrapper::after,
  .wpr-services-area .section-bottom-content .service-wrapper:hover::after {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transform: none;
    opacity: 1;
    background: linear-gradient(
      180deg,
      rgba(5, 9, 15, 0.55) 0%,
      rgba(5, 9, 15, 0.72) 45%,
      rgba(5, 9, 15, 0.92) 100%
    );
  }
  .wpr-services-area .section-bottom-content .service-wrapper .content {
    position: relative;
    height: auto;
    min-height: 380px;
    padding: 22px 20px 24px;
    gap: 14px;
  }
  .wpr-services-area .section-bottom-content .service-wrapper .content .top .tag {
    background: #fff;
    color: #030712;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 8px 5px 24px;
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
  }
  .wpr-services-area .section-bottom-content .service-wrapper .content .top .desc {
    opacity: 1 !important;
    color: #e5e7eb !important;
    font-size: 15.5px;
    line-height: 1.65;
    margin: 0;
  }
  .wpr-services-area .section-bottom-content .service-wrapper .content .mid {
    margin: 0;
    text-align: left;
  }
  .wpr-services-area .section-bottom-content .service-wrapper .content .mid h2 {
    font-size: 64px;
    color: rgba(255, 255, 255, 0.28) !important;
  }
  .wpr-services-area .section-bottom-content .service-wrapper .content .bottom {
    align-items: center;
    gap: 14px;
  }
  .wpr-services-area .section-bottom-content .service-wrapper .content .bottom ul li {
    color: #fff !important;
    font-size: 15px;
    line-height: 1.35;
  }
  .wpr-services-area .section-bottom-content .service-wrapper .content .bottom .service-btn-area {
    opacity: 1 !important;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    line-height: 52px;
  }
}
@media (min-width: 640px) and (max-width: 991px) {
  .wpr-services-area .section-bottom-content {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .wpr-services-area .section-bottom-content .service-wrapper,
  .wpr-services-area .section-bottom-content .service-wrapper:nth-child(3),
  .wpr-services-area .section-bottom-content .service-wrapper:nth-child(4) {
    width: calc(50% - 7px);
    flex-basis: calc(50% - 7px);
  }
}

/* ---------- 10. Generic theme grids -> stack on phones ---------- */
@media (max-width: 767px) {
  .wpr-working-process-area .section-bottom-content,
  .wpr-why-choose-area .section-bottom-content,
  .wpr-faq-area .section-bottom-content,
  .wpr-blog-area .section-bottom-content,
  .wpr-pricing-area .section-bottom-content {
    flex-direction: column;
  }
  .why-choose-wrapper2,
  .why-choose-wrapper2.square-dot {
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .why-choose-wrapper2 h2,
  .why-choose-wrapper2 h3,
  .why-choose-wrapper2 .title {
    font-size: 22px;
  }
  .why-choose-wrapper2 p {
    font-size: 15px;
    line-height: 1.7;
  }

  /* comparison cards (Traditional vs Web Tech) */
  .wpr-pricing-area .section-bottom-content > * {
    width: 100%;
  }
  .wpr-pricing-area .title,
  .wpr-pricing-area h2,
  .wpr-pricing-area h3 {
    font-size: clamp(24px, 7vw, 32px);
  }
  .wpr-pricing-area li {
    font-size: 15px;
    line-height: 1.5;
  }

  /* FAQ accordion */
  .wpr-faq-area .accordion-button,
  .wpr-faq-area .accordion-header button {
    font-size: 16px;
    padding: 16px 14px;
    min-height: 56px;
    text-align: left;
  }
  .wpr-faq-area .accordion-body {
    font-size: 15px;
    line-height: 1.7;
  }
}

/* ---------- 11. CONTACT section + footer ---------- */
@media (max-width: 767px) {
  .wpr-contact-area .section-inner,
  .wpr-contact-area .container {
    overflow: hidden;
  }
  .wpr-contact-area a[href^="mailto"],
  .wpr-contact-area a[href^="tel"],
  .wpr-contact-area .title,
  .wpr-contact-area h3,
  .wpr-contact-area h4 {
    font-size: clamp(17px, 5vw, 22px);
    word-break: break-word;
  }
  .wpr-contact-area .address,
  .wpr-contact-area p {
    font-size: 16px;
    line-height: 1.6;
  }
  .footer-area .footer-links,
  .footer-area ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
  }
  .footer-area a {
    display: inline-block;
    padding: 8px 4px;
    font-size: 15px;
  }
  .footer-area p,
  .copyright-area p {
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
  }
}

/* ---------- 12. Inner pages: breadcrumb / page banners ---------- */
@media (max-width: 767px) {
  .breadcrumb-area,
  .wpr-breadcrumb-area,
  .inner-banner,
  .wpr-inner-banner {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
  .breadcrumb-area h1,
  .wpr-breadcrumb-area h1,
  .inner-banner h1,
  .wpr-inner-banner h1,
  .wpr-banner-area h1 {
    font-size: clamp(28px, 8.2vw, 40px);
    line-height: 1.15;
  }
}

/* ---------- 13. Blog listing + article pages ---------- */
@media (max-width: 767px) {
  .wts-blog-grid,
  .wts-blog-cards,
  .wts-posts,
  .blog-grid {
    grid-template-columns: 1fr !important;
  }
  .wts-article,
  .wts-post,
  .wts-blog-article,
  .blog-details-area {
    overflow-wrap: anywhere;
  }
  article img,
  .wts-article img,
  .blog-details-area img {
    width: 100%;
    height: auto;
    border-radius: 12px;
  }
  article p,
  .wts-article p {
    font-size: 16px;
    line-height: 1.8;
  }
  article h2,
  .wts-article h2 {
    font-size: clamp(24px, 6.8vw, 30px);
    line-height: 1.2;
  }
  article h3,
  .wts-article h3 {
    font-size: clamp(19px, 5.4vw, 23px);
  }
  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  pre,
  code {
    white-space: pre-wrap;
    word-break: break-word;
  }
}

/* ---------- 14. WTS premium service pages (wts-*) ---------- */
@media (max-width: 991px) {
  .wts-premium-hero .wts-hero-copy h1,
  .wts-hero h1 {
    overflow-wrap: break-word;
    hyphens: auto;
  }
  .wts-hero-image img {
    border-radius: 120px 18px 18px 18px;
  }
  .wts-image-label {
    max-width: calc(100% - 20px);
  }
  .wts-detail .container {
    padding-left: 20px;
    padding-right: 20px;
  }
}
@media (max-width: 767px) {
  .wts-detail h2 {
    font-size: clamp(28px, 8vw, 38px) !important;
    line-height: 1.12;
    margin: 12px 0 18px;
  }
  .wts-detail p {
    font-size: 15.5px;
    line-height: 1.75;
  }
  .wts-two p {
    font-size: 16px;
  }
  .wts-hero-copy h1 {
    font-size: clamp(34px, 10.4vw, 46px) !important;
    line-height: 1.06;
    margin: 18px 0;
  }
  .wts-hero-copy p {
    font-size: 16px;
  }
  .wts-eyebrow {
    font-size: 11px;
    letter-spacing: 1.4px;
    line-height: 1.5;
  }
  .wts-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 26px;
  }
  .wts-actions a,
  .wts-primary,
  .wts-outline {
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
  }
  .wts-image-label {
    left: 10px;
    bottom: 12px;
  }
  .wts-heading {
    margin-bottom: 28px;
  }
  .wts-heading > p {
    max-width: 100%;
  }
  .wts-feature {
    padding: 24px 20px;
  }
  .wts-feature:hover,
  .wts-card:hover {
    transform: none;
  }
  .wts-feature h3 {
    font-size: 22px;
    margin: 16px 0 10px;
  }
  .wts-step {
    padding: 22px 18px;
  }
  .wts-step h3 {
    font-size: 21px;
    margin: 28px 0 10px;
  }
  .wts-related {
    padding: 18px 0;
    font-size: 17px;
    min-height: 56px;
  }
  .wts-last {
    padding: 52px 0;
  }
  .wts-last h2 {
    font-size: clamp(28px, 8.4vw, 38px) !important;
  }
  .wts-checks li {
    font-size: 15px;
    gap: 12px;
  }
  .wts-two,
  .wts-split,
  .wts-related-wrap {
    gap: 28px;
  }

  /* article/legal page hero + cards (wts-pages.css) */
  .wts-hero {
    padding: 52px 0 !important;
  }
  .wts-hero h1 {
    font-size: clamp(30px, 8.6vw, 42px);
    margin: 14px 0 16px;
  }
  .wts-hero p {
    font-size: 16px;
    line-height: 1.7;
  }
  .wts-kicker {
    font-size: 11px;
    letter-spacing: 1.4px;
  }
  .wts-btn {
    width: 100%;
    justify-content: center;
    min-height: 52px;
  }
  .wts-section {
    padding: 42px 0 !important;
  }
  .wts-section h2 {
    font-size: clamp(26px, 7.4vw, 34px);
  }
  .wts-card {
    padding: 22px 20px;
    border-radius: 16px;
  }
  .wts-card h3 {
    font-size: 21px;
  }
  .wts-cta {
    padding: 48px 0;
  }
  .wts-policy-content h2 {
    font-size: 21px;
    line-height: 1.3;
  }
  .wts-policy-content p,
  .wts-policy-content li {
    font-size: 15.5px;
    line-height: 1.8;
  }
  .wts-policy-footer {
    padding: 22px 16px;
  }
  .wts-policy-footer a {
    padding: 8px 2px;
    display: inline-block;
  }
}
@media (max-width: 380px) {
  .wts-hero-copy h1 {
    font-size: 31px !important;
  }
  .wts-detail h2 {
    font-size: 26px !important;
  }
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ---------- 15. Landscape phones ---------- */
@media (max-width: 991px) and (orientation: landscape) and (max-height: 500px) {
  .wpr-banner-area.wts-full-hero {
    min-height: 0 !important;
    padding: 40px 0 !important;
  }
}

/* ---------- 16. Touch devices: no sticky hover states ---------- */
@media (hover: none) {
  .wts-btn:hover,
  .wts-primary:hover,
  .wts-hero-btn:hover {
    transform: none;
  }
}

/* ---------- 17. Performance on phones ---------- */
@media (max-width: 767px) {
  .wts-hero-bg,
  [class*="wts-"] {
    will-change: auto !important;
  }
  .wts-arrow-track span {
    animation-duration: 3s;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 18. Map / embedded iframes ---------- */
.wpr-map iframe,
.box-contact-item iframe {
  width: 100%;
  border: 0;
}
@media (max-width: 991px) {
  .wpr-map {
    padding: 0 !important;
    overflow: hidden;
  }
  .wpr-map iframe {
    height: 340px !important;
    border-radius: 14px;
    display: block;
  }
  .box-contact-item {
    padding: 28px 20px !important;
  }
  .box-contact-item .icon {
    font-size: 30px;
  }
  .box-contact-item a.text,
  .box-contact-item p.text {
    word-break: break-word;
    font-size: 16px;
  }
}

/* ---------- 19. Mobile menu spacing ---------- */
@media (max-width: 991px) {
  .mobile-menu-main .mainmenu-nav ul li,
  .mobile-menu-main .menu-item {
    margin: 0 !important;
    padding: 0 !important;
  }
  .mobile-menu-main .main-element {
    display: flex !important;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 12px 4px !important;
    margin: 0 !important;
    line-height: 1.3;
  }
  .mobile-menu-main .sub-menu {
    padding-left: 14px;
    min-height: 46px;
    display: flex;
    align-items: center;
  }
}
