/* =====================================================
   WooCommerce 元件 → 鵠好品牌樣式覆寫
   ===================================================== */

/* 排序下拉(商店列) */
.woocommerce-ordering select, select.orderby {
  border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 9px 16px;
  background: #fff; font-size: 14px; cursor: pointer; outline: none; color: var(--ink);
}
.woocommerce-ordering select:focus { border-color: var(--yellow); }
.woocommerce-result-count { color: var(--ink-soft); font-size: 14px; }

/* 按鈕統一 */
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .wc-block-components-button,
.woocommerce .single_add_to_cart_button, .woocommerce-page .button, .wp-element-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--yellow); color: #fff; border: none; border-radius: var(--r-pill);
  padding: 13px 28px; font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(244,183,49,.35); transition: all .22s; line-height: 1.2;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,
.woocommerce .single_add_to_cart_button:hover, .woocommerce #respond input#submit:hover, .wp-element-button:hover {
  background: var(--yellow-dark); color: #fff; transform: translateY(-2px);
}
.woocommerce a.button.alt, .woocommerce button.button.alt { background: var(--yellow); }
/* 次要按鈕(灰底) */
.woocommerce a.button.wc-backward, .woocommerce .cart .button[name="update_cart"],
.woocommerce-cart .return-to-shop .button {
  background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
}

/* 數量選擇器 */
.woocommerce .quantity .qty {
  width: 64px; height: 48px; text-align: center; font-weight: 700;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); outline: none;
}
.woocommerce .quantity .qty:focus { border-color: var(--yellow); }

/* 商品資訊欄:移除白底卡片(.summary 卡片樣式只給購物車摘要),內容平鋪對齊 */
.pd-info.summary { background: transparent; box-shadow: none; border-radius: 0; padding: 0; position: static; }

