/* ==========================================================================
   Public website fixes + mobile performance (loaded after liquid.css).
   ========================================================================== */

/* ---- Home: hero spacing ------------------------------------------------- */
.hero .hero-copy .hero-title { margin-bottom: clamp(14px, 2.2vw, 22px); }
.hero .hero-copy .hero-lede { margin-top: 0; margin-bottom: 8px; }
@media (max-width: 640px) {
  /* tag line above the title: one tidy line instead of a two-line pill */
  .hero .hero-copy .eyebrow {
    font-size: 11px;
    letter-spacing: .08em;
    line-height: 1.35;
    padding: 8px 14px;
    gap: 8px;
  }
}

/* ---- Section eyebrows: never stuck half-faded ---------------------------- */
@media (prefers-reduced-motion: reduce) {
  .section .section-head .eyebrow { opacity: 1; letter-spacing: .14em; transition: none; }
}
.section .section-head .eyebrow { color: #1d4ed8; }

/* ---- Desktop nav: readable Login button --------------------------------- */
:root .site-nav .desktop-nav a.btn.small {
  background: linear-gradient(180deg, #2f6fea, #1d4ed8) !important;
  color: #fff !important;
  border: 1px solid rgba(29, 78, 216, .7) !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .30) !important;
  text-shadow: none;
}
:root .site-nav .desktop-nav a.btn.small::after { opacity: .28 !important; }
:root .site-nav .desktop-nav a.btn.small:hover { filter: brightness(1.08); }

/* ---- Home: featured products with photos -------------------------------- */
.section .home-product-grid {
  padding: 0;
  margin-top: 8px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.home-product-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  gap: 0;
}
.home-product-card .hp-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  border-bottom: 1px solid #e2e8f0;
}
.home-product-card .hp-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  mix-blend-mode: multiply;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.home-product-card:hover .hp-media img { transform: scale(1.05); }
.home-product-card .hp-placeholder {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
  background: #dbeafe; color: #1d4ed8; font-size: 28px; font-weight: 800;
}
.home-product-card .hp-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.home-product-card .hp-category { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: #64748b; }
.home-product-card h3 { font-size: 17px; line-height: 1.3; margin: 0; min-height: 0; }
.home-product-card p { font-size: 13.5px; line-height: 1.5; margin: 0; color: #475569; }
.home-product-card .hp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.home-product-card .hp-foot strong { color: #1d4ed8; font-size: 16px; }
.home-product-card .hp-foot .hp-quote { font-size: 13px; color: #b45309; }
.home-product-card .hp-more { font-size: 13px; font-weight: 700; color: #1d4ed8; opacity: .75; transition: transform .25s ease, opacity .25s ease; }
.home-product-card:hover .hp-more { opacity: 1; transform: translateX(3px); }
@media (max-width: 960px) {
  .section .home-product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important; }
}
@media (max-width: 640px) {
  .section .home-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
  .home-product-card .hp-body { padding: 12px 12px 14px; gap: 4px; }
  .home-product-card h3 { font-size: 15px; }
  .home-product-card p { display: none; }
  .home-product-card .hp-foot { flex-wrap: wrap; }
  .home-product-card .hp-foot strong { font-size: 15px; }
  .home-product-card .hp-more { display: none; }
}

/* ---- Floating "Request Quote": compact on phones, never over the banner --- */
@media (max-width: 640px) {
  :root .floating-quote-btn {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  :root .floating-quote-btn .fqb-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  :root .floating-quote-btn .fqb-icon { margin: 0; font-size: 22px; }
  /* keep the last lines of each page clear of the button */
  .site-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
body.has-install-banner .floating-quote-btn { opacity: 0; pointer-events: none; }

/* ---- Home on phones: swipe rows instead of a 16-screen scroll ----------- */
@media (max-width: 640px) {
  /* !important: website.css forces these grids to one column with !important below 960px */
  .mfg-card-grid,
  .ind-card-grid,
  .cap-grid,
  .why-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none !important;
    grid-auto-columns: 84%;
    gap: 14px !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1.25rem;
    margin-inline: -1.25rem;
    padding: 4px 1.25rem 18px !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .mfg-card-grid::-webkit-scrollbar, .ind-card-grid::-webkit-scrollbar,
  .cap-grid::-webkit-scrollbar, .why-grid::-webkit-scrollbar { display: none; }
  .mfg-card-grid > *, .ind-card-grid > *, .cap-grid > *, .why-grid > * {
    scroll-snap-align: start;
    min-width: 0;
    /* cards arrive already placed: sideways slide-ins fight horizontal scrolling */
    transform: none !important;
    opacity: 1 !important;
  }
  .mfg-card .card-details, .ind-card .card-details { margin-top: 10px; }
}
.swipe-hint { display: none; }
@media (max-width: 640px) {
  .swipe-hint {
    display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; font-size: 12.5px; font-weight: 600; color: #64748b;
  }
  .swipe-hint::after { content: "→"; animation: aew-nudge 1.6s ease-in-out infinite; }
}
@keyframes aew-nudge { 50% { transform: translateX(4px); } }

/* ---- Phones & touch screens: lighter effects, smoother scrolling -------- */
@media (max-width: 900px), (hover: none) {
  /* purely decorative layers */
  .hero-orbs, .hero-scan, .hero-sparks, .cta-mesh { display: none !important; }
  .hero-media { animation: none; will-change: auto; }
  /* endless decorative loops: stop */
  .mfg-icon, .ind-icon, .cap-box-icon,
  .strength-band > div, .who-panel::before, .cta-band::before,
  :root .floating-quote-btn::before, .hero-gears .hg { animation: none !important; }
  /* glass blur behind every button is costly while scrolling: use solid tints instead */
  :root :is(.btn, .hero-btn-primary, .hero-btn-secondary, .form-primary-btn, .floating-quote-btn,
            .pdf-ctrl-btn, .mobile-login-btn, .danger-btn, .icon-btn, .topbar-back-btn,
            .mobile-menu-toggle, .mobile-nav-close),
  .hero .eyebrow, .hero-btn-secondary, .quote-perk-item, .hero-panel {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .hero-btn-secondary { background: rgba(255, 255, 255, .14); }
  .hero .eyebrow { background: rgba(15, 23, 42, .45); }
  /* the floating nav keeps a (lighter) frosted look */
  .site-nav { -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%); background: rgba(255, 255, 255, .86); }
  /* hero entrance: quick fade/rise without the expensive blur filter */
  .hero .hero-copy .hero-reveal { filter: none; animation-name: aew-rise; animation-duration: .5s; animation-delay: calc(var(--d, 0s) * .35); }
  .hero-title .hw { filter: none !important; animation-duration: .55s; animation-delay: calc(.1s + var(--i) * .08s); }
  .hero-title .hw:last-child { animation: wordIn .55s var(--lg-ease) calc(.1s + var(--i) * .08s) forwards; }
}
@keyframes aew-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
