/* v6 商品頁：復刻原站單品頁（縮圖直排 / 藍色價格 / 規格按鈕 / 藍綠雙按鈕） */
:root {
  --ff-pd-blue: #1f5fd0;
  --ff-pd-green: #4c9a2a;
  --ff-pd-text: #2b3a55;
  --ff-pd-line: #dfe4ec;
  --ff-pd-muted: #7b8494;
}

/* ---------- 兩欄與左側縮圖 ---------- */
body.single-product .woocommerce div.product {
  display: flex; flex-wrap: wrap; gap: 34px; align-items: flex-start;
}
body.single-product .woocommerce div.product div.images,
body.single-product .woocommerce div.product div.summary { float: none; margin: 0; }
body.single-product .woocommerce div.product div.images { flex: 0 0 47%; width: 47%; position: relative; }
/* 描述頁籤 / 相關商品要換到下一整行，不能被兩欄 flex 擠到右邊 */
body.single-product .woocommerce div.product .woocommerce-tabs,
body.single-product .woocommerce div.product .related.products,
body.single-product .woocommerce div.product .upsells.products { flex: 0 0 100%; width: 100%; clear: both; }
body.single-product .woocommerce-product-gallery__trigger { position: absolute; right: 12px; top: 12px; z-index: 5; }
body.single-product .woocommerce div.product div.summary {
  flex: 1 1 46%; width: auto; min-width: 320px;
  display: flex; flex-direction: column;
}
body.single-product .woocommerce-product-gallery { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; }
body.single-product .woocommerce-product-gallery figure.woocommerce-product-gallery__wrapper { order: 2; flex: 1 1 auto; min-width: 0; margin: 0; }
body.single-product .woocommerce-product-gallery .flex-control-thumbs {
  order: 1; flex: 0 0 74px; width: 74px; margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto;
}
body.single-product .woocommerce-product-gallery .flex-control-thumbs li { width: 100%; padding: 0; margin: 0; cursor: pointer; }
body.single-product .woocommerce-product-gallery .flex-control-thumbs li.is-active img { border-color: var(--ff-pd-blue) !important; }
body.single-product .woocommerce-product-gallery .flex-control-thumbs img,
body.single-product .woocommerce-product-gallery__wrapper img {
  width: 100%; height: auto; border: 1px solid #e9edf4; border-radius: 4px; background: #fff;
}
body.single-product .ff-pd-static-gallery .woocommerce-product-gallery__wrapper > div { display: none; }
body.single-product .ff-pd-static-gallery .woocommerce-product-gallery__wrapper > div:first-child { display: block; }
body.single-product .woocommerce-product-gallery__image a { display: block; }

/* ---------- 右側資訊排列（不靠 hook 優先順序，用 order 固定） ---------- */
body.single-product .summary .product_title { order: 1; font-size: 25px; line-height: 1.4; font-weight: 600; color: var(--ff-pd-text); margin: 0 0 8px; }
body.single-product .summary .ff-rating-row { order: 2; display: flex; align-items: center; gap: 8px; margin: 0 0 2px; }
body.single-product .summary .ff-rating-row .ff-stock,
body.single-product .summary .ff-stock { order: 2; margin: 0 0 0 auto; font-size: 13px; color: var(--ff-pd-muted); font-weight: 400; }
body.single-product .summary .ff-pd-notice { order: 3; }
body.single-product .summary p.price,
body.single-product .summary span.price,
body.single-product .woocommerce div.product p.price,
body.single-product .woocommerce div.product span.price {
  order: 4; color: #1668e3 !important; font-size: 28px !important; font-weight: 700 !important; margin: 6px 0 16px !important;
}
body.single-product .summary .woocommerce-product-details__short-description { order: 5; }
body.single-product .summary form.cart { order: 6; }
body.single-product .summary .product_meta { order: 7; font-size: 13px; }
body.single-product .summary .ff-pd-watching { order: 8; }
body.single-product .summary .sharedaddy,
body.single-product .summary .social { order: 9; }

