.product-feature {
  background-color: var(--secondary-50);
  padding-top: 15rem;
  padding-bottom: 12rem;
  text-align: center;
}

.feature-list {
  display: flex;
  flex-direction: row;
  flex: 1;
  justify-content: space-between;
  padding-top: 2rem;
}

.feature-item {
  flex: 3;
  text-align: center;
}

.feature-item div {
  padding-bottom: 5rem;
}

.feature-item div i {
  padding: 0.75rem;
  color: var(--text-50);
  border-radius: 15px;
  background-color: var(--primary);
  font-size: 2.5rem; /* Adjust the size as needed */
}

.feature-line {
  flex: 1;
  width: 10px;
  height: 70px;
  display: flex;
  justify-content: center;
}

/* Product List */

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.category-item {
  padding: 0.75em 2em;
  background-color: var(
    --secondary-50
  ); /* Default background color for non-selected */
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.3s ease; /* Smooth color transition */
}

.category-item.selected {
  background-color: var(--primary); /* Background color for selected item */
  color: var(--text-50); /* Optional: Change text color for better visibility */
}

/* Optional: Add hover effect */
.category-item:hover {
  background-color: var(--accent); /* Lighter shade on hover */
  color: var(--text-50); /* Optional: Change text color for better visibility */
}

.separator-line {
  border-top: 1px solid #ddd; /* Thin line color and thickness */
  margin: 1rem 0; /* Adjust spacing as needed */
}

.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.product-card {
  border-radius: 1rem;
  padding: 1rem;
  width: auto;
  text-align: center;
  cursor: pointer;
  background-color: var(--text-50);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: scale(1.05);
}

.product-card img {
  width: 256px;
  height: 256px;
  object-fit: cover;
  border-radius: 5px;
}

.product-name {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
  padding-bottom: 1rem;
}

/* Animations for product details */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(
      -50%,
      -55%
    ); /* Adjusted to match the translateY value */
  }
  to {
    opacity: 1;
    transform: translate(-50%, -45%);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 0;
    transform: translate(
      -50%,
      -55%
    ); /* Adjusted to match the translateY value */
  }
}

.product-details {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Correct centering */
  align-items: center; /* Vertically center align items */
  padding: 1rem;
  background-color: white;
  border-radius: 5px;
  width: 90%;
  max-width: 900px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Optional: Add shadow for depth */
  z-index: 10;
  animation: fadeIn 0.25s forwards;
  overflow: hidden;
}

.product-details.open-animation {
  animation: fadeIn 0.25s forwards;
}

.product-details.close-animation {
  animation: fadeOut 0.25s forwards;
}

.product-details img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 1rem; /* Space between image and content */
}

.close-btn {
  align-self: flex-start; /* Align close button to the top */
  background-color: rgb(231, 55, 55);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 11; /* Ensure close button is above other content */
}

.close-btn:hover {
  background-color: rgb(181, 27, 27);
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.product-details-content h2 {
  font-size: 2rem;
  padding-bottom: 1rem;
  color: var(--text);
  border-bottom: 2px solid var(--secondary);
}

.product-details-content p {
  font-size: 0.875rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  color: var(--text);
  border-bottom: 2px solid var(--secondary);
}

.product-details-content .category-tag {
  display: inline-block;
  padding: 0.25rem 1rem;
  background-color: var(--accent);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.product-details-content .details-block {
  display: flex;
  align-items: center;
  padding-top: 1rem;
}

.product-details-content .details-block span {
  display: block;
  background-color: var(--secondary-50);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: bold;
  color: var(--text);
  text-transform: uppercase;
  margin-right: 1rem;
}

.product-details-content .details-block .value {
  font-size: 1rem;
  color: var(--text);
}

.preferred-products {
  margin-top: 2rem;
}

.preferred-products h2 {
  margin-bottom: 1rem;
}

/* Responsive styles */
@media screen and (max-width: 1184px) {
  .feature-line {
    height: 40px;
  }
}

@media screen and (max-width: 450px) {
  .feature-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding-bottom: 4rem;
  }

  .feature-item div {
    padding-bottom: 0.5rem;
  }

  .feature-item h4 {
    padding-bottom: 0.5rem;
  }

  .feature-item p {
    padding: 0rem 1rem;
    text-align: center;
  }

  .feature-list {
    flex-direction: column;
  }

  .feature-line img {
    width: 0px;
  }
}

@media (min-width: 1200px) {
  .product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  }

  .product-card img {
    max-width: 100%;
    width: 350px;
    max-height: 100%;
    height: 350px;
  }
}

@media (min-width: 1920px) {
  .product-card img {
    max-width: 100%;
    width: 400px;
    max-height: 100%;
    height: 400px;
  }
}

@media (min-width: 2560px) {
  .product-card img {
    max-width: 100%;
    width: 512px;
    max-height: 100%;
    height: 512px;
  }
}
