/* Grey Cards - Mobile & tablet refinements */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

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

/* Prevent iOS zoom on form focus */
input,
select,
textarea,
button {
  font-size: 16px;
}

.overlay {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.popup {
  box-sizing: border-box;
}

.popup .content {
  max-height: none;
  overflow: visible;
}

.popup .form-control {
  width: 100%;
  min-height: 44px;
}

.popup .btn-primary {
  min-height: 44px;
  width: 100%;
  max-width: 220px;
}

@media screen and (max-width: 991px) {
  .popup {
    width: 92% !important;
    max-width: 480px;
    margin: 40px auto;
    padding: 22px 18px 24px;
  }

  .popup h4 {
    width: auto !important;
    max-width: calc(100% - 40px);
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 16px;
  }

  .popup .close {
    top: 14px;
    right: 14px;
    font-size: 28px;
    line-height: 1;
    z-index: 2;
  }

  .navbar .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border: 0;
  }

  .navbar .navbar-collapse {
    border-radius: 0 0 8px 8px;
  }

  .header .caption {
    padding-left: 12px;
    padding-right: 12px;
  }

  .header .caption p {
    font-size: 14px;
    line-height: 1.6;
  }

  .section-padding {
    padding: 50px 0;
  }

  .contact .form input,
  .contact .form textarea {
    width: 100%;
  }

  .contact-info .cont p {
    word-break: break-word;
  }

  .works .filtering {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 6px;
  }

  .works .filtering .filter {
    display: inline-block;
    min-width: max-content;
  }

  .works .gallery .items {
    width: 100% !important;
  }
}

@media screen and (max-width: 767px) {
  .popup {
    width: 94% !important;
    margin: 24px auto;
    padding: 20px 16px 22px;
  }

  .popup h4 {
    font-size: 20px;
  }

  .section-head h4 {
    font-size: 24px;
  }

  .hero .extra-title {
    font-size: 20px;
    line-height: 1.4;
  }

  .feat-item h5 {
    font-size: 18px;
  }

  .call-action h2 {
    font-size: 22px;
    line-height: 1.35;
    padding: 0 10px;
  }

  .butn {
    display: inline-block;
  }

  footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  footer p {
    font-size: 13px;
    line-height: 1.6;
  }

  .contact .col-sm-6 {
    margin-bottom: 24px;
  }

  /* Chat widgets: pin to corners so hero text stays readable */
  [id^="gb-widget"] {
    bottom: 14px !important;
    left: 10px !important;
    top: auto !important;
    right: auto !important;
    transform: scale(0.85);
    transform-origin: left bottom;
    z-index: 50 !important;
  }

  .widget-visible {
    right: 10px !important;
    bottom: 14px !important;
    top: auto !important;
    z-index: 50 !important;
  }

  body > iframe[style*="position: fixed"],
  body iframe[style*="position: fixed"] {
    bottom: 14px !important;
    right: 10px !important;
    top: auto !important;
    left: auto !important;
    max-width: 64px !important;
    max-height: 64px !important;
    z-index: 50 !important;
  }
}

@media screen and (max-width: 480px) {
  .header .caption h1 {
    font-size: 22px !important;
  }

  .header .caption h4 {
    font-size: 13px !important;
  }

  .header .caption p {
    font-size: 13px;
  }

  .works .filtering span {
    padding: 6px 10px;
    font-size: 11px;
  }

  .tabs-section .nav-pills .nav-link {
    font-size: 12px;
    padding: 10px 4px;
  }
}
