/* ======================================
   1. 全局佈局
====================================== */

/* Shop 內容頁 - 容器（已移除側邊欄，內容全寬） */
.shop-page-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    display: block;
}



.product-article{
  margin-bottom: 20px;
}

/* ======================================
   2. 內容區 (Content)
====================================== */

.content-right {
    width: 100%;
    background-color: #fff;
    padding: 0 15px;
    box-sizing: border-box;
}

/* 分類標題 */
.archive-title h1 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
}


/* ======================================
   3. 產品標籤 (Product Tags)
====================================== */

.product-tags-container {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
}

.product-tag {
    display: inline-block;
    margin-right: 5px;
    padding: 5px;
    font-size: 0.8em;
    color: #333;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
}


/* ======================================
   4. 價格資訊 (Price Info)
====================================== */

.prod-price-info {
    margin-top: 10px;
    padding: 15px;
    border-top: 1px solid #ddd;
    background-color: #fff;
}

.prod-price-details {
    margin-top: 10px;
    text-align: right;
}

.prod-price-details > div {
    margin-bottom: 5px;
    font-size: 1em;
    color: #555;
}

.prod-price-details .base-price {
    font-weight: bold;
    color: #000;
}

.prod-price-details a {
    color: inherit;
    text-decoration: none;
}


/* ======================================
   5. 產品內容頁 - 圖片與選項
====================================== */

/* ---------- 去除 container 預設左右間距 ---------- */
.shop-page-container.container {
    padding-left: 0;
    padding-right: 0;
  }
  
  /* ---------- 產品內容頁 - 圖片與選項 (含 5 格縮圖) ---------- */
  .product-header {
    display: flex;
    justify-content: space-between; /* 左右塞滿，gap 只作用於中間 */
    gap: 50px;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }
  
  /* 兩個子項目各佔 (100% - gap) / 2 */
  .product-header .product-image,
  .product-header .product-options {
    flex: 0 0 calc((100% - 50px) / 2);
  }
  
  /* 圖片區 */
  .product-header .product-image img {
    width: 100%;
    height: auto;
    display: block;
  }
  
  /* 圖庫縮圖：固定顯示 5 個 */
  .product-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 12px;
  }
  .product-thumbnails .thumb-item {
    flex: 0 0 calc((100% - 4 * 8px) / 5);
  }
  .product-thumbnails .thumb-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
  }
  .product-thumbnails .thumb-item img:hover {
    transform: scale(1.05);
  }
  
  /* 商品標題與選項 */
  .product-options {
    display: flex;
    flex-direction: column;

    gap: 12px;
  }
  .product-options h1 {
    margin: 0 0 15px;
    font-size: 1.8em;
    color: #333;
  }
  .product-options .product-working-days {
    margin-bottom: 15px;
    font-size: 16px;
    color: #555;
  }
  
  /* 訂購表單 與 價格 */
  .Product_order_form,
  .Product_price {
    margin-top: 15px;
    font-size: 16px;
    color: #333;
    text-align: right;
  }
  .Product_price {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
  }
  .Product_price .once_price {
    display: inline-block;
  }
  
  /* 基本／單價排列 */
  .basic_price,
  .unit_price {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  /* 數量欄位 */
  .Volume {
    text-align: left;
  }
  
  /* ---------- 響應式調整 (手機板) ---------- */
  @media (max-width: 768px) {
    .product-header {
      justify-content: flex-start;  /* 手機版改為靠左 */
    }
    .product-header .product-image,
    .product-header .product-options {
      flex: 1 1 100%;  /* 單欄佈局 */
    }
  }
  
  


/* ======================================
   6. 表單 & 按鈕 (Forms & Buttons)
====================================== */

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.input-group {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    margin-right: 20px;
}
.quantity-group {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
}
.form-label {
    flex-shrink: 0;
    width: 80px;
    margin-right: 10px;
    text-align: right;
}
.order-button-group {
    flex: 0 0 100%;
    margin-top: 10px;
}
.order-button {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: none;
    cursor: pointer;
}
.form-check-input[type="checkbox"] {
    display: none;
}
.form-check-label {
    display: inline-block;
    margin: 5px;
    padding: 5px 10px;
    font-size: 16px;
    color: #fff;
    background-color: #afafaf;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.form-check-input[type="checkbox"]:checked + .form-check-label {
    background-color: #0056b3;
}
.form-check-input[type="checkbox"]:disabled + .form-check-label {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
}


/* ======================================
   7. 分頁標籤 (Tabs)
====================================== */

/* ---------- 輕盈分頁標籤樣式 ---------- */
.product-tabs {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #ddd;
  }
  .product-tabs li {
    padding: 8px 0;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
  }
  .product-tabs li:hover {
    color: #333;
  }
  .product-tabs li.active {
    color: #222;
    font-weight: 600;
    border-color: #a89372;
  }
  
  /* ---------- 簡化分頁內容區 ---------- */
  .tab-content {
    padding: 24px 0;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #eee;
    background: none;
  }
  .tab-pane {
    display: none;
  }
  .tab-pane.active {
    display: block;
  }
  


/* ======================================
   8. 圖說 (Figure & Figcaption)
====================================== */

figure figcaption {
    position: relative;
    text-align: center;
}
figure figcaption::before {
    content: '';
    display: inline-block;
    margin-right: 8px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #333;
}


/* ======================================
   9. 相關產品 (Related Products)
====================================== */

.related-products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);  /* 固定四欄 */
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.related-products li {
    border: 1px solid #ddd;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}
.related-products li:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.related-products li a {
    display: block;
    color: #333;
    text-decoration: none;
}
.related-products li img {
    width: 100%;
    height: auto;
    display: block;
}
.related-products li h3 {
    margin: 0;
    padding: 10px;
    font-size: 16px;
}


/* ======================================
  10. 上一篇 / 下一篇 (Post Navigation)
====================================== */

nav[role="navigation"] {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin: 20px 0;
    padding: 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}
.nav-previous, .nav-next {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    background-color: #f8f8f8;
    cursor: pointer;
    transition: background 0.3s ease;
    min-height: 100px;
}
.nav-previous:hover, .nav-next:hover {
    background-color: #e0e0e0;
}
.nav-next { border-left: 1px solid #ddd; padding-left: 25px; }
.nav-previous { padding-right: 25px; }
.nav-previous a, .nav-next a { color: inherit; text-decoration: none; }
.nav-previous-label, .nav-next-label { font-size: 14px; color: #888; }
.nav-previous-title, .nav-next-title { font-size: 16px; font-weight: bold; color: #333; }


/* ======================================
  11. 刀模容器 (Diecut) 
====================================== */

#diecut_container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
#diecut_container a > div {
    text-align: center;
    padding: 10px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
#diecut_container a > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
#diecut_container div img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}


/* ======================================
  12. 響應式 (Responsive)
====================================== */

@media (max-width: 768px) {
    .shop-page-container { padding: 0 10px; }

    .product-header { flex-direction: column; }
    .product-header .product-image,
    .product-header .product-options { width: 100%; }
    .product-options h1 { font-size: 1.6em; }
    .order-button { width: 100%; font-size: 14px; }
    .product-tabs { overflow-x: auto; }
    .related-products { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    #diecut_container { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}

@media (max-width: 480px) {
    .shop-page-container { margin: 10px auto; }

}
