/* ================================
   RESET / BAS
==================================*/
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  color: #fff;
  text-align: center;
  min-height: 100vh;

  /* GLOBAL BAKGRUND (undersidor + startsidan) */
  background:
    linear-gradient(rgba(0,0,0,0.90), rgba(0,0,0,0.95)),
    url("bg_robot.png") center/cover fixed no-repeat;
}

a {
  color: inherit;
  text-decoration: none;
}

a, button {
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #ff3030;
}

/* ================================
   GLOBAL KONTAKT-KNAPP (ALLTID UPPE)
==================================*/
.topbar-fixed {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
}

.contact-link {
  background: #d10000;
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-weight: bold;
  font-size: 1rem;
  border: 2px solid #b00000;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  white-space: nowrap;
}

.contact-link:hover {
  background: #ff3030;
  transform: translateY(-2px);
}

/* ================================
   STARTSIDA: HERO (HEADER)
   - bakgrundsbild bg_robot.png
   - logga centrerad
   - 10rem från top
==================================*/

/* STARTSIDANS HERO-HEADER */
header.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  background:
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.75)),
    url("bg_robot.png") center/cover no-repeat;
  display: flex;
  align-items: flex-start; /* Börjar uppifrån */
  justify-content: center;
}

/* Logga centrerad 10rem från top */
.hero-logo-wrap {
  margin-top: 10rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.hero-logo {
  width: 100px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.6));
}

body.index-page header {
  position: relative;
  height: 100vh; /* som innan */
  width: 100%;

  background:
    linear-gradient(rgba(0,0,0,0.40), rgba(0,0,0,0.55)),
    url("bg_robot.png") center/cover no-repeat;

  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* LOGGA I HERO */
body.index-page .header-overlay {
  position: absolute;
  top: 10rem;           /* enligt önskemål */
  left: 50%;
  transform: translateX(-50%);

  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  padding: 0.6rem 1rem;
  border-radius: 15px;
  box-shadow: 0 0 18px rgba(0,0,0,0.5);

  display: flex;
  justify-content: center;
  align-items: center;
}

body.index-page .header-overlay .logo {
  width: 100px;   
  height: auto;
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.6));
}

/* Mobilanpassning */
@media (max-width: 600px) {
  body.index-page .header-overlay .logo {
    width: 70px;
  }
}

/* ================================
   INTRO (texten under hero)
==================================*/
.intro {
  max-width: 850px;
  margin: 3rem auto 1rem;
  padding: 0 1.5rem;
  color: #ccc;
  font-size: 1.1rem;
  line-height: 1.6;
}

.intro strong {
  color: #fff;
}

/* ================================
   KNAPP-KORT (KAP, CNC, PLC, CAD)
==================================*/
.buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 1rem;
  row-gap: 3rem;
  padding: 5rem 8rem;

  background:
    linear-gradient(rgba(0,0,0,0.60), rgba(0,0,0,0.85)),
    url("bg_robot.png") center/cover fixed no-repeat;

  backdrop-filter: blur(4px);
  border-top: 2px solid #d10000;
  border-bottom: 2px solid #d10000;
}

.button-card-link {
  width: 430px;
  max-width: 100%;
  display: block;
  border-radius: 15px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.button-card-link:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 35px rgba(209,0,0,0.6);
}

.button-card {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.button-card h3 {
  margin: 0;
  padding: 1rem 0;
  font-size: 1.6rem;
}

.button-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.button-card .card-content {
  padding: 1.2rem 1.2rem 0;
}

.button-card p {
  color: #ccc;
  font-size: 1rem;
  text-align: left;
}

.button-card button {
  width: 100%;
  background: #d10000;
  color: #fff;
  padding: 1rem;
  border: none;
  font-weight: bold;
  font-size: 1.1rem;
}

.button-card button:hover {
  background: #a80000;
}

/* ================================
   UNDERSIDOR HEADER + NAV
   (Hamburgarmeny)
==================================*/
.inner-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(16,16,16,0.85);
  backdrop-filter: blur(6px);
  padding: 0.8rem 2rem 0.8rem 0;
  border-bottom: 2px solid #d10000;
  border-top: 1px solid #d10000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inner-header img {
  height: 70px;
  width: auto;
}

/* ...resten av menyn samma som tidigare (ej ändrat) ... */

/* ================================
   RESPONSIVT
==================================*/
@media (max-width: 900px) {
  .buttons {
    grid-template-columns: 1fr;
    padding: 3rem 1.25rem 4rem;
  }
}



/* ============================
   RESPONSIVE LAYOUT (Mobile Fix)
   — Android S23 Ultra friendly
   ============================ */
:root {
  --page-max-desktop: 1100px;
  --page-max-mobile: 420px;
}

html, body { overflow-x: hidden; }

/* Constrain main blocks so content doesn't span too wide on phones */
body > header,
body > section,
body > main,
body > footer {
  max-width: var(--page-max-desktop);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* Top bar: language + contact. Convert to flexible layout and prevent overlap */
.topbar-fixed {
  position: fixed;
  top: 8px;
  left: 8px;
  right: 8px;
  padding: 6px 10px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
}

.lang-switch {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  font-size: .95rem;
  flex-wrap: wrap;
}

.lang-switch a { text-decoration: none; opacity: .9; }
.lang-switch a.active { font-weight: 700; opacity: 1; }
.lang-sep { opacity: .6; }

.contact-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(209,0,0,0.9);
  text-decoration: none;
  white-space: nowrap;
}

/* Ensure hero content isn't hidden behind fixed topbar */
.hero { padding-top: 72px; }

/* --- Responsive image scaling across inner pages --- */
img { max-width: 100%; height: auto; display: block; }

.button-card img { /* home cards */
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 12px;
}

.machine { width: 100%; height: auto; border-radius: 12px; }

.image-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.image-box { overflow: hidden; border-radius: 12px; }
.image-box img { width: 100%; height: 100%; object-fit: cover; }
.image-box--cover { aspect-ratio: 16 / 9; }

/* --- Breakpoints --- */
@media (max-width: 900px) {
  .image-pair { grid-template-columns: 1fr; }
  .button-card img { height: 200px; }
}

@media (max-width: 600px) {
  body > header,
  body > section,
  body > main,
  body > footer {
    max-width: var(--page-max-mobile);
  }
  .topbar-fixed {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .lang-switch {
    justify-content: center;
  }
  .contact-link {
    text-align: center;
    width: 100%;
  }
  .hero { padding-top: 92px; } /* extra space so content clears the bar */
  .button-card img { height: 170px; }
  .image-box--cover { aspect-ratio: 4 / 3; }
}

@media (max-width: 380px) {
  :root { --page-max-mobile: 360px; }
}
