/* ==========================================================================
   United Co. (U.C.S.) — Shared stylesheet
   For Supplying & Industrial Engineering
   Palette: deep blue #1B4F9C · gold #F5B32B · white · silver-grey accents
   ========================================================================== */

/* ---- Design tokens ----------------------------------------------------- */
:root {
  --blue:        #1B4F9C;
  --blue-dark:   #143a73;
  --blue-darker: #0f2c58;
  --gold:        #F5B32B;
  --gold-dark:   #d9990f;
  --white:       #ffffff;
  --grey-50:     #f6f8fb;
  --grey-100:    #eef1f6;
  --grey-200:    #dfe4ec;
  --grey-300:    #c7cedb;
  --grey-500:    #7d8798;
  --grey-700:    #444c5a;
  --ink:         #1c222c;

  --shadow-sm: 0 1px 3px rgba(20, 40, 80, .08);
  --shadow-md: 0 6px 20px rgba(20, 40, 80, .10);
  --shadow-lg: 0 14px 40px rgba(20, 40, 80, .16);

  --radius:    10px;
  --radius-lg: 16px;

  --wrap: 1200px;

  --ff: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* ---- Reset / base ------------------------------------------------------ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--ff);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* safety net against sideways scroll (sticky header on <html> unaffected) */
}

img { max-width: 100%; display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--blue); }
h2.section-title { font-size: clamp(1.6rem, 3vw, 2.3rem); }

p { margin: 0 0 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.section { padding: 54px 0; }
.section--tint { background: var(--grey-50); }
.section--blue { background: var(--blue); color: #eaf0fa; }
.section--blue h2, .section--blue h3 { color: var(--white); }

.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section-head p { color: var(--grey-700); font-size: 1.05rem; }
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: .6rem;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--gold { background: var(--gold); color: var(--blue-darker); }
.btn--gold:hover { background: var(--gold-dark); color: var(--blue-darker); box-shadow: var(--shadow-md); }

.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:hover { background: var(--blue-dark); color: #fff; box-shadow: var(--shadow-md); }

.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

.btn--outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn--outline:hover { background: var(--blue); color: #fff; }

/* ---- Image placeholders ------------------------------------------------ */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(45deg, var(--grey-100) 0 14px, var(--grey-50) 14px 28px);
  border: 1px dashed var(--grey-300);
  border-radius: var(--radius);
  color: var(--grey-500);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
  overflow: hidden;
}
.ph span {
  padding: 6px 12px;
  background: rgba(255,255,255,.75);
  border-radius: 6px;
}
.ph--ratio { aspect-ratio: 4 / 3; }

/* Real photo overlaid on a placeholder. If the file is missing, inline
   onerror="this.remove()" deletes it and the styled placeholder shows through. */
.ph__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
.ph:has(> img.ph__img) { border-color: transparent; }
.ph:has(.project-carousel__img) { border-color: transparent; }

/* Per-project photo carousel (Projects page) */
.project-carousel__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s ease;
  z-index: 1;
}
.project-carousel__img.is-active { opacity: 1; z-index: 2; }
.project-carousel__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 4;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  cursor: pointer;
  background: rgba(255,255,255,.88); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .15s ease;
}
.project-carousel__btn:hover { background: #fff; }
.project-carousel__btn--prev { left: 8px; }
.project-carousel__btn--next { right: 8px; }
.project-carousel__counter {
  position: absolute; bottom: 8px; right: 8px; z-index: 4;
  background: rgba(0,0,0,.62); color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
}
.project-carousel__dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  z-index: 4; display: flex; gap: 5px;
}
.project-carousel__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.55);
  box-shadow: 0 0 2px rgba(0,0,0,.4);
}
.project-carousel__dot.is-active { background: #fff; }

/* Hero background photo (over the gradient fallback, under the dark overlay). */
.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Hero background video — sits over .hero__photo, under the dark overlay.
   object-fit: cover crops to fill, so no stretching and no letterbox bars. */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
/* Motion-sensitive visitors get the poster frame instead of a looping clip. */
@media (prefers-reduced-motion: reduce) {
  .hero__video { display: none; }
}

/* Photo-led sector cards (home + about). The icon acts as the placeholder;
   the photo covers it when present, and reappears if the file is missing. */
.sector-card--photo { padding: 0; overflow: hidden; }
.sector-card--photo .sector-card__media {
  position: relative;
  height: 168px;
  background: var(--grey-50);
  border-bottom: 1px solid var(--grey-200);
  display: flex; align-items: center; justify-content: center;
}
.sector-card--photo .sector-card__icon { margin: 0; }
.sector-card--photo .sector-card__body { padding: 26px 24px 30px; }
.sector-card--photo .sector-card__body h3 { margin-bottom: .4rem; }

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--grey-200);
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 90px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand__logo {
  height: 72px; width: auto;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand__logo.ph { width: 96px; height: 72px; font-size: .72rem; }
.brand__text { line-height: 1.15; }
.brand__name {
  display: block;
  font-weight: 800; color: var(--blue);
  font-size: 1.4rem; letter-spacing: .02em;
  white-space: nowrap;
}
.brand__tag  {
  display: block;
  font-size: .7rem; color: var(--grey-500);
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  display: block;
  padding: 9px 10px;
  color: var(--grey-700);
  font-weight: 600;
  font-size: .92rem;
  border-radius: 8px;
  white-space: nowrap;
}
.nav__links a:hover { color: var(--blue); background: var(--grey-100); }
.nav__links a.is-active { color: var(--blue); }
.nav__links a.is-active::after {
  content: "";
  display: block;
  height: 3px;
  border-radius: 3px;
  background: var(--gold);
  margin-top: 4px;
}
.nav__cta { margin-left: 8px; }

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  width: 44px; height: 44px;
}
.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  display: block;
  height: 3px; width: 26px;
  background: var(--blue);
  border-radius: 3px;
  position: relative;
  transition: transform .2s ease, opacity .2s ease;
}
.nav__toggle span::before { position: absolute; top: -8px; }
.nav__toggle span::after  { position: absolute; top: 8px; }
.nav.is-open .nav__toggle span { background: transparent; }
.nav.is-open .nav__toggle span::before { transform: rotate(45deg) translate(5px, 6px); }
.nav.is-open .nav__toggle span::after  { transform: rotate(-45deg) translate(5px, -6px); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  color: #fff;
  min-height: clamp(520px, 82vh, 780px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  border-radius: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 22px, rgba(255,255,255,.015) 22px 44px),
    radial-gradient(1100px 600px at 72% 18%, rgba(245,179,43,.16), transparent 60%),
    linear-gradient(120deg, var(--blue-darker), var(--blue) 55%, var(--blue-dark));
}
/* Darkening overlay for cinematic contrast. Must outrank .hero__video (z-index 1)
   so the headline keeps its contrast over the footage. */
