/* ===================================================
   East Coast Vapor Barrier — Custom Overrides
   Fixes for static site converted from WordPress
   =================================================== */

/* --- Fix 1: Sticky Header --- */
.elementor-location-header {
  position: sticky !important;
  top: 0;
  z-index: 9999;
  width: 100% !important;
  background: #fff;
}

.elementor-location-header > .elementor-section.elementor-sticky {
  position: relative !important;
  width: 100% !important;
  top: auto !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.elementor-location-header > .elementor-section.elementor-sticky.elementor-sticky--active {
  position: relative !important;
  width: 100% !important;
}

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

.elementor-location-header.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* --- Fix 3: Desktop Dropdown Flyout --- */
@media (min-width: 1025px) {
  .elementor-nav-menu--main .menu-item-has-children {
    position: relative;
  }

  .elementor-nav-menu--main .menu-item-has-children > .sub-menu {
    display: none;
    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;
    list-style: none;
  }

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

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

  .elementor-nav-menu--main .sub-menu li a:hover {
    background: #1e73be !important;
    color: #fff !important;
  }

  /* Inline caret 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 4: Dropdown width — extra padding so text doesn't touch edge */
  .elementor-nav-menu--main .sub-menu li a {
    min-width: 200px;
    padding-right: 30px !important;
  }
}

/* --- Fix 5: Mobile/Tablet Nav Menu --- */
@media (max-width: 1024px) {
  /* Break dropdown out of the 25% nav column — make ancestors static */
  .elementor-location-header .elementor-column,
  .elementor-location-header .elementor-widget-wrap,
  .elementor-location-header .elementor-widget-nav-menu,
  .elementor-location-header .elementor-widget-container {
    position: static !important;
    overflow: visible !important;
  }

  /* The header section is the positioning context */
  .elementor-location-header > section.elementor-sticky {
    position: relative !important;
    overflow: visible !important;
    min-height: auto !important;
    height: auto !important;
  }

  /* Full-width mobile menu below header */
  nav.elementor-nav-menu--dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    background: #fff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    z-index: 10000;
    max-height: 80vh;
    overflow-y: auto;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Menu items — centered with inline caret */
  nav.elementor-nav-menu--dropdown > ul > li {
    width: 100%;
    list-style: none;
  }

  nav.elementor-nav-menu--dropdown > ul > li > a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 14px 20px !important;
    font-size: 16px;
    color: #333 !important;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    text-align: center;
  }

  /* Items with sub-menus: center the text+caret group */
  nav.elementor-nav-menu--dropdown .menu-item-has-children > a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  /* Caret inline, not on a new line */
  nav.elementor-nav-menu--dropdown .menu-item-has-children > a .sub-arrow {
    display: inline-flex !important;
    align-items: center;
    flex-shrink: 0;
    font-size: 12px;
    transition: transform 0.3s;
  }

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

  /* Sub-menus inside mobile dropdown — COLLAPSED by default, full-width */
  nav.elementor-nav-menu--dropdown .sub-menu {
    display: none !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    background: #f8f8f8 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

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

  /* Sub-menu items — indented, centered */
  nav.elementor-nav-menu--dropdown .sub-menu li {
    width: 100%;
    list-style: none;
  }

  nav.elementor-nav-menu--dropdown .sub-menu a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 12px 20px 12px 40px !important;
    font-size: 14px !important;
    color: #333 !important;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f8f8;
    width: 100%;
  }

  /* Second-level nesting */
  nav.elementor-nav-menu--dropdown .sub-menu .sub-menu a {
    padding-left: 60px !important;
    background: #f2f2f2;
  }

  /* Fix 6: Header relative positioning for dropdown */
  .elementor-location-header {
    position: sticky !important;
  }

  .elementor-location-header > section {
    position: relative !important;
  }
}

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

.elementor-gallery__container.e-gallery-justified .e-gallery-item {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  height: auto !important;
  --item-width: auto !important;
  --item-height: auto !important;
  --item-start: auto !important;
  --item-top: auto !important;
}

