/* ======= Global Styles ======= */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #111;
  color: #eee;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ======= Header ======= */
header {
  background-color: #1a1a1a;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 180px;
  /* Changed from 65px */
}

nav a {
  color: #00ff99;
  margin: 0 10px;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

/* ======= Hero Section ======= */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(to right, #00ff99, #0066ff);
  color: #000;
}

.hero h2 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.2em;
}

.btn {
  background-color: #000;
  color: #00ff99;
  padding: 10px 20px;
  border-radius: 5px;
  display: inline-block;
  margin-top: 20px;
  font-weight: bold;
}

.btn:hover {
  background-color: #222;
}
.btn.alt {
  background-color: #333;
  color: #eee;
}
.btn.alt:hover {
  background-color: #444;
}


/* ======= Video Section ======= */
.video {
  padding: 40px 20px;
  text-align: center;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ======= Product Section ======= */
.product {
  padding: 40px 20px;
  text-align: center;
}

.product h2 {
  font-size: 2em;
  margin-bottom: 10px;
}

.product p {
  font-size: 1em;
  margin: 5px 0;
}

/* ======= Gallery Section ======= */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
}

.gallery img {
  max-width: 300px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.gallery img:hover {
  transform: scale(1.05);
}

/* ======= Shop Section ======= */
.shop {
  padding: 40px 20px;
  text-align: center;
}

.product-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
}

.product-card {
  background-color: #1a1a1a;
  padding: 20px;
  border-radius: 10px;
  width: 280px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

.product-card:hover {
  transform: scale(1.05);
}

.product-card img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* ======= Footer ======= */
footer {
  text-align: center;
  padding: 20px;
  background-color: #1a1a1a;
  color: #aaa;
  font-size: 0.9em;
}
.footer-link { /* Style for policy links in footer */
  color: #aaa;
  text-decoration: none;
}
.footer-link:hover {
  color: #00ff99;
  text-decoration: underline;
}

.watch {
  padding: 40px 20px;
  text-align: center;
}

.video-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
}

.video-card {
  background-color: #1a1a1a;
  padding: 20px;
  border-radius: 10px;
  width: 320px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

.video-card:hover {
  transform: scale(1.05);
}

.video-card h3 {
  margin-top: 10px;
  font-size: 1.2em;
}
.about, .contact, .policy-page { /* Added policy-page */
  padding: 40px 20px;
  max-width: 800px;
  margin: auto;
  text-align: left;
  line-height: 1.6; /* Improve readability */
}
.about h3 { /* Style for subheadings in About page */
  color: #00ff99;
  margin-top: 25px;
}

.about h2, .contact h2, .policy-page h2 { /* Added policy-page */
  text-align: center;
  margin-bottom: 20px;
}
.policy-page h3 { /* Style for subheadings in Policy pages */
  color: #00ff99;
  margin-top: 25px;
}

.contact ul {
  list-style: none;
  padding: 0;
}

.contact li {
  margin-bottom: 10px;
}
.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 30px 0;
}

.search-form input,
.search-form select {
  padding: 10px;
  font-size: 1em;
  border-radius: 5px;
  border: none;
  width: 200px;
}

.search-form button {
  padding: 10px 20px;
  background-color: #00ff99;
  color: #000;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.search-form button:hover {
  background-color: #00cc77;
}

.tag-link {
  display: inline-block;
  background-color: #00ff99;
  color: #000;
  padding: 4px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 4px;
  font-size: 0.9em;
  text-decoration: none;
}

.tag-link:hover {
  background-color: #00cc77;
}
.linked-product {
  margin-top: 30px;
  text-align: center;
}

