/* ========================================
   ELECTRIC SWITCHGEAR STYLES - FIXED BADGE COVERAGE & LENGTH
   ======================================== */

/* Brand Cards Container */
.switchgear-brands-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem 0;
  max-width: 1400px;
  margin: 0 auto;
}

/* Brand Card Base Styles */
.brand-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid transparent;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.brand-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px rgba(41, 129, 249, 0.2);
  border-color: rgba(41, 129, 249, 0.3);
}

/* Brand Logo Container */
.brand-logo-container {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 18px 18px 0 0;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.brand-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.brand-card:hover .brand-logo {
  transform: scale(1.1);
}

/* Logo Fallback Styles */
.logo-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.logo-subtext {
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.5px;
}

/* Brand Card Data - Always Visible */
.brand-card-data {
  padding: 1.5rem;
  background: white;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 0 0 18px 18px;
  position: relative;
}

.brand-description {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brand-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.brand-details {
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.brand-button {
  background: linear-gradient(135deg, #2981f9 0%, #1e6fd8 100%);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.brand-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.brand-button:hover {
  background: linear-gradient(135deg, #1e6fd8 0%, #2981f9 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(41, 129, 249, 0.4);
}

.brand-button:hover::before {
  left: 100%;
}

/* Brand Specific Colors */
.brand-card[data-brand="schneider"] {
  background: linear-gradient(145deg, rgba(61, 205, 88, 0.05), rgba(255, 255, 255, 0.95));
}

.brand-card[data-brand="schneider"]:hover {
  border-color: rgba(61, 205, 88, 0.5);
  box-shadow: 0 20px 60px rgba(61, 205, 88, 0.2);
}

.brand-card[data-brand="schneider"] .brand-logo-container {
  background: linear-gradient(135deg, rgba(61, 205, 88, 0.1), #f8fafc);
}

.brand-card[data-brand="schneider"] .brand-button {
  background: linear-gradient(135deg, #3dcd58 0%, #2db946 100%);
}

.brand-card[data-brand="schneider"] .brand-button:hover {
  background: linear-gradient(135deg, #2db946 0%, #3dcd58 100%);
}

.brand-card[data-brand="siemens"] {
  background: linear-gradient(145deg, rgba(0, 153, 153, 0.05), rgba(255, 255, 255, 0.95));
}

.brand-card[data-brand="siemens"]:hover {
  border-color: rgba(0, 153, 153, 0.5);
  box-shadow: 0 20px 60px rgba(0, 153, 153, 0.2);
}

.brand-card[data-brand="siemens"] .brand-logo-container {
  background: linear-gradient(135deg, rgba(0, 153, 153, 0.1), #f8fafc);
}

.brand-card[data-brand="siemens"] .brand-button {
  background: linear-gradient(135deg, #009999 0%, #007777 100%);
}

.brand-card[data-brand="abb"] {
  background: linear-gradient(145deg, rgba(255, 0, 0, 0.05), rgba(255, 255, 255, 0.95));
}

.brand-card[data-brand="abb"]:hover {
  border-color: rgba(255, 0, 0, 0.5);
  box-shadow: 0 20px 60px rgba(255, 0, 0, 0.2);
}

.brand-card[data-brand="abb"] .brand-logo-container {
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), #f8fafc);
}

.brand-card[data-brand="abb"] .brand-button {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
}

.brand-card[data-brand="larsen"] {
  background: linear-gradient(145deg, rgba(0, 102, 204, 0.05), rgba(255, 255, 255, 0.95));
}

.brand-card[data-brand="larsen"]:hover {
  border-color: rgba(0, 102, 204, 0.5);
  box-shadow: 0 20px 60px rgba(0, 102, 204, 0.2);
}

.brand-card[data-brand="larsen"] .brand-logo-container {
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.1), #f8fafc);
}

.brand-card[data-brand="larsen"] .brand-button {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
}

.brand-card[data-brand="cs"] {
  background: linear-gradient(145deg, rgba(255, 165, 0, 0.05), rgba(255, 255, 255, 0.95));
}

.brand-card[data-brand="cs"]:hover {
  border-color: rgba(255, 165, 0, 0.5);
  box-shadow: 0 20px 60px rgba(255, 165, 0, 0.2);
}

.brand-card[data-brand="cs"] .brand-logo-container {
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.1), #f8fafc);
}

.brand-card[data-brand="cs"] .brand-button {
  background: linear-gradient(135deg, #ffa500 0%, #cc8400 100%);
}

.brand-card[data-brand="bch"] {
  background: linear-gradient(145deg, rgba(128, 0, 128, 0.05), rgba(255, 255, 255, 0.95));
}

.brand-card[data-brand="bch"]:hover {
  border-color: rgba(128, 0, 128, 0.5);
  box-shadow: 0 20px 60px rgba(128, 0, 128, 0.2);
}

.brand-card[data-brand="bch"] .brand-logo-container {
  background: linear-gradient(135deg, rgba(128, 0, 128, 0.1), #f8fafc);
}

.brand-card[data-brand="bch"] .brand-button {
  background: linear-gradient(135deg, #800080 0%, #660066 100%);
}

/* Product Slider Container */
.product-slider-container {
  display: none;
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.product-slider-container.active {
  display: block;
  animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Product Slider Header */
.product-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(41, 129, 249, 0.2);
}

.slider-brand-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  text-shadow: none;
}

.close-slider-btn {
  background: white !important;
  color: #000000 !important; 
  border: 1px solid rgba(255, 255, 255, 0.474);
  position: absolute !important;
  top: 22px !important; /* Moved up from 28px */
  right: 30px !important;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0.9; /* Better centering of × symbol */

}

.close-slider-btn:hover {
  background: rgba(100, 116, 139, 0);
  color: #1e293b;
  transform: scale(1.1);
}

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Product Card Styles */
.product-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(41, 129, 249, 0.15);
}

/* Product Image - CLICKABLE FOR ZOOM WITH ICON */
.product-image-container {
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  position: relative;
  cursor: pointer;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  cursor: pointer;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

/* Zoom Icon Indicator - REPLACED EMOJI WITH ICON */
.product-image-container::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z'/%3E%3C/svg%3E");
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: center;
}

.product-image-container:hover::after {
  opacity: 1;
}

/* Product Content */
.product-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.product-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  flex: 1;
  line-height: 1.3;
}

/* FIXED PRODUCT BADGE STYLES - PROPER TEXT COVERAGE & LENGTH HANDLING */
.product-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  min-width: fit-content;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  display: inline-block;
  box-sizing: border-box;
}

/* Product Badge Types - UPDATED WITH SHORTER TEXT */
.product-badge.motor-control {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.product-badge.protection {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.product-badge.switching {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
}

.product-badge.automation {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
}

/* FIXED: Power Distribution Badge with Shorter Text */
.product-badge.power-distribution {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.product-badge.control {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.product-description {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.product-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: auto;
}

.product-quote-btn, .product-details-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.product-quote-btn {
  background: linear-gradient(135deg, #2981f9, #1e6fd8);
  color: white;
}

.product-quote-btn:hover {
  background: linear-gradient(135deg, #1e6fd8, #2981f9);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(41, 129, 249, 0.3);
}

.product-details-btn {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.product-details-btn:hover {
  background: rgba(100, 116, 139, 0.15);
  color: #ffffff;
  border-color: rgba(100, 116, 139, 0.3);
}

/* IMAGE ZOOM MODAL - IMPROVED FOR BETTER IMAGE HANDLING */
.image-zoom-modal {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-zoom-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.image-zoom-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  animation: zoomIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-zoom-content img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  background: white;
  padding: 10px;
}

.image-zoom-close {
  position: absolute;
  top: -15px;
  right: -15px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 10002;
}

.image-zoom-close:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.image-zoom-caption {
  margin-top: 20px;
  text-align: center;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.8);
  padding: 12px 24px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  max-width: 80%;
  word-wrap: break-word;
}

@keyframes zoomIn {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Switchgear Modal Styles - NO IMAGES */
.switchgear-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.switchgear-modal-backdrop.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.switchgear-modal-content {
  background: white;
  border-radius: 20px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.switchgear-modal-backdrop.active .switchgear-modal-content {
  transform: scale(1);
}

.switchgear-modal-close {
  position: absolute;
  top: 1.4rem;
  right: 1.3rem;
  background: rgb(255, 255, 255);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  color: #64748b;
}

.switchgear-modal-close:hover {
  background: rgba(0, 0, 0, 0.2);
  color: #1e293b;
  transform: scale(1.1);
}

.switchgear-modal-body {
  padding: 2rem;
}

.modal-product-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1.5rem;
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.modal-product-description {
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 1.1rem;
}

.modal-product-specs {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
}

.modal-product-specs h4 {
  color: #1e293b;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  text-align: center;
  font-weight: 600;
}

.specs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.specs-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.specs-list li:last-child {
  border-bottom: none;
}

.spec-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

.spec-value {
  color: #64748b;
  font-size: 0.95rem;
  text-align: right;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding-top: 1rem;
}

.modal-quote-btn {
  background: linear-gradient(135deg, #2981f9, #1e6fd8);
  color: white;
  border: none;
  padding: 1.2rem 2.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-quote-btn:hover {
  background: linear-gradient(135deg, #1e6fd8, #2981f9);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(41, 129, 249, 0.4);
}

/* Responsive Design - UPDATED BADGE HANDLING */
@media (max-width: 1024px) {
  .switchgear-brands-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
  }
  
  .product-badge {
    font-size: 0.65rem;
    padding: 0.35rem 0.7rem;
    max-width: 120px;
  }
  
  .image-zoom-content img {
    max-height: 70vh;
  }
  
  .image-zoom-caption {
    font-size: 1rem;
    padding: 10px 20px;
  }
}

@media (max-width: 768px) {
  
  .switchgear-brands-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }
  
  .brand-card {
    min-height: 280px;
  }
  
  .brand-logo-container {
    height: 120px;
    padding: 1.5rem;
  }
  
  .logo-text {
    font-size: 1.5rem;
  }
  
  .brand-card-data {
    padding: 1.25rem;
  }
  
  .brand-title {
    font-size: 1.2rem;
  }
  
  .product-slider-container {
    padding: 1rem;
    margin-top: 2rem;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .product-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .product-badge {
    font-size: 0.6rem;
    padding: 0.3rem 0.6rem;
    max-width: 100px;
  }
  
  .switchgear-modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .switchgear-modal-body {
    padding: 1.5rem;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-product-title {
    font-size: 1.5rem;
  }
  
  .modal-product-description {
    font-size: 1rem;
  }
  
  .image-zoom-content {
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .image-zoom-content img {
    max-height: 60vh;
  }
  
  .image-zoom-caption {
    font-size: 0.9rem;
    padding: 8px 16px;
    margin-top: 15px;
  }
  
  .image-zoom-close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    top: -12px;
    right: -12px;
  }
}

@media (max-width: 480px) {
  .brand-card {
    min-height: 250px;
  }
  
  .brand-logo-container {
    height: 100px;
    padding: 1rem;
  }
  
  .logo-text {
    font-size: 1.3rem;
  }
  
  .logo-subtext {
    font-size: 0.8rem;
  }
  
  .brand-card-data {
    padding: 1rem;
  }
  
  .slider-brand-title {
    font-size: 1.5rem;
  }
  
  .product-slider-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .product-badge {
    font-size: 0.55rem;
    padding: 0.25rem 0.5rem;
    max-width: 90px;
  }
  
  .modal-product-specs {
    padding: 1.5rem;
  }
  
  .specs-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .spec-value {
    text-align: left;
    font-weight: 500;
  }
  
  .image-zoom-content img {
    max-height: 50vh;
    padding: 5px;
  }
  
  .image-zoom-caption {
    font-size: 0.8rem;
    padding: 6px 12px;
    margin-top: 10px;
  }
  
  .image-zoom-close {
    width: 35px;
    height: 35px;
    font-size: 1.3rem;
    top: -8px;
    right: -8px;
  }
}

/* Animation Classes */
.brand-card.animate-in {
  animation: brandCardSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes brandCardSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Loading States */
.product-quote-btn.loading, .modal-quote-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.product-quote-btn.loading::after, .modal-quote-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Accessibility */
.brand-card:focus {
  outline: 3px solid rgba(41, 129, 249, 0.6);
  outline-offset: 4px;
}

.product-quote-btn:focus, .product-details-btn:focus {
  outline: 2px solid rgba(41, 129, 249, 0.5);
  outline-offset: 2px;
}

.product-image:focus {
  outline: 2px solid rgba(41, 129, 249, 0.5);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .brand-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .product-slider-container {
    display: none;
  }
  
  .switchgear-modal-backdrop, .image-zoom-modal {
    display: none;
  }
}

/* ========================================
   CONTACT OVERLAY STYLES - MISSING FROM YOUR CSS
   ======================================== */

#contactOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#contactOverlay.show {
    display: flex;
    opacity: 1;
}

.overlay-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #64748b;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(100, 116, 139, 0.1);
    color: #1e293b;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-form h2 {
    margin: 0 0 1.5rem 0;
    color: #1e293b;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2981f9;
    box-shadow: 0 0 0 3px rgba(41, 129, 249, 0.1);
}

.submit-btn {
    background: linear-gradient(135deg, #2981f9, #1e6fd8);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #1e6fd8, #2981f9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(41, 129, 249, 0.4);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .overlay-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .contact-form h2 {
        font-size: 1.5rem;
    }
}

/* MOBILE ELECTRIC SWITCHGEAR - REMOVE CLOSE BUTTON BACKGROUND */
@media screen and (max-width: 768px) {
  .product-slider-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 1rem !important;
    padding-bottom: 1.4rem !important;
  }
  
  .slider-brand-title {
    font-size: 1.65rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    text-align: left !important; /* Left aligned text */
    flex: 1 !important;
  }
  
  /* REMOVE CLOSE BUTTON BACKGROUND ON MOBILE ONLY */
  .close-slider-btn {
    background: transparent !important; /* Remove background */
    border: none !important; /* Remove border */
    box-shadow: none !important; /* Remove shadow */
    width: auto !important; /* Auto width */
    height: auto !important; /* Auto height */
    font-size: 1.5rem !important; /* Larger for better touch */
    color: #64748b !important; /* Gray color */
    padding: 0.5rem !important; /* Minimal padding */
    border-radius: 0 !important; /* Remove border radius */
    position: static !important; /* Remove absolute positioning */
    top: auto !important;
    right: auto !important;
    -webkit-tap-highlight-color: transparent !important; /* Remove mobile tap highlight */
  }
  
  .close-slider-btn:hover {
    background: rgba(100, 116, 139, 0.1) !important; /* Light hover effect only */
    transform: none !important; /* Remove scale transform */
  }
  
  /* Remove any mobile tap highlights */
  .close-slider-btn:focus,
  .close-slider-btn:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    background: rgba(100, 116, 139, 0.1) !important;
  }
}

@media screen and (max-width: 480px) {
  .slider-brand-title {
    font-size: 1.45rem !important;
  }
  
  .close-slider-btn {
    font-size: 1.3rem !important;
    padding: 0.3rem !important;
  }
}


/* NEW CLOSE BUTTON BELOW HEADING */
.close-products-btn {
  background: linear-gradient(135deg, #64748b, #475569) !important;
  color: white !important;
  border: none !important;
  padding: 0.8rem 1.5rem !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1rem !important;
  display: block;
  width: auto;
  min-width: 140px;
}

.close-products-btn:hover {
  background: linear-gradient(135deg, #475569, #334155) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(100, 116, 139, 0.3);
}

/* UPDATED HEADER LAYOUT */
.product-slider-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(41, 129, 249, 0.2);
}

.slider-brand-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  text-align: center;
}

/* MOBILE LAYOUT - BUTTON BELOW HEADING */
@media screen and (max-width: 768px) {
  .product-slider-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 1rem !important;
    padding-bottom: 1.5rem !important;
    gap: 1rem;
  }
  
  .slider-brand-title {
    font-size: 1.6rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    text-align: center !important;
    order: 1;
  }
  
  .close-products-btn {
    order: 2;
    font-size: 0.85rem !important;
    padding: 0.7rem 1.2rem !important;
    min-width: 120px !important;
  }
}

@media screen and (max-width: 480px) {
  .slider-brand-title {
    font-size: 1.4rem !important;
  }
  
  .close-products-btn {
    font-size: 0.8rem !important;
    padding: 0.6rem 1rem !important;
    min-width: 110px !important;
  }
}

/* CLOSING ANIMATION FOR PRODUCT SLIDER */
@keyframes slideOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-30px);
  }
}

.product-slider-container.closing {
  animation: slideOutUp 0.5s ease-in-out forwards;
}

/* Ensure smooth transition for product cards */
.product-card.closing {
  animation: fadeOutCard 0.3s ease-in-out forwards;
}

@keyframes fadeOutCard {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
}

/* Hide close products button on desktop by default */
.close-products-btn {
  display: none !important;
}

@media screen and (max-width: 768px) {
  .product-slider-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 1rem !important;
    padding-bottom: 1.5rem !important;
    gap: 2.5rem !important; /* Increased to 3rem for more space */
  }
  
  .slider-brand-title {
    font-size: 1.6rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    margin-bottom: 1.5rem !important; /* Additional margin for extra space */
    text-align: center !important;
    order: 1;
  }
  
  .close-products-btn {
    display: block !important;
    margin: 1rem auto 0 auto !important; /* Added top margin for extra space */
    order: 2;
    font-size: 0.85rem !important;
    padding: 0.7rem 1.2rem !important;
    min-width: 120px !important;
    background: linear-gradient(135deg, #2981f9, #1e6fd8) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
}


@media screen and (max-width: 480px) {
  .close-products-btn {
    font-size: 0.8rem !important;
    padding: 0.6rem 1rem !important;
    min-width: 110px !important;
  }
}

/* DESKTOP/MOBILE BUTTON VISIBILITY CONTROL */
.desktop-only {
    display: block !important;
}

.mobile-only {
    display: none !important;
}

/* MOBILE - Show close products button, hide circular button */
@media screen and (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .product-slider-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 1rem !important;
        padding-bottom: 1.5rem !important;
        gap: 1rem;
    }
    
    .slider-brand-title {
        font-size: 1.6rem !important;
        font-weight: 600 !important;
        margin: 0 !important;
        text-align: center !important;
        order: 1;
    }
    
    .close-products-btn {
        order: 2;
        font-size: 0.85rem !important;
        padding: 0.7rem 1.2rem !important;
        min-width: 120px !important;
    }
}

@media screen and (max-width: 480px) {
    .slider-brand-title {
        font-size: 1.4rem !important;
    }
    
    .close-products-btn {
        font-size: 0.8rem !important;
        padding: 0.6rem 1rem !important;
        min-width: 110px !important;
    }
}

/* Smooth container collapse animation */
.product-slider-container {
  overflow: hidden;
  transition: all 0.6s ease-out;
}

.product-slider-container.collapsing {
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Ensure smooth transition for all child elements */
.product-slider-container * {
  transition: inherit;
}

/* FIX: Modal text colliding with close button on mobile */
@media screen and (max-width: 768px) {
  .switchgear-modal-body {
    padding: 2rem 1.5rem 1.5rem 1.5rem !important;
    padding-top: 3.5rem !important; /* Extra top padding to avoid close button */
  }
  
  .modal-product-title {
    font-size: 1.4rem !important;
    margin-bottom: 1rem !important;
    margin-top: 0 !important;
    padding-right: 60px !important; /* Space for close button */
    line-height: 1.3 !important;
  }
  
  .modal-product-description {
    font-size: 0.95rem !important;
    padding-right: 20px !important; /* Prevent text from going under button */
    margin-bottom: 1.5rem !important;
  }
  
  /* Ensure close button stays visible and accessible */
  .switchgear-modal-close {
    position: fixed !important; /* Changed from absolute to fixed */
    top: 1rem !important;
    right: 1rem !important;
    z-index: 10003 !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 1.6rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
  }
  
  .switchgear-modal-content {
    width: 95% !important;
    margin: 1rem auto !important;
    max-height: 85vh !important;
    border-radius: 16px !important;
  }
  
  /* Prevent text overflow in specs section */
  .modal-product-specs {
    padding: 1.5rem 1rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  .modal-product-specs h4 {
    font-size: 1.2rem !important;
    margin-bottom: 1rem !important;
    padding-right: 20px !important;
  }
  
  .specs-list li {
    padding: 0.6rem 0 !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.3rem !important;
  }
  
  .spec-value {
    text-align: left !important;
    font-weight: 500 !important;
    color: #2563eb !important;
  }
}

@media screen and (max-width: 480px) {
  .switchgear-modal-body {
    padding: 4rem 1rem 1rem 1rem !important; /* Even more top padding for small screens */
  }
  
  .modal-product-title {
    font-size: 1.2rem !important;
    padding-right: 50px !important;
  }
  
  .modal-product-description {
    font-size: 0.9rem !important;
  }
  
  .switchgear-modal-close {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.4rem !important;
  }
}

