/* ===== BASE STYLES ===== */
body, html {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Lato', Arial, sans-serif;
  background-color: #f7f7f5;
  box-sizing: border-box;
  color: #2d3748;
}

*, *::before, *::after {
  box-sizing: inherit;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px 20px 60px;
  margin-top: 110px;
}

/* ===== PRODUCT DETAIL CONTAINER ===== */
.product-detail {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

/* ===== HEADING STYLES ===== */
.product-detail h2 {
  font-family: 'Merriweather', serif;
  font-size: 2.2em;
  margin-bottom: 0;
  color: #003366;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.2px;
}

.heading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 40px;
}

.separation-line {
  width: 56px;
  height: 3px;
  background-color: #b8983a;
  margin: 20px auto 0;
  display: block;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.9s ease-in-out;
}

.separation-line.animate {
  transform: scaleX(1);
}

@keyframes line-grow {
  0%   { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

/* ===== CONTENT LAYOUT - VERTICALLY CENTERED ===== */
.product-detail .content {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center; /* Vertical centering */
  min-height: 100%;
}

/* ===== IMAGE CONTAINER - CENTERED ===== */
.product-detail .image-container {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Vertical centering */
  align-items: center; /* Horizontal centering */
  height: 100%;
}

.product-detail .image-container img#main-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-top: 3px solid #003366;
}

/* ===== TEXT CONTENT ===== */
.product-detail .text {
  flex: 1;
  min-width: 300px;
  max-width: calc(100% - 640px);
  align-self: center; /* Helps with vertical alignment */
}

.product-detail .text h3 {
  font-family: 'Merriweather', serif;
  font-size: 1.55em;
  margin-bottom: 16px;
  color: #003366;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.product-detail .text p {
  font-size: 1.02em;
  line-height: 1.85;
  color: #3d4a5c;
  margin-bottom: 18px;
}

.product-detail .text ul {
  list-style-type: disc;
  margin-left: 22px;
  margin-bottom: 20px;
}

.product-detail .text ul li {
  font-size: 1em;
  line-height: 1.75;
  color: #3d4a5c;
  margin-bottom: 6px;
}

/* ===== CTA BUTTON ===== */
.product-detail .cta-button {
  display: inline-block;
  background-color: #003366;
  color: white;
  padding: 12px 32px;
  margin-bottom: 50px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Lato', sans-serif;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  border-radius: 2px;
  border: 2px solid #003366;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.product-detail .cta-button:hover {
  background-color: transparent;
  color: #003366;
}

/* ===== IMAGE PREVIEWS ===== */
.image-previews {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
  flex-wrap: wrap;
}

.image-previews img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.image-previews img:hover {
  transform: scale(1.06);
  border-color: #b8983a;
}

.image-previews img.active {
  border-color: #003366;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  main {
    margin-top: 100px;
    padding: 36px 16px 48px;
  }

  .product-detail .content {
    flex-direction: column;
    align-items: center;
  }

  .product-detail h2 {
    font-size: 1.8em;
  }

  .product-detail .image-container,
  .product-detail .text {
    min-width: unset;
    max-width: 100%;
    width: 100%;
  }

  .product-detail .text {
    text-align: center;
  }

  .product-detail .text h3 {
    font-size: 1.35em;
  }

  .product-detail .text p {
    font-size: 1em;
  }

  .product-detail .text ul {
    text-align: left;
    display: inline-block;
  }

  .image-previews {
    justify-content: center;
  }

  .image-previews img {
    width: 68px;
    height: 68px;
  }
}