.elementor-gallery__container .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;
  min-height: 200px;
}

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

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

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

/* --- Fix 7D: Lightbox --- */
#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); }
}

/* --- 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;
  }
}

/* Hide gallery overlay text (filenames, pagination, descriptions) */
.elementor-gallery-item__overlay {
  pointer-events: none;
}

/* --- Review Carousel --- */
.review-carousel-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0 40px;
}

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

.review-carousel-google-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.review-carousel-rating-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-carousel-rating-score {
  font-size: 22px;
  font-weight: 700;
  color: #222;
}

.review-carousel-stars-small {
  color: #f4b400;
  font-size: 18px;
  letter-spacing: 1px;
  line-height: 1;
}

.review-carousel-count {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
}

/* Swiper container — extra side padding so arrows sit outside cards */
.review-swiper {
  overflow: hidden;
  padding: 10px 50px 10px;
  position: relative;
}

/* Review card */
.review-card {
  background: #EDF8FD;
  border-radius: 12px;
  padding: 28px 24px 24px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
  border: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 220px;
  transition: box-shadow 0.3s ease;
}

.review-card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.review-card-stars {
  color: #f4b400;
  font-size: 20px;
  letter-spacing: 2px;
  margin-bottom: 14px;
  line-height: 1;
}

.review-card-text {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  flex: 1;
  margin-bottom: 16px;
}

.review-card-text .review-truncated {
  display: inline;
}

.review-card-text .review-read-more {
  color: #1e73be;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  margin-left: 4px;
}

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

.review-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f0f0f0;
}

.review-card-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1e73be;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.review-card-name {
  font-weight: 600;
  font-size: 14px;
  color: #222;
}

.review-card-date {
  font-size: 12px;
  color: #999;
}

/* Hide Google source badge next to name */
.review-card-source {
  display: none;
}

/* Navigation arrows — positioned outside the cards */
.review-swiper-prev,
.review-swiper-next {
  color: #1e73be !important;
  background: rgba(255, 255, 255, 0.9) !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

.review-swiper-prev {
  left: 0 !important;
}

.review-swiper-next {
  right: 0 !important;
}

.review-swiper-prev::after,
.review-swiper-next::after {
  font-size: 18px !important;
  font-weight: 700 !important;
}

.review-swiper-prev:hover,
.review-swiper-next:hover {
  background: #1e73be !important;
  color: #fff !important;
}

/* Pagination dots */
.review-swiper-pagination {
  text-align: center;
  margin-top: 20px;
}

.review-swiper-pagination .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: #ccc;
  opacity: 1;
  margin: 0 5px !important;
  transition: background 0.3s, transform 0.3s;
}

.review-swiper-pagination .swiper-pagination-bullet-active {
  background: #1e73be;
  transform: scale(1.2);
}

/* Force review carousel slides to be visible (overrides inline freeze rules) */
.review-swiper .swiper-wrapper {
  overflow: visible !important;
}

.review-swiper .swiper-slide {
  display: block !important;
  flex-shrink: 0 !important;
}

.review-swiper .swiper-slide:not(:first-child) {
  display: block !important;
}

/* Hide pagination dots */
.review-swiper-pagination {
  display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
  .review-swiper .swiper-slide {
    flex: none !important;
    max-width: none !important;
    display: block !important;
  }

  .review-swiper .swiper-slide:not(:first-child) {
    display: block !important;
  }
}

@media (max-width: 768px) {
  .review-carousel-wrapper {
    padding: 10px 0 30px;
  }

  .review-card {
    padding: 22px 18px 20px;
    min-height: 200px;
  }

  .review-swiper-prev,
  .review-swiper-next {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .review-carousel-google-badge {
    padding: 10px 16px;
  }

  .review-carousel-rating-score {
    font-size: 18px;
  }
}

/* ===================================================
   ECVB Forms — clean HTML form styling
   Replaces Gravity Forms / Elementor form markup.
   Wrapper keeps `.gform_wrapper` so existing Elementor
   section background/padding rules still apply.
   =================================================== */

.ecvb-form-wrapper {
  width: 100%;
}

.ecvb-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(5, 146, 162, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: left;
}

.ecvb-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .ecvb-form .form-row {
    grid-template-columns: 1fr;
  }
  .ecvb-form {
    padding: 22px 18px;
  }
}