/* ---------- LINE 客服提示條 ---------- */
.ff-pd-notice {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f8f9fb; border: 1px solid #edf0f5; border-left: 3px solid #efa800;
  border-radius: 4px; padding: 9px 12px; margin: 6px 0 14px;
  font-size: 13px; line-height: 1.7; color: #6b7280;
}
.ff-pd-notice-ico {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; background: #efa800; color: #fff;
  font-size: 13px; font-weight: 700; text-align: center; line-height: 18px;
}
.ff-pd-notice-text { flex: 1 1 260px; }
.ff-pd-line-id { color: #1668e3; font-weight: 700; text-decoration: underline; }
.ff-pd-notice-btn {
  flex: 0 0 auto; background: #06c755; color: #fff; border-radius: 3px;
  padding: 4px 10px; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.ff-pd-notice-btn:hover { background: #05ad4a; color: #fff; }

/* ---------- 規格按鈕 ---------- */
body.single-product .woocommerce div.product form.cart {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 4px 0 12px; padding: 0; border: 0; width: 100%;
}
body.single-product .woocommerce div.product form.cart table.variations { display: none; }
body.single-product .ff-pd-use-native .woocommerce div.product form.cart table.variations { display: table !important; }
body.single-product .ff-pd-use-native .ff-pd-specs { display: none !important; }
body.single-product .woocommerce-variation-add-to-cart {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%;
  opacity: 1 !important; visibility: visible !important;
}
.ff-pd-specs { order: 1; flex: 0 0 100%; margin-bottom: 2px; }
.ff-pd-spec-group { margin-bottom: 12px; }
.ff-pd-spec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 14px; color: #3a4353; }
.ff-pd-spec-label { font-weight: 600; }
.ff-pd-spec-value { color: var(--ff-pd-muted); font-size: 13px; }
.ff-pd-spec-value.is-set { color: var(--ff-pd-blue); font-weight: 600; }
.ff-pd-spec-clear { font-size: 12px; color: #98a0ae; text-decoration: underline; margin-left: 2px; }
.ff-pd-spec-group.is-missing .ff-pd-spec-value { color: #d0342c; }
.ff-pd-spec-options { display: flex; flex-wrap: wrap; gap: 7px; }
.ff-pd-opt {
  background: #fff; border: 1px solid #cdd4df; border-radius: 3px; color: #3a4353;
  padding: 6px 12px; font-size: 13px; line-height: 1.5; cursor: pointer;
  font-family: inherit; transition: border-color .12s, background .12s;
}
.ff-pd-opt:hover { border-color: var(--ff-pd-blue); color: var(--ff-pd-blue); }
.ff-pd-opt.is-selected {
  border: 2px solid var(--ff-pd-blue); padding: 5px 11px; background: #eef4ff;
  color: #114bb5; font-weight: 600;
}
.ff-pd-opt:focus-visible { outline: 2px solid #8fb4ff; outline-offset: 1px; }
.ff-pd-error {
  background: #fff3f2; border: 1px solid #f5c6c2; color: #c0392b; border-radius: 4px;
  padding: 8px 12px; font-size: 13px; margin: 0 0 10px;
}
.ff-shake { animation: ff-pd-shake .32s ease; }
@keyframes ff-pd-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
body.single-product .woocommerce-variation.single_variation { font-size: 13px; color: #6b7280; margin: 0 0 4px; flex: 0 0 100%; }
body.single-product .woocommerce-variation-availability { font-size: 13px; }

/* ---------- 數量 + 兩顆按鈕 ---------- */
body.single-product .woocommerce div.product form.cart .quantity { order: 2; margin: 0 !important; }
.ff-pd-qty-box { display: inline-flex !important; align-items: stretch; height: 44px; }
.ff-pd-qty-btn {
  width: 32px; border: 1px solid var(--ff-pd-line); background: #fff; color: #55607a;
  font-size: 17px; cursor: pointer; font-family: inherit; border-radius: 3px 0 0 3px;
}
.ff-pd-qty-box .ff-pd-qty-btn:last-child { border-radius: 0 3px 3px 0; }
.ff-pd-qty-btn:hover { background: #f2f6ff; }
.ff-pd-qty-box input.qty {
  width: 46px !important; height: 44px !important; margin: 0 !important; padding: 0 !important;
  border: 1px solid var(--ff-pd-line) !important; border-left: 0 !important; border-right: 0 !important;
  border-radius: 0 !important; text-align: center; font-size: 14px; appearance: textfield;
}
.ff-pd-qty-box input.qty::-webkit-inner-spin-button,
.ff-pd-qty-box input.qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body.single-product .woocommerce div.product form.cart button.button.alt,
body.single-product .woocommerce div.product form.cart button.single_add_to_cart_button {
  order: 3; flex: 1 1 180px; height: 44px; margin: 0; border-radius: 3px; border: 0;
  background: var(--ff-pd-blue) !important; color: #fff !important;
  font-size: 15px !important; font-weight: 700 !important; letter-spacing: 1px; cursor: pointer;
  opacity: 1 !important;
}
body.single-product .woocommerce div.product form.cart button.single_add_to_cart_button:hover { background: #164cae !important; }
body.single-product .woocommerce div.product form.cart button.ff-pd-buy-now {
  order: 4; flex: 1 1 180px; height: 44px; margin: 0; border-radius: 3px; border: 0;
  background: var(--ff-pd-green) !important; color: #fff !important;
  font-size: 15px !important; font-weight: 700 !important; letter-spacing: 1px; cursor: pointer;
  opacity: 1 !important;
}
body.single-product .woocommerce div.product form.cart button.ff-pd-buy-now:hover { background: #3d7f22 !important; }
body.single-product .woocommerce div.product form.cart button[disabled] { opacity: .55 !important; cursor: not-allowed; }

/* ---------- 比較 / 願望清單 / 觀看人數 ---------- */
body.single-product .summary .product_meta { border-top: 1px solid #edf0f5; padding-top: 12px; margin-top: 10px !important; }
body.single-product .summary .product_meta a { color: #7b8494; }
.ff-pd-watching {
  display: flex; align-items: center; gap: 7px; background: #eef4ff; color: #3b5b9c;
  border-radius: 6px; padding: 12px 16px; margin: 16px 0 0; font-size: 14px;
}
.ff-pd-watching b { font-size: 15px; }

/* ---------- 手機 ---------- */
@media (max-width: 860px) {
  body.single-product .woocommerce div.product { gap: 20px; }
  body.single-product .woocommerce div.product div.images,
  body.single-product .woocommerce div.product div.summary { flex: 0 0 100%; width: 100%; min-width: 0; }
  body.single-product .woocommerce-product-gallery .flex-control-thumbs { flex-basis: 58px; width: 58px; }
  body.single-product .woocommerce div.product form.cart button.button.alt,
  body.single-product .woocommerce div.product form.cart button.ff-pd-buy-now { flex: 1 1 100%; }
}
