/* Addler Motion Layer v2 (staging): calm, consistent motion across the site.
   Spotlight search, scroll reveals, count-up stats, navbar shadow, GSAP hero + CTA. */

:root { --am-ease: cubic-bezier(.22,1,.36,1); }

/* ---------- Hero / CTA start states (released by JS, 3s fallback in head) ---------- */
html.am-pending .hero-motto,
html.am-pending .hero-badge,
html.am-pending .hero-title,
html.am-pending .hero-subtitle,
html.am-pending .hero-actions > *,
html.am-pending .cta-motto,
html.am-pending .cta-title,
html.am-pending .cta-sub,
html.am-pending .cta-actions > * { opacity: 0; }

/* ---------- Scroll progress bar ---------- */
.am-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #cc0000, #ff4d57);
  transform: scaleX(0); transform-origin: 0 50%;
  z-index: 100000; pointer-events: none;
}

/* ---------- Navbar: soft shadow after scrolling ---------- */
.navbar { transition: box-shadow .35s ease, background-color .35s ease; }
.navbar.am-scrolled { box-shadow: 0 8px 28px rgba(16,18,27,.08); }

/* ---------- Buttons: small lift, soft shadow, one light sweep on hover ---------- */
html .am-btn {
  position: relative; overflow: hidden; isolation: isolate;
  transition: translate .3s var(--am-ease), box-shadow .3s ease,
    background-color .22s ease, border-color .22s ease, color .22s ease;
}
.am-btn::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform .8s var(--am-ease);
}
@media (hover: hover) and (pointer: fine) {
  html .am-btn:hover { translate: 0 -2px; box-shadow: 0 10px 22px rgba(16,18,27,.16); }
  html .am-btn:active { translate: 0 0; box-shadow: 0 4px 10px rgba(16,18,27,.12); }
  .am-btn:hover::after { transform: translateX(120%); }
}
html .am-btn:focus-visible { outline: 2px solid #cc0000; outline-offset: 3px; }

/* ---------- Scroll reveals (cards, headings, text, images) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html .am-rv {
    transition:
      opacity .7s var(--am-ease) var(--am-d, 0ms),
      translate .8s var(--am-ease) var(--am-d, 0ms),
      scale .8s var(--am-ease) var(--am-d, 0ms),
      clip-path .9s var(--am-ease) var(--am-d, 0ms),
      transform .35s var(--am-ease),
      box-shadow .35s ease, border-color .3s ease;
  }
  html .am-rv.am-hide { opacity: 0; translate: 0 24px; }
  html .am-rv.am-hide[data-am="soft"] { translate: 0 18px; }
  html .am-rv.am-hide[data-am="title"] { translate: 0 14px; clip-path: inset(0 0 100% 0); }
  html .am-rv[data-am="title"] { clip-path: inset(0 0 -20% 0); }
  html .am-rv.am-hide[data-am="img"] { translate: 0 14px; scale: .985; }
  html .am-rv.am-hide[data-am="left"] { translate: -32px 0; }
  html .am-rv.am-hide[data-am="right"] { translate: 32px 0; }

  /* inner-page heroes */
  @keyframes am-rise { from { opacity: 0; translate: 0 20px; } to { opacity: 1; translate: 0 0; } }
  .am-intro { animation: am-rise .8s var(--am-ease) var(--am-d, 0ms) both; }

  /* card icons settle in with their card */
  @keyframes am-icon { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
  .am-card:not(.am-hide) :is(.svc-icon-wrap, .cat-icon, .why-icon) {
    animation: am-icon .6s var(--am-ease) backwards;
    animation-delay: calc(var(--am-d, 0ms) + 200ms);
  }
}

/* ---------- Card hover: lift + shadow (no tilt) ---------- */
@media (hover: hover) and (pointer: fine) {
  html .am-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(16,18,27,.12);
  }
  :is(.svc-icon-wrap, .cat-icon, .why-icon) { transition: scale .35s var(--am-ease); }
  .am-card:hover :is(.svc-icon-wrap, .cat-icon, .why-icon) { scale: 1.08; }
}
:is(.svc-icon-wrap, .cat-icon, .why-icon) { display: inline-flex; }

