/* Mobile-only usability layer. Desktop styles remain untouched. */
@media (max-width: 767.98px) {
  html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; min-width: 0; font-size: 16px; line-height: 1.55; }
  img, picture, video, iframe, svg { max-width: 100%; height: auto; }
  input, select, textarea, button { font-size: 16px; }
  a, button, input, select, textarea, [role="button"] { touch-action: manipulation; }

  .container, .container-fluid, .container-sm, .container-md, .container-lg,
  .container-xl, .container-xxl { width: 100%; max-width: 100%; padding-left: 18px; padding-right: 18px; }
  .row { --bs-gutter-x: 24px; }
  section, .section { padding-top: 48px; padding-bottom: 48px; scroll-margin-top: 72px; }
  .section-title { padding-bottom: 30px; }
  .section-title h2:where(:not(.art-h)) { font-size: clamp(28px, 8vw, 36px); line-height: 1.12; overflow-wrap: anywhere; }
  h1, .page-h1 { font-size: clamp(32px, 10vw, 44px); line-height: 1.06; overflow-wrap: anywhere; }
  h2:where(:not(.art-h)) { overflow-wrap: anywhere; }

  .header { padding: 8px 0; min-height: 64px; }
  .header .logo img { max-height: 48px; width: auto; }
  .mobile-nav-toggle {
    position: relative; z-index: 10000; width: 42px; height: 42px; margin-right: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px; color: #fff !important; font-size: 24px;
    background: linear-gradient(135deg, #5e16ea, #7c3aed);
    box-shadow: 0 9px 24px rgba(94,22,234,.28);
    transition: transform .3s cubic-bezier(.2,.8,.2,1), border-radius .3s, box-shadow .3s;
  }
  .mobile-nav-toggle:active { transform: scale(.91); }
  .mobile-nav-active .mobile-nav-toggle {
    position: fixed; top: 16px; right: 16px; width: 40px; height: 40px;
    border-radius: 50%; transform: rotate(90deg); box-shadow: 0 8px 22px rgba(15,23,42,.18);
  }
  .mobile-nav-active .navmenu {
    position: fixed; inset: 0; z-index: 9997; overflow: hidden;
    background: rgba(15, 10, 28, .48); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
    animation: mobile-menu-overlay .28s ease both;
  }
  .mobile-nav-active .navmenu > ul {
    display: block; position: absolute; top: 0; right: 0; bottom: 0; left: auto;
    width: min(84vw, 330px); margin: 0; padding: 82px 18px 28px;
    border: 0; border-radius: 28px 0 0 28px; overflow-y: auto;
    background: rgba(255,255,255,.97);
    box-shadow: -18px 0 60px rgba(15,23,42,.18);
    animation: mobile-menu-panel .42s cubic-bezier(.22,1,.36,1) both;
  }
  .mobile-nav-active .navmenu > ul > li {
    opacity: 0; transform: translateX(22px);
    animation: mobile-menu-item .38s cubic-bezier(.22,1,.36,1) forwards;
  }
  .mobile-nav-active .navmenu > ul > li:nth-child(1) { animation-delay: .10s; }
  .mobile-nav-active .navmenu > ul > li:nth-child(2) { animation-delay: .15s; }
  .mobile-nav-active .navmenu > ul > li:nth-child(3) { animation-delay: .20s; }
  .mobile-nav-active .navmenu > ul > li:nth-child(4) { animation-delay: .25s; }
  .mobile-nav-active .navmenu > ul > li:nth-child(5) { animation-delay: .30s; }
  .navmenu a, .navmenu a:focus {
    min-height: 48px; margin-bottom: 5px; padding: 11px 13px; white-space: normal; line-height: 1.25;
    border-radius: 13px; color: #191425; font-size: 16px; font-weight: 700;
  }
  .navmenu a:hover, .navmenu .active, .navmenu .active:focus {
    color: #5e16ea; background: rgba(94,22,234,.09);
  }
  .navmenu a i, .navmenu a:focus i { width: 32px; height: 32px; flex: 0 0 32px; margin-left: 10px; color: #5e16ea; }
  .navmenu .dropdown ul {
    position: static; margin: 4px 0 8px 12px; padding: 6px;
    border: 0; border-left: 2px solid rgba(94,22,234,.2); border-radius: 0 12px 12px 0;
    background: rgba(94,22,234,.045); box-shadow: none;
  }
  .navmenu .dropdown > .dropdown-active { animation: mobile-submenu .25s ease both; }
  .navmenu .dropdown ul a { min-height: 42px; margin: 0; padding: 9px 12px; font-size: 14px; font-weight: 650; }

  .hero { min-height: auto; padding: 50px 0 42px; text-align: center; }
  .hero .row { row-gap: 28px; }
  .hero h1, .hero h2:where(:not(.art-h)) { font-size: clamp(34px, 10vw, 46px); line-height: 1.05; }
  .hero p { font-size: 17px; line-height: 1.5; margin: 14px auto 24px; }
  .hero .cta-btn, .hero .btn-get-started, .hero-cta { width: 100%; min-height: 52px; justify-content: center; }
  .hero img { max-height: 420px; object-fit: contain; }
  .hero-cow-carousel { width: 100%; }

  .page-title { padding: 64px 0 42px; }
  .page-title .breadcrumbs ol { font-size: 14px; gap: 4px 0; }

  .services .service-item { padding: 34px 22px; border-radius: 20px; }
  .services .service-item .icon { position: static; margin-bottom: 18px; }
  .services .service-item .icon i { font-size: 48px; }
  .portfolio .portfolio-filters { display: flex; overflow-x: auto; justify-content: flex-start; gap: 8px; padding: 4px 2px 12px; scrollbar-width: none; }
  .portfolio .portfolio-filters::-webkit-scrollbar { display: none; }
  .portfolio .portfolio-filters li { flex: 0 0 auto; min-height: 42px; margin: 0; padding: 11px 15px; border-radius: 999px; background: rgba(94,22,234,.08); }

  .card, .news-card, .blog-details, .service-item { max-width: 100%; }
  table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .swiper-button-next, .swiper-button-prev { width: 42px; height: 42px; }

  .php-email-form, form { max-width: 100%; }
  .php-email-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .php-email-form select, .php-email-form textarea,
  form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  form select, form textarea { width: 100%; min-height: 48px; }
  input[type="checkbox"], input[type="radio"] { min-width: 22px; min-height: 22px; }
  textarea, form textarea { min-height: 120px; }
  .php-email-form button[type="submit"], form button[type="submit"] { width: 100%; min-height: 52px; }

  .footer { padding-bottom: 28px; }
  .footer .footer-top { padding-top: 40px; }
  .footer .footer-links, .footer .footer-contact, .footer .footer-about { margin-bottom: 28px; }
  .footer .social-links a { width: 44px; height: 44px; }
  .scroll-top { width: 46px; height: 46px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); border-radius: 50%; }

  [style*="width:"] { max-width: 100%; }
  [data-aos] { transition-delay: 0s !important; }
}

@keyframes mobile-menu-overlay { from { opacity: 0; } to { opacity: 1; } }
@keyframes mobile-menu-panel { from { opacity: .5; transform: translateX(105%); } to { opacity: 1; transform: translateX(0); } }
@keyframes mobile-menu-item { to { opacity: 1; transform: translateX(0); } }
@keyframes mobile-submenu { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 390px) {
  .container, .container-fluid, .container-sm, .container-md, .container-lg,
  .container-xl, .container-xxl { padding-left: 14px; padding-right: 14px; }
  section, .section { padding-top: 40px; padding-bottom: 40px; }
  .hero h1, .hero h2:where(:not(.art-h)) { font-size: 32px; }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
