/* Shared Header*/
.Header {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: linear-gradient(
      135deg,
      rgba(0, 0, 142, 0.7),
      rgba(1, 114, 128, 0.7)
    ),
    url("../img/Products/PageHeader.webp") center/cover no-repeat;
  z-index: 1;
}
/* Shared Header*/
/* General styling */
main {
  display: flex;
  min-height: 100vh;
  gap: 0vw;
}

/* Sidebar styling - hidden on mobile */
aside {
  width: 30%;
  background-color: #f8f9fa;
  height: auto;
  padding: 20px;
  position: sticky;
  top: 0;
}

aside h3 {
  margin-bottom: 10px;
}

aside hr {
  margin: 10px 0;
  border: 1px solid #ddd;
}

aside a {
  display: block;
  padding: 8px 0;
  text-decoration: none;
  color: #19456b;
  transition: color 0.3s;
}

aside a:hover {
  color: #ad2142;
}

/* Mobile navigation */

/* Products section styling */
section {
  width: 70%;
  padding: 20px;
}

section h3 {
  margin-bottom: 10px;
}

section hr {
  margin: 10px 0 20px;
  border: 1px solid #ddd;
}
/* Mobile Navigation (Hidden on Desktop) */
.mobile-nav {
  display: none; /* Hidden by default */
  position: -webkit-sticky; /* Safari support */
  position: sticky;
  top: 20px; /* Distance from the top when sticking */
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 0 10px 10px 0;
  z-index: 1000;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
  max-height: 60vh;
  overflow-y: auto;
  margin-left: -15px;
}

.mobile-nav div {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  gap: 8px;
}

.mobile-nav h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #19456b;
}

.mobile-nav a {
  text-decoration: none;
  color: #19456b;
  padding: 5px 10px;
  transition: color 0.3s;
  white-space: nowrap;
}

.mobile-nav a:hover {
  color: #ad2142;
}

/* Show only on small screens (e.g., < 768px) */
@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
    flex-direction: column;
  }

  /* Adjust main content to avoid overlap (optional) */
  section {
    padding-left: 20px;
  }
}
.Category-Container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  padding: 15px;
  justify-content: center;
}