.linked-product img {
  width: 100%;
  max-width: 220px;
  margin-bottom: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.video-card {
  margin-bottom: 50px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  background-color: #1a1a1a;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.linked-product {
  margin-top: 20px;
  text-align: center;
}

.linked-product img {
  width: 100%;
  max-width: 220px;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* ======= Product Detail Page Styles ======= */
.product-detail-container {
  display: flex;
  flex-wrap: wrap;
  /* Allow wrapping on small screens */
  gap: 40px;
  padding: 40px 20px;
  max-width: 1200px;
  margin: auto;
}

.product-gallery {
  /* (MODIFIED) เปลี่ยน flex-grow ให้น้อยลง */
  flex: 0.8;
  min-width: 300px; /* Ensure gallery doesn't get too small */
}

.main-image-wrapper {
  background-color: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

#main-image {
  width: 100%;
  height: auto;
  /* (REMOVED) ลบการบังคับสัดส่วนและซูมที่ทำให้ภาพแตก */
  /* aspect-ratio: 1/1; */
  /* object-fit: cover; */
  display: block;
}

.product-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.thumbnail-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid #333;
  transition: border-color 0.3s ease;
}

.thumbnail-image:hover {
  border-color: #00ff99;
}

.product-info {
  /* (MODIFIED) เปลี่ยน flex-grow ให้มากขึ้น */
  flex: 1.2;
  min-width: 300px; /* Ensure info doesn't get too small */
  text-align: left;
}

.product-info h2 {
  font-size: 2.8em;
  margin-top: 0;
  margin-bottom: 20px;
  color: #fff;
}

.product-info p {
  font-size: 1.1em;
  color: #ccc;
  margin-bottom: 15px;
}

.product-info .category-link {
  color: #00ff99;
  text-decoration: none;
}
.product-info .category-link:hover {
  text-decoration: underline;
}

.product-info .tags-container {
  margin-top: 15px;
  margin-bottom: 30px;
  line-height: 1.6;
}
.product-info .tags-container strong {
  display: block;
  margin-bottom: 5px;
  color: #ccc;
}

/* ปุ่ม Buy on TeePublic */
.btn-buy {
  background-color: #00ff99;
  color: #000;
  font-size: 1.3em;
  /* Slightly larger */
  padding: 18px 32px; /* Slightly larger */
  display: block;
  text-align: center;
  border-radius: 8px;
  /* A bit rounder */
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 255, 153, 0.4); /* Add shadow */
  animation: pulse-green 2s infinite;
  /* Apply animation */
}

.btn-buy:hover {
  background-color: #00cc77;
  transform: scale(1.05); /* Stronger hover effect */
  animation-play-state: paused;
  /* Pause animation on hover */
}

.product-description {
  margin-top: 30px;
  border-top: 1px solid #333;
  padding-top: 20px;
}

.product-description h3 {
  color: #fff;
  font-size: 1.5em;
  margin-bottom: 10px;
}

.product-description p {
  color: #ccc;
  line-height: 1.6;
}

/* Additional Info Styles */
.product-additional-info {
  margin-top: 30px;
  border-top: 1px solid #333;
  padding-top: 20px;
}

.product-additional-info h3 {
  color: #fff;
  font-size: 1.5em;
  margin-bottom: 15px;
}

.product-additional-info ul {
  list-style: none;
  padding: 0;
  color: #ccc;
  line-height: 1.7;
}

.product-additional-info li {
  margin-bottom: 10px;
}
/* END Additional Info Styles */


/* Keyframes for pulsing button */
@keyframes pulse-green {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 255, 153, 0.4);
  }
  70% {
    transform: scale(1.02);
    box-shadow: 0 0 10px 15px rgba(0, 255, 153, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 255, 153, 0);
  }
}

/* ======= Related Products Styles ======= */
.related-products {
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid #222; /* Separator */
  margin-top: 40px;
  max-width: 1200px;
  /* Match product detail width */
  margin-left: auto;
  margin-right: auto;
}

.related-products h2 {
  font-size: 2.2em;
  margin-bottom: 30px;
  color: #fff;
}

/* ======= (NEW) Pagination Styles ======= */
.pagination {
  margin-top: 40px;
  text-align: center;
}

.pagination a {
  color: #00ff99;
  padding: 8px 16px;
  text-decoration: none;
  transition: background-color .3s;
  border: 1px solid #333;
  margin: 0 4px;
  border-radius: 4px;
}

.pagination a.active {
  background-color: #00ff99;
  color: #000;
  border: 1px solid #00ff99;
}

.pagination a:hover:not(.active) {
  background-color: #222;
}
/* END Pagination Styles */