/* ===== Fix 1: Sticky Header ===== */
.elementor-location-header,
header[data-elementor-type="header"] {
  position: sticky !important;
  top: 0 !important;
  z-index: 9999;
  width: 100% !important;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Fix the inline position:fixed that was baked in */
.elementor-location-header .elementor-section[data-settings*="sticky"] {
  position: relative !important;
  width: 100% !important;
  margin-top: 0 !important;
}

.elementor-sticky__spacer { display: none !important; }

.elementor-sticky--active {
  left: 0 !important;
  width: 100% !important;
}

/* ===== Fix 3-4: Desktop Dropdown Menus ===== */
.elementor-nav-menu--main .menu-item-has-children { position: relative; }

.elementor-nav-menu--main .menu-item-has-children > .sub-menu {
  display: none !important;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 220px;
  width: max-content;
  max-width: 320px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  border-radius: 0 0 4px 4px;
  z-index: 10000;
  padding: 6px 0;
  margin: 0;
  list-style: none;
}

.elementor-nav-menu--main .menu-item-has-children:hover > .sub-menu {
  display: block !important;
}

.elementor-nav-menu--main .sub-menu li {
  display: block !important;
  width: 100%;
}

.elementor-nav-menu--main .sub-menu a {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 11px 22px !important;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  white-space: normal;
  word-wrap: break-word;
  transition: background 0.2s, color 0.2s;
}

.elementor-nav-menu--main .sub-menu a:hover {
  background: #645B3F;
  color: #fff;
}

/* Caret inline fix */
.elementor-nav-menu--main .sub-menu .menu-item-has-children > a {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.elementor-nav-menu--main .sub-menu .menu-item-has-children > a .sub-arrow {
  display: inline-flex !important;
  align-items: center;
  flex-shrink: 0;
}

.elementor-nav-menu--main .sub-menu .menu-item-has-children > a .sub-arrow i {
  transform: rotate(-90deg) !important;
}

/* Nested flyout submenu */
.elementor-nav-menu--main .sub-menu .menu-item-has-children > .sub-menu {
  position: absolute !important;
  top: 0 !important;
  left: 100% !important;
  margin: 0 !important;
  background: #fff !important;
  border-radius: 0 4px 4px 0 !important;
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.12) !important;
  z-index: 10001 !important;
  min-width: 180px;
  width: max-content;
  max-width: 320px;
  padding: 6px 0;
}

/* ===== Fix 5-6: Mobile/Tablet Nav Menu ===== */
@media (max-width: 1024px) {
  .elementor-location-header {
    position: sticky !important;
    top: 0 !important;
  }

  /* Make all parent containers of the dropdown static so it anchors to the header section */
  .elementor-widget-nav-menu,
  .elementor-widget-nav-menu .elementor-widget-container,
  .elementor-location-header .elementor-column,
  .elementor-location-header .elementor-widget-wrap {
    position: static !important;
  }

  /* The header section itself is the positioning anchor */
  .elementor-location-header .elementor-top-section {
    position: relative !important;
    overflow: visible !important;
  }

  /* Also ensure the header container doesn't clip */
  .elementor-location-header .elementor-container {
    overflow: visible !important;
  }

  /* === FULL-WIDTH DROPDOWN CONTAINER === */
  .elementor-nav-menu--dropdown.elementor-nav-menu__container {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    background: #fff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
    z-index: 10000 !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border-top: 1px solid #f0f0f0 !important;
    box-sizing: border-box !important;
  }

  /* === MENU LIST RESET === */
  .elementor-nav-menu--dropdown .elementor-nav-menu {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  /* === MENU ITEMS — full-width block === */
  .elementor-nav-menu--dropdown li {
    display: block !important;
    width: 100% !important;
    float: none !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* === MENU LINKS — centered text === */
  .elementor-nav-menu--dropdown li > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    color: #333 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: normal !important;
    flex-grow: 0 !important;
    border-inline-start: none !important;
  }

  .elementor-nav-menu--dropdown li > a:hover {
    background: #f5f5f5 !important;
  }

  /* === CARET/ARROW — inline to the right of text === */
  .elementor-nav-menu--dropdown .menu-item-has-children > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }

  .elementor-nav-menu--dropdown .menu-item-has-children > a .sub-arrow {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    transition: transform 0.3s !important;
    position: static !important;
  }

  .elementor-nav-menu--dropdown .menu-item-has-children > a .sub-arrow i {
    transform: none !important;
    font-size: 12px !important;
  }

  /* Rotate caret when open */
  .elementor-nav-menu--dropdown .sub-menu-open > a .sub-arrow i {
    transform: rotate(180deg) !important;
  }

  /* === SUB-MENUS — collapsed by default, full-width === */
  .elementor-nav-menu--dropdown .sub-menu {
    display: none !important;
    position: static !important;
    width: 100% !important;
    background: #f8f8f8 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    list-style: none !important;
  }

  /* Toggle open state */
  .elementor-nav-menu--dropdown .sub-menu-open > .sub-menu {
    display: block !important;
  }

  /* === SUB-MENU ITEMS === */
  .elementor-nav-menu--dropdown .sub-menu li {
    display: block !important;
    width: 100% !important;
  }

  .elementor-nav-menu--dropdown .sub-menu li > a {
    padding: 12px 20px !important;
    font-size: 14px !important;
    background: #f8f8f8 !important;
    justify-content: center !important;
    border-bottom: 1px solid #eee !important;
    color: #333 !important;
  }

  .elementor-nav-menu--dropdown .sub-menu li > a:hover {
    background: #efefef !important;
  }

  /* === NESTED SUB-MENUS (e.g., Areas We Serve > cities) === */
  .elementor-nav-menu--dropdown .sub-menu .sub-menu {
    background: #f2f2f2 !important;
  }

  .elementor-nav-menu--dropdown .sub-menu .sub-menu li > a {
    padding: 12px 20px !important;
    background: #f2f2f2 !important;
    font-size: 13px !important;
    border-bottom: 1px solid #e8e8e8 !important;
  }

  .elementor-nav-menu--dropdown .sub-menu .sub-menu li > a:hover {
    background: #e8e8e8 !important;
  }
}

/* ===== Fix 7: Gallery Grid Layout ===== */
.e-gallery-items {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  position: relative !important;
}

.e-gallery-items .e-gallery-item {
  position: relative !important;
  transform: none !important;
  width: auto !important;
  height: auto !important;
}

.e-gallery-item .e-gallery-image {
  width: 100%;
  aspect-ratio: 4/3;
  background-size: cover !important;
  background-position: center !important;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.e-gallery-item:hover .e-gallery-image {
  transform: scale(1.02);
}

/* Hide gallery overlay text/pagination */
.elementor-gallery-item__overlay { display: none !important; }

@media (max-width: 1024px) {
  .e-gallery-items {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .e-gallery-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Fix 11: Smooth Scroll ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

/* ===== Fix 12: Image Height Matching ===== */
.elementor-section .elementor-row,
.elementor-section > .elementor-container {
  display: flex;
  align-items: stretch;
}

.elementor-widget-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .elementor-widget-image img {
    height: auto;
    max-height: 400px;
  }
}

/* ===== Lightbox Styles ===== */
#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

#lightbox-overlay.active {
  display: flex;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
}

.lb-img-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 88vh;
}

.lb-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  transition: opacity 0.3s;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
}

