/*
 * Metafortech — enhanced mobile UX (loads after mobile-responsive.css)
 */

/* Safe areas (notched phones) */
@supports (padding: max(0px)) {
  .meta-header .container,
  .contact-sec .container,
  .contact .container,
  footer .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 991px) {
  input,
  select,
  textarea,
  .meta-phone-field__input {
    font-size: 16px !important;
  }
}

/* Touch targets */
@media screen and (max-width: 991px) {
  .meta-header .header-cta-btn,
  .meta-header .lang-flag-toggle,
  .meta-header .navbar-toggler,
  .meta-budget-card__chip,
  .meta-phone-field__trigger,
  .whatsapp-float {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Header — compact mobile */
@media screen and (max-width: 991px) {
  .meta-header {
    padding: 8px 0;
  }

  .meta-header .logo img {
    max-height: 40px;
    width: auto;
  }

  .meta-header .header-actions {
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: stretch;
    width: 100%;
    margin-top: 0;
  }

  .meta-header .header-cta-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Hero — تقليل الفراغ تحت السلايدر */
@media screen and (max-width: 991px) {
  .meta-hero + .about-ar,
  .meta-hero + section.about-ar {
    margin-top: 0;
  }
}

@media screen and (max-width: 575px) {
  .slider .parallax-slider .caption h1,
  .slider .parallax-slider .caption h2 {
    font-size: clamp(22px, 7vw, 32px) !important;
    line-height: 1.25 !important;
  }

  .slider .parallax-slider .caption p {
    font-size: 14px !important;
  }
}

/* Sections — tighter rhythm */
@media screen and (max-width: 575px) {
  .section-padding {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  .sec-head h2 {
    font-size: clamp(22px, 6vw, 28px) !important;
    line-height: 1.3 !important;
  }
}

/* Services grid */
@media screen and (max-width: 575px) {
  .serv-arch .item {
    margin-bottom: 20px;
  }

  .serv-arch .item .icon {
    margin-bottom: 12px;
  }
}

/* Projects / cases — no horizontal bleed */
@media screen and (max-width: 991px) {
  .meta-projects-marquee,
  .meta-cases__grid,
  .projects-carousel {
    overflow-x: hidden;
    max-width: 100%;
  }
}

/* Testimonials */
@media screen and (max-width: 575px) {
  .meta-testimonials__card {
    padding: 20px 16px !important;
  }

  .meta-testimonials__quote {
    font-size: 15px !important;
    line-height: 1.65 !important;
  }
}

/* Blog cards */
@media screen and (max-width: 575px) {
  .meta-blog__grid {
    gap: 16px;
  }

  .meta-blog__card .meta-blog__title {
    font-size: 16px !important;
  }
}

/* Contact form — stack & full width */
@media screen and (max-width: 767px) {
  .contact-sec .form .row > [class*="col-lg-4"],
  .contact-sec .form .row > [class*="col-md-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .contact-sec.style2 .form input,
  .contact-sec.style2 .form textarea,
  .contact-sec .form .meta-phone-field__control {
    width: 100%;
  }
}

@media screen and (max-width: 575px) {
  .meta-budget-card {
    padding: 14px 14px 12px;
    border-radius: 12px;
  }

  .meta-budget-card__amount {
    font-size: 24px !important;
  }

  .meta-budget-card__chips {
    gap: 6px;
    margin-bottom: 14px;
  }

  .meta-budget-card__chip {
    padding: 10px 12px;
    font-size: 11px;
  }

  .meta-budget-card__track {
    height: 40px;
  }

  .meta-budget-card__slider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    margin-top: -7px;
  }

  .meta-phone-field__trigger {
    padding: 16px 10px 16px 12px !important;
  }

  .meta-phone-field__input {
    padding: 16px 14px 16px 10px !important;
  }

  .contact-sec .butn.light.full-width {
    padding: 14px 20px !important;
  }
}

/* Contact page */
@media screen and (max-width: 767px) {
  .contact .row > [class*="col-lg-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .contact .form {
    margin-bottom: 40px;
  }

  .contact .cont-info {
    text-align: center;
  }
}

/* Footer */
@media screen and (max-width: 575px) {
  .meta-footer__grid {
    gap: 24px;
  }

  .meta-footer__col {
    text-align: center;
  }

  .meta-footer__social {
    justify-content: center;
  }
}

/* WhatsApp — clear thumb zone */
@media screen and (max-width: 575px) {
  .whatsapp-float {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }
}

/* Project detail */
@media screen and (max-width: 575px) {
  .meta-project-hero__title {
    font-size: clamp(24px, 7vw, 32px) !important;
  }

  .meta-project-detail .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