/* Darkening scrim over the hero video. The top end is weighted up because the
   gold eyebrow sits ~26% down, where the old .15 left it unreadable against
   bright factory footage. Measured: gold on this backdrop ~4.4:1. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(8,20,44,.5), rgba(8,20,44,.7));
}
.hero .wrap { width: 100%; }
.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  padding: 96px 0;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5.4vw, 3.8rem);
  margin-bottom: .35em;
  text-shadow: 0 2px 24px rgba(0,0,0,.28);
}
/* Gold on moving footage needs local contrast, not just a scrim: a uniform scrim
   can't cope with bright highlights drifting behind the glyphs. Scoped to .hero
   so eyebrows on light sections are untouched. */
.hero .eyebrow {
  text-shadow: 0 1px 2px rgba(0,0,0,.75), 0 0 10px rgba(0,0,0,.5);
}
.hero__sub {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: #e5edfa;
  margin: 0 auto 2.2rem;
  max-width: 660px;
  text-shadow: 0 1px 12px rgba(0,0,0,.4);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ==========================================================================
   Page hero (interior pages)
   ========================================================================== */
.page-hero {
  position: relative;
  color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: clamp(300px, 46vh, 440px);
}
.page-hero .wrap { width: 100%; }
.page-hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 0;
}
.page-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4.6vw, 3rem);
  margin-bottom: .3em;
  text-shadow: 0 2px 22px rgba(0,0,0,.28);
}
.page-hero__sub {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: #e5edfa;
  margin: 0 auto;
  max-width: 640px;
}
.page-hero__crumbs {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  font-size: .9rem;
  color: #cdd9ef;
}
.page-hero__crumbs a { color: var(--gold); }
.page-hero__crumbs a:hover { color: #fff; }

/* ==========================================================================
   Company story (text + photo)
   ========================================================================== */
.story-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 48px;
  align-items: center;
}
.story-copy p { color: var(--grey-700); font-size: 1.05rem; }
.story-copy p:last-child { margin-bottom: 0; }
.story-media.ph {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Key numbers strip (animated counters)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}
.stat {
  text-align: center;
  padding: 10px 12px;
  position: relative;
}
.stat:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -12px; top: 50%;
  transform: translateY(-50%);
  height: 56px; width: 1px;
  background: rgba(255,255,255,.18);
}
.stat__num {
  font-size: clamp(2rem, 3.2vw, 2.7rem);
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  letter-spacing: .01em;
}
.stat__label {
  margin-top: 10px;
  font-size: .95rem;
  color: #dbe6f7;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ==========================================================================
   Sectors strip
   ========================================================================== */
.grid { display: grid; gap: 24px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.sector-card {
  display: block;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
a.sector-card { color: inherit; }
a.sector-card h3 { color: var(--blue); }
.sector-card__link {
  display: inline-block;
  margin-top: 14px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--gold-dark);
}
.sector-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}
.sector-card__icon {
  width: 84px; height: 84px;
  margin: 0 auto 22px;
  border-radius: 20px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.sector-card:hover .sector-card__icon {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-color: var(--blue-dark);
  color: var(--gold);
  transform: scale(1.06);
}
.sector-card__icon svg { width: 42px; height: 42px; }
.sector-card h3 { margin-bottom: .4rem; font-size: 1.25rem; }
.sector-card p { color: var(--grey-700); font-size: .95rem; margin: 0; }

/* ==========================================================================
   Why choose us
   ========================================================================== */
.why-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.why-card__num {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.35rem;
}
.why-card h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.why-card p { color: var(--grey-700); margin: 0; font-size: .95rem; }

/* ==========================================================================
   Projects grid
   ========================================================================== */
.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}
.project-card {
  flex: 0 1 calc((100% - 44px) / 3);
  max-width: calc((100% - 44px) / 3);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--grey-200);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
/* Homepage completed-project cards are links through to the Projects page. */
a.project-card { display: block; color: inherit; }
a.project-card:hover .project-card__arrow { transform: translateX(3px); }
.project-card__arrow { transition: transform .15s ease; display: inline-block; }
/* Deep-linked project cards clear the sticky header when jumped to. */
.project-card[id] { scroll-margin-top: 100px; }
.project-card .ph { border: 0; border-radius: 0; aspect-ratio: 4 / 3; }
.project-card__body {
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.project-card__body h3 { font-size: .98rem; margin: 0; color: var(--ink); }
.project-card__arrow { color: var(--gold-dark); font-weight: 800; }

/* --- Projects page: sector jump-nav --- */
.sector-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.sector-nav a {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 18px;
  border: 1px solid var(--grey-200);
  border-radius: 999px;
  background: #fff;
  font-weight: 700; font-size: .95rem; color: var(--blue);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.sector-nav a:hover { border-color: var(--gold); background: var(--grey-50); transform: translateY(-2px); }
.sector-nav .count {
  background: var(--blue); color: #fff;
  font-size: .72rem; font-weight: 800;
  min-width: 22px; text-align: center;
  padding: 2px 7px; border-radius: 999px;
}

/* Left-aligned section header + sticky-safe anchor offset */
.section-head--left { text-align: left; max-width: none; margin: 0 0 28px; }
.section[id] { scroll-margin-top: 88px; }

/* --- Projects page: detailed project card (photo + name + desc + CTA) --- */
.project-card--detail { display: flex; flex-direction: column; }
.project-card--detail .project-card__body {
  display: flex; flex-direction: column;
  padding: 18px; flex: 1 1 auto;
}
.proj-tag {
  display: inline-block;
  font-size: .66rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--gold-dark);
  margin-bottom: 9px;
}
.project-card--detail h3 { font-size: 1.05rem; margin: 0 0 .45rem; color: var(--ink); }
.project-card--detail .proj-desc { color: var(--grey-700); font-size: .9rem; margin: 0 0 16px; }
.proj-cta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: auto;
  font-weight: 700; font-size: .88rem; color: var(--blue);
}
.proj-cta:hover { color: var(--blue-dark); }
.proj-cta span { transition: transform .15s ease; }
.proj-cta:hover span { transform: translateX(3px); }

/* --- Machines page: photo-led machine cards --- */
.machine-card { overflow: hidden; }
.machine-card__media { display: block; overflow: hidden; }
.machine-card .ph { aspect-ratio: 16 / 11; transition: transform .3s ease; }
.machine-card:hover .ph { transform: scale(1.05); }
.machine-card__body {
  padding: 18px 18px 20px;
  display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto;
}
.machine-card h3 { margin: 0; font-size: 1.25rem; color: var(--blue); }
.machine-card h3 a { color: inherit; }
.machine-card h3 a:hover { color: var(--blue-dark); }
.machine-card__actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: auto;
}
.btn--sm { padding: 8px 16px; font-size: .85rem; }

