/* 1) Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 2) Theme */
:root {
  --primary: #3a88e2;
  --primary-light: #004080;
  --accent: #cc0000;
  --bg: #f9f9f9;
  --bg-alt: #fff;
  --text: #222;
  --text-light: #555;
  --shadow: rgba(0, 0, 0, 0.1);
}

/* 3) Layout helpers */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
.flex {
  display: flex;
}
.center {
  justify-content: center;
  align-items: center;
}

/* 4) Header & Nav */
header {
  background: var(--primary);
  color: #fff;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 5px var(--shadow);
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header .logo img {
  height: 70px;
  margin: -0.5rem;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}
nav a {
  color: #fff;
  text-decoration: none;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  border-radius: 0; /* square corners */
  transition: background 0.2s;
}
nav a:hover,
nav a.active {
  background: var(--accent);
}

/* 5) Mobile menu */
#menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}
@media (max-width: 768px) {
  nav ul {
    display: none;
    flex-direction: column;
    background: var(--primary);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
  }
  nav ul.show {
    display: flex;
  }
  #menu-toggle {
    display: block;
  }
}

/* HERO: full‑screen background + bottom caption bar */
.hero {
  position: relative;
  /* restore your full‑screen photo: */
  background: url('Pics/IMG_1773_1.JPG') 50% 30% / cover no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* remove side fades entirely */
.hero::before,
.hero::after {
  content: none;
}

/* caption bar at bottom */
.hero .overlay {
  position: absolute;
  bottom: 7rem;                   /* lift off bottom edge */
  left: 50%;
  transform: translateX(-50%);
  background: #0000006d;               /* solid black */
  padding: 1rem 2rem;
  border-radius: 8px;
  text-align: center;
  z-index: 2;
  max-width: 90%;                 /* small side margins */
}

/* ensure text and button sit inside that bar */
.hero .overlay h1,
.hero .overlay p,
.hero .overlay .btn {
  color: #fff;
  margin: 0.35rem 0;
}

/* tighter sizing for text */
.hero .overlay h1 {
  font-size: 2rem;
  line-height: 1.2;
}
.hero .overlay p {
  font-size: 1.25rem;
  line-height: 1.4;
}


/* 6) Working with You Section */
.img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  border: 1px solid var(--shadow);
  border-radius: 8px;
  background: var(--bg-alt);
  padding: 1.5rem;
  width: 90%; max-width: 1400px;
  margin: 1rem auto;
}
.img-row img,
.img-text {
  flex: 0 1 45%;
}
.img-row img {
  max-height: 400px;
  object-fit: cover;
  border-radius: 4px;
  margin: 1rem 0;
}
.img-text {
  text-align: left;
}
.img-text h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.img-text p {
  color: var(--text-light);
  line-height: 1.6;
}

/* 8) Buttons */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 0.95rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn:hover {
  background: var(--primary-light);
}

/* 9) Applications section as two‑column 4×3 grid, boxed */
.applications {
  border: 1px solid var(--shadow);
  border-radius: 8px;
  background: var(--bg-alt);
  padding: 1.5rem;
  margin: 0 auto;
  max-width: 1200px;
}
.applications .grid-container {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}
.app-heading h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary);
}
.app-heading p {
  margin-top: 0.5rem;
  color: var(--text-light);
  line-height: 1.4;
}
.applications .application-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.75rem;
}
.application-item {
  background: #fff;
  color: #333;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  text-align: center;
  border-radius: 4px;
  box-shadow: 0 1px 4px var(--shadow);
  font-size: 1rem;
}

/* 10) Product table tweaks */
main h2 {
  margin: 2rem 0 1rem;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  border: 1px solid var(--shadow);
  padding: 0.75rem;
  text-align: left;
}
th {
  background: var(--primary);
  color: #fff;
}
td img {
  display: block;
  margin: 0 auto;
  max-width: 100px;
}

/* 11) About & Contact styling */
section.about,
section.contact {
  background: var(--bg-alt);
  padding: 2rem 0;
  margin: 2rem auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
  width: 90%;
  max-width: 1200px;
}
section.about h2,
section.contact h2 {
  margin-bottom: 1rem;
  color: var(--primary);
}
section.about p,
section.contact p {
  line-height: 1.6;
  color: var(--text-light);
}
.contact ul.info li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-light);
}
.contact ul.info li i {
  color: var(--primary);
}

/* 12) Footer */
footer {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 1rem 0;
  margin-top: 1rem;
}
footer p {
  font-size: 0.9rem;
}

/* 13) Responsive tweaks */
@media (max-width: 768px) {
  .img-row {
    flex-direction: column;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .applications .app-heading {
    margin-top: 1rem;
  }
  .applications .grid-container {
    grid-template-columns: 1fr;
  }
  .applications .application-list {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 1rem;
  }
  /* slightly smaller padding on each link and extra bottom spacing */
  nav ul li a {
    padding: 0.75rem 1rem;
  }
  nav ul li {
    margin-left: 20px;
    margin-bottom: 1.5rem;
  }
  nav ul {
    padding-top: 10px;
  }
}

/* 14) Prevent any page‑wide overflow */
html, body {
  overflow-x: hidden;
}

/* ------------------------------------------
   COLLAPSE IMG‑ROW (“Working with You”)
-------------------------------------------*/
/* Single‑column from 0–768px */
@media (max-width: 768px) {
  .img-row {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin: 2rem auto;
    padding: 1rem;
  }
  .img-row img,
  .img-text {
    flex: 0 1 100%;
  }
  .img-row img {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
  }
  .img-text {
    text-align: center;
    margin-bottom: 1rem;
  }
}

/* Also collapse from 768–1197px (prevents bleeding) */
@media (min-width: 769px) and (max-width: 1197px) {
  .img-row {
    flex-direction: column;
    width: 90%;
    max-width: 90%;
    margin: 2rem auto;
    padding: 1.5rem;
  }
  .img-row img,
  .img-text {
    flex: 0 1 100%;
  }
  .img-text {
    text-align: left;
  }
}

/* ------------------------------------------
   COLLAPSE APPLICATIONS GRID
-------------------------------------------*/
/* At 0–960px: single‑column stack (heading + list) */
@media (max-width: 1000px) {
  .applications .grid-container {
    grid-template-columns: 1fr;  /* stack */
    gap: 1.5rem;
  }
}
/* At 961–1197px: two columns but narrower left col */
@media (min-width: 1001px) and (max-width: 1197px) {
  .applications .grid-container {
    grid-template-columns: 200px 1fr; /* fixed 200px heading, rest grid */
    gap: 1.5rem;
  }
}
/* Mobile grid adjustments (≤600px): 2‑column cards */
@media (max-width: 600px) {
  .applications .application-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

/* ------------------------------------------
   PRODUCTS TABLE SCROLL
-------------------------------------------*/
/* ≤768px: make table horizontally scrollable */
@media (max-width: 768px) {
  main table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  main th,
  main td {
    display: table-cell;
  }
}

/* ------------------------------------------
   GLOBAL OVERFLOW & CONTAINERS
-------------------------------------------*/
html, body {
  overflow-x: hidden;
}
.container {
  width: 90%;
  max-width: 1600px;
}
@media (max-width: 600px) {
  .container { padding: 0 0.5rem; }
}
