/* =====================================================================
   GLOBEX EQUIPMENT INVENTORY — carousel add-on (front-end)
   Self-contained: all design tokens are (re)declared on .gx-carousel so
   this file never depends on, or interferes with, the grid stylesheet.
   Everything is namespaced .gx-carousel*.

   Fonts + accent colours are driven by CSS variables that the shortcode
   sets per-instance from the admin "Fonts & colours" settings, so the
   values below are only fallbacks.
   ===================================================================== */
.gx-carousel{
  --gx-navy:#0a2a86;
  --gx-navy-dk:#081654;
  --gx-green:#2fa845;
  --gx-green-dk:#258a37;
  --gx-ink:#0b1024;
  --gx-mut:#54608a;
  --gx-dim:#7c87aa;
  --gx-line:#dde3ef;
  --gx-mist:#f4f6fb;
  --gx-mist-2:#e8ecf4;
  --gx-bp-line:rgba(10,42,134,.08);
  --gx-rad:12px;
  --gx-ff-disp:"Montserrat","Helvetica Neue",Arial,sans-serif;
  --gx-ff-ui:"Montserrat","Helvetica Neue",Arial,sans-serif;
  --gx-ff-body:"Helvetica Neue",Helvetica,Arial,sans-serif;
  --gx-ff-mono:"Helvetica Neue",Helvetica,Arial,sans-serif;
  --gx-card-w:304px;
  --gx-dot:9px;

  font-family:var(--gx-ff-body);color:var(--gx-ink);line-height:1.55;
  position:relative;margin:0 0 8px;
}
.gx-carousel *{box-sizing:border-box}

/* ---------------------------------------------------------------------
   HARDENED CONTROL RESET
   The carousel can be dropped into any theme, and many themes style
   <button> globally (dark fills, pill radii, min-widths, padding). Those
   would otherwise turn our arrows into dark pills and our dots into big
   dark blobs. We scope every interactive control under .gx-carousel and
   force the load-bearing box properties with !important so no host rule
   (short of its own !important on an equally/more-specific selector) can
   reshape them.
   --------------------------------------------------------------------- */
.gx-carousel .gx-carousel-arrow,
.gx-carousel .gx-carousel-dot{
  -webkit-appearance:none!important;
  -moz-appearance:none!important;
  appearance:none!important;
  margin:0!important;
  min-width:0!important;min-height:0!important;max-width:none!important;
  font:inherit;text-transform:none;letter-spacing:normal;line-height:1;
  text-decoration:none;text-align:center;text-shadow:none;
  -webkit-tap-highlight-color:transparent;
  outline-offset:2px;
}
.gx-carousel .gx-carousel-card{
  text-decoration:none!important;-webkit-tap-highlight-color:transparent;
}

/* ---- top bar (only when a heading is set) ---- */
.gx-carousel-topbar{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  margin-bottom:16px;flex-wrap:wrap;
}
.gx-carousel-heading{
  font-family:var(--gx-ff-disp);font-weight:800;letter-spacing:.005em;
  font-size:clamp(1.5rem,3.4vw,2.1rem);line-height:1.1;margin:0;color:var(--gx-ink);
  text-transform:uppercase;
}
.gx-carousel-nav--top{display:flex;gap:8px}

/* ---- viewport + track ---- */
.gx-carousel-viewport{position:relative}
.gx-carousel-track{
  display:flex;gap:18px;overflow-x:auto;overflow-y:hidden;
  scroll-snap-type:x mandatory;scroll-behavior:smooth;
  padding:6px 2px 14px;margin:0;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;             /* Firefox */
}
.gx-carousel-track::-webkit-scrollbar{display:none} /* Chrome/Safari */
.gx-carousel-track:focus-visible{outline:2px solid var(--gx-green);outline-offset:3px;border-radius:8px}