/* Note callout */
.note-callout {
  display: flex; align-items: center; gap: 14px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 22px;
  color: var(--grey-700); font-weight: 600;
  max-width: 820px; margin: 0 auto 40px;
}
.note-callout svg { color: var(--gold-dark); flex: 0 0 auto; }

/* --- Gallery pages --- */
.back-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--blue); }
.back-link:hover { color: var(--blue-dark); }
.back-link span { transition: transform .15s ease; }
.back-link:hover span { transform: translateX(-3px); }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.gallery-item {
  display: block; padding: 0; margin: 0; border: 0; background: none;
  cursor: pointer;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.gallery-item .ph { aspect-ratio: 4 / 3; width: 100%; }
.gallery-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* --- Lightbox --- */
.lightbox { position: fixed; inset: 0; z-index: 300; display: none; }
.lightbox.is-open { display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox__backdrop { position: absolute; inset: 0; background: rgba(8,16,34,.86); }
.lightbox__content { position: relative; z-index: 1; width: 100%; max-width: min(92vw, 1000px); text-align: center; }
.lightbox__stage {
  aspect-ratio: 4 / 3;
  border-radius: 12px; overflow: hidden;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 22px, rgba(255,255,255,.03) 22px 44px),
    var(--blue-dark);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.85); font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.lightbox__stage img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.lightbox__caption { color: #e5edfa; margin-top: 14px; font-size: .95rem; letter-spacing: .02em; }
.lightbox__close, .lightbox__nav {
  position: absolute; z-index: 2;
  background: rgba(255,255,255,.15); color: #fff; border: 0;
  width: 46px; height: 46px; border-radius: 50%;
  cursor: pointer; font-size: 1.6rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.3); }
.lightbox__close { top: -58px; right: 0; }
.lightbox__nav--prev { left: -64px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: -64px; top: 50%; transform: translateY(-50%); }
@media (max-width: 760px) {
  .lightbox__nav--prev { left: 6px; }
  .lightbox__nav--next { right: 6px; }
  .lightbox__close { top: -52px; right: 6px; }
}

/* ==========================================================================
   Partners page — brand cards
   ========================================================================== */
.partner-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.partner-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.partner-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.partner-card__logo {
  height: 120px;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  background: var(--grey-50);
  border-bottom: 1px solid var(--grey-100);
}
.partner-card__logo img {
  max-height: 74px; max-width: 82%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .82;
  transition: filter .25s ease, opacity .25s ease;
}
a.partner-card:hover .partner-card__logo img { filter: grayscale(0); opacity: 1; }
.partner-card__logo .ph {
  width: 100%; height: 100%;
  filter: grayscale(1);
  transition: filter .25s ease;
}
a.partner-card:hover .partner-card__logo .ph { filter: grayscale(0); }
.partner-card__body {
  padding: 20px;
  display: flex; flex-direction: column; flex: 1 1 auto;
}
.partner-card__country {
  display: inline-block;
  font-size: .7rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold-dark);
  margin-bottom: 7px;
}
.partner-card__body h3 { font-size: 1.15rem; margin: 0 0 .4rem; color: var(--blue); }
.partner-card__desc { color: var(--grey-700); font-size: .9rem; margin: 0 0 16px; }
.partner-card__link {
  margin-top: auto;
  font-weight: 700; font-size: .85rem; color: var(--blue);
  display: inline-flex; align-items: center; gap: 5px;
}
a.partner-card:hover .partner-card__link { color: var(--blue-dark); }
.partner-card__link span { transition: transform .15s ease; }
a.partner-card:hover .partner-card__link span { transform: translate(2px, -2px); }
.partner-card__note {
  margin-top: auto;
  font-size: .82rem; color: var(--grey-500); font-style: italic;
}

