/* Base layout fixes */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  font-family: Arial, sans-serif;
  background-color: #fff9f5;
  color: #333;
  min-width: 320px; /* Prevent super narrow mobile views */
}

/* Product container */
.container {
  display: flex;
  flex-direction: row; /* Ensure horizontal layout on desktop */
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  gap: 30px;
  align-items: flex-start;
  box-sizing: border-box;
  justify-content: space-between; /* Distribute space between items */
}

/* Left Product Image Column */
.product-images-container {
  width: 45%; /* Adjusted width */
  max-width: 450px;
  position: sticky;
  top: 20px;
  height: fit-content;
  flex-shrink: 0; /* Prevent shrinking */
}

/* Main product image */
.main-image-container {
  width: 100%;
  margin-bottom: 15px;
  border: 2px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1/1;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Thumbnail images for selection */
.thumbnail-container {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: center;
}

.thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 2px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.thumbnail.active {
  border-color: #503530;
}

.thumbnail:hover {
  border-color: #503530;
}

/* Right Product Info */
.product-info {
  width: 50%; /* Adjusted width */
  display: flex;
  flex-direction: column;
  align-self: flex-start; /* Align to top */
}

.product-title {
  font-size: 32px;
  font-weight: bold;
  color: #503530;
  margin-top: 0;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.rating {
  color: #ff9800;
  font-size: 18px;
  margin: 15px 0;
}

.brand {
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.description {
  margin: 15px 0;
  line-height: 1.6;
}

/* Button Container */
.button-container {
  margin: 15px 0 30px;
  display: flex;
  justify-content: center; /* Ensure centering */
  width: 100%;
  position: relative; /* Add position relative */
  z-index: 1; /* Add z-index */
}

.availability-btn {
  background-color: #503530; /* Changed to a dark brown color */
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.2s;
  width: 220px; /* Increased width slightly */
  text-align: center;
  display: inline-block; /* Ensure it's displayed */
  box-shadow: 0 3px 5px rgb(255, 255, 255); /* Add shadow for visibility */
  position: relative; /* Add position relative */
  z-index: 2; /* Add z-index */
  text-decoration: none; /* Remove underline from link */
}

.availability-btn:hover {
  background-color: #503530; /* Darker shade on hover */
  box-shadow: 0 3px 5px rgba(0,0,0,0.2); /* Add shadow on hover */
}

.highlights {
  margin-top: 30px;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  clear: both;
}

.highlights h3 {
  color:#503530; /* Changed heading color to match homepage */
  margin-top: 0;
  margin-bottom: 15px;
}

.highlights ul {
  padding-left: 20px; /* Add proper padding for list */
  list-style-position: inside; /* Keep bullets inside the container */
}

.highlights li {
  margin-bottom: 10px;
  line-height: 1.5;
  text-align: left; /* Ensure text is left-aligned */
  padding-left: 5px; /* Small padding to keep text from touching bullets */
  display: list-item; /* Ensure proper list rendering */
  position: relative; /* For positioning */
}

/* Enhanced Footer */
footer {
  background-color: #fff8dc; /* Changed footer background to match homepage */
  color: #503530; /* Changed footer text color to match homepage */
  padding: 20px;
  margin-top: 40px;
  border-top: 2px solid #eee; /* Add a subtle top border */
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logos {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.footer-logos a img {
    /* Add filter if needed, e.g., if they are white */
    /* filter: invert(1); */
    width: 30px;
    height: 30px;
    display: block;
}

.brand-footer {
  margin: 10px 0;
}

.brand-footer img {
    /* Add filter if needed */
    width: 120px;
    /* filter: none; */ /* Reset filter if applied elsewhere */
}

.help {
  font-size: 14px;
  line-height: 1.5;
  color: #503530; /* Ensure help text matches homepage */
}

.help strong {
    color: #503530; /* Ensure heading is also dark brown */
}

.help a {
  color: #503530; /* Changed link color to match homepage */
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  margin-bottom: 5px;
}

.help a:hover {
  text-decoration: underline;
  color: #c77f20; /* Use accent color for hover like homepage */
}

.help .contact-icon {
    /* Adjust icon color if needed - using filter for PNGs */
    /* filter: invert(20%) sepia(15%) saturate(800%) hue-rotate(350deg) brightness(90%) contrast(90%); */
    /* The above filter is an example to make icons brown, uncomment and adjust if icons are white/light */
    display: inline-block;
    margin-right: 8px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    object-fit: contain;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    margin: 0 auto;
    padding: 12px 0;
    gap: 15px;
    width: 100%;
    align-items: center;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal scrolling */
  }

  main {
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .product-images-container {
    width: 90%;
    max-width: 350px;
    position: relative;
    top: 0;
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .main-image-container {
    margin-bottom: 10px;
    width: 100%;
  }

  .product-info {
    width: 90%;
    padding: 0;
    margin: 0 auto;
    gap: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .brand-container {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
  }

  .brand {
    padding: 0;
    gap: 6px;
    justify-content: center;
  }

  .simple-share-buttons {
    gap: 5px;
    margin: 0 auto;
  }

  .description {
    margin: 0 auto;
    padding: 0;
    text-align: center;
    width: 95%;
  }

  .button-container {
    margin: 15px 0;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .availability-btn {
    display: block !important;
    width: 220px;
    margin: 0 auto;
  }

  .highlights {
    width: 95%;
    margin: 10px auto;
    padding: 12px;
  }

  .thumbnail-container {
    padding: 0;
    margin-top: 10px;
    gap: 8px;
    justify-content: center;
    width: 100%;
  }

  .thumbnail {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
  }

  /* Footer mobile adjustments */
  footer {
    margin: 0;
    padding: 15px;
    width: 100%;
  }

  .footer-content {
    padding: 0;
    gap: 15px;
    width: 100%;
  }

  .description {
    order: 1;
    margin-bottom: 15px;
  }
  
  .button-container {
    order: 2;
    width: 100%;
    margin: 0 auto 25px;
    padding: 0;
  }
  
  .highlights {
    order: 3;
    margin-top: 0;
  }

  .footer-content {
    flex-direction: column;
    gap: 15px;
    align-items: center; /* Center align footer content */
  }

  .footer-logos {
    justify-content: center; /* Center logos in mobile view */
  }

  .help {
    text-align: center; /* Center help text */
    line-height: 1.8; /* Increase line height for better readability */
  }
  
  .help span, .help a {
    display: inline-flex; /* Use inline-flex for centering */
    justify-content: center; /* Center icon and text */
    align-items: center;
    width: 100%; /* Ensure it takes full width for centering */
  }
}