:root {
  --padding-right-for-menu-items: 10em;
  --padding-right-for-menu-items-mobile: 1em;
  --primary: #c00000;
  --primary-dark: #a80000;
  --accent: #3953A3;
}

/* === GLOBAL RESET === */
html,
body {
  margin: 0;
  font-family: 'Barlow', sans-serif !important;
  height: 100%;
  padding: 0;
  scroll-behavior: smooth;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.content-container {
  box-sizing: border-box;
  flex: 1;
  padding-top: 0;
}

/* === LOGO === */
.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 50px;
  width: auto;
}

/* === PRIMARY NAVIGATION === */
.primary-nav {
  background-color: #eee;
  padding: 1em var(--padding-right-for-menu-items);
  border-bottom: 1px solid #ccc;
  box-sizing: border-box;
  position: relative;
  width: 100%;
  z-index: 1001;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.nav-header {
  display: flex;
  justify-content: space-between;
}

.hamburger {
  font-size: 28px;
  cursor: pointer;
  display: none;
  position: relative;
  margin-left: auto;
  z-index: 2100;
}

.hamburger::before {
  content: "\2630";
  font-size: 28px;
  display: inline-block;
}

.hamburger.open::before {
  content: "\00d7";
  font-size: 32px;
}

.nav-collapse {
  display: none;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: 2em;
  margin: 0;
  padding: 1em 0 0;
}

.nav-links li a {
  text-decoration: none;
  color: #222;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color .2s ease;
}

.nav-links li a:hover,
.nav-links li a:focus {
  color: var(--primary);
}

.nav-links li a.active {
  color: var(--primary);
}

/* === MOBILE NAV DRAWER === */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 2000;
  overflow-y: auto;
}

.nav-overlay.show {
  transform: translateX(0);
}

body.menu-open::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500;
}

.nav-collapse-2 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2em 1.5em;
  gap: 0.5em;
}

.nav-collapse-2 .nav-links {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.nav-collapse-2 .nav-links li {
  border-bottom: 1px solid #eee;
  padding: 0.8em 0;
  width: 100%;
}

.nav-collapse-2 .nav-links li a {
  font-size: 1em;
  font-weight: 600;
  color: #111;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.8em 0;
  box-sizing: border-box;
}

.accordion-toggle {
  all: unset;
  font-size: 1em;
  font-weight: 600;
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.8em 0;
  box-sizing: border-box;
}

.nav-collapse-2 .nav-links li a:hover,
.accordion-toggle:hover,
.accordion-toggle.active {
  color: var(--primary);
}

.accordion-toggle.active::after,
.accordion-subtoggle.active::after {
  transform: rotate(90deg);
}

.accordion-panel {
  margin-top: 0.5em;
  display: none;
  flex-direction: column;
  gap: 0.6em;
  padding-left: 1em;
}

.accordion-panel.show {
  display: flex;
}

.accordion-subtoggle {
  font-size: 0.95em;
  font-weight: 500;
  color: #222;
  background: none;
  border: none;
  padding: 0.5em 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.3s ease;
}

.accordion-subtoggle:hover,
.accordion-subtoggle.active {
  color: var(--primary);
}

.accordion-subpanel {
  margin: 0.5em 0;
  padding-left: 1em;
  list-style: none;
  display: none;
  flex-direction: column;
  gap: 0.4em;
}

.accordion-subpanel.show {
  display: flex;
}

.accordion-subpanel li a {
  text-decoration: none;
  font-size: 0.9em;
  color: #444;
  display: block;
  margin: 0.4em 0;
}

.accordion-subpanel li a:hover {
  color: var(--primary);
}

.accordion-subitem,
.accordion-subpanel li {
  list-style: none;
}

.accordion-toggle::after,
.accordion-subtoggle::after {
  content: '›';
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.accordion-subpanel .subcat-image {
  width: 240px;
  height: 160px;
  margin: 1em auto;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accordion-subpanel .subcat-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  font-weight: bold;
  color: #111;
  cursor: pointer;
  z-index: 2101;
}

.nav-close:hover {
  color: var(--primary);
}

/* === MEGA MENU (Desktop) === */
.mega-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 999;
  padding: 2em 3em;
}

.mega-dropdown.show {
  display: block;
}

.dropdown-container {
  display: flex;
  align-items: flex-start;
  gap: 2em;
  max-width: 1200px;
  margin: 0 auto;
}

.main-categories {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 220px;
  border-right: 1px solid #ddd;
  flex-shrink: 0;
}

.main-categories li {
  padding: 0.8em 1em;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease, border-left-color 0.3s ease;
  border-left: 3px solid transparent;
}

.main-categories li:hover,
.main-categories li:focus {
  background: #f7f7f7;
  color: var(--primary);
  border-left-color: var(--primary);
}

.main-categories li.active {
  background: #f0f0f0;
  color: var(--primary);
  border-left-color: var(--primary);
}

.subcategories {
  flex-grow: 1;
  padding-left: 2em;
  display: flex;
  flex-direction: column;
}

.subcat-panel {
  display: none;
  flex-direction: row;
  justify-content: space-between;
  gap: 2em;
}

.subcat-panel.active {
  display: flex;
}

.subcat-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.subcat-panel ul li {
  border-bottom: 1px solid #eee;
}

.subcat-panel ul li a {
  display: block;
  padding: 0.8em 1em;
  font-weight: 500;
  color: #222;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease, border-left-color 0.3s ease;
  border-left: 3px solid transparent;
}

.subcat-panel ul li a:hover,
.subcat-panel ul li a:focus {
  background: #f7f7f7;
  color: var(--primary);
  border-left-color: var(--primary);
}

.subcat-panel ul li a.active {
  background: #f0f0f0;
  color: var(--primary);
  border-left-color: var(--primary);
}

.subcat-image {
  width: 300px;
  /* uniform size */
  height: 300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
}

.subcat-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* fills container */
  object-position: center;
  /* ensures center crop */
}