/* ==========================================================================
   Spare Parts page — live search + part cards
   ========================================================================== */
.parts-search { position: relative; max-width: 520px; margin: 22px auto 0; }
.parts-search input {
  width: 100%;
  padding: 14px 44px 14px 46px;
  border: 1px solid var(--grey-300);
  border-radius: 999px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.parts-search input::placeholder { color: var(--grey-500); }
.parts-search input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27, 79, 156, .14);
}
.parts-search__icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--grey-500); pointer-events: none;
}
.parts-search__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: var(--grey-100); color: var(--grey-700);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
  display: none; align-items: center; justify-content: center;
}
.parts-search__clear.is-visible { display: flex; }
.parts-search__clear:hover { background: var(--grey-200); }

.part-card h3 { font-size: 1rem; }
.parts-noresults { display: none; text-align: center; color: var(--grey-500); padding: 40px 0; }
.parts-noresults strong { color: var(--ink); }

/* ==========================================================================
   Imports page
   ========================================================================== */
.keymsg {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  background: var(--gold);
  color: var(--blue-darker);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.keymsg svg { flex: 0 0 auto; }
.keymsg strong { font-size: clamp(1.2rem, 2.8vw, 1.75rem); font-weight: 800; line-height: 1.25; }

.region-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.region-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.region-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}
.region-card__media.ph {
  aspect-ratio: 16 / 10;   /* larger photo area */
  border: 0;
  border-radius: 0;
}
.region-card__body {
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.region-card h3 { font-size: 1.35rem; margin: 0 0 .55rem; }
.region-card .region-countries {
  color: var(--grey-700);
  font-size: .95rem;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Contact page — big tap cards + map
   ========================================================================== */
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.contact-card {
  display: flex; flex-direction: column; gap: 8px;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.contact-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--gold); }
.contact-card__icon {
  width: 60px; height: 60px; border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.contact-card--wa .contact-card__icon { background: #25D366; color: #fff; }
.contact-card__icon svg { width: 28px; height: 28px; }
.contact-card__label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--gold-dark); font-weight: 800;
}
.contact-card h3 { font-size: 1.2rem; margin: 0; color: var(--blue); }
.contact-card__value { color: var(--grey-700); font-size: 1rem; margin: 0; }
.contact-card .tel-list { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.contact-card .tel-list a { font-size: 1.15rem; font-weight: 700; color: var(--blue); }
.contact-card .tel-list a:hover { color: var(--blue-dark); }
.contact-card__cta { margin-top: 10px; font-weight: 700; font-size: .9rem; color: var(--blue); }
.contact-card--wa .contact-card__cta { color: #1a9c4e; }

.map-embed {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--grey-200);
}
.map-embed iframe { display: block; width: 100%; height: 440px; border: 0; }

/* ==========================================================================
   Partners strip
   ========================================================================== */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.partner-logo {
  height: 62px;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 14px;
  overflow: hidden;
}
.partner-logo img {
  max-height: 100%; max-width: 100%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .8;
  transition: filter .25s ease, opacity .25s ease;
}
.partner-logo:hover img { filter: grayscale(0); opacity: 1; }
.partner-logo.ph {
  aspect-ratio: auto;
  height: 62px;
  color: var(--grey-500);
  font-size: .72rem;
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: start;
}
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.contact-list .ci-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 2px;
}
.contact-list .ci-value { color: #eaf0fa; font-size: 1.02rem; }
.contact-list a { color: #eaf0fa; }
.contact-list a:hover { color: #fff; text-decoration: underline; }
.contact-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.10);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.contact-icon svg { width: 20px; height: 20px; }

.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* Live map inside the dark "Get in touch" block (every page). */
.contact-map {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: var(--shadow-md);
  /* Gradient shows while the iframe loads. */
  background: linear-gradient(120deg, var(--blue-darker), var(--blue-dark));
}
.contact-map iframe { display: block; width: 100%; height: 100%; border: 0; }

/* WhatsApp button */
.btn--whatsapp { background: #25D366; color: #06331b; }
.btn--whatsapp:hover { background: #1eb257; color: #06331b; box-shadow: var(--shadow-md); }

/* Floating WhatsApp */
.wa-float {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 200;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform .15s ease;
}
.wa-float:hover { transform: scale(1.07); color: #fff; }
.wa-float svg { width: 30px; height: 30px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--blue-darker);
  color: #c8d5ea;
  padding: 56px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #c8d5ea; font-size: .93rem; }
.footer-links a:hover { color: var(--gold); }
.footer-brand .brand__name { color: #fff; }
.footer-brand p { color: #9fb2d0; font-size: .9rem; max-width: 320px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 20px;
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: space-between;
  font-size: .85rem;
  color: #8ea3c4;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
/* Collapse the dense 8-link nav to a hamburger until the screen is wide enough
   for the full bar (brand + 8 links + CTA need ~1180px). Prevents nav overflow. */
@media (max-width: 1240px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--grey-200);
    box-shadow: var(--shadow-md);
    padding: 8px 16px 16px;
    display: none;
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__links a { padding: 12px 8px; border-radius: 6px; }
  .nav__links a.is-active::after { display: none; }
  .nav__cta { margin: 8px 0 0; }
}

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .partners-grid { grid-template-columns: repeat(5, 1fr); }
  /* 5 stats: 3 + 2. Drop the divider at each row's end. */
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 32px 16px; }
  .stat:nth-child(3n)::after { display: none; }
}

@media (max-width: 860px) {
  .grid--3 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  /* Stacked: a 4:3 map eats the whole viewport — flatten it. */
  .contact-map { aspect-ratio: 16 / 11; }
  .map-embed iframe { height: 340px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .story-grid { grid-template-columns: 1fr; gap: 32px; }
  .story-media.ph { aspect-ratio: 16 / 10; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
  .stat:not(:last-child)::after { display: none; }
  /* keep a divider only between the two columns' rows would be messy — omit on stacked */
  /* Odd count: the trailing stat spans both columns instead of sitting alone. */
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .section { padding: 40px 0; }
  .grid--4 { grid-template-columns: 1fr; }           /* sectors -> single column */
  .project-card { flex: 0 1 100%; max-width: 100%; }  /* projects -> single column */
  .partners-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { min-height: clamp(440px, 70vh, 620px); }
  .hero__inner { padding: 64px 0; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand__tag { display: none; }
  .page-hero__inner { padding: 56px 0; }
  /* keep the header compact on phones */
  .nav { min-height: 76px; }
  .brand { gap: 12px; }
  .brand__logo { height: 58px; }
  .brand__logo.ph { width: 78px; height: 58px; }
  .brand__name { font-size: 1.25rem; }
}

@media (max-width: 400px) {
  .partners-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Projects-page detailed cards: 3-col (default) -> 2-col -> 1-col.
   Placed last so these win over the generic .project-card rules above. */
@media (max-width: 900px) {
  .project-card--detail { flex: 0 1 calc((100% - 22px) / 2); max-width: calc((100% - 22px) / 2); }
}
@media (max-width: 560px) {
  .project-card--detail { flex: 0 1 100%; max-width: 100%; }
}

/* Partner cards: 3 -> 2 -> 1 */
@media (max-width: 900px) { .partner-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .partner-cards { grid-template-columns: 1fr; } }

/* Region cards: 4 -> 2 -> 1 */
@media (max-width: 900px) { .region-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .region-cards { grid-template-columns: 1fr; } }

/* Contact cards: 3 -> 2 -> 1 */
@media (max-width: 900px) { .contact-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .contact-cards { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .map-embed iframe { height: 340px; } }

/* Gallery grid: 4 -> 3 -> 2 -> 1 */
@media (max-width: 1024px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .machine-card__actions { flex-direction: column; align-items: stretch; }
  .machine-card__actions .btn { text-align: center; justify-content: center; }
}
@media (max-width: 420px)  { .gallery-grid { grid-template-columns: 1fr; } }
