/* =====================================================================
   METAL MPR — dizajn sistem
   Tema: čelik + kobalt (signalna boja), tehnički datasheet stil
   ===================================================================== */
:root {
  --paper: #f1f3f5;
  --panel: #ffffff;
  --panel-2: #f7f8f9;
  --ink: #14161a;
  --steel: #565e67;
  --steel-2: #8a919a;
  --line: #dee1e6;
  --line-soft: #e8eaee;
  --signal: #1b4be0;
  --signal-deep: #0f34ac;
  --signal-tint: #eaeefc;
  --amber: #e8a23a;
  --ok: #1f9d5b;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 12px 32px -18px rgba(20, 22, 26, .28);
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .05), 0 6px 18px -12px rgba(20, 22, 26, .22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
body { overflow-x: hidden; }
[id] { scroll-margin-top: 84px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ---- Type ---- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; margin: 0; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: .55em;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--signal);
  display: inline-block;
}

/* ---- Buttons ---- */
.btn {
  --bg: var(--signal); --fg: #fff; --bd: var(--signal);
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: -.01em;
  padding: .78em 1.35em;
  border-radius: 999px;
  border: 1.5px solid var(--bd);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--signal-deep); border-color: var(--signal-deep); transform: translateY(-1px); }
.btn.ghost { --bg: transparent; --fg: var(--ink); --bd: var(--line); }
.btn.ghost:hover { --bg: var(--panel); border-color: var(--ink); transform: translateY(-1px); }
.btn.small { padding: .55em 1em; font-size: .85rem; }
.btn svg { width: 1em; height: 1em; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; font-size: 1.15rem; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
.brand .swatch {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--signal), var(--signal-deep));
  position: relative; flex: none;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.28);
}
.brand small { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em; color: var(--steel-2); display: block; margin-top: 1px; }
.header-collapse { display: flex; align-items: center; gap: 1.2rem; margin-left: auto; }
.nav { display: flex; align-items: center; gap: .3rem; }
.nav a {
  font-family: var(--font-display); font-weight: 500; font-size: .92rem;
  padding: .5rem .85rem; border-radius: 999px; color: var(--steel);
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--ink); background: var(--panel); }
.nav a.active { color: var(--signal); }
.header-cta { display: inline-flex; align-items: center; gap: .9rem; }
.header-phone { font-family: var(--font-mono); font-size: .82rem; color: var(--ink); white-space: nowrap; }
.header-phone span { color: var(--steel-2); }
.header-phone:hover { color: var(--signal); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1.5px solid var(--line); border-radius: 10px; width: 42px; height: 42px; cursor: pointer; align-items: center; justify-content: center; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after { content: ""; display: block; width: 18px; height: 2px; background: var(--ink); position: relative; transition: transform .2s; }
.menu-toggle span::before { position: absolute; top: -6px; }
.menu-toggle span::after { position: absolute; top: 6px; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 96px) 0 clamp(36px, 6vw, 64px); }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 88% -10%, var(--signal-tint), transparent 60%),
    linear-gradient(180deg, #fff, var(--paper));
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); margin: .5rem 0 1rem; }
.hero h1 .accent { color: var(--signal); }
.hero p.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--steel); max-width: 44ch; margin: 0 0 1.8rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.hero-visual { position: relative; }
.hero-visual .frame {
  border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--panel); box-shadow: var(--shadow); aspect-ratio: 4/3;
}
.hero-visual .frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual .tag {
  position: absolute; left: -14px; bottom: 20px;
  background: var(--ink); color: #fff; font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .08em; padding: .6rem .9rem; border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.hero-visual .tag b { color: var(--amber); }

/* ---- Stat strip ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: clamp(28px, 5vw, 46px); }
.stats .cell { background: var(--panel); padding: 1.15rem 1.25rem; }
.stats .val { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.03em; }
.stats .lbl { font-size: .82rem; color: var(--steel); margin-top: .15rem; }

/* ---- Sections ---- */
section.block { padding: clamp(48px, 8vw, 88px) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: clamp(24px, 4vw, 40px); flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.section-head p { color: var(--steel); max-width: 46ch; margin: .5rem 0 0; }

/* ---- Category chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .02em;
  padding: .5rem .95rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--panel); color: var(--steel); cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { color: var(--steel-2); margin-left: .35em; }
.chip.active .n { color: rgba(255,255,255,.6); }

/* ---- Product grid ---- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: clamp(16px, 2vw, 24px); }
.card {
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--signal) 40%, var(--line)); }
.card .thumb { aspect-ratio: 4/3; background: var(--panel-2); position: relative; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 12px; transition: transform .35s ease; }
.card:hover .thumb img { transform: scale(1.04); }
.card .cat-badge {
  position: absolute; top: 10px; left: 10px; font-family: var(--font-mono);
  font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(4px);
  border: 1px solid var(--line); color: var(--steel); padding: .28rem .55rem; border-radius: 7px;
}
.card .body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card h3 { font-size: 1.12rem; letter-spacing: -.01em; }
.card .short { font-size: .9rem; color: var(--steel); flex: 1; }
.card .card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; }
.card .spec-hint { font-family: var(--font-mono); font-size: .72rem; color: var(--steel-2); }
.card .arrow { color: var(--signal); font-weight: 600; font-family: var(--font-display); font-size: .88rem; display: inline-flex; align-items: center; gap: .3em; }

/* ---- Datasheet / spec table ---- */
.datasheet { border: 1.5px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--panel); }
.datasheet .row { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-soft); }
.datasheet .row:first-child { border-top: none; }
.datasheet .k { font-size: .82rem; color: var(--steel); padding: .7rem .9rem; background: var(--panel-2); }
.datasheet .v { font-family: var(--font-mono); font-size: .84rem; padding: .7rem .9rem; color: var(--ink); }

