/* Saidelong v1.1 fidelity fixes
   Loaded after every original stylesheet so the WordPress/Elementor build behaves like the supplied static source. */

/* 1) Progressive motion: visible is the default. JS opts individual elements into motion.
   This prevents a slow cache/plugin/observer from ever leaving copy or images invisible. */
body.sdl-theme [data-reveal],
body.sdl-theme .reveal-image{
  opacity:1!important;
  transform:none!important;
}
html.sdl-motion-active body.sdl-theme [data-reveal].sdl-pending{
  opacity:0!important;
  transform:translate3d(0,18px,0)!important;
}
html.sdl-motion-active body.sdl-theme [data-reveal="left"].sdl-pending{transform:translate3d(-18px,8px,0)!important}
html.sdl-motion-active body.sdl-theme [data-reveal="right"].sdl-pending{transform:translate3d(18px,8px,0)!important}
html.sdl-motion-active body.sdl-theme .reveal-image.sdl-pending{
  opacity:0!important;
  transform:scale(1.018)!important;
}
body.sdl-theme .hero-facts-grid,
body.sdl-theme .fact{opacity:1!important;transform:none!important}
html.sdl-motion-active body.sdl-theme .hero:not(.facts-loaded) .hero-facts-grid,
html.sdl-motion-active body.sdl-theme .hero:not(.facts-loaded) .fact{opacity:0!important}
body.elementor-editor-active [data-reveal],
body.elementor-editor-active .reveal-image,
body.elementor-editor-preview [data-reveal],
body.elementor-editor-preview .reveal-image{
  opacity:1!important;
  transform:none!important;
}

