/*
 * Union Distribution — single-ud_product.php styles.
 * Ported from product-files/ud_product_demo.html (source of truth for classes).
 *
 * Everything is scoped under .ud-product-page on purpose: the demo uses generic
 * selectors (body, a, section, h1..h3) and reuses Bootstrap class names (.btn,
 * .card) that the theme already loads. Scoping keeps those rules off the theme
 * header/footer and out of Bootstrap's way on the same page. The CSS custom
 * properties live on the wrapper (not :root) for the same isolation reason.
 * Enqueued only on is_singular('ud_product') — see functions.php.
 */

/*
 * Palette below is the theme's, not the demo's: navy #161c55 (footer / dark
 * sections), red #EA0029 (CTA + hover, see .more in scss/style.scss), #E7E7E7
 * borders, #F8F8F9 panels, Roboto. Navy carries structure (eyebrows, badges,
 * dark section), red carries interaction (buttons, actives, bullets).
 */
.ud-product-page{
  --ink:#000000;
  --ink-soft:#7a7a7a;
  --line:#E7E7E7;
  --bg:#ffffff;
  --panel:#F8F8F9;
  --accent:#EA0029;
  --accent-ink:#b8001f;
  --brand:#161c55;
  --brand-soft:#eef0f8;
  --brand-line:#d6dbef;
  --glow:#7f9cff;
  --zoom:2.4;
  --radius:10px;
  --radius-btn:5px;
  --maxw:1200px;
  --ease:cubic-bezier(.16,1,.3,1);
  margin:0;font-family:'Roboto', sans-serif;
  color:var(--ink);background:var(--bg);line-height:1.55;
}
html:has(.ud-product-page){scroll-behavior:smooth}
.ud-product-page *{box-sizing:border-box}
/* theme links are dark with a red hover, never underlined */
.ud-product-page a{color:var(--ink);text-decoration:none;transition:color .3s}
.ud-product-page a:hover{color:var(--accent);text-decoration:none}
.ud-product-page h1,.ud-product-page h2,.ud-product-page h3{line-height:1.2;margin:0}
.ud-product-page .wrap{max-width:var(--maxw);margin:0 auto;padding:0 20px}

.ud-product-page .reveal{opacity:0;transform:translateY(28px);transition:opacity .7s var(--ease),transform .7s var(--ease)}
.ud-product-page .reveal.in{opacity:1;transform:none}
.ud-product-page .reveal.d1{transition-delay:.08s}
.ud-product-page .reveal.d2{transition-delay:.16s}
.ud-product-page .reveal.d3{transition-delay:.24s}

.ud-product-page .breadcrumb{padding:14px 0;font-size:13px;color:var(--ink-soft);background:none;margin:0;border-radius:0}
.ud-product-page .breadcrumb a{color:var(--ink-soft)}
.ud-product-page .breadcrumb span{margin:0 6px}
.ud-product-page .breadcrumb b{color:var(--ink);font-weight:600}

.ud-product-page .hero{display:grid;grid-template-columns:1.1fr 1fr;gap:40px;padding:10px 0 50px}
.ud-product-page .gallery .main{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
  aspect-ratio:4/3;display:flex;align-items:center;justify-content:center;
  color:#AEAEAE;font-size:14px;position:relative;overflow:hidden;
}
.ud-product-page .gallery .main img{width:100%;height:100%;object-fit:contain}
.ud-product-page .gallery .main .ph{font-weight:600;letter-spacing:.03em}

/*
 * Hover zoom. .main is already overflow:hidden, so it doubles as the lens
 * viewport and the <img> itself is what scales — no overlay node, no cloned
 * background-image. JS writes only transform-origin (the cursor position); the
 * scale lives here. Origin is deliberately NOT transitioned: it has to track
 * the pointer 1:1, and only the scale-in/out should animate. .is-zoomable is
 * added by JS, so the no-image placeholder never gets a zoom cursor.
 */