/* === HERO CAROUSEL === */
.hero-carousel {
  width: 100%;
  height: 600px;
  /* fixed uniform height for desktop */
  overflow: hidden;
  position: relative;
  margin-bottom: 2em;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* match parent height */
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 0;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* fill area, crop edges */
  object-position: center;
  /* keep middle visible */
  display: block;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  padding: 0.6em 0.9em;
  font-size: 2em;
  cursor: pointer;
  z-index: 2;
  border-radius: 50%;
  opacity: 0.8;
}

.carousel-nav.left {
  left: 30px;
}

.carousel-nav.right {
  right: 30px;
}

.carousel-nav:hover {
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 1;
}

/* === MOBILE HERO/BANNER === */
@media (max-width: 768px) {
  .hero-carousel {
    height: 280px;
    /* allow flexible height on mobile */
    margin-bottom: 0;
    overflow: hidden;
  }

  .carousel-slide {
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    width: 100%;
    height: auto;
    /* let image control height */
  }

  .carousel-slide.active {
    opacity: 1;
    z-index: 1;
    position: relative;
    /* only active slide takes space */
  }

  .carousel-slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
    /* fill width, keep ratio */
  }

  .carousel-nav {
    font-size: 1.2em;
    padding: 0.3em 0.5em;
  }

  .carousel-nav.left {
    left: 10px;
  }

  .carousel-nav.right {
    right: 10px;
  }
}

/* === MACHINING SHOWCASE === */
.machining-showcase {
  margin-top: 4em;
}

.machining-heading {
  font-size: 2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 2em;
}

.machining-heading .highlight {
  background-color: var(--accent);
  color: white;
  padding: 0.2em 0.5em;
  display: inline-block;
  font-weight: 700;
}

.machining-cards-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
}

.machining-card {
  position: relative;
  display: block;
  overflow: hidden;
  height: 400px;
}

.machining-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.machining-card:hover img {
  transform: scale(1.05);
}

.overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 1em;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1em;
}

.arrow-circle {
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4em;
  transition: background-color 0.3s ease;
}

.arrow-circle:hover {
  background-color: var(--primary-dark);
}

.overlay-content {
  display: flex;
  align-items: center;
  gap: 0.6em;
  /* spacing between text and arrow */
}

.overlay-text {
  font-size: clamp(1rem, 2vw, 1.5rem);
  /* scales with screen */
  /* font-weight: 600; */
}

.overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 1em;
  display: flex;
  align-items: center;
  z-index: 2;
  /* keep text above the dark layer */
}

.machining-card::before {
  content: "";
  position: absolute;
  inset: 0;
  /* covers entire card */
  background: rgba(0, 0, 0, 0.55);
  /* darkness with opacity */
  z-index: 1;
  /* sits above the image but below text */
  transition: background 0.3s ease;
}

.machining-card:hover::before {
  background: rgba(0, 0, 0, 0.70);
  /* darken a bit more on hover */
}



/* === FOOTER === */
.site-footer {
  background-color: #1a1a1a;
  color: #f2f2f2;
  padding: 3em var(--padding-right-for-menu-items) 1em;
  font-size: 14px;
  margin-top: 4em;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2em;
  align-items: flex-start;
}

.footer-logo img {
  width: 150px;
  height: auto;
}

.footer-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 3em;
}

.footer-column h4 {
  margin-bottom: 1em;
  font-size: 16px;
  color: #fff;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column ul li {
  margin-bottom: 0.6em;
}

.footer-column ul li a {
  color: #ccc;
  text-decoration: none;
}