/* Image zoom inside cards */
.product-card-img-wrap, .blog-card-img, .inst-photo-wrap, .ctlg-cover-wrap, .product-main-image { overflow: hidden; }
.product-card-img-wrap img, .blog-card-img img, .inst-photo-wrap img, .ctlg-cover-wrap img, .product-main-image img {
  transition: transform .8s var(--am-ease);
}
@media (hover: hover) and (pointer: fine) {
  .am-card:hover :is(.product-card-img-wrap, .blog-card-img, .inst-photo-wrap, .ctlg-cover-wrap) img { transform: scale(1.04); }
  .product-main-image:hover img { transform: scale(1.04); }
}

/* Count-up numbers keep their width while counting */
.am-count { font-variant-numeric: tabular-nums; }

/* WhatsApp button hover */
@media (hover: hover) and (pointer: fine) {
  html.am-ready .wa-btn-float { transition: scale .25s var(--am-ease), box-shadow .25s ease; }
  html.am-ready .wa-btn-float:hover { scale: 1.08; }
}

/* ---------- Spotlight search ---------- */
.am-spot-backdrop {
  position: fixed; inset: 0; z-index: 100001;
  background: rgba(10,12,22,.58);
  opacity: 0; pointer-events: none; transition: opacity .28s ease; will-change: opacity;
}
.am-spot-backdrop.is-on { opacity: 1; pointer-events: auto; }
html #navSearch.am-spot {
  position: fixed; z-index: 100002; margin: 0; max-width: none !important; min-width: 0 !important; flex: none !important; box-sizing: border-box;
  padding: 0 26px; gap: 14px; border-radius: 22px;
  background: rgba(255,255,255,.97); border-color: rgba(255,255,255,.8);
  box-shadow: 0 40px 90px rgba(0,0,0,.38), 0 0 0 1px rgba(0,0,0,.05);
  top: 0; left: 0; contain: layout style; will-change: translate, width, height;
  transition: translate .38s cubic-bezier(.22,1,.36,1), width .38s cubic-bezier(.22,1,.36,1),
              height .38s cubic-bezier(.22,1,.36,1), padding .38s cubic-bezier(.22,1,.36,1),
              border-radius .38s ease, box-shadow .38s ease;
}
html #navSearch.am-spot input { font-size: 22px; color: #111; transition: font-size .38s cubic-bezier(.22,1,.36,1); }
html #navSearch.am-spot input::placeholder { color: #9a9a9a; }
html #navSearch.am-spot svg { width: 24px; height: 24px; stroke: #cc0000; flex: none; transition: width .38s cubic-bezier(.22,1,.36,1), height .38s cubic-bezier(.22,1,.36,1); }
html #navSearch.am-spot.is-anim .search-dropdown { opacity: 0 !important; pointer-events: none !important; }
html #navSearch.am-spot .search-dropdown {
  top: calc(100% + 14px); left: 0; right: 0; min-width: 0; border-radius: 18px;
  max-height: min(58vh, 520px); overflow-y: auto; box-shadow: 0 30px 70px rgba(0,0,0,.3);
}
.am-spot-hints {
  position: fixed; z-index: 100002; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  opacity: 0; translate: 0 10px; pointer-events: none;
  transition: opacity .25s ease .08s, translate .35s cubic-bezier(.22,1,.36,1) .08s;
}
.am-spot-hints.is-on { opacity: 1; translate: 0 0; pointer-events: auto; }
.am-spot-hints.is-gone { opacity: 0; pointer-events: none; }
.am-spot-hints button {
  font-family: inherit; font-size: 13px; font-weight: 500; border: 0; border-radius: 999px;
  padding: 9px 16px; background: rgba(255,255,255,.2); color: #fff; cursor: pointer;
  transition: background .2s ease, scale .2s ease;
}
.am-spot-hints button:hover { background: rgba(255,255,255,.34); scale: 1.05; }

@media (prefers-reduced-motion: reduce) {
  .am-progress { display: none !important; }
  .am-intro { animation: none !important; }
  html #navSearch.am-spot, .am-spot-backdrop, .am-spot-hints { transition: none !important; }
}