.ud-product-page .gallery .main.is-zoomable{cursor:zoom-in}
.ud-product-page .gallery .main img{transition:transform .3s var(--ease)}
.ud-product-page .gallery .main.zoomed img{transform:scale(var(--zoom))}
.ud-product-page .thumbs{display:flex;gap:10px;margin-top:12px}
.ud-product-page .thumbs .t{
  flex:1;aspect-ratio:1/1;background:var(--panel);border:1px solid var(--line);
  border-radius:8px;display:flex;align-items:center;justify-content:center;overflow:hidden;
  color:#AEAEAE;font-size:11px;cursor:pointer;transition:border-color .3s,box-shadow .3s,transform .3s;
}
.ud-product-page .thumbs .t img{width:100%;height:100%;object-fit:cover}
.ud-product-page .thumbs .t:hover{transform:translateY(-2px)}
.ud-product-page .thumbs .t.active{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}

.ud-product-page .badges{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.ud-product-page .badge{
  font-size:12px;font-weight:600;letter-spacing:.02em;
  background:var(--brand-soft);color:var(--brand);
  border:1px solid var(--brand-line);padding:8px 12px;border-radius:100px;
}
.ud-product-page h1{font-size:30px;font-weight:700;margin-bottom:8px}
.ud-product-page .ids{font-size:13px;color:var(--ink-soft);margin-bottom:18px}
.ud-product-page .ids b{color:var(--ink);font-weight:600}
.ud-product-page .lead{font-size:16px;color:#555;margin-bottom:22px}
.ud-product-page .lead p{margin:0 0 10px}
.ud-product-page .lead p:last-child{margin-bottom:0}
.ud-product-page .keyf{list-style:none;padding:0;margin:0 0 26px}
.ud-product-page .keyf li{position:relative;padding:7px 0 7px 26px;font-size:14px;border-bottom:1px solid var(--line)}
.ud-product-page .keyf li:before{
  content:"";position:absolute;left:2px;top:13px;width:8px;height:8px;
  background:var(--accent);border-radius:2px;transform:rotate(45deg);
}
.ud-product-page .cta-row{display:flex;gap:12px;flex-wrap:wrap}
/* theme buttons (.more): 5px radius, 1px red border, 0.4s fill on hover */
.ud-product-page .btn{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:45px;padding:10px 26px;border-radius:var(--radius-btn);font-weight:500;font-size:16px;
  background:var(--accent);color:#FCFCFC;border:1px solid var(--accent);
  transition:all .4s;
}
.ud-product-page .btn:hover{background:var(--accent-ink);border-color:var(--accent-ink);color:#FCFCFC;text-decoration:none}
.ud-product-page .btn.ghost{background:transparent;color:var(--ink);border-color:var(--accent)}
.ud-product-page .btn.ghost:hover{background:var(--accent);border-color:var(--accent);color:#FCFCFC}

.ud-product-page section{padding:46px 0}
.ud-product-page .sec-head{font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--brand);margin-bottom:8px}
.ud-product-page .sec-title{font-size:24px;font-weight:700;color:var(--ink);margin-bottom:26px}

.ud-product-page .banners{background:var(--panel);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.ud-product-page .banner-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.ud-product-page .banner{
  position:relative;aspect-ratio:3/4;background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;overflow:hidden;
  color:#AEAEAE;text-align:center;padding:16px;
  transition:transform .3s var(--ease),box-shadow .3s var(--ease),border-color .3s;
}
.ud-product-page .banner:hover{transform:translateY(-6px);box-shadow:0 14px 34px rgba(22,28,85,.14);border-color:var(--brand-line)}
.ud-product-page .banner .bt{position:relative;z-index:2;font-weight:700;color:var(--ink);font-size:15px}
.ud-product-page .banner .bs{position:relative;z-index:2;font-size:12px}
/* with a real image: cover it, drop a legibility gradient, anchor the title bottom-left in white */
.ud-product-page .banner--img{justify-content:flex-end;align-items:flex-start;text-align:left}
.ud-product-page .banner--img img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ud-product-page .banner--img:after{content:"";position:absolute;inset:0;z-index:1;background:linear-gradient(to top,rgba(22,28,85,.72),rgba(22,28,85,0) 55%)}
.ud-product-page .banner--img .bt{color:#fff}
/* on the category archive the grid sits inside .prod-archive, which brings its
   own .wrap and background: strip the panel and keep only the bottom gap */
.ud-product-page .banners--inline{background:none;border:0;padding:0 0 6px}
.ud-product-page .banners--inline .sec-head{margin-bottom:14px}

/* ============ RICH CONTENT = MINI LANDING ============ */
/* same navy + blue/teal radial signature the theme uses on footer and .oces2026 */
.ud-product-page .story{
  color:#eef1f4;overflow:hidden;position:relative;
  background:
    radial-gradient(circle at -17% 122%, rgba(70,110,255,.55) 11%, rgba(70,110,255,.25) 28%, transparent 35%),
    radial-gradient(circle at 109% 155%, rgba(0,180,190,.75) 17%, rgba(0,180,190,.25) 27%, transparent 40%),
    linear-gradient(180deg,#161c55 30%,#161c55 -29%);
}
.ud-product-page .story .sec-head{color:var(--glow)}
.ud-product-page .story .sec-title{color:#fff;font-size:34px;letter-spacing:-.01em}
.ud-product-page .story-intro{max-width:640px;margin-bottom:44px}
.ud-product-page .story-intro p{color:rgba(255,255,255,.72);font-size:16px;margin:0}

.ud-product-page .stats{display:grid;grid-template-columns:repeat(4,1fr);gap:20px;margin-bottom:64px}
.ud-product-page .stat{border:1px solid rgba(255,255,255,.14);border-radius:var(--radius);padding:22px;background:rgba(255,255,255,.05)}
.ud-product-page .stat .num{font-size:34px;font-weight:800;color:#fff;letter-spacing:-.02em;line-height:1}
.ud-product-page .stat .num span{font-size:18px;color:var(--glow);font-weight:700}
.ud-product-page .stat .lbl{font-size:13px;color:rgba(255,255,255,.6);margin-top:8px}

.ud-product-page .feature{display:grid;grid-template-columns:1fr 1fr;gap:48px;align-items:center;padding:34px 0;border-top:1px solid rgba(255,255,255,.12)}
.ud-product-page .feature:nth-child(even) .feat-visual{order:2}
.ud-product-page .feat-visual{
  aspect-ratio:16/11;border-radius:14px;position:relative;overflow:hidden;
  background:linear-gradient(135deg,#141a4c,#222a72);border:1px solid rgba(255,255,255,.14);
  display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.45);font-size:13px;
}
.ud-product-page .feat-visual img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.ud-product-page .feat-visual .tag{position:absolute;top:14px;left:14px;z-index:2;font-size:11px;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:var(--glow);background:rgba(70,110,255,.18);padding:5px 10px;border-radius:100px}
/* Animated stand (feature blocks with "use_arc") — scenes come from
   product-files/animated_scenes.html. The angles arrive per-post as --ang-from /
   --ang-to / --rot inline on the <svg>, already flipped to CSS's rotation
   direction in PHP. Inactive scenes are display:none, which is also what
   restarts the animation from the top when the toggle switches to one.
   The box is sized off the container's height, not its width: the scenes are
   square and .feat-visual is 16/11 with overflow:hidden, so a width-driven box
   would get its base and screen top clipped on the narrower columns. */
.ud-product-page .stand{height:86%;aspect-ratio:1;max-width:86%}
.ud-product-page .stand-scene{display:none;height:100%}
.ud-product-page .stand-scene.is-active{display:block}
.ud-product-page .stand-svg{display:block;width:100%;height:100%}
@keyframes ud-tilt{
  0%,14%{transform:rotate(var(--ang-from))}
  44%,58%{transform:rotate(var(--ang-to))}
  86%,100%{transform:rotate(var(--ang-from))}
}
@keyframes ud-rotate{
  0%,12%{transform:rotate(0deg)}
  38%,62%{transform:rotate(var(--rot))}
  88%,100%{transform:rotate(0deg)}
}
/* transform-origin is in viewBox units and matches the pivot dot the diagram
   draws, so the panel turns about exactly the point the angle rays leave from. */
.ud-product-page .tiltPivot,.ud-product-page .rotPivot{transform-box:view-box}
.ud-product-page .tiltPivot{animation:ud-tilt 6s cubic-bezier(.5,0,.5,1) infinite}
.ud-product-page .rotPivot{animation:ud-rotate 6.5s cubic-bezier(.5,0,.5,1) infinite}
.ud-product-page .stand-svg--floor .tiltPivot{transform-origin:190px 108px}
.ud-product-page .stand-svg--wall .tiltPivot{transform-origin:136px 158px}
.ud-product-page .stand-svg--rot .rotPivot{transform-origin:150px 118px}

.ud-product-page .stand-toggle{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px}
.ud-product-page .stand-toggle button{
  font:inherit;font-size:13px;font-weight:600;line-height:1;
  color:rgba(255,255,255,.72);background:rgba(255,255,255,.05);
  border:2px solid rgba(255,255,255,.14);border-radius:100px;
  padding:8px 16px;cursor:pointer;transition:color .3s,border-color .3s,background .3s;
}
.ud-product-page .stand-toggle button:hover{color:#fff;border-color:rgba(255,255,255,.34)}
.ud-product-page .stand-toggle button.is-active{color:#fff;border-color:var(--accent);background:rgba(234,0,41,.16)}

.ud-product-page .feat-copy h3{font-size:22px;color:#fff;margin-bottom:12px}
.ud-product-page .feat-copy p{color:rgba(255,255,255,.72);font-size:15px;margin:0 0 14px}
.ud-product-page .feat-copy .mini{display:flex;gap:22px;flex-wrap:wrap}
.ud-product-page .feat-copy .mini div{font-size:13px;color:rgba(255,255,255,.6)}
.ud-product-page .feat-copy .mini b{display:block;color:#fff;font-size:20px;font-weight:800}

.ud-product-page .video-block{margin:60px 0 12px}
.ud-product-page .video-frame{
  position:relative;border-radius:16px;overflow:hidden;border:1px solid rgba(255,255,255,.14);
  aspect-ratio:16/9;background:radial-gradient(circle at 50% 45%,#232b78,#12173f);
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  transition:transform .3s var(--ease);
}
.ud-product-page .video-frame:hover{transform:scale(1.006)}
.ud-product-page .video-frame iframe,.ud-product-page .video-frame video{position:absolute;inset:0;width:100%;height:100%;border:0;z-index:3}
.ud-product-page .play{
  width:78px;height:78px;border-radius:50%;background:var(--accent);
  display:flex;align-items:center;justify-content:center;position:relative;z-index:2;
  box-shadow:0 10px 40px rgba(234,0,41,.45);
}
.ud-product-page .play:before{content:"";border-style:solid;border-width:14px 0 14px 22px;border-color:transparent transparent transparent #fff;margin-left:5px}
.ud-product-page .play:after{
  content:"";position:absolute;inset:-14px;border-radius:50%;border:2px solid rgba(234,0,41,.5);
  animation:ud-pulse 2.2s ease-out infinite;
}
@keyframes ud-pulse{0%{transform:scale(1);opacity:.8}100%{transform:scale(1.7);opacity:0}}
.ud-product-page .video-cap{position:absolute;bottom:16px;left:18px;font-size:13px;color:rgba(255,255,255,.6);z-index:2}

.ud-product-page .retailers{background:var(--panel);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.ud-product-page .retail-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}
.ud-product-page .retail{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:18px;display:flex;align-items:center;justify-content:space-between;gap:12px;
  transition:all .4s;
}
.ud-product-page .retail:hover{transform:translateY(-3px);border-color:var(--accent);box-shadow:0 8px 20px rgba(22,28,85,.10)}
.ud-product-page .retail .logo{font-weight:700;font-size:15px;color:var(--ink)}
.ud-product-page .retail .logo img{max-height:26px;width:auto;display:block}
.ud-product-page .retail .go{font-size:13px;font-weight:600;color:var(--accent);white-space:nowrap}

.ud-product-page .spec-group{margin-bottom:26px;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.ud-product-page .spec-group h3{font-size:14px;font-weight:700;color:var(--brand);padding:12px 16px;background:var(--panel);border-bottom:1px solid var(--line)}
/* table-layout:fixed is load-bearing: with the default 'auto' a long value
   grows the table past width:100% instead of wrapping, and .spec-group's
   overflow:hidden then clips it clean off the right edge. 'fixed' pins the
   columns to the 40/60 split below; overflow-wrap handles values that are one
   long unbreakable token (model codes, URLs). */
.ud-product-page table.spec{width:100%;table-layout:fixed;border-collapse:collapse;font-size:14px}
.ud-product-page table.spec td{padding:10px 16px;border-bottom:1px solid var(--line);vertical-align:top;overflow-wrap:anywhere}
.ud-product-page table.spec tr:last-child td{border-bottom:none}
.ud-product-page table.spec td.k{width:40%;color:var(--ink-soft)}
.ud-product-page table.spec td.v{font-weight:500}
.ud-product-page table.spec td.v p{margin:0}

.ud-product-page .rel-track{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.ud-product-page .card{display:block;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:#fff;transition:transform .3s var(--ease),box-shadow .3s var(--ease),border-color .3s}
.ud-product-page .card:hover{transform:translateY(-5px);box-shadow:0 12px 30px rgba(22,28,85,.12);border-color:var(--brand-line);text-decoration:none}
.ud-product-page .card .thumb{aspect-ratio:4/3;background:var(--panel);display:flex;align-items:center;justify-content:center;color:#AEAEAE;font-size:12px;border-bottom:1px solid var(--line);overflow:hidden}
.ud-product-page .card .thumb img{width:100%;height:100%;object-fit:cover}
.ud-product-page .card .body{padding:12px 14px}
.ud-product-page .card .name{font-size:14px;font-weight:600;margin-bottom:4px;color:var(--ink);transition:color .3s}
.ud-product-page .card:hover .name{color:var(--accent)}
.ud-product-page .card .meta{font-size:12px;color:var(--ink-soft)}
.ud-product-page .slider-note{font-size:12px;color:#AEAEAE;margin-top:14px;font-style:italic}

/* --- product category archive (taxonomy-ud_product_cat.php) --- */
.ud-product-page .prod-archive{padding:10px 0 60px}
.ud-product-page .prod-archive .sec-title{font-size:34px;letter-spacing:-.01em;margin-bottom:10px}
.ud-product-page .prod-archive-intro{max-width:720px;color:var(--ink-soft);font-size:15px;margin-bottom:34px}
.ud-product-page .prod-archive-intro p{margin:0 0 10px}
.ud-product-page .prod-filter{display:flex;flex-wrap:wrap;gap:8px;margin-top:22px}
.ud-product-page .prod-filter .chip{
  font-size:13px;font-weight:600;line-height:1;color:var(--ink-soft);
  border:1px solid var(--line);border-radius:100px;padding:9px 16px;background:#fff;
  transition:color .3s,border-color .3s,background .3s;
}
.ud-product-page .prod-filter .chip:hover{color:var(--accent);border-color:var(--accent)}
.ud-product-page .prod-filter .chip.is-active{color:#fff;background:var(--brand);border-color:var(--brand)}
.ud-product-page .prod-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-top:26px}
/* the card body is a column so the excerpt can sit under the name and every
   card in a row still ends up the same height */
.ud-product-page .prod-grid .card .body{display:flex;flex-direction:column;gap:4px}
.ud-product-page .card .excerpt{font-size:13px;color:var(--ink-soft);line-height:1.5}
.ud-product-page .prod-empty{color:var(--ink-soft);margin:26px 0 0}

/* the_posts_pagination() prints a heading for screen readers, and the theme has
   no rule for that class — without this it renders as visible text */
.ud-product-page .screen-reader-text{
  position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;
}
/* WP prints .navigation.pagination with .page-numbers children (not a list, so
   Bootstrap's .page-item / .page-link rules never come into play) */
.ud-product-page .pagination{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:40px;padding:0}
.ud-product-page .pagination .nav-links{display:flex;flex-wrap:wrap;gap:8px}
.ud-product-page .pagination .page-numbers{
  min-width:38px;height:38px;padding:0 12px;border:1px solid var(--line);border-radius:var(--radius-btn);
  display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;
  color:var(--ink);background:#fff;transition:color .3s,border-color .3s,background .3s;
}
.ud-product-page .pagination a.page-numbers:hover{color:var(--accent);border-color:var(--accent)}
.ud-product-page .pagination .page-numbers.current{color:#fff;background:var(--brand);border-color:var(--brand)}
.ud-product-page .pagination .page-numbers.dots{border-color:transparent;background:none}

@media(max-width:900px){
  .ud-product-page .hero{grid-template-columns:1fr;gap:28px}
  .ud-product-page .banner-grid{grid-template-columns:repeat(2,1fr)}
  .ud-product-page .stats{grid-template-columns:repeat(2,1fr)}
  .ud-product-page .feature{grid-template-columns:1fr;gap:24px}
  .ud-product-page .feature:nth-child(even) .feat-visual{order:0}
  .ud-product-page .rel-track{grid-template-columns:repeat(2,1fr)}
  .ud-product-page .prod-grid{grid-template-columns:repeat(2,1fr)}
  .ud-product-page .story .sec-title{font-size:26px}
  .ud-product-page .prod-archive .sec-title{font-size:26px}
}

/* 575.98px = the theme's own _xs boundary (scss/_mixin.scss), not the demo's
   900px above. Below it a 40/60 spec split leaves the value column ~200px on a
   phone, so the rows stack: label on its own line, value full width under it. */
@media(max-width:575.98px){
  .ud-product-page table.spec,
  .ud-product-page table.spec tbody,
  .ud-product-page table.spec tr,
  .ud-product-page table.spec td{display:block;width:auto}
  .ud-product-page table.spec tr{padding:10px 16px;border-bottom:1px solid var(--line)}
  .ud-product-page table.spec tr:last-child{border-bottom:none}
  .ud-product-page table.spec td{padding:0;border-bottom:none}
  /* width:auto has to be repeated here — td.k's 40% outranks the grouped
     rule above, and a media query adds no specificity of its own */
  .ud-product-page table.spec td.k{width:auto;font-size:12px;letter-spacing:.04em;text-transform:uppercase;margin-bottom:3px}
  .ud-product-page table.spec td.v{font-weight:600}
}

@media(prefers-reduced-motion:reduce){
  /* the zoom stays (it is a user action, not decoration) — only the easing goes */
  .ud-product-page .gallery .main img{transition:none}
  .ud-product-page .reveal{opacity:1!important;transform:none!important;transition:none!important}
  /* the stand freezes at rest — the diagram still reads as a range */
  .ud-product-page .tiltPivot,.ud-product-page .rotPivot{animation:none}
  .ud-product-page .play:after{animation:none}
  html:has(.ud-product-page){scroll-behavior:auto}
}
