:root {
  --primary-color: #0e273c;
  --accent-color: #33b2d7;
  --bg-light: #f5f8fa;
  --text-color: #333;
  --white: #fff;
  --gray-light: #f8f9fa;
  --sidebar-bg: #f8f9fa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Montserrat', sans-serif;
  background: var(--white);
  color: var(--text-color);
  line-height: 1.6;
  height: auto;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.lang-th {
  font-family: 'Noto Serif Thai', serif;
}

.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hero-header {
  width: 100%;
  background-color: #e2ecef;
  padding: 20px 10px;
  margin-bottom: 0px;
  text-align: center;
  color: #164f72;
  min-height: clamp(120px, 20vh, 150px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-title {
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: bold;
  margin-bottom: clamp(8px, 2vw, 10px);
  margin-top: clamp(8px, 2vw, 10px);
  line-height: 1.2;
  text-align: center;
}

.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.2rem);
  opacity: 0.8;
  margin-bottom: clamp(15px, 3vw, 20px);
  text-align: center;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.badge {
  background: rgba(51, 178, 215, 0.1);
  color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(51, 178, 215, 0.3);
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.product-images {
  position: sticky;
  top: 120px;
}

.main-image-container {
  position: relative;
  border: 1px solid #e0e0e0;
  border-radius: 0px;
  aspect-ratio: 1;
  display: block;
  overflow: hidden;
  background: transparent;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.image-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  width: clamp(30px, 8vw, 40px);
  height: clamp(30px, 8vw, 40px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(14px, 4vw, 18px);
  color: var(--text-color);
  transition: all 0.3s ease;
  border-radius: 50%;
}

.image-nav:hover {
  background: var(--accent-color);
  color: white;
}

.image-nav.prev { left: clamp(5px, 2vw, 10px); }
.image-nav.next { right: clamp(5px, 2vw, 10px); }

.thumbnail-action-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 25px;
  margin-top: 50px;
  flex-wrap: wrap;
}

.thumbnail-grid {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap !important; 
  gap: 20px;
  min-width: 250px;
  overflow-x: auto; 
  overflow-y: hidden;
  padding-bottom: 2px; 
  padding-top: 2px; 
  padding-left: 2px; 
}

.thumbnail {
  width: 80px !important; 
  height: 80px !important;
  min-width: 80px !important; 
  flex-shrink: 0 !important; 
  aspect-ratio: 1;
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  border-radius: 0px;
  overflow: hidden;
  transform: scale(1);
}

.thumbnail:hover,
.thumbnail.active {
  border-color: var(--accent-color);
  transform: scale(1.00);
  box-shadow: 0 2px 8px rgba(51, 178, 215, 0.3);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Product Info Section */
.product-info {
  padding-left: 20px;
}

.product-info h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.product-subtitle {
  font-size: 1.3rem;
  color: var(--accent-color);
  margin-bottom: 30px;
  font-weight: 500;
}

.product-description {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 30px;
  color: var(--text-color);
}

.features-section {
  margin: 40px 0;
}

.features-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.feature-list {
  list-style: none;
}

.feature-list li {
  transition: none !important;
  animation: none !important;
  transform: none !important;
}

/* Override the CSS hover effects from product_style.css */
.feature-list li:hover {
  background: #f8f9fa !important; /* Keep original background */
  transform: none !important; /* Remove translateX animation */
  transition: none !important;
  animation: none !important;
}

/* Ensure no visual changes on any interaction */
.feature-list li:hover,
.feature-list li:focus,
.feature-list li:active {
  background: #f8f9fa !important;
  color: inherit !important;
  transform: translateX(0px) !important;
  transition-duration: 0s !important;
}

.feature-icon {
  width: 24px;
  height: 24px;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 2px;
}

.action-filter-buttons {
  display: flex;
  gap: 15px;
  margin: 0px 0;
  flex-wrap: wrap;
  margin-top: -10px;
}

.btn-filter {
  padding: 15px 30px;
  font-weight: 500;
  font-size: 12.4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-filter-primary {
  background: var(--accent-color);
  color: white;
}

.btn-filter-primary:hover {
  background: #2a9bc1;
  transform: translateY(-2px);
}

.btn-filter-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-filter-secondary:hover {
  background: var(--primary-color);
  color: white;
}

.btn-filter-tertiary {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-filter-tertiary:hover {
  background: var(--primary-color);
  color: white;
}

.product-info {
  padding-left: 20px;
}

.product-info h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.product-subtitle {
  font-size: 1.3rem;
  color: var(--accent-color);
  margin-bottom: 10px;
  font-weight: 500;
}

.product-code {
  color: #718096;
  font-size: 0.9rem;
  margin-bottom: 30px;
  font-weight: 500;
}

.price-section {
  margin-bottom: 30px;
}

.price-label {
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.login-button {
  background: var(--accent-color);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 0px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 14px;
}

.login-button:hover {
  background: #2a9bc1;
  transform: translateY(-2px);
}

.option-group {
  margin-bottom: 25px;
}

.option-label {
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 10px;
  font-size: 1rem;
}

.option-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.option-btn {
  padding: 15px 30px;
  font-weight: 500;
  font-size: 12.4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  letter-spacing: 0.5px;
}

.option-btn.active {
  background: #45b4da;
  color: white;
  transform: translateY(-2px);
}

.option-btn:hover:not(.active) {
  border-color: var(--accent-color);
  background: rgba(51, 178, 215, 0.1);
}

.product-description {
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 30px 0;
  color: var(--text-color);
}

.features-section {
  margin: 40px 0;
}

.features-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.feature-list {
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 15px;
  padding: 15px;
  background: white;
  transition: all 0.3s ease;
}

.feature-list li:hover {
  background: rgba(51, 178, 215, 0.1);
  transform: translateX(5px);
}

.feature-icon {
  width: 24px;
  height: 24px;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 2px;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.btn-f {
  padding: 15px 30px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-f-primary {
  background: var(--accent-color);
  color: white;
}

.btn-f-primary:hover {
  background: #2a9bc1;
  transform: translateY(-2px);
}

.btn-f-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-f-secondary:hover {
  background: var(--primary-color);
  color: white;
}

.option-btn:hover:not(.active):not(.disabled) {
  border-color: var(--accent-color);
  background: rgba(51, 178, 215, 0.1);
}

.option-btn.disabled {
  background-color: #f5f5f5;
  color: #999;
  border-color: #ddd;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

footer {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 40px 20px;
  font-weight: 500;
  margin-top: auto;
}

/* Responsive for tablets and small laptops */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 30px 15px;
  }

  .product-images {
    position: static;
  }

  .product-info {
    padding-left: 0;
  }

  .hero-title {
    margin-top: 100px;
    font-size: 1.8rem;
  }

  .specs-section {
    padding: 30px 20px;
  }
}

@media (max-width: 768px) {
  .hero-badges {
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 2vw, 10px);
  }

  .thumbnail-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .thumbnail-grid {
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important; /* ไม่ให้ขึ้นบรรทัดใหม่ */
    order: 2;
    margin-top: clamp(15px, 3vw, 20px);
    gap: 8px;
    overflow-x: auto !important; /* เลื่อนในแนวนอนได้ */
    overflow-y: hidden !important;
    padding-bottom: 5px; /* เผื่อ scrollbar */
  }

  /* เพิ่ม rule สำหรับ thumbnail items */
  .thumbnail-grid > * {
    width: 60px !important; /* ขนาดเล็กลง */
    height: 60px !important; /* กำหนดความสูง */
    min-width: 60px !important; /* ป้องกันการหด */
    flex-shrink: 0 !important; /* ไม่ให้หดตัว */
    box-sizing: border-box !important;
  }

  .action-filter-buttons {
    order: 1;
    flex-direction: row;
    gap: 8px;
    justify-content: space-between;
  }

  .btn-filter {
    flex: 1;
    box-sizing: border-box;
    padding: 16px 12px;
    font-size: 13px;
    display: flex;
    min-width: auto;
    max-width: none;
  }

  .specs-tabs {
    flex-direction: column;
    border-radius: 6px;
  }

  .tab-btn {
    border-right: none;
    border-bottom: 1px solid #ddd;
    padding: 12px 25px;
    font-size: 13px;
  }

  .tab-btn:last-child {
    border-bottom: none;
  }

  .specs-table {
    font-size: 12px;
    overflow-x: auto;
    display: block;
    border-radius: 6px;
  }

  .specs-table thead,
  .specs-table tbody,
  .specs-table tr {
    display: table;
    width: 100%;
  }

  .specs-table th,
  .specs-table td {
    padding: 10px 8px;
    font-size: 12px;
    min-width: 60px;
  }

  .specs-table th:first-child,
  .specs-table td:first-child {
    min-width: 120px;
    padding-left: 15px;
  }
}

/* Responsive for very small devices like iPhone SE */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.2rem;
    margin-top: 70px;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .product-info h1 {
    font-size: 1.5rem;
  }

  .product-subtitle {
    font-size: 1rem;
  }

  .price-label,
  .option-label {
    font-size: 0.9rem;
  }

  .btn-filter,
  .option-btn,
  .btn-f {
    padding: 12px 20px;
    font-size: 12px;
  }
}

/* Responsive for large and ultra-wide displays (like 4K monitors) */
@media (min-width: 1600px) {
  .main-content {
    max-width: 1600px;
    gap: 100px;
  }

  .product-info h1 {
    font-size: 3rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .btn-filter,
  .option-btn,
  .btn-f {
    font-size: 14px;
    padding: 18px 36px;
  }
}

@keyframes ripple {
  to {
    transform: scale(2);
    opacity: 0;
  }
}