/* 加入購物車區(單一商品) */
.pd-info form.cart { display: flex; align-items: center; gap: 14px; margin: 24px 0 8px; flex-wrap: wrap; }
/* 數量步進器:無縫膠囊 [− | 數字 | +] */
.pd-info form.cart .quantity {
  display: inline-flex; align-items: center; height: 52px; flex-shrink: 0;
  border: 1.5px solid var(--line); border-radius: var(--r-pill); background: #fff; overflow: hidden;
}
.pd-info form.cart .quantity:focus-within { border-color: var(--yellow); }
.pd-info form.cart .quantity .qty-btn {
  width: 42px; height: 100%; padding: 0; border: 0; background: transparent;
  font-size: 20px; font-weight: 400; line-height: 1; color: var(--ink-soft);
  cursor: pointer; display: grid; place-items: center; transition: background .15s, color .15s;
}
.pd-info form.cart .quantity .qty-btn:hover { background: var(--cream-2); color: var(--ink); }
.pd-info form.cart .quantity .qty-btn:active { background: var(--yellow-soft); }
.pd-info form.cart .quantity .qty {
  width: 46px; height: 100%; border: 0; border-radius: 0; background: transparent;
  text-align: center; font-weight: 700; font-size: 15px; color: var(--ink); outline: none;
  -moz-appearance: textfield; padding: 0;
}
.pd-info form.cart .quantity .qty::-webkit-outer-spin-button,
.pd-info form.cart .quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pd-info form.cart .single_add_to_cart_button { flex: 1; min-width: 180px; height: 52px; order: 1; }
.pd-info form.cart .variations { width: 100%; order: -1; }
/* 變化型:單一變化區在 flex 表單裡佔滿整行(否則會縮成內容寬、按鈕沒滿版) */
.pd-info form.cart .single_variation_wrap { width: 100%; flex: 1 0 100%; }
.pd-info .woocommerce-variation-add-to-cart { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pd-info .woocommerce-variation-add-to-cart .single_add_to_cart_button { flex: 1; min-width: 180px; height: 52px; order: 1; }

/* 可選樣式:變化型 swatch */
.pd-info .variations { border-collapse: collapse; margin: 4px 0 8px; width: 100%; }
.pd-info .variations tbody, .pd-info .variations tr, .pd-info .variations th, .pd-info .variations td { display: block; border: none !important; background: none !important; box-shadow: none !important; }
.pd-info .variations tr { margin-bottom: 20px; }
.pd-info .variations th.label { text-align: left; padding: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.pd-info .variations th.label label { margin: 0; font-weight: 600; }
.pd-info .variations td.value { padding: 0; position: relative; }
.pd-info .variations .swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.pd-info .variations .swatch { padding: 9px 18px; border-radius: var(--r-pill); border: 1.5px solid var(--line); font-size: 14px; cursor: pointer; background: #fff; color: var(--ink); transition: all .2s; }
.pd-info .variations .swatch:hover { border-color: var(--yellow); }
.pd-info .variations .swatch.on { border-color: var(--yellow); background: var(--yellow-soft); color: var(--yellow-dark); font-weight: 600; }
.pd-info .variations .swatch:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.pd-info .reset_variations { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--muted); }
/* 變化價格只顯示在上方灰底框(由 main.js 同步),這裡的第二處隱藏 */
.pd-info .woocommerce-variation-price { display: none !important; }
.pd-info .woocommerce-variation-availability { width: 100%; order: 0; }

/* 直接購買 + 收藏 */
.pd-info .wish-btn { order: 2; width: 52px; height: 52px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-soft); flex-shrink: 0; cursor: pointer; transition: all .2s; }
.pd-info .wish-btn:hover, .pd-info .wish-btn.on { border-color: var(--rose); color: var(--rose); }
.pd-info .wish-btn svg { width: 20px; height: 20px; }
.pd-info .buy-now-btn { order: 3; flex-basis: 100%; height: 52px; border-radius: var(--r-pill); border: 1.5px solid var(--yellow); background: #fff; color: var(--yellow-dark); font-weight: 700; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s; }
.pd-info .buy-now-btn:hover { background: var(--yellow); color: #fff; box-shadow: 0 6px 16px rgba(244,183,49,.35); }
.pd-info .buy-now-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--yellow-soft), 0 0 0 4px var(--yellow); }
/* 未選變化時鎖住直接購買 */
.pd-info .single_add_to_cart_button.disabled ~ .buy-now-btn,
.pd-info .single_add_to_cart_button[disabled] ~ .buy-now-btn { opacity: .45; pointer-events: none; }
/* 直接購買 與下方分隔線的間距加大 */
.pd-info .assure { margin-top: 24px; }

/* 星等 */
.woocommerce .star-rating span::before, .woocommerce p.stars a { color: var(--yellow); }
.woocommerce .star-rating { color: var(--yellow); font-size: 1em; }
.pd-info .woocommerce-product-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.pd-info .woocommerce-review-link { color: var(--muted); font-size: 13px; }

/* 價格 */
.price-row { display: flex; align-items: baseline; gap: 12px; background: var(--cream-2); border-radius: var(--r); padding: 18px 22px; margin-bottom: 24px; }
.price-row .price { font-size: 30px; font-weight: 900; color: var(--ink); margin: 0; }
.price-row del { color: var(--muted); font-size: 16px; font-weight: 500; }
.price-row ins { text-decoration: none; }
.price-row .off { align-self: center; background: var(--rose); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.price-row .off .woocommerce-Price-amount { color: #fff; font-size: 1em; font-weight: 700; }

/* 金額順序與樣式(參考 prototype):特價(粗黑)→ 原價(灰刪除線)→ 省$X(珊瑚膠囊) */
.price-row .price { display: inline-flex; align-items: baseline; }
.price-row .price > ins { order: 1; }
.price-row .price > del { order: 2; margin-left: 12px; }
.price-row .price .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
/* 特價金額改黑色(覆寫商品卡用的紅色,僅價格框) */
.price-row ins, .price-row ins .woocommerce-Price-amount, .price-row ins bdi { color: var(--ink) !important; text-decoration: none; }

/* 商品圖庫(無白底外框,主圖填滿圓角卡) */
.pd .gallery { position: relative; }
.pd .gallery .onsale { position: absolute; top: 16px; left: 16px; z-index: 4; }
.woocommerce-product-gallery { position: relative; background: transparent; padding: 0; box-shadow: none; border-radius: 0; }
.woocommerce-product-gallery__wrapper { margin: 0; }
.woocommerce-product-gallery__image { border-radius: var(--r-xl); overflow: hidden; }
.woocommerce-product-gallery__image img { border-radius: var(--r-xl); display: block; }
/* 主圖卡:多圖時 flexslider 包在 .flex-viewport,單圖時用 __wrapper */
.woocommerce-product-gallery .flex-viewport,
.woocommerce-product-gallery--columns-1 .woocommerce-product-gallery__wrapper {
  border-radius: var(--r-xl); box-shadow: var(--shadow-sm); overflow: hidden; background: #fff;
}
/* 放大鏡觸發鈕(SVG 背景,置中對齊) */
.woocommerce-product-gallery__trigger {
  position: absolute; top: 18px; right: 18px; z-index: 9; width: 44px; height: 44px;
  border-radius: 50%; font-size: 0; box-shadow: var(--shadow-sm); transition: all .2s;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232b2b2b' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 20px 20px;
}
.woocommerce-product-gallery__trigger:hover {
  background-color: var(--yellow); transform: scale(1.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E");
}
/* 縮圖列(4 格方塊) */
.flex-control-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0 0; list-style: none; padding: 0; }
.flex-control-thumbs li { width: auto; margin: 0; }
.flex-control-thumbs img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--r); cursor: pointer; opacity: 1; border: 2px solid transparent; box-shadow: var(--shadow-sm); transition: border-color .2s; }
.flex-control-thumbs img:hover { border-color: var(--yellow-soft); }
.flex-control-thumbs img.flex-active { border-color: var(--yellow); }

/* ===== 燈箱(PhotoSwipe)品牌化 ===== */
.pswp__bg { background: #1b1713; }
.pswp__caption__center { text-align: center; font-size: 14px; color: #fff; }
.pswp__counter { font-weight: 600; font-size: 14px; opacity: .85; }
.pswp__button { transition: opacity .2s; }
.pswp__button:hover, .pswp__button--arrow--left:hover:before, .pswp__button--arrow--right:hover:before { opacity: 1; }
/* 上方工具列加一點底色提升可讀性 */
.pswp__top-bar { background: linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0)); }
/* 載入轉圈用品牌黃 */
.pswp__preloader__cut { background: var(--yellow); }

/* 分頁標籤(商品 tabs) */
.woocommerce-tabs ul.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: 0 0 26px; padding: 0; list-style: none; }
.woocommerce-tabs ul.tabs::before { display: none; }
.woocommerce-tabs ul.tabs li { background: none; border: none; border-radius: 0; padding: 0; margin: 0; }
.woocommerce-tabs ul.tabs li a { padding: 14px 24px; font-size: 15px; font-weight: 600; color: var(--muted); display: block; }
.woocommerce-tabs ul.tabs li.active a { color: var(--ink); box-shadow: inset 0 -3px 0 var(--yellow); }
.woocommerce-tabs .panel { color: var(--ink-soft); line-height: 1.9; max-width: none; }
.woocommerce-tabs .panel h2 { color: var(--ink); font-size: 18px; }

/* 規格說明:屬性表(參考 prototype 規格表,滿版) */
.shop_attributes, table.woocommerce-product-attributes { width: 100%; border-collapse: collapse; margin: 0; }
.shop_attributes tr, .shop_attributes th, .shop_attributes td { border: none !important; background: none; }
.shop_attributes th, .shop_attributes td { text-align: left; padding: 15px 20px; border-bottom: 1px solid var(--line) !important; font-size: 14px; vertical-align: middle; }
.shop_attributes th { background: var(--cream-2) !important; color: var(--ink); font-weight: 600; width: 200px; white-space: nowrap; }
.shop_attributes td { color: var(--ink-soft); }
.shop_attributes td p { margin: 0; }

/* WC 星型字型(主題移除了 WC 樣式,這裡補回讓 .star-rating 顯示星星) */
@font-face {
  font-family: star; font-weight: 400; font-display: block;
  src: url(../../../../plugins/woocommerce/assets/fonts/star.woff) format("woff");
}
.star-rating { overflow: hidden; position: relative; height: 1.4em; line-height: 1.4; width: 5.4em; font-family: star; font-weight: 400; font-size: 15px; }
.star-rating::before { content: "\73\73\73\73\73"; color: var(--line); float: left; top: 0; left: 0; position: absolute; }
.star-rating span { overflow: hidden; float: left; top: 0; left: 0; position: absolute; padding-top: 1.5em; }
.star-rating span::before { content: "\53\53\53\53\53"; top: 0; position: absolute; left: 0; color: var(--yellow); }