/* ---- Product detail ---- */
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.gallery .main {
  border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--panel);
  aspect-ratio: 1/1; overflow: hidden; display: grid; place-items: center;
}
.gallery .main img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.gallery .thumbs { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.gallery .thumbs button {
  width: 72px; height: 72px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--panel); overflow: hidden; cursor: pointer; padding: 4px; transition: border-color .15s;
}
.gallery .thumbs button.active { border-color: var(--signal); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pd .info h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: .5rem 0 .6rem; }
.pd .info .desc p { color: var(--steel); margin: 0 0 .9rem; }
.pd .info .actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.video-embed { margin-top: 1.4rem; border-radius: var(--r-md); overflow: hidden; border: 1.5px solid var(--line); aspect-ratio: 16/9; }
.video-embed iframe { width: 100%; height: 100%; border: 0; }

/* ---- About ---- */
.about-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.about-grid .lede p { color: var(--steel); }
.about-grid .lede p:first-of-type { font-size: 1.1rem; color: var(--ink); }
.figure { border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); box-shadow: var(--shadow-sm); }
.figure img { width: 100%; }
.figure figcaption { font-family: var(--font-mono); font-size: .74rem; color: var(--steel); padding: .7rem .9rem; border-top: 1px solid var(--line); }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.adv { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 1.1rem 1.2rem; background: var(--panel); }
.adv .num { font-family: var(--font-mono); font-size: .74rem; color: var(--signal); }
.adv h4 { margin: .35rem 0 .3rem; font-size: 1.05rem; }
.adv p { font-size: .88rem; color: var(--steel); margin: 0; }

/* ---- Programs ---- */
.programs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.programs .p { background: var(--panel); padding: 1.3rem 1.35rem; }
.programs .p h4 { font-size: 1.08rem; margin-bottom: .4rem; }
.programs .p p { font-size: .88rem; color: var(--steel); margin: 0; }

/* ---- Reference / clients ---- */
.clients { display: flex; flex-wrap: wrap; gap: .6rem; }
.clients .c {
  font-family: var(--font-display); font-weight: 500; font-size: .95rem;
  border: 1.5px solid var(--line); border-radius: 999px; padding: .5rem 1.1rem; background: var(--panel);
}