/* ---- card ---- */
.gx-carousel-card{
  flex:0 0 auto;width:var(--gx-card-w);scroll-snap-align:start;
  display:flex;flex-direction:column;
  background:#fff;border:1px solid var(--gx-mist-2);border-radius:var(--gx-rad);
  overflow:hidden;color:inherit;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.gx-carousel-card:hover,
.gx-carousel-card:focus-visible{
  border-color:var(--gx-line);
  box-shadow:0 18px 40px -22px rgba(10,16,36,.32);
  transform:translateY(-3px);outline:none;
}
.gx-carousel-card:focus-visible{box-shadow:0 0 0 3px rgba(47,168,69,.28),0 18px 40px -22px rgba(10,16,36,.32)}

.gx-carousel-media{
  position:relative;display:block;aspect-ratio:16/10;background:#f0f3fa;overflow:hidden;
}
.gx-carousel-img{width:100%;height:100%;display:block}
/* Whole photo always visible (no cropping), centred, aspect ratio kept —
   hardened so theme image rules can't override it. */
.gx-carousel .gx-carousel-media img.gx-carousel-img{
  display:block!important;
  width:100%!important;height:100%!important;
  max-width:none!important;max-height:none!important;
  margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
  object-fit:contain!important;object-position:50% 50%!important;
  transition:transform .35s ease;
}
.gx-carousel-card:hover .gx-carousel-img{transform:scale(1.04)}
.gx-carousel-img--empty{
  display:flex;align-items:center;justify-content:center;color:#9aa6c8;
  background-image:
    linear-gradient(var(--gx-bp-line) 1px,transparent 1px),
    linear-gradient(90deg,var(--gx-bp-line) 1px,transparent 1px);
  background-size:28px 28px;
}
.gx-carousel-img--empty .gx-machine{width:58%;max-width:150px;color:#7d89b6}

.gx-carousel-banner{
  position:absolute;top:0;left:0;right:0;z-index:2;
  background:var(--gx-green);color:#fff;
  font-family:var(--gx-ff-mono);font-size:.66rem;font-weight:700;
  letter-spacing:.14em;text-transform:uppercase;
  padding:7px 12px;text-align:center;line-height:1.2;
}
.gx-carousel-cond{
  position:absolute;bottom:10px;right:10px;z-index:2;
  background:rgba(10,42,134,.94);color:#fff;
  font-family:var(--gx-ff-mono);font-size:.56rem;font-weight:600;
  letter-spacing:.12em;text-transform:uppercase;
  padding:4px 9px;border-radius:4px;
}

.gx-carousel-body{
  display:flex;flex-direction:column;gap:12px;padding:16px 18px 18px;flex:1;
}
.gx-carousel-cat{
  font-family:var(--gx-ff-mono);font-size:.62rem;font-weight:700;
  letter-spacing:.14em;text-transform:uppercase;color:var(--gx-green);
}
.gx-carousel-title{
  font-family:var(--gx-ff-ui);font-weight:700;font-size:1.16rem;line-height:1.22;
  color:var(--gx-ink);margin:-4px 0 0;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.gx-carousel-card:hover .gx-carousel-title{color:var(--gx-navy)}

.gx-carousel-specs{
  display:grid;grid-template-columns:repeat(3,1fr);gap:1px;
  background:var(--gx-mist-2);border-radius:8px;overflow:hidden;
}
.gx-carousel-spec{background:var(--gx-mist);padding:8px 10px;display:block;min-width:0}
.gx-carousel-spec-k{
  display:block;font-family:var(--gx-ff-mono);font-size:.54rem;letter-spacing:.1em;
  text-transform:uppercase;color:var(--gx-dim);font-weight:600;
}
.gx-carousel-spec-v{
  display:block;font-family:var(--gx-ff-ui);font-weight:700;font-size:.9rem;
  color:var(--gx-ink);margin-top:2px;line-height:1.2;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

.gx-carousel-foot{
  display:flex;align-items:flex-end;justify-content:space-between;gap:10px;
  margin-top:auto;padding-top:2px;
}
.gx-carousel-pricewrap{line-height:1.05;min-width:0}
.gx-carousel-pricelabel{
  display:block;font-family:var(--gx-ff-mono);font-size:.58rem;
  letter-spacing:.14em;text-transform:uppercase;color:var(--gx-dim);margin-bottom:2px;font-weight:600;
}
.gx-carousel-price{
  font-family:var(--gx-ff-disp);font-weight:800;font-size:1.5rem;
  color:var(--gx-navy);letter-spacing:.005em;line-height:1;
}
.gx-carousel-cta{
  display:inline-flex;align-items:center;gap:5px;flex-shrink:0;
  font-family:var(--gx-ff-ui);font-weight:700;font-size:.78rem;letter-spacing:.02em;
  color:var(--gx-green);white-space:nowrap;
}
.gx-carousel-cta svg{width:15px;height:15px;transition:transform .18s ease}
.gx-carousel-card:hover .gx-carousel-cta svg{transform:translateX(3px)}

/* ---------------------------------------------------------------------
   ARROWS
   --------------------------------------------------------------------- */
.gx-carousel .gx-carousel-arrow{
  display:inline-flex;align-items:center;justify-content:center;
  width:42px!important;height:42px!important;border-radius:50%!important;
  cursor:pointer;padding:0!important;
  background:#fff!important;border:1px solid var(--gx-line)!important;
  color:var(--gx-navy)!important;box-shadow:none;
  transition:background .15s,border-color .15s,color .15s,box-shadow .15s,opacity .15s;
}
.gx-carousel .gx-carousel-arrow:hover{
  border-color:var(--gx-navy)!important;background:var(--gx-navy)!important;color:#fff!important;
  box-shadow:0 8px 18px -8px rgba(10,42,134,.5);
}
.gx-carousel .gx-carousel-arrow svg{width:20px;height:20px;display:block}
.gx-carousel .gx-carousel-arrow:disabled{
  opacity:.35;cursor:default;box-shadow:none;
  background:#fff!important;border-color:var(--gx-line)!important;color:var(--gx-navy)!important;
}
.gx-carousel .gx-carousel-arrow:focus-visible{outline:2px solid var(--gx-green);outline-offset:2px}

/* floating arrows over the viewport edges */
.gx-carousel-arrow--float{
  position:absolute;top:50%;transform:translateY(-50%);z-index:5;
  box-shadow:0 8px 22px -10px rgba(10,16,36,.35);
}
.gx-carousel-prev.gx-carousel-arrow--float{left:-6px}
.gx-carousel-next.gx-carousel-arrow--float{right:-6px}
/* when a top nav is present, hide the floating pair to avoid duplicate controls */
.gx-carousel.has-topnav .gx-carousel-arrow--float{display:none}

/* ---------------------------------------------------------------------
   DOTS  (windowed: only a few show at once, the rest scale away at the
   edges — see carousel.js). The container is a fixed-width viewport; the
   inner track slides so the active dot stays in view.
   --------------------------------------------------------------------- */
.gx-carousel .gx-carousel-dots{
  display:flex;justify-content:flex-start;align-items:center;
  overflow:hidden;width:fit-content;max-width:100%;margin:8px auto 0;
}
.gx-carousel .gx-carousel-dots:empty{display:none}
.gx-carousel .gx-carousel-dots-track{
  display:flex;gap:8px;align-items:center;
  transition:transform .28s ease;will-change:transform;
}
.gx-carousel .gx-carousel-dot{
  flex:0 0 auto;
  width:var(--gx-dot)!important;height:var(--gx-dot)!important;border-radius:50%!important;
  padding:0!important;cursor:pointer;
  background:var(--gx-mist-2)!important;border:1px solid var(--gx-line)!important;
  box-shadow:none;transform-origin:center;
  transition:background .15s,border-color .15s,width .2s ease,transform .2s ease,opacity .2s ease;
}
.gx-carousel .gx-carousel-dot:hover{background:var(--gx-dim)!important;border-color:var(--gx-dim)!important}
.gx-carousel .gx-carousel-dot.is-active{
  background:var(--gx-navy)!important;border-color:var(--gx-navy)!important;
  width:24px!important;border-radius:999px!important;
}
.gx-carousel .gx-carousel-dot:focus-visible{outline:2px solid var(--gx-green);outline-offset:2px}

/* Windowed mode: uniform round dots (no pill) so the sliding maths stays
   exact, active shown by colour + a slight bump, edges shrink to hint at
   "more". */
.gx-carousel.gx-dots-compact .gx-carousel-dot.is-active{
  width:var(--gx-dot)!important;border-radius:50%!important;transform:scale(1.18);
}
.gx-carousel.gx-dots-compact .gx-carousel-dot.gx-edge{transform:scale(.42);opacity:.55}
.gx-carousel.gx-dots-compact .gx-carousel-dot.gx-edge-2{transform:scale(.72);opacity:.8}

/* admin-only hint when no units are selected */
.gx-carousel-adminhint{
  font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:.9rem;
  background:#fff8e5;border:1px solid #f0dfa0;border-radius:8px;
  padding:12px 16px;color:#6b5a1e;
}
.gx-carousel-adminhint a{color:#0a2a86;font-weight:700}
.gx-carousel-adminhint span{color:#9a8b52;font-size:.82em}

/* ---- responsive card widths (scroll shows a peek of the next card) ---- */
@media (max-width:1024px){ .gx-carousel{--gx-card-w:280px} }
@media (max-width:680px){
  .gx-carousel{--gx-card-w:78%;--gx-dot:7px}
  .gx-carousel-track{gap:14px}
  .gx-carousel-arrow--float{display:none} /* rely on swipe + dots on phones */
  .gx-carousel-heading{font-size:1.45rem}
  .gx-carousel .gx-carousel-dots-track{gap:7px}
  .gx-carousel .gx-carousel-dot.is-active{width:18px!important}
}

@media (prefers-reduced-motion:reduce){
  .gx-carousel-track{scroll-behavior:auto}
  .gx-carousel-card,.gx-carousel-img,.gx-carousel-cta svg,
  .gx-carousel .gx-carousel-dots-track,.gx-carousel .gx-carousel-dot{transition:none}
  .gx-carousel-card:hover{transform:none}
  .gx-carousel-card:hover .gx-carousel-img{transform:none}
}