.footer-column ul li a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 2em;
  text-align: center;
  border-top: 1px solid #444;
  padding-top: 1em;
  font-size: 13px;
  color: #aaa;
}

/* === FAQ SECTION === */
/* .faq-section {
  max-width: 1000px;
  margin: 5em auto;
  padding: 0 2em;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #222;
}

.faq-section h2 {
  text-align: center;
  font-size: 2em;
  font-weight: 700;
  margin-bottom: 1.5em;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.faq-item {
  border-bottom: 1px solid #ddd;
  padding: 1.2em 0;
  transition: background 0.3s ease;
}

.faq-item:hover {
  background-color: #fafafa;
}

.faq-item h3 {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0;
  cursor: pointer;
  position: relative;
  padding-right: 1.5em;
}

.faq-item h3::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.4em;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.faq-item.open h3::after {
  content: '–';
  transform: rotate(180deg);
}

.faq-item p {
  margin: 0.6em 0 0;
  line-height: 1.6;
  color: #444;
  display: none;
}

.faq-item.open p {
  display: block;
} */

/* === RESPONSIVE === */
@media (max-width: 1068px) {
  :root {
    --padding-right-for-menu-items: 1em;
  }

  .hamburger {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-end;
    gap: 1em;
  }

  .footer-container {
    padding: var(--padding-right-for-menu-items-mobile);
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .footer-columns {
    flex-direction: column;
    align-items: flex-start;
    gap: 1em;
  }

  .mega-dropdown {
    display: none !important;
  }

  .machining-cards-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .machining-card {
    height: 200px;
  }
}

@media (min-width: 1069px) {
  .nav-collapse {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .nav-collapse-2,
  .nav-collapse-2.show {
    display: none;
  }

  .nav-overlay {
    display: none;
  }
}

/* === MOBILE HERO/BANNER === */
@media (max-width: 768px) {
  .hero-carousel {
    height: auto;
    margin-bottom: 0;
  }

  .carousel-slide {
    position: absolute;
    /* keep them stacked */
    opacity: 0;
    /* hidden by default */
    transition: opacity 1s ease-in-out;
    /* smooth fade */
    width: 100%;
    height: auto;
  }

  .carousel-slide.active {
    opacity: 1;
    /* fade in */
    z-index: 1;
    position: relative;
    /* ensures active one takes space */
  }

  .carousel-slide img {
    width: 100%;
    height: auto;
    /* maintain aspect ratio */
    object-fit: cover;
  }

  .carousel-nav {
    font-size: 1.2em;
    /* shrink the arrow size */
    padding: 0.3em 0.5em;
    /* less padding around it */
  }

  .carousel-nav.left {
    left: 10px;
    /* tuck in closer to screen edge */
  }

  .carousel-nav.right {
    right: 10px;
  }

  .carousel-nav {
    font-size: 1.2em;
    /* shrink the arrow size */
    padding: 0.3em 0.5em;
  }

  .carousel-nav.left {
    left: 10px;
  }

  .carousel-nav.right {
    right: 10px;
  }

  .machining-heading {
    font-size: 1.5em;
    /* smaller heading for mobile */
    margin-bottom: 1em;
    /* slightly tighter spacing */
  }

  .machining-showcase {
    margin-top: 2em;
  }

  .machining-cards-container {
    grid-template-columns: 1fr 1fr;
    /* 2 columns */
    gap: 0.5rem;
  }

  .machining-card {
    aspect-ratio: 1 / 1;
    /* square cards on mobile */
    height: auto;
  }

  .overlay-text {
    font-size: 0.9rem;
  }

  .arrow-circle {
    display: none;
  }

  .overlay-content {
    justify-content: center;
    /* center just the text when arrow is hidden */
  }
}

@media (max-width: 768px) {
  .hero-carousel {
    height: 200px;
    /* fixed height */
    position: relative;
    /* keep slides contained */
    overflow: hidden;
  }

  .carousel-container {
    height: 100%;
    /* ensure container respects fixed height */
  }

  .carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* force fill fixed height */
    opacity: 0;
    transition: opacity 1s ease-in-out;
  }

  .carousel-slide.active {
    opacity: 1;
    z-index: 1;
  }

  .carousel-slide img {
    width: 100%;
    height: 100%;
    /* stretch to container */
    object-fit: cover;
    /* crop nicely, no distortion */
  }

  /* .faq-section {
    margin: 3em 1em;
    padding: 0;
  }

  .faq-section h2 {
    font-size: 1.6em;
    margin-bottom: 1em;
  }

  .faq-item h3 {
    font-size: 1.1em;
  } */
}

img.lazy-footer {
  opacity: 0;
  transition: opacity 0.5s ease;
}

img.lazy-loaded {
  opacity: 1;
}