/* 2) Header mega menu: keep the exact full-width four-card system from the supplied source. */
body.sdl-theme .site-header{overflow:visible}
body.sdl-theme .nav-product{position:static}
body.sdl-theme .nav-dropdown{
  top:calc(100% - 2px);
  left:0;
  right:0;
  width:100%;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  padding:24px var(--side) 28px;
  border-top:3px solid #ff641d;
  background:#f3f2ee;
  box-shadow:0 26px 60px rgba(11,15,13,.2);
}
body.sdl-theme .nav-dropdown a{
  min-width:0;
  background:#fff;
  color:#202522!important;
  border:1px solid rgba(31,35,33,.11)!important;
}
body.sdl-theme .nav-dropdown a::before{
  content:"";
  display:block;
  width:100%;
  aspect-ratio:16/8.6;
  background-position:center;
  background-size:cover;
  transition:transform .55s cubic-bezier(.2,.7,.2,1),filter .35s ease;
}
/* These URLs are relative to assets/css/fidelity-fixes.css. */
body.sdl-theme .nav-dropdown a::before{background-image:var(--sdl-mega-image)!important;}
body.sdl-theme .nav-dropdown a:nth-of-type(1)::before,
body.sdl-theme .nav-dropdown a:nth-of-type(2)::before,
body.sdl-theme .nav-dropdown a:nth-of-type(3)::before{background-size:contain!important;background-repeat:no-repeat!important;background-color:#fff!important;}
body.sdl-theme .nav-dropdown a:nth-of-type(4)::before{background-size:cover!important;background-repeat:no-repeat!important;}
body.sdl-theme .nav-dropdown a:hover::before,
body.sdl-theme .nav-dropdown a:focus-visible::before{transform:scale(1.035);filter:contrast(1.04)}
body.sdl-theme .nav-dropdown strong{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  min-height:68px;padding:17px 18px;font-size:17px;line-height:1.22;font-weight:650;
}
body.sdl-theme .nav-dropdown strong::after{content:"↗";flex:0 0 auto;color:#ff641d;font-size:15px;font-weight:400}
body.sdl-theme .nav-dropdown span{display:none}

/* 3) The quote modal is deliberately restored to the centered source design. */
body.sdl-theme .quote-modal{
  position:fixed!important;
  inset:0!important;
  z-index:140!important;
  display:grid!important;
  place-items:center!important;
  padding:24px!important;
  opacity:0!important;
  visibility:visible!important;
  pointer-events:none!important;
  background:transparent!important;
  transition:opacity .24s var(--ease)!important;
}
body.sdl-theme .quote-modal.is-open{opacity:1!important;pointer-events:auto!important}
body.sdl-theme .quote-backdrop{
  position:absolute!important;inset:0!important;
  background:rgba(13,17,14,.72)!important;
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
}
body.sdl-theme .quote-dialog{
  position:relative!important;
  inset:auto!important;
  z-index:1!important;
  width:min(760px,100%)!important;
  max-width:760px!important;
  max-height:min(820px,calc(100vh - 48px))!important;
  overflow:auto!important;
  background:#fff!important;
  color:var(--ink)!important;
  border-radius:8px!important;
  padding:34px!important;
  box-shadow:0 28px 90px rgba(0,0,0,.25)!important;
  transform:translateY(18px) scale(.985)!important;
  transition:transform .28s var(--ease)!important;
}
body.sdl-theme .quote-modal.is-open .quote-dialog{transform:none!important}
body.sdl-theme .quote-close{
  position:absolute!important;top:18px!important;right:18px!important;
  width:38px!important;height:38px!important;
  border:1px solid #dfe3dc!important;border-radius:8px!important;
  background:#fff!important;color:var(--ink)!important;
  cursor:pointer!important;font-size:22px!important;line-height:1!important;
  display:grid!important;place-items:center!important;padding:0!important;
}
body.sdl-theme .quote-dialog h2{
  margin:0!important;
  font-size:clamp(30px,4vw,52px)!important;
  line-height:1.02!important;
  letter-spacing:-.05em!important;
  font-weight:500!important;
  text-transform:uppercase!important;
  max-width:560px!important;
}
body.sdl-theme .quote-dialog>p{
  margin:12px 0 0!important;
  color:var(--muted)!important;
  font-size:14px!important;
  max-width:520px!important;
}
body.sdl-theme .quote-form{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:18px 16px!important;
  margin-top:28px!important;
}
body.sdl-theme .quote-form label{
  display:block!important;
  color:#3f4540!important;
  font-size:14px!important;
  line-height:1.35!important;
  font-weight:500!important;
}
body.sdl-theme .quote-form input:not([type="hidden"]):not(.sdl-hp),
body.sdl-theme .quote-form textarea{
  display:block!important;
  width:100%!important;
  margin-top:8px!important;
  padding:13px 0 12px!important;
  border:0!important;
  border-bottom:1px solid #b9c0b7!important;
  border-radius:0!important;
  background:transparent!important;
  color:var(--ink)!important;
  box-shadow:none!important;
  font-size:16px!important;
  line-height:1.45!important;
  outline:none!important;
}
body.sdl-theme .quote-form input:focus,
body.sdl-theme .quote-form textarea:focus{border-color:var(--orange)!important}
body.sdl-theme .quote-form textarea{min-height:112px!important;resize:vertical!important}
body.sdl-theme .quote-form .full{grid-column:1/-1!important}
body.sdl-theme .quote-submit{margin-top:6px!important;border-radius:6px!important}
body.sdl-theme .sdl-hp{
  position:absolute!important;left:-10000px!important;top:auto!important;
  width:1px!important;height:1px!important;overflow:hidden!important;
  opacity:0!important;pointer-events:none!important;
}

/* Source custom-select treatment used by both the homepage inquiry and RFQ modal. */
body.sdl-theme .form-label{
  display:block!important;margin:0 0 7px!important;color:#4b514c!important;
  font-size:14px!important;line-height:1.3!important;font-weight:500!important;
}
body.sdl-theme .custom-select{position:relative!important;width:100%!important;z-index:6!important}
body.sdl-theme .custom-select.is-open{z-index:30!important}
body.sdl-theme .custom-select-trigger{
  width:100%!important;height:50px!important;padding:0 4px 0 0!important;
  border:0!important;border-bottom:1px solid #aeb5ac!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;color:var(--ink)!important;
  display:flex!important;align-items:center!important;justify-content:space-between!important;gap:18px!important;
  font-size:17px!important;line-height:1!important;font-weight:400!important;text-align:left!important;cursor:pointer!important;
  outline:none!important;
  transition:border-color .32s cubic-bezier(.22,.61,.36,1),color .32s cubic-bezier(.22,.61,.36,1)!important;
}
body.sdl-theme .custom-select-trigger:hover{border-color:#6d746d!important;transform:none!important}
body.sdl-theme .custom-select.is-open .custom-select-trigger,
body.sdl-theme .custom-select-trigger:focus-visible{border-color:var(--orange)!important;box-shadow:none!important}
body.sdl-theme .custom-select-chevron{
  position:relative!important;width:11px!important;height:11px!important;flex:0 0 11px!important;margin-right:5px!important;
  border-right:1.5px solid #555c56!important;border-bottom:1.5px solid #555c56!important;
  transform:rotate(45deg) translateY(-2px)!important;
  transition:transform .42s cubic-bezier(.22,.61,.36,1)!important;
}
body.sdl-theme .custom-select.is-open .custom-select-chevron{transform:rotate(225deg) translate(-1px,-1px)!important}
body.sdl-theme .custom-select-menu{
  position:absolute!important;left:0!important;right:0!important;top:calc(100% + 8px)!important;
  padding:7px!important;border:1px solid #d5dad2!important;border-radius:8px!important;
  background:rgba(255,255,255,.98)!important;box-shadow:0 20px 55px rgba(24,29,25,.13)!important;
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  opacity:0!important;visibility:hidden!important;pointer-events:none!important;
  transform:translate3d(0,-8px,0) scale(.985)!important;transform-origin:top center!important;
  transition:opacity .26s ease,transform .38s cubic-bezier(.22,.61,.36,1),visibility .26s ease!important;
}
body.sdl-theme .custom-select.is-open .custom-select-menu{
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important;
}
body.sdl-theme .custom-select-option{
  width:100%!important;min-height:44px!important;padding:0 12px!important;border:0!important;border-radius:5px!important;
  background:transparent!important;color:#2a2f2b!important;display:flex!important;align-items:center!important;
  font-size:16px!important;line-height:1.25!important;font-weight:400!important;text-align:left!important;cursor:pointer!important;
}
body.sdl-theme .custom-select-option:hover,
body.sdl-theme .custom-select-option:focus-visible{padding-left:16px!important;background:#f1f3ee!important;color:#202420!important;outline:none!important}
body.sdl-theme .custom-select-option.is-selected{background:#1f2421!important;color:#fff!important;font-weight:400!important}

/* 4) Elementor wrapper neutrality: the component itself controls its original DOM/layout. */
body.elementor-page .sdl-section-shell,
body.elementor-page .sdl-section-shell.e-con,
body.elementor-page .sdl-section-shell>.e-con-inner{
  width:100%!important;max-width:none!important;margin:0!important;padding:0!important;gap:0!important;
}
body.elementor-page [class*="elementor-widget-sdl-"]>.elementor-widget-container{
  width:100%!important;max-width:none!important;margin:0!important;padding:0!important;
}

@media(max-width:920px){
  body.sdl-theme .nav-dropdown{
    position:static;display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
    width:100%;margin:2px 0 8px;padding:8px;border:1px solid rgba(31,35,33,.1);box-shadow:none;
    opacity:1;visibility:visible;pointer-events:auto;transform:none;
  }
  body.sdl-theme .nav-product.is-open .nav-dropdown{display:grid}
  body.sdl-theme .nav-dropdown a::before{aspect-ratio:16/9}
  body.sdl-theme .nav-dropdown strong{min-height:54px;padding:11px 12px;font-size:13px}
}

@media(max-width:640px){
  body.sdl-theme .quote-modal{padding:12px!important}
  body.sdl-theme .quote-dialog{padding:26px 18px 22px!important;border-radius:2px!important;max-height:calc(100vh - 24px)!important}
  body.sdl-theme .quote-form{grid-template-columns:1fr!important}
  body.sdl-theme .quote-form .full{grid-column:auto!important}
  body.sdl-theme .form-label{margin-bottom:5px!important;font-size:13px!important}
  body.sdl-theme .custom-select-trigger{height:46px!important;font-size:16px!important}
  body.sdl-theme .custom-select-menu{top:calc(100% + 6px)!important}
  body.sdl-theme .custom-select-option{min-height:42px!important;font-size:15px!important}
}

/* 5) Homepage Why Choose fidelity + editable background. */
body.sdl-theme .why-choose{position:relative!important;overflow:hidden!important;background:#1d231f!important;color:#fff!important;}
body.sdl-theme .why-choose::before{content:""!important;position:absolute!important;inset:0!important;background:linear-gradient(90deg,rgba(18,23,20,.97),rgba(18,23,20,.84)),var(--sdl-why-bg) var(--sdl-why-bg-pos,center center)/cover no-repeat!important;opacity:var(--sdl-why-overlay,.82)!important;pointer-events:none!important;}
body.sdl-theme .why-choose>.wrap{position:relative!important;z-index:1!important;}
body.sdl-theme .why-layout{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:0 48px!important;align-items:stretch!important;}
body.sdl-theme .why-head{grid-column:1!important;grid-row:1!important;display:block!important;margin:0 0 24px!important;}
body.sdl-theme .why-head .title-lg{max-width:650px!important;margin:0!important;}
body.sdl-theme .why-grid{grid-column:1!important;grid-row:2!important;display:grid!important;grid-template-columns:1fr!important;align-content:start!important;border-top:1px solid rgba(255,255,255,.18)!important;border-bottom:0!important;}
body.sdl-theme .why-card{position:relative!important;min-height:0!important;padding:24px 42px 24px 0!important;color:#fff!important;border-right:0!important;border-bottom:1px solid rgba(255,255,255,.18)!important;background:transparent!important;}
body.sdl-theme .why-card:hover{background:rgba(255,255,255,.035)!important;}
body.sdl-theme .why-card small{display:block!important;margin:0 0 10px!important;color:var(--orange)!important;font-size:11px!important;line-height:1.25!important;font-weight:750!important;letter-spacing:.12em!important;text-transform:uppercase!important;}
body.sdl-theme .why-card h3{max-width:520px!important;margin:0!important;font-size:clamp(24px,2vw,32px)!important;line-height:1.08!important;letter-spacing:-.035em!important;text-transform:none!important;}
body.sdl-theme .why-card p{max-width:100%!important;margin:14px 0 0!important;color:rgba(255,255,255,.67)!important;font-size:16px!important;line-height:1.65!important;}
body.sdl-theme .why-card .why-arrow{position:absolute!important;right:10px!important;top:50%!important;bottom:auto!important;transform:translateY(-50%)!important;color:var(--orange)!important;font-size:22px!important;}
body.sdl-theme .why-card:hover .why-arrow{transform:translate(4px,calc(-50% - 4px))!important;}
body.sdl-theme .why-photo{grid-column:2!important;grid-row:1/3!important;position:relative!important;min-height:480px!important;height:100%!important;margin:0!important;overflow:hidden!important;background:#252b27!important;}
body.sdl-theme .why-photo img{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important;}
@media(max-width:1000px){body.sdl-theme .why-layout{grid-template-columns:1fr!important;gap:0!important}body.sdl-theme .why-head{grid-column:1!important;grid-row:auto!important}body.sdl-theme .why-grid{grid-column:1!important;grid-row:auto!important}body.sdl-theme .why-photo{grid-column:1!important;grid-row:auto!important;height:360px!important;min-height:0!important;margin-top:28px!important}}
@media(max-width:600px){body.sdl-theme .why-card{padding:24px 42px 24px 0!important}body.sdl-theme .why-card p{font-size:14px!important}body.sdl-theme .why-photo{height:280px!important}}

/* Final v4 Factory / Quality reveal safety. */
body.sdl-theme.factory-page .reveal,body.sdl-theme.quality-page .reveal{opacity:1;transform:none;}
html.sdl-motion-active body.sdl-theme.factory-page .reveal.sdl-pending,html.sdl-motion-active body.sdl-theme.quality-page .reveal.sdl-pending{opacity:0;transform:translate3d(0,18px,0);}
body.sdl-theme.factory-page .reveal.is-visible,body.sdl-theme.quality-page .reveal.is-visible,body.sdl-theme.quality-page .reveal.in{opacity:1!important;transform:none!important;}

/* Resources are native WordPress Posts in v2.3. */
body.sdl-theme.resources-page .resources-banner{
  background-image:linear-gradient(90deg,rgba(15,20,17,.76),rgba(15,20,17,.28)),url('../source/resources/banner.webp')!important;
  background-size:cover!important;
  background-position:center 58%!important;
}
body.sdl-theme .sdl-pagination{margin-top:40px;border-top:1px solid var(--line);padding-top:22px}
body.sdl-theme .sdl-pagination ul{display:flex;gap:8px;list-style:none;margin:0;padding:0;flex-wrap:wrap}
body.sdl-theme .sdl-pagination a,body.sdl-theme .sdl-pagination span{display:grid;place-items:center;min-width:38px;height:38px;padding:0 10px;border:1px solid var(--line);font-size:11px}
body.sdl-theme .sdl-pagination .current{background:var(--ink);color:#fff;border-color:var(--ink)}
body.sdl-theme.resource-post-page .resource-featured-image{display:block;width:100%;max-height:520px;object-fit:cover;margin:0 0 46px}
