
/* Product Detail Styles */
.product-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem; /* 減少間距 */
  padding: 0 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* 產品標題和圖片容器對齊 */
.product-summary {
  margin-top: 0.75rem; /* 與圖片容器的上邊距一致 */
}

.product-summary h1 {
  margin: 0 0 1rem 0; /* 移除上邊距，由父元素控制 */
}

.product-image {
  flex: 1;
  min-width: 300px;
  max-width: 50%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 0.75rem auto 0.75rem 0; /* 右側留出間距 */
  padding: 0.75rem;
  box-sizing: border-box;
}

.product-main-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Responsive styles */
@media (max-width: 768px) {
  .product-image {
    flex: 0 0 100%;
    max-width: 100%;
    text-align: center;
    padding: 0.75rem;
    margin: 0.5rem auto; /* 移動端保持自動外邊距 */
    justify-content: center;
  }
  
  .product-main-image {
    max-width: 90%;
    height: auto;
    margin: 0 auto;
    display: block;
  }
}

/* Related Products Section */
.related-products {
  margin-top: 4rem;
  padding: 0 2%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  width: 100%;
}

.related-products h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
  font-size: 1.8rem;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
  font-size: 2rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background-color: #007acc;
  margin: 0.5rem auto 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 1rem 0;
  width: 100%;
  box-sizing: border-box;
}

/* 移動端調整：當螢幕寬度小於 768px 時改為單欄顯示 */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1%;
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr;
    padding: 0 10%;
  }
}

.product-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
  display: block;
}

.product-card h3 {
  font-size: 1.1rem;
  margin: 1rem 1rem 0.5rem;
  color: #333;
}

.product-desc {
  padding: 0 1rem;
  color: #666;
  font-size: 0.9rem;
  flex-grow: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-button {
  display: block;
  background-color: #007acc;
  color: white;
  text-align: center;
  padding: 0.6rem 1rem;
  margin: 0 1rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s;
}

.product-button:hover {
  background-color: #005fa3;
}

.no-products {
  text-align: center;
  color: #666;
  margin-top: 2rem;
}


/* 統一讓所有 ueditor 內容可橫向捲動 */
.ueditor-content {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}

/* 遇到寬度設定固定的 div 也強制限制 */
.ueditor-content div[style*="width"] {
  display: block;
  overflow-x: auto;
  max-width: 100% !important;
  width: 100% !important;
}

/* iframe 響應式 */
.ueditor-content iframe {
  max-width: 100%;
  width: 100%;
  height: auto;
}



@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
  }
  
  .product-card h3 {
    font-size: 1rem;
  }
  
  .product-desc {
    font-size: 0.85rem;
  }
}

.tab-container {
  max-width: 1200px;
  margin: 2rem auto; /* 恢復原本的上下邊距 */
  padding: 0 1rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem; /* 增加下方間距 */
  padding-top: 1rem; /* 增加上方間距 */
  border-bottom: 1px solid #eee; /* 加入底部邊框 */
  padding-bottom: 1rem; /* 底部內邊距 */
}

.tab-link {
  padding: 0.6rem 1.2rem;
  background-color: #f0f0f0;
  border: none;
  cursor: pointer;
  font-weight: bold;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.tab-link.active {
  background-color: #007acc;
  color: #fff;
}

.tab-content {
  display: none;
  width: 100%;
  max-width: 100%;
  padding: 2rem 0;
  border-top: 1px solid #eee;
  margin-top: -1px;
  box-sizing: border-box;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 確保所有內容都在容器內 */
.tab-content * {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal !important;
}

/* 特別處理段落和列表 */
.tab-content p,
.tab-content li,
.tab-content div,
.tab-content span,
.tab-content td,
.tab-content th {
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  max-width: 100% !important;
}

/* 覆蓋可能影響換行的樣式 */
.tab-content {
  white-space: normal !important;
}

.tab-content * {
  white-space: normal !important;
}

/* 處理表格 */
.tab-content table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
  word-break: break-word;
}

.tab-content table td,
.tab-content table th {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 處理圖片 */
.tab-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

/* 處理程式碼區塊 */
.tab-content pre,
.tab-content code {
  white-space: pre-wrap;
  word-wrap: break-word;
  max-width: 100%;
  overflow-x: auto;
  display: block;
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
}

/* 處理長連結和長單字 */
.tab-content a,
.tab-content .long-text {
  word-break: break-all;
  overflow-wrap: break-word;
}

.tab-content.active {
  display: block;
}

.marquee-container {
  overflow: hidden;
  position: relative;
}

.marquee-content {
  display: flex;
  gap: 2rem;
  /* animation: scroll-left 40s linear infinite; */
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

.product-card {
  min-width: 250px;
  flex-shrink: 0;
}




@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .product-card {
    width: 220px;
  }
  
  .products-grid {
    gap: 1.5rem;
    animation-duration: 30s;
  }
}

@media (max-width: 768px) {
  .product-card {
    width: 200px;
  }
  
  .products-grid {
    gap: 1rem;
    animation-duration: 25s;
  }
}

/* Ensure the layout doesn't break on small screens */
@media (max-width: 480px) {
  .product-card {
    width: 180px;
  }
  
  .products-grid {
    animation-duration: 20s;
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
  }
  
  .product-card h3 {
    font-size: 1rem;
  }
  
  .product-desc {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}


