/* =====================================================
   BACKGROUND FLOATING ANIMATION (OPTIMIZED)
===================================================== */
.flange-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.flange-image {
  position: absolute;
  width: 20%;
  opacity: 0.5;
  animation: float 45s infinite alternate ease-in-out;
  will-change: transform;
}

@keyframes float {
  0%   { transform: translate(5vw,10vh) rotate(0deg); }
  25%  { transform: translate(70vw,30vh) rotate(8deg); }
  50%  { transform: translate(40vw,60vh) rotate(-5deg); }
  75%  { transform: translate(10vw,40vh) rotate(6deg); }
  100% { transform: translate(30vw,30vh) rotate(0deg); }
}

/* =====================================================
   TYPES SECTION - FLANGE GRID (CENTERED)
===================================================== */
.types {
  width: 100%;
  padding: 40px 20px;
  box-sizing: border-box;
}

.types h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
  font-size: 2rem;
  font-weight: 600;
}

.flange-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  align-items:center;
  justify-content: center;
}

.flange-card {
  width: 100%;
  max-width: 300px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.flange-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.flange-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: #f5f5f5;
}

.flange-card h3 {
  margin: 15px 0;
  padding: 0 10px;
  font-size: 1.1rem;
  font-weight: 600;
}

.flange-card h3 a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.flange-card h3 a:hover {
  color: #cc4b24;
}

/* =====================================================
   OVERLAY WRAPPER & CONTENT
===================================================== */
.flange-overlay-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 20px 0;
  box-sizing: border-box;
}

.flange-overlay {
  max-width: 1400px;
  margin: 0 auto;
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.flange-content {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.flange-left {
  padding: 20px;
}

.flange-left h2 {
  font-size: 24px;
  color: #555;
  margin-bottom: 10px;
}

.flange-left p {
  font-size: 16px;
  line-height: 1.6;
  margin-top: 10px;
}

/* =====================================================
   FLANGE LIST (GRID – BETTER UX)
===================================================== */
.flange-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 20px;
  margin: 15px 0;
  padding-left: 0;
  list-style-position: inside;
}

/* =====================================================
   ICONS & CTA
===================================================== */
.flange-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.icon-box {
  text-align: center;
  font-size: 18px;
}

.icon-box span {
  font-size: 30px;
  display: block;
  margin-bottom: 5px;
}

.quote-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  background: linear-gradient(to right, #f44336, #ff9800);
  color: #fff;
  padding: 10px 28px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quote-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* =====================================================
   PRODUCT FLANGE GRID
===================================================== */
.product_flange {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.product_flange * {
  box-sizing: border-box;
}

.product_flange .responsive {
  flex: 0 1 calc(25% - 10px);
}

.product_flange .gallery {
  border: 1px solid #ccc;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease;
}

.product_flange .gallery:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.25);
}

.product_flange .gallery img {
  width: 100%;
  height: 250px;
  object-fit: contain;
  padding: 6px;
  transition: transform 0.3s ease;
}

.product_flange .gallery:hover img {
  transform: scale(1.05);
}

.product_flange .desc {
  padding: 15px;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  color: #fff;
  background: #cc4b24;
}

.product_flange .desc a {
  color: #fff;
  text-decoration: none;
}

/* =====================================================
   OVERLAY HOVER (PERFORMANCE SAFE)
===================================================== */
.product_flange .overlay {
  position: absolute;
  inset: 0;
  background: rgba(75,75,77,0.7);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product_flange .gallery:hover .overlay {
  opacity: 1;
}

.product_flange .overlay a {
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =====================================================
   FLANGE DRAWING SECTION
===================================================== */
.flange_drawing {
  position: relative;
  width: 100%;
  min-height: 400px;
  max-height: 800px;
  background: url('/assets/images/flange_manufacturer_India.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  box-sizing: border-box;
}

.dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1;
}

.flange-heading {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: 4rem;
  text-align: center;
}

.svg-overlay {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  width: calc(100% - 40px);
}

/* =====================================================
   FLANGE TABLES
===================================================== */
.expandable-table {
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.table-header {
  background: #cc4b24;
  padding: 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header h3,
.expand-icon {
  color: #fff;
  font-size: 18px;
}

.expand-icon {
  transition: transform 0.3s ease;
}

.expand-icon.expanded {
  transform: rotate(180deg);
}

.table-content {
  display: none;
  overflow-x: auto;
}

.table-content.expanded {
  display: block;
}

.instruction-text {
  text-align: center;
  color: #666;
  font-style: italic;
  font-size: 14px;
  margin: 10px 0;
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 1024px) {
  .flange-list { grid-template-columns: repeat(2, 1fr); }
  .flange-icons { grid-template-columns: repeat(2, 1fr); }
  .product_flange .responsive { flex: 0 1 calc(33.33% - 10px); }
}

@media (max-width: 768px) {
  .flange-left { padding: 15px; }
  .flange-left h2 { font-size: 20px; }
  
  .types h2 { font-size: 1.5rem; }
  
  .flange-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
  }
  
  .flange-card {
    max-width: 250px;
  }
  
  .flange-card img {
    height: 180px;
  }

  .product_flange .responsive { flex: 0 1 calc(50% - 10px); }

  .flange_drawing {
    min-height: 300px;
  }

  .flange-heading {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .flange-image { width: 30%; }
  
  .types {
    padding: 30px 15px;
  }
  
  .flange-grid {
    grid-template-columns: 1fr;
    max-width: 300px;
  }
  
  .flange-card {
    max-width: 100%;
  }

  .product_flange .responsive { flex: 0 1 100%; }

  .quote-btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .icon-box span { font-size: 24px; }
}

/* ============================================
   INFO BOX (TEXT SECTION)
============================================ */
.info-box {
  width: 100%;
  background: #ffffff;
  border: 1px solid #ccc;
  border-top: none; /* merges with gallery above */
  padding: 15px; /* includes required top padding */
  margin-top: 0;  /* removes gap between boxes */
  min-height: 270px;
  text-align: left;

  /* Soft shading */
  box-shadow: inset 0 0 12px rgba(0,0,0,0.08);
}

.info-box ul {
  margin: 0;
  padding-left: 18px;
  font-size: 16px;
  line-height: 1.65;
}