/* ---- Documents ---- */
.docs { display: grid; gap: .7rem; }
.doc {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--panel);
  transition: border-color .15s, transform .15s;
}
.doc:hover { border-color: var(--signal); transform: translateX(3px); }
.doc .ico { width: 38px; height: 38px; border-radius: 9px; background: var(--signal-tint); color: var(--signal); display: grid; place-items: center; flex: none; }
.doc .meta { flex: 1; }
.doc .meta b { font-family: var(--font-display); font-weight: 500; }
.doc .meta small { display: block; font-family: var(--font-mono); font-size: .7rem; color: var(--steel-2); }
.doc .dl { color: var(--signal); font-family: var(--font-display); font-weight: 500; font-size: .85rem; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.contact-card { border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.contact-card .cc-row { display: flex; gap: 1rem; padding: 1.1rem 1.3rem; border-top: 1px solid var(--line-soft); }
.contact-card .cc-row:first-child { border-top: none; }
.contact-card .cc-row .ico { color: var(--signal); flex: none; margin-top: 2px; }
.contact-card .cc-row .k { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--steel-2); }
.contact-card .cc-row .v { font-size: 1rem; }
.contact-card .cc-row .v a:hover { color: var(--signal); }
.form { display: grid; gap: 1rem; }
.form .field { display: grid; gap: .4rem; }
.form label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--steel); }
.form label .req { color: var(--signal); }
.form input, .form textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .8rem .95rem; background: var(--panel);
  transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-tint); }
.form textarea { min-height: 130px; resize: vertical; }
.form .note { font-size: .8rem; color: var(--steel-2); }
.map-embed { border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-top: 1.5rem; aspect-ratio: 16/8; }
.map-embed iframe { width: 100%; height: 100%; border: 0; }

/* ---- CTA band ---- */
.cta-band { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: clamp(28px, 5vw, 52px); display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
.cta-band h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.cta-band p { color: rgba(255,255,255,.7); margin: .5rem 0 0; }
.cta-band .btn.ghost { --fg: #fff; --bd: rgba(255,255,255,.3); }
.cta-band .btn.ghost:hover { --bg: rgba(255,255,255,.08); border-color: #fff; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(40px, 6vw, 72px); padding: clamp(36px, 5vw, 56px) 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid .about-col p { color: var(--steel); font-size: .9rem; max-width: 38ch; }
.footer-col h5 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--steel-2); margin: 0 0 .8rem; }
.footer-col a, .footer-col p { display: block; font-size: .92rem; color: var(--steel); margin-bottom: .45rem; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: .74rem; color: var(--steel-2); }

/* ---- Breadcrumb ---- */
.crumbs { font-family: var(--font-mono); font-size: .76rem; color: var(--steel-2); padding: 1.5rem 0 0; display: flex; gap: .5rem; align-items: center; }
.crumbs a:hover { color: var(--signal); }

/* ---- Utilities ---- */
.hidden { display: none !important; }
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-grid, .pd, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { grid-template-columns: 1fr; }
  .cta-band .btn { width: 100%; justify-content: center; }

  .menu-toggle { display: inline-flex; margin-left: auto; }

  /* Padajući mobilni meni */
  .header-collapse {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--panel); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); padding: .5rem var(--gutter) 1.1rem;
    max-height: calc(100vh - 60px); overflow-y: auto;
  }
  .site-header.open .header-collapse { display: flex; }
  .header-collapse .nav { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .header-collapse .nav a { padding: .95rem .25rem; border-bottom: 1px solid var(--line-soft); font-size: 1.02rem; border-radius: 0; }
  .header-collapse .nav a:hover { background: transparent; }
  .header-cta { flex-direction: column; align-items: stretch; gap: .8rem; margin-top: 1rem; }
  .header-phone { font-size: 1rem; padding: .3rem .25rem; }
  .header-cta .btn { width: 100%; justify-content: center; padding: .9em 1.35em; }

  /* Hamburger -> X */
  .site-header.open .menu-toggle span { background: transparent; }
  .site-header.open .menu-toggle span::before { top: 0; transform: rotate(45deg); }
  .site-header.open .menu-toggle span::after { top: 0; transform: rotate(-45deg); }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .site-header .bar { height: 60px; }
  .menu-toggle { width: 44px; height: 44px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: .4rem; }
  .datasheet .row { grid-template-columns: 1fr; }
  .datasheet .k { border-bottom: 1px solid var(--line-soft); }
  .datasheet .v { padding-top: .5rem; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: clamp(2.1rem, 9vw, 3rem); }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .pd .info .actions .btn { flex: 1 1 auto; justify-content: center; }
  .gallery .thumbs button { width: 60px; height: 60px; }
  .crumbs { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
