/*
 * V3.20 - Frontend Sales UX Optimization
 * Lightweight overlay for the public sales frontend. Scoped by .ifu-sales-page,
 * so it does not change admin, API or support pages.
 */
:root{
  --ifu-blue:#0b3f7f;
  --ifu-blue-strong:#083875;
  --ifu-orange:#ff8a00;
  --ifu-orange-soft:#fff4e6;
  --ifu-ink:#0f1f35;
  --ifu-muted:#64748b;
  --ifu-line:#dfe9f3;
  --ifu-bg:#eef7ff;
  --ifu-card:#ffffff;
  --ifu-radius:24px;
  --ifu-shadow:0 22px 60px rgba(15,31,53,.10);
  --ifu-ease:cubic-bezier(.22,1,.36,1);
}

html{scroll-behavior:smooth;}
body.ifu-sales-page{
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  background:linear-gradient(180deg,#f3fbff 0%,#eef7ff 46%,#f7fbff 100%);
}
body.ifu-sales-page *{box-sizing:border-box;}

/* Header / navigation: keep actions clear, avoid active duplicate CTA. */
body.ifu-sales-page :is(header,.site-header,.app-header,.landing-header,.topbar,.navbar,.nav){
  backdrop-filter:saturate(1.08) blur(10px);
  -webkit-backdrop-filter:saturate(1.08) blur(10px);
}
body.ifu-sales-page :is(header,.site-header,.app-header,.landing-header,.topbar,.navbar) :is(a,button,.btn){
  min-height:42px;
}
body.ifu-sales-page .ifu-hide-self-link{display:none!important;}

/* Reduce the unused visual gap above the quick quote area. */
body.ifu-sales-page :is(.hero,.hero-section,.landing-hero,.home-hero,.page-hero){
  padding-top:clamp(30px,5vw,68px)!important;
  padding-bottom:clamp(28px,4.8vw,62px)!important;
  min-height:auto!important;
}
body.ifu-sales-page :is(.hero,.hero-section,.landing-hero,.home-hero,.page-hero) + :is(section,.section,.quote-section,.quick-quote,#quote,#quoteForm,#quickQuote),
body.ifu-sales-page :is(.quote-section,.quick-quote,#quote,#quoteForm,#quickQuote,.quote-card,.pricing-card){
  margin-top:clamp(10px,2.2vw,28px)!important;
}
body.ifu-sales-page .ifu-quote-anchor{
  scroll-margin-top:96px;
}

/* Quote/product card polish. */
body.ifu-sales-page :is(.quote-card,.quick-quote,.quote-section .card,.pricing-card,.checkout-card,.product-card,.plan-card,.form-card){
  border:1px solid rgba(223,233,243,.96);
  box-shadow:var(--ifu-shadow);
  border-radius:var(--ifu-radius);
}
body.ifu-sales-page :is(.quote-card,.quick-quote,.pricing-card,.form-card) :is(input,select,textarea){
  min-height:48px;
  border-radius:16px;
  transition:border-color .18s var(--ifu-ease),box-shadow .18s var(--ifu-ease),background .18s var(--ifu-ease);
}
body.ifu-sales-page :is(.quote-card,.quick-quote,.pricing-card,.form-card) :is(input,select,textarea):focus{
  outline:0;
  border-color:rgba(15,92,168,.56)!important;
  box-shadow:0 0 0 4px rgba(15,92,168,.10)!important;
}

/* Button system: one visual language, centered primary CTA, smoother tap/hover. */
body.ifu-sales-page :is(a,button,.btn,.button,[role="button"]){
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
body.ifu-sales-page :is(.btn,.button,button[type="submit"],a[class*="btn"],a[class*="button"],.cta,.cta-button){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:46px;
  border-radius:999px;
  font-weight:800;
  letter-spacing:-.01em;
  line-height:1.1;
  text-decoration:none!important;
  transition:transform .18s var(--ifu-ease),box-shadow .18s var(--ifu-ease),background .18s var(--ifu-ease),border-color .18s var(--ifu-ease),opacity .18s var(--ifu-ease);
}
body.ifu-sales-page :is(.btn,.button,button[type="submit"],a[class*="btn"],a[class*="button"],.cta,.cta-button):hover{
  transform:translateY(-1px);
}
body.ifu-sales-page :is(.btn,.button,button[type="submit"],a[class*="btn"],a[class*="button"],.cta,.cta-button):active{
  transform:translateY(0) scale(.985);
}
body.ifu-sales-page :is(.btn,.button,button,a,[role="button"]):focus-visible{
  outline:4px solid rgba(255,138,0,.24);
  outline-offset:3px;
}
body.ifu-sales-page :is(.btn-primary,.primary,.cta-primary,button[type="submit"],.btn--primary){
  background:linear-gradient(135deg,#ff8a00,#ffb13b)!important;
  color:#fff!important;
  border-color:transparent!important;
  box-shadow:0 16px 34px rgba(255,138,0,.24);
}
body.ifu-sales-page :is(.btn-outline,.btn-secondary,.secondary,.cta-secondary,.btn--secondary){
  background:rgba(255,255,255,.72)!important;
  color:var(--ifu-blue)!important;
  border:1px solid rgba(191,211,231,.96)!important;
  box-shadow:0 12px 28px rgba(15,31,53,.05);
}
body.ifu-sales-page :is(.hero,.hero-section,.landing-hero,.home-hero) :is(.btn,.button,.cta,a[class*="btn"]):nth-of-type(n+4){
  display:none!important;
}

/* Product/quote horizontal choices become easier to scan and tap. */
body.ifu-sales-page :is(.product-tabs,.tabs,.category-tabs,.quote-tabs,.segmented-control){
  display:flex;
  gap:10px;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scroll-snap-type:x proximity;
  -webkit-overflow-scrolling:touch;
  padding-bottom:4px;
}
body.ifu-sales-page :is(.product-tabs,.tabs,.category-tabs,.quote-tabs,.segmented-control) > *{
  flex:0 0 auto;
  scroll-snap-align:start;
}
body.ifu-sales-page :is(.product-tabs,.tabs,.category-tabs,.quote-tabs,.segmented-control)::-webkit-scrollbar{height:0;}

/* Dedicated mobile sales action bar. Hidden when the quote form is visible. */
.ifu-mobile-salesbar{
  position:fixed;
  left:12px;
  right:12px;
  bottom:calc(12px + env(safe-area-inset-bottom,0px));
  z-index:2147482500;
  display:none;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:center;
  padding:10px;
  border:1px solid rgba(223,233,243,.98);
  border-radius:22px;
  background:rgba(255,255,255,.92);
  box-shadow:0 18px 42px rgba(15,31,53,.16);
  backdrop-filter:blur(14px) saturate(1.1);
  -webkit-backdrop-filter:blur(14px) saturate(1.1);
  transform:translateY(0);
  transition:opacity .18s var(--ifu-ease),transform .18s var(--ifu-ease);
}
.ifu-salesbar-copy{min-width:0;padding-left:4px;}
.ifu-salesbar-title{font-size:13px;font-weight:900;color:var(--ifu-ink);line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ifu-salesbar-sub{font-size:11.5px;color:var(--ifu-muted);line-height:1.2;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ifu-salesbar-actions{display:flex;gap:8px;align-items:center;}
.ifu-salesbar-btn{
  min-height:42px;
  padding:0 15px;
  border-radius:999px;
  border:1px solid rgba(191,211,231,.92);
  background:#fff;
  color:var(--ifu-blue);
  font-weight:900;
  text-decoration:none!important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 22px rgba(15,31,53,.06);
}
.ifu-salesbar-btn--primary{
  background:linear-gradient(135deg,#ff8a00,#ffb13b);
  color:#fff;
  border-color:transparent;
  box-shadow:0 14px 28px rgba(255,138,0,.28);
}
body.ifu-sales-page.ifu-quote-visible .ifu-mobile-salesbar{
  opacity:0;
  pointer-events:none;
  transform:translateY(14px);
}

/* Support widget should not fight the salesbar on mobile. */
@media(max-width:760px){
  body.ifu-sales-page{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px));}
  body.ifu-sales-page .ifu-mobile-salesbar{display:grid;}
  body.ifu-sales-page :is(.hero,.hero-section,.landing-hero,.home-hero,.page-hero){
    padding-top:24px!important;
    padding-bottom:24px!important;
  }
  body.ifu-sales-page :is(.hero h1,.hero-title,.landing-hero h1,.home-hero h1){
    font-size:clamp(30px,8.5vw,42px)!important;
    line-height:1.05!important;
    letter-spacing:-.045em;
    margin-bottom:12px!important;
  }
  body.ifu-sales-page :is(.hero p,.hero-subtitle,.hero-desc,.landing-hero p){
    font-size:15px!important;
    line-height:1.55!important;
    margin-bottom:16px!important;
  }
  body.ifu-sales-page :is(.hero,.hero-section,.landing-hero,.home-hero) :is(.btn,.button,.cta,a[class*="btn"]){
    width:100%;
    min-height:50px;
    margin-top:8px;
  }
  body.ifu-sales-page :is(.quote-card,.quick-quote,.quote-section .card,.pricing-card,.checkout-card,.product-card,.plan-card,.form-card){
    border-radius:22px;
    box-shadow:0 16px 42px rgba(15,31,53,.09);
  }
  body.ifu-sales-page :is(.quote-section,.quick-quote,#quote,#quoteForm,#quickQuote,.quote-card,.pricing-card){
    margin-top:12px!important;
  }
  body.ifu-sales-page :is(.grid,.row,.quote-grid,.products-grid,.checkout-grid){
    gap:14px!important;
  }
  body.ifu-sales-page :is(.form-actions,.actions,.cta-row,.button-row){
    display:grid!important;
    grid-template-columns:1fr;
    gap:10px!important;
  }
  body.ifu-sales-page :is(.form-actions,.actions,.cta-row,.button-row) :is(.btn,.button,button,a[class*="btn"]){
    width:100%;
  }
  body.ifu-sales-page .isw{bottom:94px!important;}
}

@media(max-width:420px){
  .ifu-mobile-salesbar{grid-template-columns:1fr;}
  .ifu-salesbar-actions{display:grid;grid-template-columns:1fr 1fr;}
  .ifu-salesbar-btn{min-height:40px;padding:0 11px;font-size:13px;}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  body.ifu-sales-page *, .ifu-mobile-salesbar{transition:none!important;animation:none!important;}
}