.ecvb-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ecvb-form .form-group--full {
  width: 100%;
}

.ecvb-form label {
  font-size: 14px;
  font-weight: 600;
  color: #28323c;
  letter-spacing: 0.01em;
}

.ecvb-form .required {
  color: #d11a2a;
  margin-left: 2px;
}

.ecvb-form input[type="text"],
.ecvb-form input[type="email"],
.ecvb-form input[type="tel"],
.ecvb-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  color: #222;
  background-color: #f7f9fb;
  border: 1.5px solid #dde3ea;
  border-radius: 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  box-sizing: border-box;
  line-height: 1.4;
}

.ecvb-form input:focus,
.ecvb-form textarea:focus {
  outline: none;
  border-color: #0592a2;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(5, 146, 162, 0.15);
}

.ecvb-form input[aria-invalid="true"],
.ecvb-form textarea[aria-invalid="true"] {
  border-color: #d11a2a;
  background-color: #fff5f6;
}

.ecvb-form textarea {
  min-height: 130px;
  resize: vertical;
}

.ecvb-form .form-actions {
  margin-top: 6px;
}

.ecvb-form__submit {
  display: inline-block;
  width: 100%;
  padding: 14px 28px;
  background: #0592a2;
  color: #ffffff;
  font-family: Montserrat, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  text-transform: none;
}

.ecvb-form__submit:hover:not(:disabled) {
  background: #047d8c;
  box-shadow: 0 6px 18px rgba(5, 146, 162, 0.25);
}

.ecvb-form__submit:active:not(:disabled) {
  transform: translateY(1px);
}

.ecvb-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ecvb-form__message {
  min-height: 0;
  font-size: 14.5px;
  line-height: 1.5;
}

.ecvb-form__message.is-success {
  padding: 12px 14px;
  border-radius: 10px;
  background-color: #e7f7ef;
  color: #16653a;
  border: 1px solid #b4dec5;
}

.ecvb-form__message.is-error {
  padding: 12px 14px;
  border-radius: 10px;
  background-color: #fdecee;
  color: #962432;
  border: 1px solid #f3c2c8;
}

/* --- What Damages Your Vapor Barrier section --- */
.ecvb-damages-section {
  background: #eaf4f8;
  padding: 70px 20px;
}

.ecvb-damages {
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
}

.ecvb-damages__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: #0e3a5a;
  margin: 0 0 18px;
  line-height: 1.2;
}

.ecvb-damages__rule {
  width: 70px;
  height: 3px;
  background: #0592a2;
  margin: 0 auto 24px;
  border-radius: 2px;
}

.ecvb-damages__intro {
  max-width: 780px;
  margin: 0 auto 44px;
  color: #4b5b6a;
  font-size: 16.5px;
  line-height: 1.65;
}

.ecvb-damages__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: left;
  margin-bottom: 40px;
}

.ecvb-damages__card {
  background: #fff;
  border-radius: 8px;
  padding: 28px 26px;
  border-top: 3px solid #0592a2;
  box-shadow: 0 2px 10px rgba(14, 58, 90, 0.06);
}

.ecvb-damages__card-title {
  font-size: 18px;
  font-weight: 700;
  color: #0e3a5a;
  margin: 0 0 14px;
  line-height: 1.3;
}

.ecvb-damages__card p {
  margin: 0;
  color: #4b5b6a;
  font-size: 15px;
  line-height: 1.6;
}

.ecvb-damages__outro {
  max-width: 780px;
  margin: 0 auto;
  color: #28323c;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 500;
}

.ecvb-damages,
.ecvb-damages p,
.ecvb-damages h2,
.ecvb-damages h3 {
  text-decoration: none;
}

@media (max-width: 900px) {
  .ecvb-damages__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .ecvb-damages-section {
    padding: 50px 16px;
  }
  .ecvb-damages__grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

