/* ==========================================================================
   FACTORY PAGE SPECIFIC STYLES (factory.css)
   ========================================================================== */

/* --- Light Header Override --- */
.factory-page .site-header {
  background-color: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #e6edf7;
}

.factory-page .nav-link {
  color: #123563;
}

.factory-page .nav-link:hover,
.factory-page .nav-link.active {
  color: var(--accent);
}

.factory-page .btn-search,
.factory-page .mobile-toggle {
  color: #1a202c;
}

.factory-page .btn-quote {
  background-color: var(--accent);
}

/* ==========================================================================
   1. BANNER SECTION
   ========================================================================== */

.factory-banner-section {
  position: relative;
  padding: 170px 0 140px 0;
  overflow: hidden;
  background-color: var(--primary-dark);
}

.factory-banner-bg {
  position: absolute;
  inset: 0;
  background-image: url("../images/factory_exterior.jpg");
  background-size: cover;
  background-position: right center;
}

/* Blue fade from left so the text stays readable */
.factory-banner-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 34, 92, 0.92) 18%, rgba(0, 47, 125, 0.75) 45%, rgba(0, 59, 149, 0.25) 72%, rgba(0, 59, 149, 0.05) 100%);
}

.factory-banner-text {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.factory-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 18px;
}

.factory-breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

.factory-breadcrumb a:hover {
  color: #ffffff;
}

.factory-breadcrumb .breadcrumb-sep {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.factory-breadcrumb .breadcrumb-current {
  color: #ffffff;
  font-weight: 600;
}

.factory-banner-title {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0;
}

.factory-title-bar {
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background-color: #ffffff;
  margin: 14px 0 22px 0;
}

.factory-banner-subtitle {
  font-size: 17px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  max-width: 480px;
  margin-bottom: 0;
}

/* ==========================================================================
   2. GALLERY SECTION
   ========================================================================== */

.factory-gallery-section {
  padding: 80px 0 100px 0;
  background-color: #ffffff;
}

.factory-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px 26px;
}

.factory-gallery-item {
  margin: 0;
  cursor: zoom-in;
}

.factory-gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.factory-gallery-item:hover img {
  transform: scale(1.02);
  box-shadow: 0 16px 36px rgba(15, 34, 74, 0.16);
}

.factory-gallery-caption {
  margin-top: 16px;
  text-align: center;
  font-size: 15.5px;
  font-weight: 700;
  color: #123563;
}

/* ==========================================================================
   3. LIGHTBOX
   ========================================================================== */

.factory-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(8, 15, 30, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.factory-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  margin: 0;
  max-width: min(1100px, 86vw);
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.factory-lightbox.active .lightbox-content img {
  transform: scale(1);
}

.lightbox-caption {
  margin-top: 18px;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.lightbox-close {
  position: absolute;
  top: 26px;
  right: 30px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background-color: var(--accent);
  border-color: var(--accent);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 1199px) {
  .factory-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 991px) {
  .factory-banner-section {
    padding: 130px 0 110px 0;
  }
  .factory-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575px) {
  .factory-banner-section {
    padding: 110px 0 90px 0;
  }
  .factory-gallery-section {
    padding: 60px 0 70px 0;
  }
  .factory-gallery-grid {
    grid-template-columns: 1fr;
  }
  .lightbox-prev {
    left: 12px;
  }
  .lightbox-next {
    right: 12px;
  }
  .lightbox-close {
    top: 16px;
    right: 16px;
  }
}