.Category-Item {
  width: 200px;
  min-height: 200px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.4s, box-shadow 0.4s;
  opacity: 0;
  transform: translateY(50px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.Category-Item.visible {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}

.Category-Item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.Category-Item img {
  width: 100%;
  height: 80%;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
  border-radius: 5px;
  image-rendering: auto;
}

.Category-Item p {
  color: #19456b;
  font-size: 0.85rem;
  padding: 8px;
  transition: background-color 0.3s, color 0.3s;
  word-break: break-word;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.Category-Item:hover p {
  background-color: #ad2142;
  color: white;
  border-radius: 5px;
}

/* Responsive */
@media (max-width: 780px) {
  .Category-Item {
    width: 160px;
    min-height: 160px;
  }
  .Category-Container {
    grid-template-columns: repeat(2, 1fr);
  }

  aside {
    display: none;
  }

  section {
    width: 100%;
  }

  .Category-Item p {
    font-size: 0.75rem;
    padding: 6px;
    -webkit-line-clamp: 3;
  }
}
@media (max-width: 400px) {
  .Category-Container {
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    gap: 8px;
    padding: 8px;
  }

  .Category-Item {
    width: 130px;
    min-height: 130px;
  }
  .Category-Item p {
    font-size: 0.65rem;
    -webkit-line-clamp: 3;
  }

  .Category-Item img {
    width: 70%;
    height: 50%;
  }

  section h3 {
    font-size: 0.9rem;
    margin-left: 8px;
  }
}
/* Category Active */
.category-link.active {
  color: #ad2142;
  font-weight: bold;
}
/* Hovering Section  */
.Hovering-Section {
  width: 90%;
  max-width: 1200px;
  margin: 5vh auto;
  text-align: center;
}

.image-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* Wrap on small screens */
  gap: 10px;
  height: auto;
  padding: 10px 5px;
}

.image-wrapper {
  position: relative;
  flex: 1 1 150px;
  min-width: 100px;
  max-width: 200px;
  margin-bottom: 100px;
  margin-top: 10vh;
}

.Hovering-Section img {
  width: 60%;
  margin: 0 auto;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: contain;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: block;
}

/* Info Box Styling */
.info-box {
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 180px;
  padding: 8px;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  font-size: 0.75em;
  z-index: 9000;
  white-space: normal;
  overflow: visible;
  display: block;
}

.info-box .Info-Title {
  font-size: 1rem;
  color: #19456b;
  font-weight: 700;
  margin-bottom: 5px;
  display: block;
}

.info-box p:not(.Info-Title) {
  margin: 0;
  display: block;
  line-height: 1.4;
  text-align: center;
}

.image-wrapper:hover .info-box {
  opacity: 1;
  visibility: visible;
  top: 110%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .image-wrapper {
    flex: 1 1 45%;
    max-width: 45%;
    margin-bottom: 60px;
  }

  .Hovering-Section img {
    width: 80%;
  }

  .info-box {
    max-width: 160px;
    font-size: 0.7rem;
  }

  .info-box .Info-Title {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .image-wrapper {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .Hovering-Section img {
    width: 40%;
  }
}
/* Second Hovering Section - Auto Hovering */
/* Second Hovering Section */
.second-Hovering {
  width: 90%;
  max-width: 1200px;
  margin: 5vh auto;
  text-align: center;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.second-Hovering > div {
  position: relative;
  flex: 1 1 150px;
  min-width: 100px;
  max-width: 200px;
  margin-bottom: 100px;
}

.second-Hovering img {
  width: 60%;
  margin: 0 auto;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: contain;
  transition: transform 0.3s ease;
  display: block;
}

/* Component Structure */
.Component {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px; /* Space between top/gasket/buttom */
}

.Component .top,
.Component .gasket,
.Component .buttom {
  position: relative;
  transition: all 0.3s ease;
}

/* Info Box Styling */
.second-Hovering .info-box {
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 180px;
  padding: 8px;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  font-size: 0.75em;
  z-index: 9000;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .second-Hovering > div {
    flex: 1 1 45%;
    max-width: 45%;
    margin-bottom: 60px;
  }
}

@media (max-width: 480px) {
  .second-Hovering > div {
    flex: 1 1 100%;
    max-width: 100%;
  }
}
/* Gasket Unique Styling */
/* Gasket-specific styling */
.Component .gasket {
  position: relative;
  margin: -8vh auto;
}

.Component .gasket .info-box {
  left: -100%; /* Position to the left */
  top: 50%;
  transform: translateY(-50%);
  width: 180px; /* Fixed width for better control */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

/* Show on hover/auto-hover */
.Component .gasket.auto-hover .info-box,
.Component .gasket.active-hover .info-box {
  left: -110%; /* Final position */
  opacity: 1;
  visibility: visible;
}

/* Arrow for the info box */
.Component .gasket .info-box::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 10px 0 10px 10px;
  border-style: solid;
  border-color: transparent transparent transparent white;
}

/* Adjust other info boxes to maintain original positioning */
.second-Hovering .info-box:not(.gasket .info-box) {
  left: 50%;
  transform: translateX(-50%);
  top: 110%;
}
/* Add this to your existing CSS */
.product-link {
  display: contents; /* Makes the anchor tag invisible to layout */
  text-decoration: none; /* Removes underline */
  color: inherit; /* Inherits text color from parent */
}

/* Optional: If you need to maintain the hover effects */
.product-link:hover .Category-Item {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.product-link:hover .Category-Item p {
  background-color: #ad2142;
  color: white;
  border-radius: 5px;
}
/* Add to your CSS */
/* Initially hide all hover sections */
/* Initially hide all hover text */
.hover-text.hidden {
  display: none;
}

/* Show text when section is active */
.hover-section.active .hover-text {
  display: block;
}

/* Keep your existing hover section styles */
.hover-section {
  display: none;
}

.hover-section.active {
  display: block;
}
/* Add this to your CSS */
.empty-category-message {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  font-size: 1.5rem;
  color: #666;
  font-weight: bold;
  grid-column: 1 / -1; /* Span all columns */
}

@media (max-width: 768px) {
  .empty-category-message {
    height: 160px;
    font-size: 1.2rem;
  }
}

@media (max-width: 400px) {
  .empty-category-message {
    height: 130px;
    font-size: 1rem;
  }
}
