/* Site-wide responsive + layout fixes (mobile, tablet, desktop) */

:root {
  --shpe-page-gutter: clamp(1rem, 4vw, 2rem);
  --shpe-header-offset-mobile: 90px;
  --shpe-header-offset-tablet: 110px;
}

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

body {
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

video:not(.elementor-video):not(.shpe-ai-video) {
  max-width: 100%;
  height: auto;
}

.e-con,
.e-con-inner,
.elementor-widget-wrap,
.elementor-container {
  min-width: 0;
}

.elementor-widget-image img,
.elementor-widget-image-gallery img,
.elementor-gallery__container img {
  display: block;
}

/* ---------- Header & footer brand logos ---------- */
.elementor-location-header .elementor-element-4b5a2682 {
  flex: 0 0 auto;
  flex-shrink: 0;
}

.elementor-location-header .elementor-element-4b5a2682 img {
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  max-height: 76px;
  min-width: 112px;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.elementor-371 .elementor-element-1017700d img,
.elementor-location-footer .elementor-element-1017700d img {
  width: auto !important;
  max-width: min(240px, 100%) !important;
  min-width: 168px;
  height: auto !important;
  object-fit: contain;
  object-position: left center;
}

.jkit-nav-logo {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.jkit-nav-logo img {
  width: auto !important;
  max-width: 220px !important;
  height: auto !important;
  max-height: 64px;
  object-fit: contain;
}

/* ---------- Mobile / tablet nav (no Elementor device-mode dependency) ---------- */
@media (max-width: 1024px) {
  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-hamburger-menu {
    display: block !important;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    padding: 10px 12px;
    touch-action: manipulation;
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu-wrapper {
    width: min(100%, 360px);
    max-width: 360px;
    border-radius: 0;
    background-color: #f7f7f7;
    position: fixed;
    top: 0;
    left: -110%;
    height: 100% !important;
    z-index: 999999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    transition: left 0.45s cubic-bezier(0.6, 0.1, 0.68, 0.53);
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu-wrapper.active {
    left: 0;
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu > li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu > li > a {
    display: block;
    padding: 14px 20px;
    min-height: 44px;
    line-height: 1.3;
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu li > .sub-menu {
    position: static !important;
    display: none;
    box-shadow: none !important;
    background: rgba(0, 0, 0, 0.03);
    padding-left: 0;
    margin: 0;
    width: 100%;
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu li.shpe-submenu-open > .sub-menu,
  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu li > .sub-menu.dropdown-open {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 999998;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu-wrapper.active ~ .jkit-overlay,
  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet.active-overlay .jkit-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-close-menu {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .elementor-location-header .elementor-element-1b62b851 {
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .elementor-location-header .elementor-element-4b5a2682 {
    flex: 0 0 auto;
    flex-shrink: 0;
  }

  .elementor-location-header .elementor-element-4b5a2682 img {
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: 62px;
    min-width: 96px;
    object-fit: contain;
    object-position: left center;
  }

  .elementor-location-header .elementor-element-1d3be380 {
    --margin-bottom: -80px !important;
  }
}

@media (max-width: 767px) {
  .elementor-location-header .elementor-element-4b5a2682 img {
    max-height: 54px;
    min-width: 88px;
  }

  .elementor-location-header .elementor-element-1d3be380 {
    --margin-bottom: -68px !important;
  }

  .elementor-location-header .elementor-element-6348570e {
    --icon-size: 15px;
  }
}

body.shpe-nav-open {
  overflow: hidden;
  touch-action: none;
}

/* ---------- Homepage hero ---------- */
@media (max-width: 767px) {
  .elementor-466 .elementor-element.elementor-element-fe9ea7c {
    --padding-top: 6.5em !important;
    --padding-bottom: 2em !important;
    --padding-left: 1em !important;
    --padding-right: 1em !important;
  }

  .elementor-466 .elementor-element.elementor-element-8023ab7 .elementor-heading-title {
    font-size: clamp(1.65rem, 7vw, 2rem) !important;
    line-height: 1.15 !important;
  }

  .elementor-466 .elementor-element.elementor-element-42bc0d9 .elementor-headline {
    font-size: clamp(1.75rem, 8vw, 2.2rem) !important;
    line-height: 1.15 !important;
  }

  .elementor-466 .elementor-element.elementor-element-8446cc0 {
    width: 100% !important;
    max-width: 100% !important;
    --container-widget-width: 100% !important;
  }
}

@media (max-width: 1024px) and (min-width: 768px) {
  .elementor-466 .elementor-element.elementor-element-fe9ea7c {
    --padding-top: 8em !important;
    --padding-left: 1.5em !important;
    --padding-right: 1.5em !important;
  }

  .elementor-466 .elementor-element.elementor-element-8023ab7 .elementor-heading-title,
  .elementor-466 .elementor-element.elementor-element-42bc0d9 .elementor-headline {
    font-size: clamp(2rem, 5vw, 3rem) !important;
  }
}

/* ---------- Inner page heroes (portfolio, services, about) ---------- */
@media (max-width: 1024px) {
  .elementor-page:not(.home) [data-elementor-type="wp-page"] > .e-con.e-parent:first-of-type,
  .elementor-page:not(.home) main > .elementor > .e-con.e-parent:first-of-type,
  .elementor-page:not(.home) #content > .elementor > .e-con.e-parent:first-of-type {
    --padding-top: var(--shpe-header-offset-tablet) !important;
    --padding-left: var(--shpe-page-gutter) !important;
    --padding-right: var(--shpe-page-gutter) !important;
  }
}

@media (max-width: 767px) {
  .elementor-page:not(.home) [data-elementor-type="wp-page"] > .e-con.e-parent:first-of-type,
  .elementor-page:not(.home) main > .elementor > .e-con.e-parent:first-of-type,
  .elementor-page:not(.home) #content > .elementor > .e-con.e-parent:first-of-type {
    --padding-top: var(--shpe-header-offset-mobile) !important;
  }

  .elementor-page .elementor-heading-title {
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }
}

/* ---------- Columns & grids ---------- */
@media (max-width: 1024px) {
  .elementor-column,
  .elementor-col-50,
  .elementor-col-33,
  .elementor-col-25 {
    min-width: 0;
  }

  .e-con.e-parent > .e-con-inner {
    padding-left: var(--shpe-page-gutter);
    padding-right: var(--shpe-page-gutter);
  }
}

@media (max-width: 767px) {
  .elementor-widget-text-editor,
  .elementor-widget-heading {
    max-width: 100%;
  }

  .elementor-button,
  .elementor-button-link,
  .jkit-hamburger-menu,
  .jkit-close-menu {
    touch-action: manipulation;
  }
}

/* ---------- Footer (static export layout) ---------- */
.elementor.elementor-371.elementor-location-footer {
  width: 100%;
  max-width: none;
  clear: both;
  display: block;
  box-sizing: border-box;
}

.elementor-371 .elementor-element.elementor-element-21eab9b0,
.elementor-371 .elementor-element.elementor-element-4fc82566,
.elementor-371 .elementor-element.elementor-element-22f51a2 {
  width: 100%;
  max-width: 100%;
  background-color: var(--e-global-color-primary, #131112);
}

.elementor-371 .elementor-element.elementor-element-21eab9b0 {
  display: flex;
  flex-direction: column;
}

.elementor-371 .elementor-element.elementor-element-21eab9b0 > .e-con-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: flex-start;
  width: 100%;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.elementor-371 .elementor-element.elementor-element-4fc82566 > .e-con-inner,
.elementor-371 .elementor-element.elementor-element-22f51a2 > .e-con-inner {
  width: 100%;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.elementor-371 .elementor-element.elementor-element-2bbf0c7f {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.elementor-371 .elementor-element.elementor-element-2bbf0c7f > .e-con-inner {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

@media (min-width: 768px) {
  .elementor-371 .elementor-element.elementor-element-159bc1f {
    flex: 0 0 29%;
    width: 29% !important;
    max-width: 29% !important;
  }

  .elementor-371 .elementor-element.elementor-element-6b51c5ed {
    flex: 0 0 17%;
    width: 17% !important;
    max-width: 17% !important;
  }

  .elementor-371 .elementor-element.elementor-element-1543ddd2 {
    flex: 0 0 25%;
    width: 25% !important;
    max-width: 25% !important;
  }

  .elementor-371 .elementor-element.elementor-element-115e06e4 {
    flex: 0 0 27%;
    width: 27% !important;
    max-width: 27% !important;
  }
}

@media (max-width: 1024px) and (min-width: 768px) {
  .elementor-371 .elementor-element.elementor-element-159bc1f {
    flex: 0 0 40%;
    width: 40% !important;
    max-width: 40% !important;
  }

  .elementor-371 .elementor-element.elementor-element-6b51c5ed,
  .elementor-371 .elementor-element.elementor-element-1543ddd2,
  .elementor-371 .elementor-element.elementor-element-115e06e4 {
    flex: 0 0 20%;
    width: 20% !important;
    max-width: 20% !important;
  }
}

@media (max-width: 767px) {
  .elementor-location-footer .e-con-inner {
    text-align: center;
  }

  .elementor-location-footer .elementor-widget-wrap {
    justify-content: center;
  }
}

/* ---------- Forms & contact ---------- */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px;
    max-width: 100%;
  }

  .metform-form-main-wrapper,
  .mf-form-wrapper {
    padding-left: var(--shpe-page-gutter);
    padding-right: var(--shpe-page-gutter);
  }
}

/* ---------- Lightbox on touch devices ---------- */
@media (hover: none) and (pointer: coarse) {
  .elementor-gallery__container .e-gallery-item:hover,
  .elementor-image-gallery .gallery-item:hover .gallery-icon {
    transform: none;
    box-shadow: none;
  }
}

/* ---------- Smoother scrolling on supported browsers ---------- */
@supports (scrollbar-gutter: stable) {
  html {
    scrollbar-gutter: stable;
  }
}

/* ---------- Global mobile hardening (all pages) ---------- */
.elementor-widget-text-editor [class*='overflow-x'],
.elementor-widget-text-editor [class*='max-w-'],
.elementor-widget-text-editor .w-full,
.elementor-widget-text-editor [class*='flex-grow'],
.elementor-widget-text-editor [class*='text-token'] {
  max-width: 100% !important;
  width: auto !important;
  overflow-x: visible !important;
  overflow: visible !important;
  min-width: 0 !important;
}

.elementor-widget-text-editor .markdown.prose,
.elementor-widget-text-editor .markdown.prose p {
  max-width: 100% !important;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.elementor-widget-text-editor table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.elementor-widget-video iframe,
.elementor-widget-video video,
.elementor-video {
  max-width: 100%;
}

/* Corporate Videos — AI section layout moved to shpe-static-ai-videos.css */

.swiper,
.elementor-swiper,
.elementor-image-carousel-wrapper {
  max-width: 100%;
  overflow: hidden;
}

/* Duplicate nav items (already under Services submenu) */
#menu-item-1542,
#menu-item-1543,
#menu-item-1985 {
  display: none !important;
}

/* ---------- Homepage: gallery tabs ---------- */
@media (max-width: 767px) {
  .elementor-element-1418606 > .e-con-inner {
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 8px 14px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
    max-width: 100%;
  }

  .elementor-element-1418606 > .e-con-inner::-webkit-scrollbar {
    display: none;
  }

  .elementor-element-1418606 .elementor-widget-heading {
    flex: 0 0 auto;
  }

  .elementor-element-a170d3d > .e-con-inner,
  .elementor-element-9da5d1f > .e-con-inner {
    padding-left: var(--shpe-page-gutter) !important;
    padding-right: var(--shpe-page-gutter) !important;
  }
}

/* ---------- Homepage: Creative Services cards ---------- */
@media (max-width: 1024px) {
  .elementor-element-8434430 > .e-con-inner,
  .elementor-element-8434430.e-grid > .e-con-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
  }
}

@media (max-width: 767px) {
  .elementor-element-8434430 > .e-con-inner,
  .elementor-element-8434430.e-grid > .e-con-inner,
  .e-grid.e-con > .e-con-inner {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .jkit-icon-box.icon-position-left .jkit-icon-box-wrapper {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px;
  }

  .jkit-icon-box .icon-box-description {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .elementor-button-wrapper {
    width: 100%;
  }

  .elementor-button {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Inner page heroes & titles ---------- */
@media (max-width: 767px) {
  .elementor-page:not(.home) .e-con.e-parent:first-of-type .elementor-heading-title {
    font-size: clamp(1.45rem, 6.5vw, 2rem) !important;
    line-height: 1.2 !important;
  }

  .elementor-631 .elementor-element-42349d94,
  .elementor-632 .elementor-element-42349d94,
  .elementor-633 .elementor-element-42349d94,
  .elementor-634 .elementor-element-1ac3b65f,
  .elementor-457 .elementor-element-42349d94,
  .elementor-656 .elementor-element-42349d94,
  .elementor-390 .elementor-element-42349d94 {
    --padding-top: 5.5rem !important;
    --padding-bottom: 1.25rem !important;
    --padding-left: var(--shpe-page-gutter) !important;
    --padding-right: var(--shpe-page-gutter) !important;
  }

  .elementor-widget-text-editor {
    font-size: 0.95rem;
    line-height: 1.65;
  }
}

@media (max-width: 1024px) and (min-width: 768px) {
  .elementor-631 .elementor-element-42349d94,
  .elementor-632 .elementor-element-42349d94,
  .elementor-633 .elementor-element-42349d94,
  .elementor-634 .elementor-element-1ac3b65f,
  .elementor-457 .elementor-element-42349d94,
  .elementor-656 .elementor-element-42349d94 {
    --padding-top: 7rem !important;
  }
}

/* ---------- Footer mobile layout ---------- */
@media (max-width: 767px) {
  .elementor-location-footer .e-con-full,
  .elementor-location-footer .e-con-child,
  .elementor-location-footer .e-con.e-child,
  .elementor-371 .elementor-element.elementor-element-159bc1f,
  .elementor-371 .elementor-element.elementor-element-6b51c5ed,
  .elementor-371 .elementor-element.elementor-element-1543ddd2,
  .elementor-371 .elementor-element.elementor-element-115e06e4 {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
  }

  .elementor-371 .elementor-element.elementor-element-2bbf0c7f,
  .elementor-371 .elementor-element.elementor-element-2bbf0c7f > .e-con-inner {
    flex-direction: column !important;
    align-items: center;
    text-align: center;
  }

  .elementor-371 .elementor-element.elementor-element-9d4a785 .elementor-widget-container {
    text-align: center !important;
  }

  .elementor-location-footer .elementor-icon-list-items {
    align-items: center;
  }

  .elementor-location-footer .elementor-widget-image img {
    margin-left: auto;
    margin-right: auto;
  }

  .elementor-371 .elementor-element-1017700d img,
  .elementor-location-footer .elementor-element-1017700d img {
    max-width: 210px !important;
    min-width: 150px;
  }
}

/* ---------- Call Now floating button clearance ---------- */
@media (max-width: 767px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  #callnowbutton.call-now-button {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ---------- Portfolio galleries on tablet ---------- */
@media (max-width: 1024px) {
  .elementor-widget-image-gallery .elementor-image-gallery .gallery-columns-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ---------- Prevent horizontal page scroll from wide children ---------- */
@media (max-width: 767px) {
  .e-con,
  .e-con-inner,
  .elementor-section,
  .elementor-container,
  .elementor-widget-wrap {
    max-width: 100%;
  }

  .elementor-location-header .e-con-inner {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  h1.elementor-heading-title,
  h2.elementor-heading-title {
    hyphens: auto;
  }
}

/* ---------- Contact form (Metform) ---------- */
@media (max-width: 767px) {
  .mf-form-wrapper,
  .metform-form,
  .metform-form input[type='text'],
  .metform-form input[type='email'],
  .metform-form input[type='tel'],
  .metform-form textarea,
  .metform-form select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .mf-form-row,
  .metform-form .mf-input,
  .metform-form .mf-btn {
    width: 100% !important;
  }

  .metform-form .mf-btn button,
  .metform-form .mf-submit-btn {
    width: 100%;
    min-height: 44px;
  }
}

/* ---------- Safe area (notched phones) ---------- */
@supports (padding: env(safe-area-inset-left)) {
  @media (max-width: 767px) {
    body {
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }

    .jeg-elementor-kit.jkit-nav-menu.break-point-tablet .jkit-menu-wrapper {
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}