/* 評價列表 */
#reviews .commentlist { list-style: none; margin: 0; padding: 0; }
#reviews .commentlist li.review, #reviews .commentlist li.comment { padding: 20px 0; border-bottom: 1px solid var(--line); }
#reviews .commentlist .comment_container { display: flex; gap: 16px; align-items: flex-start; }
#reviews .commentlist img.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--cream-2); margin: 0; float: none; border: none; padding: 0; }
#reviews .comment-text { width: 100%; }
#reviews .woocommerce-review__author { font-weight: 600; font-size: 14px; color: var(--ink); }
#reviews .woocommerce-review__published-date { color: var(--muted); font-size: 12px; margin-left: 6px; }
#reviews .star-rating { margin: 6px 0 8px; }
#reviews .description p { font-size: 14px; color: var(--ink-soft); margin: 0; }
#reviews .comment-form-rating label { font-weight: 600; }
#reviews #respond { background: var(--cream-2); border-radius: var(--r-lg); padding: 18px 22px; margin-top: 8px; }
.woocommerce-Reviews-title { display: none; }

/* 通知訊息 */
.woocommerce-message, .woocommerce-info, .woocommerce-error, .woocommerce-noreviews {
  border: none; border-radius: var(--r); padding: 16px 20px 16px 22px; box-shadow: var(--shadow-sm);
  background: var(--cream-2); color: var(--ink); border-left: 4px solid var(--yellow);
}
.woocommerce-message { border-left-color: var(--green); background: #EEF5E6; }
.woocommerce-error { border-left-color: var(--rose); background: #FCEEEB; list-style: none; }

/* 麵包屑(Woo 自帶 — 我們用 Rank Math,故隱藏 Woo 的) */
.woocommerce-breadcrumb { display: none; }

/* 購物車 / 結帳 表格 */
.woocommerce table.shop_table { border: none; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); background: #fff; border-collapse: collapse; }
.woocommerce table.shop_table th { background: var(--cream-2); color: var(--ink); padding: 16px; font-weight: 700; }
.woocommerce table.shop_table td { padding: 16px; border-top: 1px solid var(--line); }
.woocommerce .cart_item img { border-radius: 10px; }
.woocommerce .cart-collaterals .cart_totals {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 8px 20px;
}
.woocommerce-checkout #order_review { background: none; border-radius: 0; box-shadow: none; padding: 0; }
.woocommerce-checkout #payment { background: none; border-radius: 0; }
.woocommerce-checkout #payment ul.payment_methods { padding: 0; }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea,
.woocommerce-checkout .input-text, .select2-container .select2-selection {
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; outline: none;
}
.woocommerce form .form-row input.input-text:focus { border-color: var(--yellow); }

/* =====================================================
   我的帳號 — Layout
   ===================================================== */
.acc-layout { display: grid; grid-template-columns: 260px 1fr; gap: 30px; align-items: start; margin-top: 26px; }

/* 側欄 */
.acc-side { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 26px 18px; position: sticky; top: 150px; }
.acc-user { text-align: center; padding: 8px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.acc-user .av { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #FCEFC9, #F4B731); display: grid; place-items: center; margin: 0 auto 12px; font-size: 28px; }
.acc-user b { font-size: 17px; display: block; margin-bottom: 8px; }
.member-badge { display: inline-block; background: linear-gradient(90deg, #F4B731, #E2A41E); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill); letter-spacing: .03em; }
.acc-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; text-decoration: none; transition: all .18s; }
.acc-nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.acc-nav a:hover { background: var(--cream-2); color: var(--ink); }
.acc-nav a.on { background: var(--yellow-soft); color: var(--yellow-dark); }
.acc-nav .sep { height: 1px; background: var(--line); margin: 10px 6px; }

/* 主內容 */
.acc-main > h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.acc-main .desc { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* 覆蓋 WC 預設 account navigation */
.woocommerce-account .woocommerce-MyAccount-navigation { display: contents; }
.woocommerce-account .woocommerce-MyAccount-navigation ul { all: unset; display: contents; }
.woocommerce-account .woocommerce-MyAccount-navigation ul li { all: unset; display: contents; }
.woocommerce-account .woocommerce-MyAccount-content { all: unset; display: block; }

/* ─── 統計卡片 ─── */
.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.acc-stat-card { background: #fff; border-radius: var(--r-lg); padding: 16px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); }
.acc-stat-card .icon { width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; flex-shrink: 0; }
.acc-stat-card .icon svg { width: 22px; height: 22px; }
.acc-stat-card strong { font-size: 22px; font-weight: 800; display: block; line-height: 1.1; color: var(--ink); }
.acc-stat-card span { font-size: 12px; color: var(--muted); margin-top: 2px; display: block; }

/* ─── 訂單篩選 tabs ─── */
.order-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.order-tabs .tab-btn { padding: 8px 18px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none; transition: all .18s; cursor: pointer; }
.order-tabs .tab-btn:hover { border-color: var(--yellow); color: var(--yellow-dark); }
.order-tabs .tab-btn.on { background: var(--yellow); border-color: var(--yellow); color: #fff; }

/* ─── 訂單卡 ─── */
.order { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 22px 24px; margin-bottom: 16px; }
.order-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.order-top .no { font-size: 13px; color: var(--muted); }
.order-top .no b { color: var(--ink); font-weight: 600; }
.order-top .date { font-size: 12px; color: var(--muted); margin-top: 3px; }
.badge-st { font-size: 12px; font-weight: 700; padding: 5px 13px; border-radius: var(--r-pill); }
.badge-st.ship   { background: var(--yellow-soft); color: var(--yellow-dark); }
.badge-st.proc   { background: var(--yellow-soft); color: var(--yellow-dark); }
.badge-st.done   { background: #E8EFDD; color: var(--green); }
.badge-st.wait   { background: #FCE6E1; color: var(--rose); }
.badge-st.cancel { background: var(--cream-2); color: var(--muted); }
.order-body { display: flex; gap: 14px; align-items: center; }
.order-thumbs { display: flex; gap: 10px; }
.order-thumbs .t { width: 60px; height: 60px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.order-thumbs .t img { width: 60px; height: 60px; object-fit: cover; display: block; border-radius: 12px; }
.order-meta { margin-left: auto; text-align: right; }
.order-meta .cnt { font-size: 13px; color: var(--muted); }
.order-meta .amt { font-size: 18px; font-weight: 800; margin-top: 2px; }
.order-meta .amt .woocommerce-Price-amount { font-size: inherit; font-weight: inherit; }
.order-acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ─── 個人資料表單 ─── */
.pf-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 30px 32px; margin-bottom: 22px; }
.pf-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 20px; display: flex; align-items: center; gap: 9px; }
.pf-card h3 .d { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); flex-shrink: 0; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pf-grid .grid-full,
.pf-grid > .form-row-wide { grid-column: 1 / -1; }
.pf-grid .field label,
.pf-grid .form-row label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: block; margin-bottom: 6px; }
.pf-grid .field input,
.pf-grid .field select,
.pf-grid .form-row input.input-text,
.pf-grid .form-row select { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 14px; font-size: 14px; outline: none; transition: border-color .2s; box-sizing: border-box; }
.pf-grid .field input:focus,
.pf-grid .field select:focus,
.pf-grid .form-row input.input-text:focus { border-color: var(--yellow); }
.email-readonly { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 14px; font-size: 14px; background: var(--bg); color: var(--ink-soft); box-sizing: border-box; }

/* WC 顯示密碼按鈕（隱藏預設粉紅框） */
.show-password-input { display: none !important; }

/* WC 密碼強度計樣式 */
.woocommerce-account .woocommerce-password-strength {
  margin-top: 8px; padding: 6px 12px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; border: none !important;
  display: flex; align-items: center; gap: 6px;
}
.woocommerce-account .woocommerce-password-strength::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.woocommerce-account .woocommerce-password-strength.short,
.woocommerce-account .woocommerce-password-strength.bad    { background: #fdecea; color: #D94F3D; }
.woocommerce-account .woocommerce-password-strength.short::before,
.woocommerce-account .woocommerce-password-strength.bad::before { background: #D94F3D; }
.woocommerce-account .woocommerce-password-strength.good   { background: #fff8e1; color: var(--yellow-dark); }
.woocommerce-account .woocommerce-password-strength.good::before { background: var(--yellow); }
.woocommerce-account .woocommerce-password-strength.strong { background: #e8f5ee; color: var(--green); }
.woocommerce-account .woocommerce-password-strength.strong::before { background: var(--green); }
.woocommerce-account .woocommerce-password-hint {
  font-size: 12px; color: var(--muted); margin-top: 6px; display: block;
}

/* ─── 訂單明細 ─── */
.ord-box { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 26px 28px; margin-bottom: 20px; }
.ord-box h3 { font-size: 16px; font-weight: 800; margin-bottom: 18px; display: flex; align-items: center; gap: 9px; }
.ord-box h3 .d { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); flex-shrink: 0; }
.ord-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.ord-top .no { font-size: 13px; color: var(--muted); }
.ord-top .no b { color: var(--ink); font-weight: 700; font-size: 15px; }

/* 進度步驟 */
.od-steps { display: flex; align-items: center; justify-content: space-between; max-width: 480px; }
.od-step { text-align: center; flex: 1; position: relative; }
.od-step .c { width: 34px; height: 34px; border-radius: 50%; background: var(--cream-2); color: var(--muted); display: grid; place-items: center; margin: 0 auto 8px; font-weight: 700; font-size: 14px; position: relative; z-index: 1; }
.od-step.done .c { background: var(--green); color: #fff; }
.od-step.active .c { background: var(--yellow); color: #fff; }
.od-step small { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.od-step::after { content: ""; position: absolute; top: 17px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.od-step:last-child::after { display: none; }
.od-step.done::after { background: var(--green); }

/* 商品列 */
.od-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.od-item:last-child { border-bottom: none; }
.od-item .thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.od-item .nm { font-weight: 600; font-size: 14.5px; }
.od-item .vr { color: var(--muted); font-size: 13px; margin-top: 3px; }
.od-item .qty-x { color: var(--muted); font-size: 13px; margin-left: auto; padding-right: 18px; white-space: nowrap; }
.od-item .pr { font-weight: 700; white-space: nowrap; }

/* 2-col 佈局（收件資訊 + 金額） */
.od-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.od-info .r { display: flex; padding: 7px 0; font-size: 14px; }
.od-info .r .k { color: var(--muted); width: 84px; flex-shrink: 0; }
.od-info .r .v { color: var(--ink); }

/* ─── 地址列表 ─── */
/* ─── 優惠券頁 ─── */
.coupon-page-head { margin-bottom: 22px; }
.coupon-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.coupon-card {
  display: flex; align-items: stretch; background: #fff;
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  overflow: hidden; border: 1.5px solid var(--line);
}
.coupon-left {
  min-width: 110px; background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 16px; gap: 2px; position: relative;
}
.coupon-left::after {
  content: ''; position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; background: var(--bg); border-radius: 50%; z-index: 1;
}
.coupon-amount { display: flex; align-items: baseline; gap: 2px; color: #fff; }
.coupon-amount .num { font-size: 32px; font-weight: 900; line-height: 1; }
.coupon-amount .unit { font-size: 16px; font-weight: 700; }
.coupon-type { font-size: 12px; color: rgba(255,255,255,.85); font-weight: 600; }
.coupon-mid { flex: 1; padding: 18px 24px 18px 28px; border-left: 1.5px dashed var(--line); }
.coupon-code-label { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.coupon-code { font-size: 20px; font-weight: 900; letter-spacing: .12em; color: var(--ink); margin-bottom: 8px; }
.coupon-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.coupon-meta span { font-size: 12px; color: var(--muted); }
.coupon-right { display: flex; align-items: center; padding: 0 20px; }
.btn-copy-coupon {
  background: var(--yellow-soft); color: var(--yellow-dark); border: none;
  padding: 9px 18px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .18s; white-space: nowrap;
}
.btn-copy-coupon:hover, .btn-copy-coupon.copied { background: var(--yellow); color: #fff; }
.coupon-empty { text-align: center; padding: 60px 20px; }
.coupon-empty .ic { font-size: 48px; margin-bottom: 16px; }
.coupon-empty h3 { font-size: 18px; margin-bottom: 8px; }
.coupon-empty p { color: var(--muted); margin-bottom: 24px; }

.addr-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.addr-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 24px; border: 1.5px solid transparent; }
.addr-card.default { border-color: var(--yellow); }
.addr-card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.addr-card .nm { font-weight: 700; font-size: 15px; }
.addr-card .df { font-size: 11px; font-weight: 700; color: var(--yellow-dark); background: var(--yellow-soft); padding: 3px 10px; border-radius: var(--r-pill); }
.addr-card .row { color: var(--ink-soft); font-size: 14px; line-height: 1.9; }
.addr-card .acts { display: flex; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.addr-card .acts a { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.addr-card .acts a:hover { color: var(--yellow-dark); }

/* ─── 響應式 ─── */
@media (max-width: 920px) {
  .acc-layout { grid-template-columns: 1fr; }
  .acc-side { position: static; }
  .acc-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .acc-nav .sep { display: none; }
  .od-2col { grid-template-columns: 1fr; }
  .addr-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .acc-nav { grid-template-columns: 1fr; }
  .order-body { flex-wrap: wrap; }
  .order-meta { margin-left: 0; text-align: left; }
  .pf-grid { grid-template-columns: 1fr; }
}

/* 商店列表:沿用 .prod-grid 不需 Woo 的 ul.products */
.woocommerce ul.products { display: none; }

/* ============================================================
   評價表單:評分星選擇器(p.stars 互動)+ 表單樣式
   ============================================================ */
#review_form .comment-form-rating { margin: 4px 0 18px; }
#review_form .comment-form-rating > label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
#review_form .comment-form-rating select { display: none; } /* 隱藏無 JS fallback 下拉 */
p.stars { display: inline-flex; margin: 0; line-height: 1; }
p.stars a {
  position: relative; width: 1.5em; height: 1.5em; font-size: 22px;
  text-indent: -999em; display: inline-block; text-decoration: none; box-shadow: none;
}
p.stars a::before {
  display: block; position: absolute; top: 0; left: 0; width: 1.5em; height: 1.5em;
  line-height: 1.5; font-family: "star"; content: "\73"; color: var(--line);
  text-indent: 0; text-align: center;
}
p.stars:hover a::before { content: "\53"; color: var(--yellow); }
p.stars a:hover ~ a::before { content: "\73"; color: var(--line); }
p.stars.selected a.active::before { content: "\53"; color: var(--yellow); }
p.stars.selected a.active ~ a::before { content: "\73"; color: var(--line); }
p.stars.selected a:not(.active)::before { content: "\53"; color: var(--yellow); }

#reviews #respond { background: var(--cream-2); border-radius: var(--r-lg); padding: 24px; margin-top: 0; }
/* 留言表單上方:與評價清單分隔的間距 + 分隔線 */
#reviews #review_form_wrapper { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 36px; }
#reviews .comment-reply-title { font-size: 16px; font-weight: 700; color: var(--ink); display: block; margin-bottom: 14px; }
#review_form .comment-form-comment label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
#review_form textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r); background: #fff;
  padding: 14px 16px; font-size: 15px; line-height: 1.7; outline: none; min-height: 130px; resize: vertical;
  font-family: inherit;
}
#review_form textarea:focus { border-color: var(--yellow); }
#review_form .form-submit { margin: 16px 0 0; }
#review_form .comment-form-author, #review_form .comment-form-email { margin-bottom: 14px; }

/* ============================================================
   手機版:固定底部購買列
   ============================================================ */
.m-buybar { display: none; }
@media (max-width: 640px) {
  .m-buybar {
    display: flex; align-items: center; gap: 8px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: #fff; border-top: 1px solid var(--line);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(0,0,0,.07);
  }
  .m-buybar .m-qty {
    display: inline-flex; align-items: center; flex-shrink: 0; height: 46px;
    border: 1.5px solid var(--line); border-radius: var(--r-pill); background: #fff;
  }
  .m-buybar .m-qty .qty-btn {
    width: 30px; height: 100%; padding: 0; border: 0; background: transparent;
    font-size: 18px; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center;
  }
  .m-buybar .m-qty-val { min-width: 22px; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink); }
  .m-buybar .m-cart, .m-buybar .m-buy {
    flex: 1; height: 46px; border-radius: var(--r-pill); font-weight: 700; font-size: 14px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .m-buybar .m-cart { border: 0; background: var(--yellow); color: #fff; box-shadow: 0 4px 12px rgba(244,183,49,.35); }
  .m-buybar .m-buy { border: 1.5px solid var(--yellow); background: #fff; color: var(--yellow-dark); }
  /* 內容底部留白,避免被購買列蓋住 */
  body.single-product .wrap { padding-bottom: 86px; }
}

/* 隱藏 WooCommerce 預設隱私權說明 */
.woocommerce-privacy-policy-text { display: none; }

/* ===== 購物車頁 ===== */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 30px; align-items: start; margin-top: 26px; }

.cart-list { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 8px 26px; }
.cart-head { display: grid; grid-template-columns: 1fr 120px 130px 100px 40px; gap: 12px; padding: 16px 0; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.cart-head span:nth-child(2),.cart-head span:nth-child(3),.cart-head span:nth-child(4) { text-align: center; }

.cart-item { display: grid; grid-template-columns: 1fr 120px 130px 100px 40px; gap: 12px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: none; }
.ci-prod { display: flex; gap: 16px; align-items: center; }
.ci-prod .thumb { width: 84px; height: 84px; border-radius: var(--r); overflow: hidden; flex-shrink: 0; background: var(--cream-2); }
.ci-prod .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-prod .name { font-weight: 600; font-size: 15px; line-height: 1.4; }
.ci-prod .name a { color: var(--ink); }
.ci-prod .name a:hover { color: var(--yellow-dark); }
.ci-prod .var { color: var(--muted); font-size: 13px; margin-top: 5px; }
.ci-price { text-align: center; font-weight: 600; font-size: 14px; }
.ci-qty { display: flex; justify-content: center; }
.ci-sub { text-align: center; font-weight: 800; color: var(--ink); }
.ci-del-wrap { display: flex; justify-content: center; }
.ci-del { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: all .2s; }
.ci-del:hover { background: #FCE6E1; color: var(--rose); }

.cart-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.cart-foot a { color: var(--ink-soft); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: color .2s; }
.cart-foot a:hover { color: var(--yellow-dark); }

/* 加購優惠：繼續購物下方，卡片式四欄 */
.hm-upsell-wrap {
  margin-top: 28px !important; margin-bottom: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
  padding: 20px !important;
}
.hm-upsell-title { grid-column: 1 / -1 !important; margin-bottom: 4px !important; }
.hm-upsell-item {
  display: flex !important; flex-direction: column !important; align-items: stretch !important;
  gap: 8px !important; padding: 12px !important;
  border-bottom: none !important; border: none !important;
  background: #fff !important; border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.06) !important;
}
.hm-upsell-img { text-align: center !important; }
.hm-upsell-img img { width: 100% !important; height: 110px !important; border-radius: 7px !important; object-fit: cover !important; }
.hm-upsell-info { flex: 1 !important; }
.hm-upsell-btn {
  display: block !important; width: 100% !important; text-align: center !important;
  margin-top: auto !important; padding: 10px 0 !important;
}
@media (max-width: 768px) {
  .hm-upsell-wrap { grid-template-columns: repeat(2, 1fr) !important; padding: 14px !important; gap: 10px !important; }
}

/* 訂單摘要 */
.summary { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 26px; position: sticky; top: 140px; }
.summary h3 { font-size: 18px; font-weight: 800; margin-bottom: 18px; }
.sum-rows { margin-bottom: 4px; }
.sum-row { display: flex; justify-content: space-between; padding: 9px 0; color: var(--ink-soft); font-size: 14px; }
.sum-row.disc { color: var(--green); }
.free-ship { color: var(--green); font-weight: 600; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 16px; }
.sum-total b { font-size: 16px; }
.sum-total .amt { font-size: 26px; font-weight: 900; color: var(--ink); }
.sum-total .amt .woocommerce-Price-amount { font-size: inherit; font-weight: inherit; }
.sum-note { color: var(--muted); font-size: 12px; margin: 12px 0 18px; text-align: center; line-height: 1.6; }
/* 覆蓋 hello-elementor 桃紅色 hover/active/focus */
.woocommerce-cart-form .btn-outline:hover,
.woocommerce-cart-form .btn-outline:focus,
.woocommerce-cart-form .btn-outline:active,
.promo-in .btn-outline:hover,
.promo-in .btn-outline:focus,
.promo-in .btn-outline:active { background: #fff !important; color: var(--yellow-dark) !important; border-color: var(--yellow) !important; outline: none !important; box-shadow: none !important; }
/* 前往結帳按鈕滿版 */
.summary .checkout-btn { margin-top: 24px !important; }
.summary .checkout-btn,
.summary .wc-proceed-to-checkout a.checkout-button { display: block !important; width: 100% !important; box-sizing: border-box !important; text-align: center !important; }
.summary .checkout-btn:hover,
.summary .checkout-btn:focus,
.summary .checkout-btn:active { color: #fff !important; }

.pay-icons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.pay-icons span { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
/* 前往結帳按鈕撐滿 */
.summary .wc-proceed-to-checkout { padding: 0; }
.summary .wc-proceed-to-checkout a.checkout-button,
.summary .wc-proceed-to-checkout .btn { display: block; width: 100%; text-align: center; box-sizing: border-box; }

/* 優惠碼輸入 */
.promo-in { display: flex; gap: 8px; margin-bottom: 20px; }
.promo-in input { flex: 1; border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 11px 16px; outline: none; font-size: 14px; transition: border-color .2s; }
.promo-in input:focus { border-color: var(--yellow); }

/* 購物車數量 */
.cart-item .qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-pill); overflow: hidden; height: 36px; }
.cart-item .qty-btn { width: 34px; height: 36px; font-size: 17px; line-height: 1; color: var(--ink-soft); background: none; border: none; cursor: pointer; appearance: none; -webkit-appearance: none; outline: none; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.cart-item .qty-btn:hover { background: var(--cream-2); color: var(--ink); border: none !important; }
.cart-item .qty-val { width: 52px; height: 36px; text-align: center; border: none; border-left: 1.5px solid var(--line); border-right: 1.5px solid var(--line); font-weight: 700; font-size: 14px; -moz-appearance: textfield; outline: none; background: #fff; }
.cart-item .qty-val::-webkit-inner-spin-button,
.cart-item .qty-val::-webkit-outer-spin-button { -webkit-appearance: none; }
.cart-item .qty--solo { border: none; }
.cart-item .qty--solo span { padding: 0 12px; font-weight: 700; font-size: 14px; }

/* =====================================================
   結帳頁 Checkout
   ===================================================== */

/* 標題隱藏 */
.woocommerce-checkout .entry-title { display: none; }

/* 步驟列 */
.co-steps { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 28px 0 6px; }
.co-step { display: flex; align-items: center; gap: 10px; text-decoration: none; }
a.co-step:hover .co-step-t { color: var(--yellow-dark); }
.co-step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--cream-2); color: var(--muted); flex-shrink: 0; }
.co-step-t { font-size: 14px; color: var(--muted); font-weight: 600; }
.co-step.done .co-step-n { background: var(--green); color: #fff; }
.co-step.done .co-step-t, .co-step.active .co-step-t { color: var(--ink); }
.co-step.active .co-step-n { background: var(--yellow); color: #fff; }
.co-step-bar { width: 46px; height: 2px; background: var(--line); }

/* 兩欄 grid */
.co-layout { display: grid !important; grid-template-columns: 1fr 380px; gap: 30px; align-items: start; margin-top: 24px; }
.co-left { display: flex; flex-direction: column; gap: 22px; }

/* 卡片 */
.co-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 28px; }
.co-card-h { font-size: 17px; font-weight: 800; margin-bottom: 22px; display: flex; align-items: center; gap: 9px; }
.co-n { width: 26px; height: 26px; border-radius: 50%; background: var(--yellow-soft); color: var(--yellow-dark); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }

/* WC 欄位重置 */
.co-fields .woocommerce-billing-fields > h3,
.co-fields .woocommerce-shipping-fields > h3,
.co-fields .woocommerce-additional-fields { display: contents; }
.co-fields .woocommerce-additional-fields > h3 { display: none; }
.co-fields .woocommerce-additional-fields__field-wrapper { display: contents; }
.co-fields .woocommerce-billing-fields__field-wrapper,
.co-fields .woocommerce-shipping-fields__field-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.co-fields p.form-row { float: none !important; width: auto !important; padding: 0 !important; margin: 0 !important; }
.co-fields .form-row-wide,
.co-fields #billing_address_1_field,
.co-fields #billing_address_2_field,
.co-fields #billing_postcode_field,
.co-fields #billing_country_field,
.co-fields #billing_email_field,
.co-fields #shipping_address_1_field,
.co-fields #shipping_address_2_field,
.co-fields #shipping_city_field,
.co-fields #shipping_state_field,
.co-fields #shipping_postcode_field,
.co-fields #shipping_country_field { grid-column: 1 / -1; }
/* 欄位視覺排序（宅配：電子郵件→姓名→電話→縣市→鄉鎮市→郵遞區號→地址；其餘欄位排後） */
.co-fields .woocommerce-billing-fields__field-wrapper > p { order: 20; }
.co-fields #billing_email_field      { order: 1; }
.co-fields #billing_first_name_field { order: 2; }
.co-fields #billing_last_name_field  { order: 3; }
.co-fields #billing_phone_field      { order: 4; }
.co-fields #billing_state_field      { order: 5; }
.co-fields #billing_city_field       { order: 6; }
.co-fields #billing_postcode_field   { order: 7; }
.co-fields #billing_address_1_field  { order: 8; }
.co-fields #billing_address_2_field  { order: 9; }
.co-fields #billing_country_field    { order: 10; }
.co-fields .hoohao-hidden { display: none !important; }
.co-fields .form-row label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; color: var(--ink-soft); }
.co-fields .form-row label .required { color: var(--rose); }
.co-fields .form-row label .optional { color: var(--muted); font-weight: 400; }
/* 電話強制顯示為必填（PHP hook 被 ECPay session 覆蓋，改用 CSS 處理視覺） */
.co-fields #billing_phone_field label .optional { display: none; }
.co-fields #billing_phone_field label::after { content: '\00a0\002A'; color: var(--rose); }
.co-fields input.input-text,
.co-fields select,
.co-fields textarea { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r); padding: 11px 14px; font-size: 14px; outline: none; transition: border-color .2s; box-sizing: border-box; }
.co-fields select,
.woocommerce-checkout .co-fields select { -webkit-appearance: none !important; appearance: none !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 19px center !important; padding-right: 44px !important; }
.co-fields input.input-text:focus,
.co-fields select:focus,
.co-fields textarea:focus { border-color: var(--yellow); }
.co-fields .woocommerce-invalid input.input-text { border-color: var(--rose); }
.co-fields .woocommerce-additional-fields textarea { min-height: 80px; resize: vertical; }
.co-fields .woocommerce-shipping-fields__field-wrapper { margin-top: 4px; }

/* 配送方式 */
.co-ship-options { display: grid; gap: 12px; }
.co-choice { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px; cursor: pointer; transition: border-color .2s; }
.co-choice:hover { border-color: var(--yellow); }
.co-choice.on { border-color: var(--yellow); background: var(--yellow-soft); }
.co-choice input[type=radio] { display: none; }
.co-choice-info { flex: 1; }
.co-choice-info b { font-size: 14px; display: block; }
.co-choice-info span { font-size: 12px; color: var(--muted); }
.co-choice-fee { margin-left: auto; font-weight: 700; font-size: 14px; }
/* JS toggle on/off */
.co-ship-options input[type=radio]:checked ~ * { color: var(--ink); }

/* 付款方式 */
#order_review .shop_table,
#order_review thead,
#order_review tbody,
#order_review .cart_item,
#order_review .cart-subtotal,
#order_review .order-total { display: none !important; }
#payment { background: none !important; border-radius: 0; padding: 0 !important; }
#payment ul.payment_methods { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
#payment ul.payment_methods li.wc_payment_method { border: 1.5px solid var(--line) !important; border-radius: var(--r) !important; padding: 0 !important; transition: border-color .2s; cursor: pointer; background: transparent !important; margin: 0 !important; list-style: none !important; box-shadow: none !important; }
#payment ul.payment_methods li.wc_payment_method:hover { border-color: var(--yellow) !important; }
#payment ul.payment_methods li.wc_payment_method:has(input[type=radio]:checked) { border-color: var(--yellow) !important; background: var(--yellow-soft) !important; }
#payment ul.payment_methods li.wc_payment_method > label { display: flex !important; align-items: center; gap: 12px; font-size: 14px !important; font-weight: 700 !important; cursor: pointer; width: 100%; padding: 16px 18px; box-sizing: border-box; }
#payment ul.payment_methods li.wc_payment_method > label img { display: none !important; }
#payment ul.payment_methods li.wc_payment_method input[type=radio] { display: none !important; }
#payment .payment_box { display: none !important; }
#payment .place-order { display: none; }

/* 右欄（sidebar 模式時 sticky） */
.co-summary { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 26px; position: sticky; top: 30px; }
.co-summary > h3 { font-size: 17px; font-weight: 800; margin-bottom: 18px; }
.co-items { display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 14px; }
.co-it { display: flex; gap: 12px; align-items: center; }
.co-it-thumb { width: 56px; height: 56px; flex-shrink: 0; position: relative; }
.co-it-thumb img { width: 56px; height: 56px; object-fit: cover; display: block; border-radius: 10px; }
.co-it-qty { position: absolute; top: -6px; right: -6px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.co-it-info { flex: 1; min-width: 0; }
.co-it-name { font-size: 13px; font-weight: 600; line-height: 1.4; }
.co-it-var { font-size: 12px; color: var(--muted); margin-top: 2px; }
.co-it-price { font-size: 13px; font-weight: 700; white-space: nowrap; margin-left: auto; }
.co-sum-rows { margin-bottom: 4px; }
.co-confirm { display: block; width: 100%; text-align: center; margin-top: 20px; }
.co-confirm:hover, .co-confirm:focus, .co-confirm:active { color: #fff !important; }
.co-agree { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; line-height: 1.7; }
.co-agree a { color: var(--yellow-dark); }

/* 響應式 */
@media (max-width: 960px) {
  .co-layout { grid-template-columns: 1fr; }
  .co-summary { position: static; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 640px) {
  .co-fields .woocommerce-billing-fields__field-wrapper,
  .co-fields .woocommerce-shipping-fields__field-wrapper { grid-template-columns: 1fr; }
  .co-step-t { display: none; }
  .co-step-bar { width: 24px; }
}
@media (max-width: 640px) {
  .cart-list { padding: 8px 16px; }
  .cart-head { display: none; }
  .cart-item { grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; gap: 10px; position: relative; }
  .ci-prod { grid-column: 1 / -1; }
  .ci-price::before { content: "單價 "; color: var(--muted); font-weight: 400; }
  .ci-sub::before { content: "小計 "; color: var(--muted); font-weight: 400; }
  .ci-del-wrap { position: absolute; top: 22px; right: 0; }
}

/* 購物車／帳號頁標題隱藏 */
body.woocommerce-cart .entry-title,
body.woocommerce-cart .site-main h1,
body.woocommerce-account .page-head h1,
body.woocommerce-account .entry-title { display: none !important; }

/* ===== 免運進度提醒 ===== */
.hs-free-ship { background: var(--cream-2); border-radius: var(--r); padding: 14px 18px; margin-top: 24px; margin-bottom: 20px; font-size: 14px; }
.hs-free-ship--done { display: flex; align-items: center; gap: 8px; color: var(--green, #3d9e6e); font-weight: 600; }
.hs-free-ship--done svg { flex-shrink: 0; stroke: var(--green, #3d9e6e); }
.hs-free-ship__text { margin-bottom: 10px; color: var(--ink-soft); }
.hs-free-ship__text b { color: var(--ink); }
.hs-free-ship__bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.hs-free-ship__fill { height: 100%; background: var(--yellow); border-radius: 99px; transition: width .4s ease; }

/* ===== 結帳頁專用 ===== */
/* Header：隱藏主選單、搜尋、帳號；logo 置中 */
body.woocommerce-checkout .mainnav { display: none !important; }
body.woocommerce-checkout .topbar .search,
body.woocommerce-checkout .topbar .top-acts { display: none !important; }
body.woocommerce-checkout .topbar { justify-content: center; }
body.woocommerce-checkout .crumbs { display: none !important; }

/* 單欄 layout，置中 */
body.woocommerce-checkout .co-layout { grid-template-columns: 1fr !important; max-width: 760px; margin-left: auto; margin-right: auto; }
body.woocommerce-checkout .co-summary { position: static; }

/* 訂單備註上方留白 */
.co-fields #order_comments_field { margin-top: 10px !important; }

/* =====================================================
   感謝頁 (order-received)
   ===================================================== */
body.woocommerce-order-received .mainnav { display: none !important; }
body.woocommerce-order-received .topbar .search,
body.woocommerce-order-received .topbar .top-acts { display: none !important; }
body.woocommerce-order-received .topbar { justify-content: center; }
body.woocommerce-order-received .crumbs { display: none !important; }
body.woocommerce-order-received .site-main { max-width: 660px; margin-left: auto; margin-right: auto; }

/* 步驟列（全完成綠色） */
.co-step-bar--done { background: var(--green, #3d9e6e) !important; }
.co-steps--done .co-step .co-step-n { background: var(--green, #3d9e6e); color: #fff; }
.co-steps--done .co-step .co-step-t { color: var(--ink); }

/* 感謝卡 */
.ty-wrap { margin: 0 auto; }
.ty-card { background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 44px 40px; text-align: center; }

/* 打勾圖示 */
.ty-check { width: 92px; height: 92px; border-radius: 50%; background: #E8EFDD; display: grid; place-items: center; margin: 0 auto 22px; position: relative; }
.ty-check svg { width: 46px; height: 46px; color: var(--green, #3d9e6e); }
.ty-ring { position: absolute; inset: -8px; border: 2px dashed #BBD49E; border-radius: 50%; opacity: .6; }

.ty-card h1 { font-size: 26px; font-weight: 900; margin: 0 0 8px; }
.ty-lead { color: var(--ink-soft); margin: 4px 0; font-size: 15px; }

/* 訂單資訊區塊 */
.ty-info { background: var(--cream-2); border-radius: var(--r-lg); padding: 20px 24px; margin: 24px 0; text-align: left; }
.ty-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 14px; }
.ty-k { color: var(--ink-soft); }
.ty-v { font-weight: 700; }
.ty-amt { color: var(--ink); font-size: 18px; font-weight: 900; }
.ty-div { height: 1px; background: var(--line); margin: 6px 0; }

/* 複製訂單號 */
.ty-copy { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.ty-copy-ic { color: var(--yellow-dark); flex-shrink: 0; }
.ty-copy--ok .ty-copy-ic { color: var(--green, #3d9e6e); }

/* 後續步驟 */
.ty-next { display: flex; flex-direction: column; gap: 14px; text-align: left; margin: 24px 0; }
.ty-step { display: flex; gap: 14px; align-items: center; }
.ty-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--yellow-soft); color: var(--yellow-dark) !important; display: grid; place-items: center; flex-shrink: 0; }
.ty-ic svg { color: var(--yellow-dark) !important; stroke: var(--yellow-dark) !important; }
.ty-step b { font-size: 14px; display: block; margin-bottom: 2px; }
.ty-step span { font-size: 13px; color: var(--muted); }

/* 按鈕 */
.ty-btns { display: flex; gap: 14px; margin-top: 28px; }
.ty-btns .btn { flex: 1; }

/* 客服文字 */
.ty-mail { color: var(--muted); font-size: 13px; margin-top: 20px; }
.ty-mail b { color: var(--ink-soft); }

@media (max-width: 640px) {
  .ty-card { padding: 32px 20px; }
  .ty-btns { flex-direction: column; }
  body.woocommerce-order-received .co-steps .co-step-t { display: none; }
  body.woocommerce-order-received .co-steps .co-step-bar { width: 28px; }
}
