/* Reset default body and html padding/margin */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  background-color: #ffffff;
  overflow-x: hidden; /* Prevent sideways scroll */
}

/* Apply box-sizing border-box globally */
*, *::before, *::after {
  box-sizing: border-box;
}
/* Products Section */
.products-section {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 20px;
  box-sizing: border-box;
}

/* Individual Product Card */
.product {
  perspective: 1000px;
  margin: 20px;
  width: calc(25% - 40px); /* Four products in a row */
  height: 400px;
  transition: transform 0.3s ease-in-out;
}

/* Inner Container for 3D Flip Effect */
.product-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.product:hover .product-inner {
  transform: rotateY(180deg);
}

/* Front and Back Faces */
.product-front, .product-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* Front Face Content */
.product-front {
  background-color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-front img {
  max-width: 100%;
  height: 200px;
  border-radius: 10px;
}

.product-front h3 {
  margin-top: 15px;
  font-size: 20px;
  font-weight: bold;
  color: #0077cc;
  text-align: center;
}

/* Back Face Content */
.product-back {
  background-color: #f4f4f4;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 20px;
}

.product-back p {
  font-size: 16px;
  color: #333;
  text-align: center;
  line-height: 1.4;
}

/* Read More Button Styling */
.read-more {
  display: inline-block;
  padding: 10px 20px;
  background-color: #0077cc;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.read-more:hover {
  background-color: #005fa360;
}

/* Responsive Design */

/* Tablet Screens (Less than 1024px) */
@media screen and (max-width: 1024px) {
  .product {
    width: calc(50% - 40px); /* Show 2 products per row on tablets */
    height: 350px; /* Adjust height for smaller screens */
  }
}

/* Mobile Screens (Less than 768px) */
@media screen and (max-width: 768px) {
  .product {
    width: calc(100% - 40px); /* Show 1 product per row on small devices */
    height: 350px;
  }

  /* Center the content in smaller screens */
  .products-section {
    justify-content: center;
  }
}
