/*
 * West Suburban Tree Care: plain CSS replacements for Elementor Pro widgets.
 * Elementor Pro's JavaScript was removed (4 of its lazy-loaded bundles were missing
 * and 404ed on every page). This file replaces what that JS used to do.
 * Breakpoints mirror the site's Elementor settings:
 * laptop <=1366, tablet_extra <=1200, tablet <=1024, mobile_extra <=880, mobile <=767.
 */

/* 1. Carousels (nested-carousel, loop-carousel): CSS scroll-snap rows.
 *    Per-widget slide counts and gaps come from inline custom properties
 *    (--wstc-d/l/te/t/me/m and --wstc-gd/gl/gte/gt/gme/gm) written from the
 *    widget's own Elementor settings. */
.wstc-carousel{--wstc-per:var(--wstc-d,3);--wstc-gap:var(--wstc-gd,0px)}
@media (max-width:1366px){.wstc-carousel{--wstc-per:var(--wstc-l,3);--wstc-gap:var(--wstc-gl,0px)}}
@media (max-width:1200px){.wstc-carousel{--wstc-per:var(--wstc-te,3);--wstc-gap:var(--wstc-gte,0px)}}
@media (max-width:1024px){.wstc-carousel{--wstc-per:var(--wstc-t,2);--wstc-gap:var(--wstc-gt,0px)}}
@media (max-width:880px){.wstc-carousel{--wstc-per:var(--wstc-me,2);--wstc-gap:var(--wstc-gme,0px)}}
@media (max-width:767px){.wstc-carousel{--wstc-per:var(--wstc-m,1);--wstc-gap:var(--wstc-gm,0px)}}
.wstc-carousel .swiper{overflow:hidden}
.wstc-carousel .swiper-wrapper{
  display:flex;gap:var(--wstc-gap);
  overflow-x:auto;overflow-y:hidden;
  scroll-snap-type:x mandatory;scroll-behavior:smooth;
  overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;
  scrollbar-width:none;transform:none!important;
}
.wstc-carousel .swiper-wrapper::-webkit-scrollbar{display:none}
.wstc-carousel .swiper-wrapper>style{display:none}
.wstc-carousel .swiper-slide{
  flex:0 0 calc((100% - (var(--wstc-per) - 1) * var(--wstc-gap)) / var(--wstc-per));
  width:auto!important;max-width:none;margin:0!important;
  scroll-snap-align:start;height:auto;
}
.wstc-carousel .elementor-swiper-button{cursor:pointer;user-select:none}
.wstc-carousel .elementor-swiper-button.wstc-hidden,
.wstc-carousel .swiper-pagination.wstc-hidden{display:none}
.wstc-carousel .swiper-pagination{position:static!important;left:auto!important;transform:none!important;display:flex;justify-content:center;gap:6px;margin-top:20px;width:100%!important}
.wstc-carousel .swiper-pagination-bullet{border:0;padding:0;cursor:pointer}
.wstc-carousel .swiper-pagination-bullet:focus-visible,
.wstc-carousel .elementor-swiper-button:focus-visible{outline:2px solid #F7941D;outline-offset:2px}
@media (prefers-reduced-motion:reduce){.wstc-carousel .swiper-wrapper{scroll-behavior:auto}}

/* 2. Lead-form modal (was Elementor Pro popup #1227). Native <dialog>;
 *    links fall back to /get-pricing/ (same Rivetflo form) without JS. */
.wstc-modal{
  width:650px;max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);
  padding:0;border:0;border-radius:25px;overflow:auto;background:#fff;
  box-shadow:2px 8px 23px 3px rgba(0,0,0,.2);
}
.wstc-modal::backdrop{background:rgba(0,0,0,.8)}
.wstc-modal .elementor-1227{width:100%}
dialog.wstc-modal button.wstc-modal__close{
  position:sticky;top:12px;float:right;margin:12px 12px -48px 0;z-index:5;
  display:flex;align-items:center;justify-content:center;
  width:36px;height:36px;padding:0;border:0;border-radius:50%;
  background:#fff;color:#CF0000;font-size:18px;line-height:1;cursor:pointer;
  box-shadow:0 1px 4px rgba(0,0,0,.2);
}
dialog.wstc-modal button.wstc-modal__close:hover,
dialog.wstc-modal button.wstc-modal__close:focus{background:#fff;color:#FF0000}
dialog.wstc-modal button.wstc-modal__close:focus-visible{outline:2px solid #F7941D;outline-offset:2px}
dialog.wstc-modal button.wstc-modal__close svg{width:1em;height:1em;fill:currentColor}
html.wstc-modal-open{overflow:hidden}

/* 3. /contact/ side card (was Elementor Pro "sticky" on desktop/laptop/tablet). */
@media (min-width:881px){
  .elementor-element.elementor-element-cb43afa{position:sticky;top:160px;align-self:flex-start}
}