.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 28px;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.lb-prev:hover, .lb-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-spinner {
  display: none;
  position: absolute;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lb-spin 0.8s linear infinite;
}

@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

/* ===== Carousel freeze override ===== */
/* Remove the freeze rules so carousels can work */

/* ===== Google Reviews Carousel ===== */
#google-reviews-widget {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  font-family: 'Poppins', sans-serif;
}

.gr-header {
  text-align: center;
  margin-bottom: 30px;
}

.gr-google-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.gr-rating-text {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.gr-rating-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gr-score {
  font-size: 32px;
  font-weight: 700;
  color: #333;
}

.gr-stars-header {
  font-size: 24px;
  color: #f4b400;
  letter-spacing: 2px;
}

.gr-count {
  font-size: 14px;
  color: #666;
  width: 100%;
}

/* Carousel layout */
.gr-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gr-carousel-viewport {
  overflow: hidden;
  flex: 1;
  border-radius: 8px;
}

.gr-carousel-track {
  display: flex;
  align-items: stretch;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.gr-card {
  flex: 0 0 calc(100% / 3);
  box-sizing: border-box;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
}

.gr-card > .gr-card-top,
.gr-card > .gr-text {
  background: #fff;
  border-radius: 0;
}

.gr-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 0;
  background: #fff;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.gr-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.gr-name-wrap {
  display: flex;
  flex-direction: column;
}

.gr-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.gr-card-stars {
  font-size: 16px;
  color: #f4b400;
  letter-spacing: 1px;
  line-height: 1;
}

.gr-text {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  padding: 12px 20px 20px;
  margin: 0;
  background: #fff;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  flex: 1;
}

.gr-text.gr-expanded {
  /* No truncation when expanded */
}

.gr-read-more {
  color: #1e73be;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.gr-read-more:hover {
  text-decoration: underline;
}

/* Arrow buttons */
.gr-arrow {
  background: #645B3F;
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gr-arrow:hover {
  background: #C37509;
  transform: scale(1.1);
}

/* Dots navigation */
.gr-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.gr-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s;
}

.gr-dot.active {
  background: #645B3F;
  transform: scale(1.3);
}

.gr-dot:hover {
  background: #C37509;
}

/* Tablet: 2 cards */
@media (max-width: 1024px) {
  .gr-card {
    flex: 0 0 50%;
  }
}

/* Mobile: 1 card */
@media (max-width: 768px) {
  #google-reviews-widget {
    padding: 0 10px;
    margin: 30px auto;
  }

  .gr-card {
    flex: 0 0 100%;
  }

  .gr-arrow {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .gr-score {
    font-size: 26px;
  }

  .gr-stars-header {
    font-size: 20px;
  }

  .gr-rating-text {
    font-size: 17px;
  }
}
