/* ===== Magic of Tiles — Site Fixes ===== */

/* ---------- Navbar: width / responsiveness ---------- */
header.elementor-location-header section.elementor-sticky--active,
header.elementor-location-header section.elementor-sticky[style*="width"],
header.elementor-location-header section.elementor-sticky__spacer {
  width: 100% !important;
  max-width: 100vw !important;
  left: 0 !important;
  right: 0 !important;
  box-sizing: border-box;
}

header.elementor-location-header .elementor-container {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

header.elementor-location-header nav.elementor-nav-menu__container[style*="width"] {
  width: 100% !important;
  max-width: 100vw !important;
  left: 0 !important;
}

/* Logo column: cap logo size in nav */
header.elementor-location-header #site-logo img {
  max-width: 64px;
  height: auto;
  width: auto;
}

@media (max-width: 1024px) {
  header.elementor-location-header .elementor-col-50,
  header.elementor-location-header .elementor-col-25 {
    width: auto !important;
    flex: 0 0 auto !important;
  }
  header.elementor-location-header .elementor-container {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  header.elementor-location-header .elementor-element-1f826a86 {
    display: none !important;
  }
  header.elementor-location-header .elementor-element-48f6f970 {
    margin-left: auto;
  }
  header.elementor-location-header nav.elementor-nav-menu--main {
    display: none !important;
  }
  header.elementor-location-header .elementor-menu-toggle {
    display: flex !important;
    font-size: 26px;
    padding: 8px 10px;
  }
  /* Mobile / tablet dropdown: full viewport width, fixed-position panel.
     Default state (closed): hidden. Bootstrap default (display:none) wins. */
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container {
    position: fixed !important;
    top: var(--mot-mobile-menu-top, 64px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    box-shadow: 0 12px 28px rgba(0,0,0,0.14);
    max-height: 70vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    z-index: 9998 !important;
    -webkit-overflow-scrolling: touch;
    transform: none !important;
  }
  /* When the JS marks it open (or the bootstrap rule fires from .elementor-active +) */
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container.mot-mobile-open,
  header.elementor-location-header .elementor-menu-toggle.elementor-active + nav.elementor-nav-menu--dropdown.elementor-nav-menu__container {
    display: block !important;
  }

  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-nav-menu {
    display: block !important;
  }

  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item {
    display: block !important;
    width: 100% !important;
  }

  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-sub-item {
    display: flex !important;
    width: 100% !important;
    padding: 14px 36px !important; /* room for the absolute caret on the right */
    font-size: 17px !important;
    line-height: 1.3 !important;
    border-bottom: 1px solid #eee !important;
    color: #222 !important;
    align-items: center;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal;
    position: relative;
  }
  /* Default state: caret pinned to the right, text stays centered */
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children > a .sub-arrow {
    position: absolute !important;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
  }

  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .sub-menu {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
  }

  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .sub-menu .elementor-sub-item {
    font-size: 16px !important;
    padding: 12px 4px !important;
    color: #444 !important;
  }

  /* Active / current-page menu item — white text on the dark accent bg */
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item.elementor-item-active,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-sub-item.elementor-item-active,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container li.current-menu-item > a,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container li.current_page_item > a,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item.highlighted,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-sub-item.highlighted {
    color: #fff !important;
    background-color: #BC9342 !important;
  }
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .elementor-item.elementor-item-active .sub-arrow i,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container li.current-menu-item > a .sub-arrow i,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container li.current_page_item > a .sub-arrow i {
    color: #fff !important;
  }

  /* Expanded parent ("clicked" item with submenu open) — center text, white */
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children.sub-menu-open > a,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children > a:hover,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children > a:focus {
    color: #fff !important;
    background-color: #4C4943 !important;
    justify-content: center !important;
    text-align: center !important;
    position: relative;
  }
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children.sub-menu-open > a .sub-arrow,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children > a:hover .sub-arrow,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children > a:focus .sub-arrow {
    position: absolute !important;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
    color: #fff !important;
  }
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children.sub-menu-open > a .sub-arrow i,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children > a:hover .sub-arrow i,
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children > a:focus .sub-arrow i {
    color: #fff !important;
  }

  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children > a .sub-arrow i {
    transform: none !important;
    transition: transform .2s ease;
  }
  header.elementor-location-header nav.elementor-nav-menu--dropdown.elementor-nav-menu__container .menu-item-has-children.sub-menu-open > a .sub-arrow i {
    transform: rotate(180deg) !important;
  }

  /* Hide the second (spacer) sticky-header dropdown so we don't open both */
  header.elementor-location-header section.elementor-sticky__spacer nav.elementor-nav-menu--dropdown {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  header.elementor-location-header .elementor-menu-toggle {
    display: none !important;
  }
}

/* ---------- Nav: flyout submenu (Areas We Work In) ---------- */
/* First-level submenu drops below the parent */
header.elementor-location-header .elementor-nav-menu--main .menu-item-has-children > .sub-menu {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  inset-inline-start: 0 !important;
  min-width: 220px;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border-radius: 4px;
  padding: 6px 0 !important;
  margin: 0 !important;
}

/* Nested submenu (depth 2+) flies out to the right */
header.elementor-location-header .elementor-nav-menu--main .sub-menu .menu-item-has-children {
  position: relative;
}
header.elementor-location-header .elementor-nav-menu--main .sub-menu .menu-item-has-children > .sub-menu {
  top: 0 !important;
  left: 100% !important;
  inset-inline-start: 100% !important;
  margin-top: -6px !important;
  margin-left: 0 !important;
}

/* Keep the flyout open while the cursor crosses the gap into it */
header.elementor-location-header .elementor-nav-menu--main .sub-menu .menu-item-has-children > .sub-menu::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -8px; width: 8px;
  background: transparent;
}

/* Submenu link layout: keep text and caret on a single line */
header.elementor-location-header .elementor-nav-menu--main .sub-menu a.elementor-sub-item,
header.elementor-location-header .elementor-nav-menu--main .sub-menu a {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  border-left: 0 !important;
  padding: 10px 16px !important;
  color: #222;
}
header.elementor-location-header .elementor-nav-menu--main .sub-menu a:hover,
header.elementor-location-header .elementor-nav-menu--main .sub-menu a:focus {
  background: #f5f1e8;
  color: #BC9342;
}

/* The caret/arrow sits inline next to the link text */
header.elementor-location-header .elementor-nav-menu--main .sub-menu a .sub-arrow {
  display: inline-flex !important;
  align-items: center;
  margin: 0 0 0 10px !important;
  padding: 0 !important;
  line-height: 1;
  flex: 0 0 auto;
}
header.elementor-location-header .elementor-nav-menu--main .sub-menu a .sub-arrow i,
header.elementor-location-header .elementor-nav-menu--main .sub-menu a .sub-arrow svg {
  font-size: 12px;
  transform: rotate(-90deg);
}

/* ---------- Gallery: visible thumbs (clean grid) ---------- */
.elementor-widget-gallery .elementor-gallery__container.e-gallery-container,
.elementor-widget-gallery .elementor-gallery__container.e-gallery-masonry {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px !important;
  height: auto !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
  position: relative;
}
@media (max-width: 1024px) {
  .elementor-widget-gallery .elementor-gallery__container { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 768px) {
  .elementor-widget-gallery .elementor-gallery__container { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
  .elementor-widget-gallery .elementor-gallery__container { grid-template-columns: 1fr !important; }
}

.elementor-widget-gallery .e-gallery-item.elementor-gallery-item {
  position: relative !important;
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: #f0f0f0;
  cursor: pointer;
  aspect-ratio: 4 / 5;
}

.elementor-widget-gallery .e-gallery-item img.mot-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.elementor-widget-gallery .e-gallery-item:hover img.mot-thumb {
  transform: scale(1.04);
}
.elementor-widget-gallery .e-gallery-item .e-gallery-image,
.elementor-widget-gallery .e-gallery-item .elementor-gallery-item__overlay {
  display: none !important;
}

/* ---------- Lightbox slider ---------- */
.mot-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100000;
  padding: 24px;
}
.mot-lightbox.mot-open { display: flex; }
.mot-lightbox__stage {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.mot-lightbox__img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  user-select: none;
}
.mot-lightbox__caption {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  background: rgba(0,0,0,0.55);
  padding: 6px 14px;
  border-radius: 30px;
  max-width: 80vw;
  text-align: center;
}
.mot-lightbox__close,
.mot-lightbox__nav {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 0;
  cursor: pointer;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  transition: background .2s ease;
  user-select: none;
}
.mot-lightbox__close:hover,
.mot-lightbox__nav:hover { background: rgba(255,255,255,0.25); }
.mot-lightbox__close { top: 18px; right: 18px; font-size: 22px; }
.mot-lightbox__nav--prev { left: 18px; top: 50%; transform: translateY(-50%); }
.mot-lightbox__nav--next { right: 18px; top: 50%; transform: translateY(-50%); }
.mot-lightbox__counter {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; opacity: 0.75;
}
@media (max-width: 600px) {
  .mot-lightbox__close,
  .mot-lightbox__nav { width: 40px; height: 40px; font-size: 20px; }
  .mot-lightbox__nav--prev { left: 8px; }
  .mot-lightbox__nav--next { right: 8px; }
}

/* ---------- Media carousel: defeat the bootstrap "display:none !important" rules ---------- */
.elementor-widget-media-carousel .elementor-main-swiper {
  position: relative !important;
  overflow: hidden !important;
}
.elementor-widget-media-carousel .swiper-wrapper {
  display: flex !important;
  flex-wrap: nowrap !important;
  /* Clipping is handled by .elementor-main-swiper; the wrapper itself must
     allow children to extend so the translate exposes off-stage slides. */
  overflow: visible !important;
  min-width: 0 !important;
  transition: transform .55s ease;
  will-change: transform;
}
.elementor-widget-media-carousel .swiper-slide,
.elementor-widget-media-carousel .swiper-slide:not(:first-child),
.elementor-widget-media-carousel .swiper-slide.swiper-slide-duplicate-prev {
  display: block !important;
  max-width: none !important;
  height: auto !important;
}
/* The <a> inside each slide is inline by default — that collapses the inner
   .elementor-carousel-image (which has width:100%) to 0. Force block. */
.elementor-widget-media-carousel .swiper-slide > a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  text-decoration: none;
}
.elementor-widget-media-carousel .elementor-carousel-image {
  display: block !important;
  width: 100% !important;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  cursor: pointer;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #f0eee8;
}

/* Custom arrows — replaces the hidden Elementor buttons */
.elementor-widget-media-carousel .mot-carousel-arrow {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  transition: background .2s ease, transform .15s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.elementor-widget-media-carousel .mot-carousel-arrow:hover {
  background: #BC9342;
}
.elementor-widget-media-carousel .mot-carousel-arrow:active {
  transform: translateY(-50%) scale(0.95) !important;
}
.elementor-widget-media-carousel .mot-carousel-arrow--prev { left: 12px; }
.elementor-widget-media-carousel .mot-carousel-arrow--next { right: 12px; }
.elementor-widget-media-carousel .mot-carousel-arrow svg {
  width: 22px; height: 22px; fill: currentColor;
}

/* Dot pagination */
.elementor-widget-media-carousel .mot-carousel-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.elementor-widget-media-carousel .mot-carousel-dots button {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #cfc8ba;
  border: 0; padding: 0; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.elementor-widget-media-carousel .mot-carousel-dots button:hover {
  transform: scale(1.2);
}
.elementor-widget-media-carousel .mot-carousel-dots button.is-active {
  background: #BC9342;
}

@media (max-width: 600px) {
  .elementor-widget-media-carousel .mot-carousel-arrow {
    width: 38px; height: 38px; font-size: 18px;
  }
  .elementor-widget-media-carousel .mot-carousel-arrow--prev { left: 6px; }
  .elementor-widget-media-carousel .mot-carousel-arrow--next { right: 6px; }
}

/* ---------- Bathtub Reglazing section (homepage) ---------- */
.mot-bathtub-section {
  background-color: #f0f0f0 !important;
  padding: 0 24px 60px !important;
}
.mot-bathtub-section .elementor-container {
  align-items: center;
  gap: 32px;
  max-width: 1280px !important;
  width: 100%;
  margin: 0 auto !important;
  padding: 0;
}
.mot-bathtub-section .elementor-column {
  flex: 1 1 50%;
  min-width: 0;
}
.mot-bathtub-section .elementor-widget-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
.mot-bathtub-section .elementor-heading-title {
  margin-bottom: 16px;
}
.mot-bathtub-section ul {
  padding-left: 20px;
  margin: 8px 0 16px;
  list-style: disc;
}
.mot-bathtub-section ul li {
  margin-bottom: 6px;
}

@media (max-width: 1024px) {
  .mot-bathtub-section {
    padding: 0 20px 40px !important;
  }
  .mot-bathtub-section .elementor-container {
    gap: 24px;
  }
}

/* Tablet only — no outer padding on the Bathtub Reglazing section */
@media (min-width: 769px) and (max-width: 1024px) {
  .mot-bathtub-section,
  section.mot-bathtub-section.elementor-section.elementor-top-section {
    padding: 0 !important;
  }
  .mot-bathtub-section .elementor-container {
    gap: 16px;
  }
}

/* Bathtub Reglazing column padding — strictly 20px on every viewport */
.mot-bathtub-section .elementor-column > .elementor-element-populated {
  padding: 20px !important;
}

@media (max-width: 768px) {
  .mot-bathtub-section,
  section.mot-bathtub-section.elementor-section.elementor-top-section {
    padding: 0 0 32px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .mot-bathtub-section .elementor-container {
    flex-direction: column;
    gap: 20px;
  }
  .mot-bathtub-section .elementor-column {
    flex: 1 1 100%;
    width: 100% !important;
    max-width: 100%;
  }
  .mot-bathtub-section .elementor-heading-title {
    margin-bottom: 12px;
  }
}

/* ---------- Contact popup ---------- */
.mot-popup {
  position: fixed; inset: 0;
  display: none;
  align-items: stretch;
  justify-content: center;
  z-index: 100001;
}
.mot-popup.mot-open { display: flex; }
.mot-popup__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  cursor: pointer;
}
.mot-popup__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(960px, 96vw);
  max-height: 92vh;
  margin: auto;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.mot-popup__media {
  flex: 1 1 50%;
  background-size: cover;
  background-position: center;
  background-color: #ddd;
  min-height: 320px;
}
.mot-popup__content {
  flex: 1 1 50%;
  padding: 36px 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}
.mot-popup__close {
  position: absolute;
  top: 12px; right: 14px;
  width: 32px; height: 32px;
  background: transparent;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  color: #333;
  line-height: 1;
  z-index: 2;
}
.mot-popup__close:hover { color: #000; }
.mot-popup h2.mot-popup__title {
  font-family: 'Gilda Display', serif;
  font-size: 32px;
  line-height: 1.25;
  margin: 0 0 12px;
  color: #1a1a1a;
  font-weight: 700;
  text-align: center;
}
.mot-popup__lead {
  text-align: center;
  color: #444;
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 14px;
}
.mot-popup__phone {
  text-align: center;
  margin: 0 0 18px;
}
.mot-popup__phone a {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.mot-popup__form {
  display: flex; flex-direction: column;
  gap: 10px;
}
.mot-popup__row {
  display: flex; gap: 10px;
}
.mot-popup__form input,
.mot-popup__form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  background: #fff;
  font-size: 15px;
  color: #222;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
}
.mot-popup__form input:focus,
.mot-popup__form textarea:focus {
  border-color: #BC9342;
}
.mot-popup__form textarea { resize: vertical; min-height: 56px; }
.mot-popup__submit {
  margin-top: 4px;
  padding: 14px 18px;
  background: #4C4943;
  color: #fff;
  font-weight: 600;
  border: 0;
  border-radius: 3px;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s ease;
}
.mot-popup__submit:hover { background: #BC9342; }
.mot-popup__success {
  display: none;
  text-align: center;
  padding: 20px 0;
  color: #2e7d32;
  font-size: 16px;
}
.mot-popup.mot-success .mot-popup__form { display: none; }
.mot-popup.mot-success .mot-popup__success { display: block; }

@media (max-width: 760px) {
  .mot-popup__dialog { flex-direction: column; max-height: 96vh; }
  .mot-popup__media { display: none; }
  .mot-popup__content { padding: 28px 22px 24px; }
  .mot-popup h2.mot-popup__title { font-size: 26px; }
  .mot-popup__row { flex-direction: column; }
}

/* Lock body scroll while modal open */
body.mot-modal-open { overflow: hidden; }

/* Lock body scroll while mobile menu open */
body.mot-mobile-menu-open { overflow: hidden; }
