/* ============================================
   Academy New WC Pages — Dark theme content area
   Used on A-site private cart/checkout pages.
   Header/footer comes from the site theme (puskar + Elementor).
   ============================================ */

/* ---- Content area (between theme header and footer) ---- */
.academy-new-content-area {
  background: linear-gradient(180deg, #2c343b 0%, #424d59 40%, #6b7785 100%);
  background-attachment: fixed;
  min-height: 60vh;
}
.academy-new-main {
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
}
.academy-new-title {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}
/* Remove old standalone footer/header rules */
.academy-new-footer {
  padding: 24px 40px;
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
}
.academy-new-footer a { color: #39fff5; }

/* ============================================
   WooCommerce Cart & Checkout — Academy Theme
   body.woocommerce-cart / body.woocommerce-checkout
   for high specificity without !important.
   ============================================ */

/* ---- Remove focus outline ---- */
body.woocommerce-cart *:focus,
body.woocommerce-cart *:focus-visible,
body.woocommerce-checkout *:focus,
body.woocommerce-checkout *:focus-visible {
  outline: none;
  box-shadow: none;
}

/* ---- Page Background (top darker → bottom lighter) ---- */
body.woocommerce-cart,
body.woocommerce-checkout {
  background: linear-gradient(180deg, #2c343b 0%, #424d59 40%, #6b7785 100%);
  background-attachment: fixed;
  font-family: 'Noto Sans TC', sans-serif;
  color: #fff;
  min-height: 100vh;
}

/* ---- Hide default header/footer ---- */
body.woocommerce-cart .site-header,
body.woocommerce-checkout .site-header,
body.woocommerce-cart .site-footer,
body.woocommerce-checkout .site-footer {
  display: none;
}

body.woocommerce-cart .page-content::after,
body.woocommerce-cart .entry-content::after,
body.woocommerce-cart .woocommerce::after,
body.woocommerce-cart .woocommerce::before,
body.woocommerce-checkout .page-content::after,
body.woocommerce-checkout .entry-content::after,
body.woocommerce-checkout .woocommerce::after,
body.woocommerce-checkout .woocommerce::before,
body.woocommerce-checkout .woocommerce form.checkout::after,
body.woocommerce-checkout .woocommerce form.checkout::before {
  content: none;
  display: none;
}
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main {
  margin-bottom: 0;
  padding-bottom: 40px;
}
body.woocommerce-cart .page-header,
body.woocommerce-checkout .page-header {
  margin-bottom: 0;
}

/* ---- Page Container ---- */
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ---- Page Title ---- */
body.woocommerce-cart .entry-title,
body.woocommerce-checkout .entry-title {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
}

/* ============================================
   CART PAGE — List-style items (no table borders)
   ============================================ */

/* Hide default table header row */
body.woocommerce-cart table.shop_table.cart thead {
  display: none;
}

/* Turn table into block layout */
body.woocommerce-cart table.shop_table.cart {
  display: block;
  background: rgba(0,0,0,0.1);
  border: none;
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  border-radius: 12px;
  padding: 8px 24px;
}
body.woocommerce-cart table.shop_table.cart tbody {
  display: block;
}
body.woocommerce-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 20px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  border-top: none;
}
body.woocommerce-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item td {
  display: block;
  padding: 0;
  border: none;
  background: transparent;
}

/* Thumbnail — left column, spans all rows, stretches to match content */
body.woocommerce-cart table.shop_table td.product-thumbnail {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: stretch;
  margin-right: 40px;
}
body.woocommerce-cart table.shop_table td.product-thumbnail img {
  width: 180px;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* Product name — middle column, row 1 */
body.woocommerce-cart table.shop_table td.product-name {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
body.woocommerce-cart table.shop_table td.product-name a {
  color: #39fff5;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
}
body.woocommerce-cart table.shop_table td.product-name a:hover {
  opacity: 0.8;
}
/* Cart selectors (場次 + 身份優惠): smaller label */
body.woocommerce-cart table.shop_table td.product-name .academy-cart-select-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* Session / variation info */
body.woocommerce-cart table.shop_table td.product-name dl.variation {
  margin: 12px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}
body.woocommerce-cart table.shop_table td.product-name dl.variation dd p {
  margin: 0;
}

/* Hide individual price column */
body.woocommerce-cart table.shop_table td.product-price {
  display: none;
}

/* Quantity — right column, row 1 (top-right) */
body.woocommerce-cart table.shop_table td.product-quantity {
  grid-column: 3;
  grid-row: 1;
}
body.woocommerce-cart table.shop_table td.product-quantity .quantity input.qty {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 8px;
  width: 50px;
  text-align: center;
  font-size: 14px;
}

/* Subtotal — middle+right columns, row 2 */
body.woocommerce-cart table.shop_table td.product-subtotal {
  grid-column: 2 / -1;
  grid-row: 2;
  margin-top: 8px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  text-align: right;
}
/* Discount: original price smaller */
body.woocommerce-cart table.shop_table td.product-subtotal del {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.5;
  margin-right: 8px;
}
body.woocommerce-cart table.shop_table td.product-subtotal ins {
  text-decoration: none;
}
body.woocommerce-cart table.shop_table td.product-subtotal small {
  font-size: 12px;
  font-weight: 400;
}

/* Remove button — hidden (quantity 1→0 triggers remove) */
body.woocommerce-cart table.shop_table td.product-remove {
  display: none !important;
}

/* ---- Actions row (coupon + update cart) ---- */
body.woocommerce-cart table.shop_table.cart tr td.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 20px 0 0;
  border: none;
  background: transparent;
}

/* Hide the coupon form inline — we'll show it below */
body.woocommerce-cart table.shop_table.cart .coupon {
  display: none;
}

/* Update cart button — right aligned */
body.woocommerce-cart table.shop_table.cart td.actions > button[name="update_cart"] {
  margin-left: auto;
}

/* ---- Coupon section (separate block below cart) ---- */
body.woocommerce-cart .academy-coupon-toggle {
  margin-top: 20px;
}

/* ---- Buttons (cart page) ---- */
body.woocommerce-cart .woocommerce a.button,
body.woocommerce-cart .woocommerce button.button,
body.woocommerce-cart .woocommerce input.button {
  background-color: transparent;
  color: #39fff5;
  border: 1px solid #39fff5;
  border-radius: 8px;
  padding: 12px 28px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  text-transform: none;
  line-height: 1.4;
  min-width: 160px;
  text-align: center;
}
body.woocommerce-cart .woocommerce a.button:hover,
body.woocommerce-cart .woocommerce button.button:hover,
body.woocommerce-cart .woocommerce input.button:hover {
  background-color: #39fff5;
  color: #1a1a1a;
}

/* ---- Cart Totals ---- */
/* Cart page: two-column layout */
body.woocommerce-cart .woocommerce {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
body.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper {
  width: 100%;
}
body.woocommerce-cart .woocommerce > .woocommerce-cart-form {
  width: 100%;
}
body.woocommerce-cart .woocommerce > .cart-collaterals {
  width: 100%;
  max-width: 100%;
  float: none;
}
body.woocommerce-cart .woocommerce > .cart-collaterals .cart_totals,
body.woocommerce-cart .woocommerce .cart-collaterals .cart_totals {
  width: 100%;
  float: none;
  background: rgba(0,0,0,0.1);
  border: none;
  border-radius: 12px;
  padding: 24px;
  margin-top: 0;
}
body.woocommerce-cart .cart_totals h2 {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
body.woocommerce-cart .cart_totals table.shop_table {
  display: table;
  background: transparent;
  border: none;
}
body.woocommerce-cart .cart_totals table.shop_table thead {
  display: table-header-group;
}
body.woocommerce-cart .cart_totals table.shop_table tbody {
  display: table-row-group;
}
body.woocommerce-cart .cart_totals table.shop_table tr {
  display: table-row;
}
body.woocommerce-cart .cart_totals table.shop_table td,
body.woocommerce-cart .cart_totals table.shop_table th {
  display: table-cell;
  color: #e0e0e0;
  font-size: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: transparent;
}
body.woocommerce-cart .cart_totals .order-total td,
body.woocommerce-cart .cart_totals .order-total td .woocommerce-Price-amount {
  color: #39fff5;
  font-size: 22px;
  font-weight: 700;
}

/* Proceed to checkout */
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout a.checkout-button {
  width: 100%;
  text-align: center;
}

/* ---- Custom Qty +/- Buttons ---- */
.academy-qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.academy-qty__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  padding: 0;
}
.academy-qty__btn:hover,
.academy-qty__btn:active {
  background-color: #fff;
  color: #1a1a1a;
  border-color: #fff;
}
.academy-qty__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

/* ---- Custom Remove Button (text) ---- */
.academy-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.academy-remove-btn:hover,
.academy-remove-btn:active {
  background-color: #fff;
  color: #1a1a1a;
  border-color: #fff;
}

/* ---- Cart loading states ---- */

/* Override WooCommerce's blockUI (inline styles via jQuery.blockUI)
   Must use !important here to beat inline styles */
body.woocommerce-cart .blockUI.blockOverlay,
body.woocommerce-checkout .blockUI.blockOverlay {
  background: transparent !important;
  opacity: 0 !important;
}
body.woocommerce-cart .blockUI.blockMsg,
body.woocommerce-checkout .blockUI.blockMsg {
  display: none !important;
}

/* Our custom blur + SVG loader */
body.woocommerce-cart .processing table.shop_table,
body.woocommerce-cart .woocommerce-cart-form.is-updating table.shop_table {
  filter: blur(3px);
  pointer-events: none;
  transition: filter 0.2s;
}
.academy-cart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
  padding-bottom: 200px;
}

/* Logo 由下往上填滿 cyan 重點色，1 秒一個循環 */
.academy-cart-loading__logo {
  width: 200px;
  height: 80px;
  background-color: var(--accent, #39fff5);
  -webkit-mask-image: url('https://dracademy.com.tw/wp-content/uploads/2025/08/logo-page.webp');
          mask-image: url('https://dracademy.com.tw/wp-content/uploads/2025/08/logo-page.webp');
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  animation: academy-cart-fill-up 1s ease-in-out infinite;
}

@keyframes academy-cart-fill-up {
  0%   { clip-path: inset(100% 0 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* blockUI on cart totals and checkout */
body.woocommerce-cart .cart_totals .blockUI.blockOverlay,
body.woocommerce-checkout #order_review .blockUI.blockOverlay {
  background: transparent !important;
  opacity: 0 !important;
}
body.woocommerce-cart .cart_totals .blockUI.blockMsg,
body.woocommerce-checkout #order_review .blockUI.blockMsg {
  display: none !important;
}

/* ---- Coupon toggle section ---- */
.academy-coupon-section {
  margin-top: 24px;
}
body.woocommerce-cart button.academy-coupon-toggle {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid #39fff5;
  border-radius: 8px;
  color: #39fff5;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
body.woocommerce-cart button.academy-coupon-toggle:hover,
body.woocommerce-cart button.academy-coupon-toggle.is-active {
  background-color: #39fff5;
  color: #1a1a1a;
  border-color: #39fff5;
}
.academy-coupon-form {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
}
.academy-coupon-form.is-open {
  display: flex;
}
.academy-coupon-form input.input-text {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  flex: 1;
}
.academy-coupon-form input.input-text::placeholder {
  color: rgba(255,255,255,0.4);
}

/* ============================================
   CHECKOUT PAGE
   ============================================ */
body.woocommerce-checkout .woocommerce-billing-fields h3,
body.woocommerce-checkout .woocommerce-shipping-fields h3,
body.woocommerce-checkout .woocommerce-additional-fields h3,
body.woocommerce-checkout #order_review_heading {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Checkout two-column layout */
body.woocommerce-checkout .woocommerce .col2-set {
  float: none;
  width: 100%;
}
body.woocommerce-checkout .woocommerce .col2-set .col-1,
body.woocommerce-checkout .woocommerce .col2-set .col-2 {
  float: none;
  width: 100%;
  max-width: 100%;
}
body.woocommerce-checkout .woocommerce form.checkout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
  align-items: start;
}
body.woocommerce-checkout .woocommerce form.checkout .col2-set {
  grid-column: 1;
}
body.woocommerce-checkout .woocommerce form.checkout #order_review,
body.woocommerce-checkout .woocommerce form.checkout #order_review_heading {
  grid-column: 2;
  grid-row: 1;
}
body.woocommerce-checkout .woocommerce form.checkout #order_review {
  grid-row: 1;
  position: static;
}
/* Remove bottom whitespace */
body.woocommerce-checkout .site-main {
  padding-bottom: 40px;
}
body.woocommerce-checkout .site-main::after {
  display: none;
}
body.woocommerce-checkout .entry-content::after,
body.woocommerce-checkout .page-content::after {
  content: none;
}
/* (footer handled in top section) */

/* Hide "您的訂單" heading */
body.woocommerce-checkout #order_review_heading {
  display: none;
}

/* Checkout form fields — all inputs 16px white */
body.woocommerce-checkout .form-row label {
  color: #ccc;
  font-size: 14px;
  font-weight: 500;
}
body.woocommerce-checkout .form-row label .required {
  color: #39fff5;
}
body.woocommerce-checkout .woocommerce-input-wrapper input.input-text,
body.woocommerce-checkout .woocommerce-input-wrapper textarea,
body.woocommerce-checkout .woocommerce-input-wrapper select,
body.woocommerce-checkout input.input-text,
body.woocommerce-checkout textarea,
body.woocommerce-checkout select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  font-family: 'Noto Sans TC', sans-serif;
  width: 100%;
  box-sizing: border-box;
}
body.woocommerce-checkout .woocommerce-input-wrapper input.input-text::placeholder,
body.woocommerce-checkout textarea::placeholder {
  color: rgba(255,255,255,0.4);
}
/* Remove ALL validation borders (green/red) and focus colors */
body.woocommerce-checkout .form-row.woocommerce-validated input.input-text,
body.woocommerce-checkout .form-row.woocommerce-validated select,
body.woocommerce-checkout .form-row.woocommerce-validated textarea,
body.woocommerce-checkout .form-row.woocommerce-validated .select2-container--default .select2-selection--single {
  border-color: rgba(255,255,255,0.2);
}
body.woocommerce-checkout .form-row.woocommerce-invalid input.input-text,
body.woocommerce-checkout .form-row.woocommerce-invalid select,
body.woocommerce-checkout .form-row.woocommerce-invalid textarea {
  border-color: rgba(231,76,60,0.5);
}
/* Focus state — cyan border + label color transition */
body.woocommerce-checkout .form-row input.input-text:focus,
body.woocommerce-checkout .form-row textarea:focus,
body.woocommerce-checkout .form-row select:focus,
body.woocommerce-checkout .woocommerce-input-wrapper input:focus,
body.woocommerce-checkout .woocommerce-input-wrapper textarea:focus,
body.woocommerce-checkout .woocommerce-input-wrapper select:focus {
  border: 1px solid #39fff5 !important;
  box-shadow: none !important;
  transition: border-color 0.3s ease;
}
body.woocommerce-checkout input.input-text,
body.woocommerce-checkout textarea,
body.woocommerce-checkout select {
  transition: border-color 0.3s ease;
}
/* Label turns cyan when sibling input is focused */
body.woocommerce-checkout .form-row label {
  transition: color 0.3s ease;
}
body.woocommerce-checkout .form-row:focus-within > label {
  color: #39fff5;
}
/* Override WC CSS variables globally on checkout */
body.woocommerce-checkout {
  --wc-form-border-color: rgba(255,255,255,0.2);
  --wc-form-color-background: rgba(255,255,255,0.1);
  --wc-form-border-radius: 8px;
  --wc-form-border-width: 1px;
  --wc-green: rgba(255,255,255,0.2);
  --wc-highlight: rgba(255,255,255,0.2);
}
/* Nuclear: kill green validated border everywhere */
body.woocommerce-checkout .form-row.woocommerce-validated .select2-container .select2-selection,
body.woocommerce-checkout .form-row.woocommerce-validated input,
body.woocommerce-checkout .form-row.woocommerce-validated select,
body.woocommerce-checkout .form-row.woocommerce-validated textarea {
  border-color: rgba(255,255,255,0.2);
}

/* Select2 text vertical center */
body.woocommerce-checkout .select2-container--default .select2-selection--single {
  display: flex;
  align-items: center;
}
body.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1;
  padding-top: 0;
  padding-bottom: 0;
}
body.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 50%;
  transform: translateY(-50%);
  right: 12px;
  height: auto;
}

/* Select2 dropdown: force dark bg everywhere (Select2 uses inline styles) */
.select2-dropdown,
.select2-dropdown *,
.select2-results,
.select2-results__options,
.select2-search--dropdown {
  background-color: #2c343b !important;
}
.select2-results__option {
  background-color: #2c343b !important;
  color: #e0e0e0 !important;
}
.select2-results__option[aria-selected="true"] {
  background-color: rgba(57,255,245,0.2) !important;
  color: #39fff5 !important;
}
.select2-results__option--highlighted,
.select2-results__option--highlighted[aria-selected] {
  background-color: rgba(57,255,245,0.12) !important;
  color: #39fff5 !important;
}
.select2-search--dropdown .select2-search__field {
  background-color: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  color: #fff !important;
}

/* Select2 dropdown — custom dark theme */
body.woocommerce-checkout .select2-container--default .select2-selection--single {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  height: 50px;
  padding: 10px 16px;
}
body.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #fff;
  font-size: 16px;
  line-height: 28px;
  padding-left: 0;
}
body.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 12px;
  right: 12px;
}
body.woocommerce-checkout .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: rgba(255,255,255,0.5) transparent transparent transparent;
}
/* Select2 dropdown panel — dark theme (global, select2 renders outside .woocommerce-checkout) */
.select2-container--default .select2-dropdown {
  background: #2c343b;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  overflow: hidden;
}
.select2-container--default .select2-search--dropdown {
  background: #2c343b;
  padding: 8px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 16px;
  padding: 10px 12px;
}
.select2-container--default .select2-results {
  background: #2c343b;
}
.select2-container--default .select2-results__options {
  background: #2c343b;
}
.select2-container--default .select2-results__option {
  color: #e0e0e0;
  padding: 10px 16px;
  font-size: 15px;
  background: #2c343b;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: rgba(57,255,245,0.15);
  color: #39fff5;
}
.select2-container--default .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected="true"] {
  background: rgba(57,255,245,0.25);
  color: #39fff5;
}
/* Select2 focused state */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #39fff5;
}


/* Checkout order review */
body.woocommerce-checkout .woocommerce-checkout-review-order {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 24px;
}
body.woocommerce-checkout table.shop_table {
  background: transparent;
  border: none;
}
body.woocommerce-checkout table.shop_table th,
body.woocommerce-checkout table.shop_table td {
  color: #e0e0e0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  font-size: 16px;
}
body.woocommerce-checkout table.shop_table td:last-child,
body.woocommerce-checkout table.shop_table th:last-child {
  text-align: right;
}
body.woocommerce-cart table.shop_table td.product-subtotal {
  text-align: right;
}
body.woocommerce-cart .cart_totals table.shop_table td {
  text-align: right;
}
body.woocommerce-checkout table.shop_table tfoot .order-total td,
body.woocommerce-checkout table.shop_table tfoot .order-total td .woocommerce-Price-amount {
  color: #39fff5;
  font-size: 20px;
  font-weight: 700;
}

/* Payment methods */
body.woocommerce-checkout #payment {
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 20px;
  border: none;
}
body.woocommerce-checkout #payment ul.payment_methods {
  list-style: none;
  padding: 0;
  margin: 0;
  border: none;
}
body.woocommerce-checkout #payment ul.payment_methods li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
body.woocommerce-checkout #payment ul.payment_methods li label {
  color: #e0e0e0;
  font-size: 16px;
}
body.woocommerce-checkout #payment div.payment_box {
  background: rgba(255,255,255,0.05);
  color: #ccc;
  border-radius: 8px;
  padding: 16px;
  margin-top: 8px;
  font-size: 16px;
}
/* TapPay credit card fields inside payment box */
body.woocommerce-checkout #payment div.payment_box input,
body.woocommerce-checkout #payment div.payment_box select,
body.woocommerce-checkout #payment div.payment_box .tpfield,
body.woocommerce-checkout #payment div.payment_box iframe {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  padding: 10px 12px;
}
body.woocommerce-checkout #payment div.payment_box label {
  color: #ccc;
  font-size: 14px;
}
body.woocommerce-checkout #payment div.payment_box p {
  color: #ccc;
  font-size: 14px;
}
/* Payment box — remove gap between arrow and box */
body.woocommerce-checkout #payment div.payment_box {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
body.woocommerce-checkout #payment div.payment_box::before {
  display: none;
}
body.woocommerce-checkout #payment ul.payment_methods li {
  border-bottom: none;
}

/* Privacy policy text */
body.woocommerce-checkout .woocommerce-privacy-policy-text p {
  color: #ccc;
  font-size: 14px;
}
body.woocommerce-checkout .woocommerce-privacy-policy-text a {
  color: #39fff5;
}

/* Terms and conditions */
body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper {
  color: #ccc;
  font-size: 14px;
}

/* ECPay invoice section */
body.woocommerce-checkout .ipgw-invoice-wrapper,
body.woocommerce-checkout .ecpay-invoice-wrapper {
  color: #e0e0e0;
  font-size: 16px;
}
body.woocommerce-checkout .ipgw-invoice-wrapper input,
body.woocommerce-checkout .ipgw-invoice-wrapper select,
body.woocommerce-checkout .ecpay-invoice-wrapper input,
body.woocommerce-checkout .ecpay-invoice-wrapper select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
}

/* Order notes textarea — dark theme */
body.woocommerce-checkout .woocommerce-additional-fields textarea#order_comments {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  min-height: 100px;
  resize: vertical;
}

/* All text in checkout — baseline 16px */
body.woocommerce-checkout .woocommerce {
  font-size: 16px;
}

/* Checkout coupon toggle — style as button, hide default link */
body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 20px;
}
body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info::before {
  display: none;
}
body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info a.showcoupon {
  display: inline-flex;
  background: transparent;
  border: 1px solid #39fff5;
  border-radius: 8px;
  color: #39fff5;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info a.showcoupon:hover {
  background-color: #39fff5;
  color: #1a1a1a;
}
/* Hide the "有折價券嗎?" text, show only the button */
body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info {
  font-size: 0;
  line-height: 0;
}
body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info a.showcoupon {
  font-size: 14px;
  line-height: 1.4;
}

/* Checkout coupon form */
body.woocommerce-checkout .checkout_coupon.woocommerce-form-coupon {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
body.woocommerce-checkout .checkout_coupon input.input-text {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  flex: 1;
}
body.woocommerce-checkout .checkout_coupon input.input-text::placeholder {
  color: rgba(255,255,255,0.4);
}

/* Checkout buttons */
body.woocommerce-checkout .woocommerce a.button,
body.woocommerce-checkout .woocommerce button.button,
body.woocommerce-checkout .woocommerce input.button,
body.woocommerce-checkout .woocommerce #place_order {
  background-color: transparent;
  color: #39fff5;
  border: 1px solid #39fff5;
  border-radius: 8px;
  padding: 16px 32px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  text-transform: none;
  width: 100%;
  text-align: center;
}
body.woocommerce-checkout .woocommerce a.button:hover,
body.woocommerce-checkout .woocommerce button.button:hover,
body.woocommerce-checkout .woocommerce input.button:hover,
body.woocommerce-checkout .woocommerce #place_order:hover {
  background-color: #39fff5;
  color: #1a1a1a;
}

/* ============================================
   WC Blocks fallback (if blocks still render)
   ============================================ */
body.woocommerce-checkout .wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button {
  background-color: transparent;
  color: #39fff5;
  border: 1px solid #39fff5;
  border-radius: 8px;
  padding: 16px 32px;
  font-weight: 700;
  font-size: 16px;
  transition: background-color 0.2s, color 0.2s;
}
body.woocommerce-checkout .wc-block-components-button.wp-element-button.wc-block-components-checkout-place-order-button:hover {
  background-color: #39fff5;
  color: #1a1a1a;
}

/* ============================================
   Notices
   ============================================ */
body.woocommerce-cart .woocommerce-message,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-checkout .woocommerce-message,
body.woocommerce-checkout .woocommerce-info {
  background: rgba(57,255,245,0.1);
  border-top: none;
  border-left: 4px solid #39fff5;
  color: #e0e0e0;
  border-radius: 8px;
  padding: 12px 20px;
}
body.woocommerce-cart .woocommerce-message a,
body.woocommerce-checkout .woocommerce-message a {
  color: #39fff5;
}
body.woocommerce-cart .woocommerce-message::before,
body.woocommerce-cart .woocommerce-info::before,
body.woocommerce-checkout .woocommerce-message::before,
body.woocommerce-checkout .woocommerce-info::before,
body.woocommerce-cart .woocommerce-error::before,
body.woocommerce-checkout .woocommerce-error::before {
  display: none;
}
body.woocommerce-cart .woocommerce-error,
body.woocommerce-checkout .woocommerce-error {
  background: rgba(231,76,60,0.15);
  border-top: none;
  border-left: 4px solid #e74c3c;
  color: #e0e0e0;
  border-radius: 8px;
  padding: 12px 20px;
}

/* Empty Cart — B 站深色卡片風格（限新版 cart 頁，避免影響舊 /cart/） */
body.academy-new-cart-page .woocommerce > .cart-empty,
body.academy-new-cart-page .cart-empty {
  text-align: center;
  color: #e0e0e0;
  font-size: 18px;
  letter-spacing: 0.02em;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  max-width: 560px;
  margin: 40px auto 24px;
  padding: 64px 24px 24px;
  position: relative;
}
body.academy-new-cart-page .cart-empty::before {
  content: '';
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2339fff5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/><path d='M3 6h18'/><path d='M16 10a4 4 0 0 1-8 0'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.85;
}
body.academy-new-cart-page .return-to-shop {
  text-align: center;
  margin: 0 auto 40px;
  max-width: 560px;
  padding: 0 24px 48px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-top: none;
  border-radius: 0 0 16px 16px;
  margin-top: -24px;
}
body.academy-new-cart-page .return-to-shop a.button {
  display: inline-block;
  background: linear-gradient(135deg, #39fff5 0%, #1ec9c0 100%);
  color: #1a1a1a !important;
  border: none;
  padding: 14px 36px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(57,255,245,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.academy-new-cart-page .return-to-shop a.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(57,255,245,0.45);
  background: linear-gradient(135deg, #39fff5 0%, #1ec9c0 100%);
  color: #1a1a1a !important;
}

/* Price colors inherit */
body.woocommerce-cart .woocommerce-Price-amount,
body.woocommerce-checkout .woocommerce-Price-amount {
  color: inherit;
}

/* ============================================
   Identity Selector (cart page)
   ============================================ */
.academy-identity-selector {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-sizing: border-box;
  max-width: 100%;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.academy-identity-selector__label {
  color: #ccc;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.academy-identity-selector__select {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: 'Noto Sans TC', sans-serif;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  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='rgba(255,255,255,0.5)' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.academy-identity-selector__select:focus {
  border-color: #39fff5;
  outline: none;
}
.academy-identity-selector__select option {
  background: #2c343b;
  color: #e0e0e0;
}

/* ---- Cart inline selectors (batch + identity) ---- */
.academy-cart-selects {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}
.academy-cart-select-label {
  display: block;
  font-size: 16px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}
.academy-batch-select-wrap,
.academy-identity-select-wrap {
  flex: 1;
  min-width: 0;
}
.academy-batch-select,
.academy-identity-select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  padding: 8px 36px 8px 12px;
  font-size: 13px;
  font-family: 'Noto Sans TC', sans-serif;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  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='rgba(255,255,255,0.5)' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  max-width: 280px;
  width: 100%;
}
.academy-batch-select:focus,
.academy-identity-select:focus {
  border-color: #39fff5;
  outline: none;
}
/* Batch validation notice */
.academy-batch-notice {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.academy-batch-notice strong {
  color: #fff;
}

.academy-batch-select option,
.academy-identity-select option {
  background: #2c343b;
  color: #e0e0e0;
}

/* ---- Discount fee rows — green color ---- */
body.woocommerce-cart .cart_totals table.shop_table tr.fee td,
body.woocommerce-checkout table.shop_table tfoot tr.fee td {
  color: #39fff5;
  font-size: 16px;
  font-weight: 600;
}
body.woocommerce-cart .cart_totals table.shop_table tr.fee th,
body.woocommerce-checkout table.shop_table tfoot tr.fee th {
  color: #39fff5;
  font-size: 16px;
}

/* ---- Order Breakdown (cart totals) ---- */
.academy-order-breakdown {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.academy-order-breakdown__title {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
}
.academy-order-breakdown__item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.academy-order-breakdown__item:last-child {
  border-bottom: none;
}
.academy-order-breakdown__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.academy-order-breakdown__name {
  color: #e0e0e0;
  font-size: 14px;
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}
.academy-order-breakdown__price {
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.academy-order-breakdown__discount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding-left: 12px;
}
.academy-order-breakdown__discount span:first-child {
  color: #39fff5;
  font-size: 14px;
}
.academy-order-breakdown__discount span:last-child {
  color: #39fff5;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.academy-order-breakdown__price del {
  color: rgba(224, 224, 224, 0.5);
  font-size: 13px;
  text-decoration: line-through;
  margin-right: 6px;
}
.academy-order-breakdown__price ins {
  color: #39fff5;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

/* Cart item subtotal discount styling */
body.woocommerce-cart .product-subtotal del {
  color: rgba(224, 224, 224, 0.5);
  font-size: 13px;
}
body.woocommerce-cart .product-subtotal ins {
  text-decoration: none;
  font-size: 18px;
}

/* ---- Hide undo/restore notice ---- */
body.woocommerce-cart .woocommerce-message {
  display: none;
}

/* Checkout identity row */
.academy-identity-checkout-row th,
.academy-identity-checkout-row td {
  color: #39fff5;
  font-size: 14px;
}

/* ============================================
   Recommended Products
   ============================================ */
.academy-recommendations {
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-radius: 0;
  padding: 32px 0 0;
  margin: 32px 0;
  max-width: 1140px;
}
.academy-recommendations__title {
  color: #39fff5;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.academy-recommendations__title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: #39fff5;
  border-radius: 2px;
  flex-shrink: 0;
}
.academy-recommendations__grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.academy-recommendations__grid::-webkit-scrollbar {
  display: none;
}
.academy-rec-card {
  flex: 1 0 calc((100% - 48px) / 5);
  min-width: calc((100% - 48px) / 5);
  max-width: calc((100% - 24px) / 3);
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s;
  scroll-snap-align: start;
}
.academy-rec-card:hover {
  border-color: rgba(57,255,245,0.3);
}
.academy-rec-card__img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}
.academy-rec-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.academy-rec-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #39fff5;
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 30px;
  white-space: nowrap;
}
.academy-rec-card__name {
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  text-align: center;
}
.academy-rec-card__price {
  color: #39fff5;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}
.academy-rec-card__btn,
a.academy-rec-card__btn,
a.academy-rec-card__btn:visited,
a.academy-rec-card__btn:link {
  display: inline-block;
  background: #39fff5 !important;
  color: #1a1a1a !important;
  border: 1px solid #39fff5 !important;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color 0.2s, color 0.2s, filter 0.2s;
  margin-top: 20px;
}
.academy-rec-card__btn:hover,
a.academy-rec-card__btn:hover,
.academy-rec-card__btn:focus {
  background: #39fff5 !important;
  color: #1a1a1a !important;
  filter: brightness(0.92);
}

/* Already-in-cart state */
.academy-rec-card.is-in-cart {
  opacity: 0.35;
  pointer-events: none;
}
.academy-rec-card.is-in-cart .academy-rec-card__btn {
  display: none;
}

/* ============================================
   Checkout — horizontal recommendation cards
   ============================================ */
body.woocommerce-checkout .academy-recommendations__grid {
  flex-direction: column;
  gap: 10px;
}
body.woocommerce-checkout .academy-rec-card {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 0;
  overflow: hidden;
  position: relative;
  min-width: 0;
  max-width: 100%;
}
body.woocommerce-checkout .academy-rec-card__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
body.woocommerce-checkout .academy-rec-card__img {
  width: 60px;
  height: 60px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 6px;
}
body.woocommerce-checkout .academy-rec-card__badge {
  display: none; /* replaced by __top-badge */
}
/* Top badge: full-width background label at card top */
body.woocommerce-checkout .academy-rec-card__top-badge {
  background: var(--color-accent, #39fff5);
  color: #1a2028;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 6px 12px;
}
body.woocommerce-checkout .academy-rec-card__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 12px 12px;
}
body.woocommerce-checkout .academy-rec-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  align-items: flex-start;
  text-align: left;
}
body.woocommerce-checkout .academy-rec-card__name {
  font-size: 13px;
  text-align: left;
}
body.woocommerce-checkout .academy-rec-card__price {
  font-size: 14px;
}
body.woocommerce-checkout .academy-rec-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
body.woocommerce-checkout .academy-rec-card__btn {
  margin-top: 0;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  body.woocommerce-cart .site-main,
  body.woocommerce-checkout .site-main {
    padding: 20px 12px;
  }

  /* Cart item: compact grid on mobile */
  body.woocommerce-cart table.shop_table.cart {
    padding: 8px 12px;
  }
  body.woocommerce-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item {
    grid-template-columns: 80px 1fr auto;
    gap: 0 12px;
    padding: 16px 0;
  }
  body.woocommerce-cart table.shop_table td.product-thumbnail img {
    height: 100%;
  }
  body.woocommerce-cart table.shop_table td.product-name a {
    font-size: 16px;
  }

  /* Cart selectors stack on mobile */
  .academy-cart-selects {
    flex-direction: column;
    gap: 8px;
  }
  .academy-batch-select,
  .academy-identity-select {
    max-width: 100%;
  }

  body.woocommerce-cart table.shop_table td.product-subtotal {
    margin-top: 10px;
  }

  /* Cart totals */
  body.woocommerce-cart .cart_totals {
    padding: 16px;
  }
  body.woocommerce-cart .cart_totals .wc-proceed-to-checkout a.checkout-button {
    padding: 14px 20px;
    font-size: 16px;
  }

  /* Coupon section */
  .academy-coupon-form {
    flex-direction: column;
  }

  /* Recommendations */
  .academy-rec-card {
    flex: 0 0 calc((100% - 24px) / 3);
    min-width: 140px;
  }

  /* Checkout: single column */
  body.woocommerce-checkout .woocommerce form.checkout {
    grid-template-columns: 1fr;
  }
  body.woocommerce-checkout .woocommerce form.checkout #order_review,
  body.woocommerce-checkout .woocommerce form.checkout #order_review_heading {
    grid-column: 1;
    grid-row: auto;
    position: static;
  }
}

/* ============================================
   WooCommerce My Account — Academy Dark Theme
   body.woocommerce-account
   ============================================ */

html body.woocommerce-account {
  background: #2c343b !important;
  background-image: linear-gradient(180deg, #2c343b 0%, #424d59 40%, #6b7785 100%) !important;
  background-attachment: fixed !important;
  font-family: 'Noto Sans TC', sans-serif !important;
  color: #fff !important;
  min-height: 100vh;
}
html body.woocommerce-account #page,
html body.woocommerce-account .site {
  background: transparent !important;
}

/* Hide default header/footer/sidebar */
html body.woocommerce-account .site-header,
html body.woocommerce-account #site-header,
html body.woocommerce-account .site-footer,
html body.woocommerce-account #site-footer,
html body.woocommerce-account .entry-title,
html body.woocommerce-account .page-header,
html body.woocommerce-account .entry-header,
html body.woocommerce-account .site-branding {
  display: none !important;
}

/* Reset hello-elementor container constraints */
html body.woocommerce-account .site-main,
html body.woocommerce-account.hello-elementor-default .site-main,
html body:not([class*=elementor-page-]).woocommerce-account .site-main {
  max-width: 1140px !important;
  margin: 0 auto !important;
  padding: 60px 20px !important;
  width: 100% !important;
  float: none !important;
  color: #fff !important;
}
html body.woocommerce-account .page-content,
html body.woocommerce-account .entry-content {
  max-width: 100% !important;
  color: #fff !important;
}

/* Override theme link colors */
html body.woocommerce-account a {
  color: var(--color-accent, #39fff5) !important;
  text-decoration: none;
}
html body.woocommerce-account a:hover {
  text-decoration: underline;
}

/* Override site-title / branding color */
html body.woocommerce-account .site-title,
html body.woocommerce-account .site-title a {
  display: none !important;
}

/* WooCommerce notices */
body.woocommerce-account .woocommerce-notices-wrapper .woocommerce-error,
body.woocommerce-account .woocommerce-notices-wrapper .woocommerce-message {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  padding: 12px 16px;
  margin-bottom: 20px;
  list-style: none;
}
body.woocommerce-account .woocommerce-notices-wrapper .woocommerce-error {
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}

/* ---- Login Page: split layout (left logo / right form) ---- */
html body.woocommerce-account:not(.logged-in) .site-main,
html body.woocommerce-account:not(.logged-in).hello-elementor-default .site-main,
html body:not([class*=elementor-page-]).woocommerce-account:not(.logged-in) .site-main {
  max-width: 100% !important;
  padding: 0 !important;
  display: flex !important;
  min-height: 100vh;
}

/* Left panel: dark + logo */
html body.woocommerce-account:not(.logged-in) .site-main::before {
  content: '';
  flex: 0 0 50%;
  background: #1a2028;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('/wp-content/uploads/2026/03/drex_academy_logo.webp');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 240px auto;
}

/* Right panel: form wrapper */
html body.woocommerce-account:not(.logged-in) .page-content,
html body.woocommerce-account:not(.logged-in) .entry-content {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 48px !important;
  max-width: 50% !important;
}

/* Login Form */
body.woocommerce-account .woocommerce-form-login {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 32px 28px;
}

body.woocommerce-account .woocommerce-form-login h2,
body.woocommerce-account .woocommerce h2,
body.woocommerce-account h2,
body.woocommerce-account h3 {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin: 0 0 24px !important;
}

body.woocommerce-account .woocommerce-form-row label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}
body.woocommerce-account .woocommerce-form-row label .required {
  color: var(--color-accent, #39fff5);
}

html body.woocommerce-account .woocommerce-Input,
html body.woocommerce-account .input-text,
html body.woocommerce-account input[type="text"],
html body.woocommerce-account input[type="password"],
html body.woocommerce-account input[type="email"] {
  width: 100% !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
  font-family: 'Noto Sans TC', sans-serif !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  color: #fff !important;
  outline: none !important;
  transition: border-color 0.2s;
  box-sizing: border-box !important;
}
html body.woocommerce-account .woocommerce-Input:focus,
html body.woocommerce-account .input-text:focus,
html body.woocommerce-account input[type="text"]:focus,
html body.woocommerce-account input[type="password"]:focus,
html body.woocommerce-account input[type="email"]:focus {
  border-color: var(--color-accent, #39fff5) !important;
}
html body.woocommerce-account .woocommerce-Input::placeholder,
html body.woocommerce-account input::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
}

body.woocommerce-account .form-row {
  margin-bottom: 16px;
}

/* Remember me checkbox */
body.woocommerce-account .woocommerce-form-login__rememberme {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
  cursor: pointer;
}
body.woocommerce-account .woocommerce-form__input-checkbox {
  accent-color: var(--color-accent, #39fff5);
  width: 16px;
  height: 16px;
}

/* Login button */
body.woocommerce-account .woocommerce-form-login__submit {
  width: 100%;
  padding: 14px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  font-family: 'Noto Sans TC', sans-serif !important;
  background: var(--color-accent, #39fff5) !important;
  color: #1a2028 !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer;
  transition: opacity 0.2s;
}
body.woocommerce-account .woocommerce-form-login__submit:hover {
  opacity: 0.9;
}

/* Lost password link */
body.woocommerce-account .woocommerce-LostPassword {
  text-align: center;
  margin-top: 16px;
}
body.woocommerce-account .woocommerce-LostPassword a {
  color: var(--color-accent, #39fff5);
  font-size: 13px;
  text-decoration: none;
}
body.woocommerce-account .woocommerce-LostPassword a:hover {
  text-decoration: underline;
}

/* ---- My Account Dashboard (logged in) ---- */

/* Navigation: horizontal tabs at top */
html body.woocommerce-account .woocommerce-MyAccount-navigation {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 24px;
  width: 100% !important;
  float: none !important;
}
html body.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
html body.woocommerce-account .woocommerce-MyAccount-navigation li {
  flex-shrink: 0;
}
html body.woocommerce-account .woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.6) !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
html body.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.04);
}
html body.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
  color: var(--color-accent, #39fff5) !important;
  border-bottom-color: var(--color-accent, #39fff5);
  background: rgba(57, 255, 245, 0.06);
}

/* Content: full width below nav */
html body.woocommerce-account .woocommerce-MyAccount-content {
  width: 100% !important;
  float: none !important;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 28px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.6;
}
body.woocommerce-account .woocommerce-MyAccount-content a {
  color: var(--color-accent, #39fff5);
}
body.woocommerce-account .woocommerce-MyAccount-content p {
  margin: 0 0 12px;
}

/* Tables inside my-account */
body.woocommerce-account table {
  width: 100%;
  border-collapse: collapse;
}
body.woocommerce-account table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
body.woocommerce-account table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Buttons in my-account */
html body.woocommerce-account .woocommerce-Button,
html body.woocommerce-account .button,
html body.woocommerce-account a.button {
  display: inline-block;
  margin-top: 40px !important;
  padding: 8px 20px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: 'Noto Sans TC', sans-serif !important;
  background: var(--color-accent, #39fff5) !important;
  color: #1a2028 !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: opacity 0.2s;
}
html body.woocommerce-account .woocommerce-Button:hover,
html body.woocommerce-account .button:hover,
html body.woocommerce-account a.button:hover {
  background: var(--color-accent, #39fff5) !important;
  color: #1a2028 !important;
  opacity: 0.85;
}

/* WooCommerce info/message/error boxes in my-account */
html body.woocommerce-account .woocommerce-message,
html body.woocommerce-account .woocommerce-info,
html body.woocommerce-account .woocommerce-error {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-radius: 8px !important;
  color: rgba(255, 255, 255, 0.8) !important;
  padding: 16px 20px !important;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
html body.woocommerce-account .woocommerce-message::before,
html body.woocommerce-account .woocommerce-info::before {
  color: var(--color-accent, #39fff5) !important;
}
html body.woocommerce-account .woocommerce-error {
  border-color: rgba(248, 113, 113, 0.3) !important;
}
html body.woocommerce-account .woocommerce-error::before {
  color: #f87171 !important;
}
html body.woocommerce-account .woocommerce-message .button,
html body.woocommerce-account .woocommerce-info .button {
  margin-top: 0 !important;
  flex-shrink: 0;
}

/* Fieldset / legend in my-account */
html body.woocommerce-account fieldset {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  padding: 20px !important;
  margin-top: 24px;
}
html body.woocommerce-account legend {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 14px;
  padding: 0 8px;
}

/* ---- My Account Mobile ---- */
@media (max-width: 768px) {
  html body.woocommerce-account .site-main,
  html body.woocommerce-account.hello-elementor-default .site-main,
  html body:not([class*=elementor-page-]).woocommerce-account .site-main {
    padding: 20px 16px !important;
  }

  /* Navigation: horizontal scroll */
  html body.woocommerce-account .woocommerce-MyAccount-navigation {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: 20px;
  }
  html body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 12px;
  }
  html body.woocommerce-account .woocommerce-MyAccount-navigation ul::-webkit-scrollbar {
    display: none;
  }
  html body.woocommerce-account .woocommerce-MyAccount-navigation li a {
    padding: 12px 16px;
    font-size: 13px;
  }

  /* Content */
  html body.woocommerce-account .woocommerce-MyAccount-content {
    padding: 20px 16px;
    border-radius: 8px;
  }

  /* Login form */
  body.woocommerce-account .woocommerce-form-login {
    padding: 24px 20px;
  }

  /* Login page: stack, hide left logo panel */
  html body.woocommerce-account:not(.logged-in) .site-main {
    flex-direction: column !important;
    min-height: auto !important;
  }
  html body.woocommerce-account:not(.logged-in) .site-main::before {
    flex: 0 0 auto;
    height: 120px;
    background-size: 160px auto;
  }
  html body.woocommerce-account:not(.logged-in) .page-content,
  html body.woocommerce-account:not(.logged-in) .entry-content {
    flex: 1 !important;
    max-width: 100% !important;
    padding: 24px 20px !important;
  }
}

/* ============================================
   Side Cart Drawer
   ============================================ */
.academy-new-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.academy-new-header__cart-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  position: relative;
  padding: 8px;
}
.academy-new-header__cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: #39fff5;
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Overlay */
.academy-side-cart { display: none; }
.academy-side-cart.is-open { display: block; }
.academy-side-cart__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}

/* Panel */
.academy-side-cart__panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: #2c343b;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.academy-side-cart.is-open .academy-side-cart__panel {
  transform: translateX(0);
}

.academy-side-cart__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.academy-side-cart__header h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.academy-side-cart__close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.academy-side-cart__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  color: #e0e0e0;
}
/* Style WC widget cart inside side cart */
.academy-side-cart__body .widget_shopping_cart_content {
  color: #e0e0e0;
}
.academy-side-cart__body .woocommerce-mini-cart {
  list-style: none;
  padding: 0;
  margin: 0;
}
.academy-side-cart__body .woocommerce-mini-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.academy-side-cart__body .woocommerce-mini-cart-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}
.academy-side-cart__body .woocommerce-mini-cart-item a:not(.remove) {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
.academy-side-cart__body .woocommerce-mini-cart-item .remove {
  color: rgba(255,255,255,0.4);
  font-size: 20px;
  text-decoration: none;
}
.academy-side-cart__body .woocommerce-mini-cart__total {
  padding: 16px 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.academy-side-cart__body .woocommerce-mini-cart__total .woocommerce-Price-amount {
  color: #39fff5;
}
.academy-side-cart__body .woocommerce-mini-cart__empty-message {
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 40px 0;
}
/* Hide default widget buttons (we have our own in footer) */
.academy-side-cart__body .woocommerce-mini-cart__buttons { display: none; }

.academy-side-cart__footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.academy-side-cart__btn {
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.academy-side-cart__btn--cart {
  background: transparent;
  color: #39fff5;
  border: 1px solid #39fff5;
}
.academy-side-cart__btn--cart:hover {
  background: rgba(57,255,245,0.1);
  color: #39fff5;
}
.academy-side-cart__btn--checkout {
  background: #39fff5;
  color: #1a1a1a;
  border: none;
}
.academy-side-cart__btn--checkout:hover {
  opacity: 0.9;
  color: #1a1a1a;
}

/* ============================================
   Return to Shop button — 移除漸層背景，改為 outline 風格
   （比照 B 站 .btn-outline 設計系統）
   ============================================ */
body.academy-new-cart-page .return-to-shop a.button,
body.academy-new-cart-page .return-to-shop a.button.wc-backward,
body.woocommerce-cart .return-to-shop a.button,
body.woocommerce-cart .return-to-shop a.button.wc-backward {
  background: transparent !important;
  background-image: none !important;
  background-color: transparent !important;
  border: 1px solid #39fff5 !important;
  border-radius: 8px !important;
  color: #39fff5 !important;
  box-shadow: none !important;
  padding: 12px 28px !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  transform: none !important;
}

body.academy-new-cart-page .return-to-shop a.button:hover,
body.academy-new-cart-page .return-to-shop a.button.wc-backward:hover,
body.woocommerce-cart .return-to-shop a.button:hover,
body.woocommerce-cart .return-to-shop a.button.wc-backward:hover {
  background: #39fff5 !important;
  background-color: #39fff5 !important;
  background-image: none !important;
  color: #1a1a1a !important;
  border-color: #39fff5 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Return-to-shop 容器：移除半透明背景 + 白邊框，按鈕浮在純背景上 */
body.academy-new-cart-page .return-to-shop,
body.woocommerce-cart .return-to-shop {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-top: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* ============================================
   隱藏 WC「更新購物車」按鈕（已改即時同步）
   +/- 強制圓形透明邊框（蓋過父主題 yellow .button）
   尺寸對照圖按鈕青色（B 站風格）
   ============================================ */
body.academy-new-cart-page button[name="update_cart"],
body.academy-new-cart-page input[name="update_cart"] {
  display: none !important;
}

body.academy-new-cart-page .academy-qty__btn,
body.academy-new-checkout-page .academy-qty__btn {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  color: #fff !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  box-shadow: none !important;
  text-shadow: none !important;
  padding: 0 !important;
}
body.academy-new-cart-page .academy-qty__btn:hover,
body.academy-new-checkout-page .academy-qty__btn:hover {
  background: #fff !important;
  background-color: #fff !important;
  color: #1a1a1a !important;
  border-color: #fff !important;
}

body.academy-new-cart-page .woocommerce-cart-form .quantity input.qty {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
}

/* 尺寸對照圖按鈕：B 站青色 outline */
body.academy-new-checkout-page .size-chart-btn,
body.academy-new-checkout-page .size-chart-button-field button,
body.academy-new-checkout-page .size-chart-button-field a.button,
body.academy-new-checkout-page #billing_size_chart_button_field button {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 1px solid #39fff5 !important;
  color: #39fff5 !important;
  border-radius: 8px !important;
  padding: 12px 24px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
body.academy-new-checkout-page .size-chart-btn:hover,
body.academy-new-checkout-page .size-chart-button-field button:hover,
body.academy-new-checkout-page .size-chart-button-field a.button:hover {
  background: #39fff5 !important;
  background-color: #39fff5 !important;
  color: #1a1a1a !important;
}

/* ============================================
   結帳頁訂單摘要：商品圖 80x80 方形 cover
   ============================================ */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table .cart_item .product-name img,
body.academy-new-checkout-page table.shop_table .cart_item img {
  width: 80px !important;
  height: 80px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin-right: 12px !important;
}

/* ============================================
   原價刪除線 (新版 cart / checkout 由 prepend_regular_price filter 輸出)
   ============================================ */
body.academy-new-cart-page .academy-cart-regular-price,
body.academy-new-checkout-page .academy-cart-regular-price {
  color: #888 !important;
  text-decoration: line-through !important;
  margin-right: 8px !important;
  font-weight: 400 !important;
  display: inline-block;
}
body.academy-new-cart-page .academy-cart-regular-price .woocommerce-Price-amount,
body.academy-new-checkout-page .academy-cart-regular-price .woocommerce-Price-amount {
  color: #888 !important;
  text-decoration: line-through !important;
}

/* ============================================
   購物車單價欄隱藏（避免和小計重複） + 特價青色強調
   ============================================ */
body.academy-new-cart-page .woocommerce-cart-form table.shop_table td.product-price,
body.academy-new-cart-page .woocommerce-cart-form table.shop_table th.product-price {
  display: none !important;
}

/* 價格上下兩行 + 底部對齊（與圖片底邊齊高） */
body.academy-new-cart-page td.product-subtotal {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: flex-end !important;
  align-self: stretch !important;
  text-align: right !important;
  gap: 4px !important;
}

/* 上行：原價（含「原價」前綴）灰色刪除線 */
body.academy-new-cart-page td.product-subtotal .academy-cart-regular-price {
  display: block !important;
  color: #888 !important;
  font-weight: 400 !important;
  font-size: 14px !important;
  margin-right: 0 !important;
  text-decoration: none !important;
}
body.academy-new-cart-page td.product-subtotal .academy-cart-regular-price__label {
  color: #888 !important;
  margin-right: 6px !important;
  text-decoration: none !important;
}
body.academy-new-cart-page td.product-subtotal .academy-cart-regular-price .woocommerce-Price-amount,
body.academy-new-cart-page td.product-subtotal .academy-cart-regular-price bdi {
  color: #888 !important;
  text-decoration: line-through !important;
}

/* 下行：特價青色強調 */
body.academy-new-cart-page td.product-subtotal > .woocommerce-Price-amount,
body.academy-new-cart-page td.product-subtotal > bdi,
body.academy-new-cart-page td.product-subtotal > .woocommerce-Price-amount bdi {
  color: #39fff5 !important;
  font-weight: 700 !important;
  font-size: 20px !important;
  display: block !important;
  text-decoration: none !important;
}

/* ============================================
   購物車商品 row：商品名 + 場次/身份下拉緊湊化
   ============================================ */
body.academy-new-cart-page table.shop_table td.product-name {
  padding-left: 0 !important;
  color: #39FFF5 !important;
}
/* 商品標題：純文字 + 連結 + strong 全部統一重點色 */
body.academy-new-cart-page table.shop_table td.product-name,
body.academy-new-cart-page table.shop_table td.product-name a,
body.academy-new-cart-page table.shop_table td.product-name a:hover,
body.academy-new-cart-page table.shop_table td.product-name a:link,
body.academy-new-cart-page table.shop_table td.product-name a:visited,
body.academy-new-cart-page table.shop_table td.product-name strong,
body.academy-new-cart-page table.shop_table td.product-name strong a {
  color: #39FFF5 !important;
  font-weight: 600 !important;
}
/* 例外：刪除按鈕、場次選擇器 label、quantity 數字、加購前綴 → 不套重點色 */
body.academy-new-cart-page table.shop_table td.product-name .academy-checkout-remove-btn,
body.academy-new-cart-page table.shop_table td.product-name .academy-remove-btn,
body.academy-new-cart-page table.shop_table td.product-name .academy-cart-select-label,
body.academy-new-cart-page table.shop_table td.product-name .academy-cart-selects label,
body.academy-new-cart-page table.shop_table td.product-name .product-quantity {
  color: rgba(255,255,255,0.7) !important;
}
body.academy-new-cart-page table.shop_table td.product-name .academy-addon-cart-prefix {
  color: #39FFF5 !important;
}
/* (B-7 #2) 場次/身份下拉容器：垂直堆疊 + 左側對齊商品標題 */
body.academy-new-cart-page table.shop_table .academy-cart-selects {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  margin: 8px 0 0 0 !important;
  padding-left: 0 !important;
}
/* (B-7 #2) 單一下拉 wrap：寬度固定 360px（不再有左側 label，select 直接 placeholder）*/
body.academy-new-cart-page table.shop_table .academy-cart-selects .academy-batch-select-wrap,
body.academy-new-cart-page table.shop_table .academy-cart-selects .academy-identity-select-wrap {
  display: block !important;
  flex: 0 0 auto !important;
  width: 360px !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
body.academy-new-cart-page table.shop_table .academy-cart-selects .academy-batch-select,
body.academy-new-cart-page table.shop_table .academy-cart-selects .academy-identity-select {
  width: 100% !important;
  display: block !important;
}
body.academy-new-cart-page table.shop_table .academy-cart-select-label {
  display: inline-block !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
body.academy-new-cart-page table.shop_table .academy-batch-select,
body.academy-new-cart-page table.shop_table .academy-identity-select {
  flex: 1 1 auto !important;
}
/* (B-7) 購物車所有商品 row：移除全部分隔線（top + bottom + left + right） */
html body.academy-new-cart-page table.shop_table tbody tr.cart_item,
html body.academy-new-cart-page table.shop_table tbody tr.cart_item td,
html body.academy-new-cart-page table.shop_table tbody tr.cart_item > td {
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}
/* (B-7 #2) 商品縮圖強制 1:1，避免長條形商品圖跑掉比例 */
body.academy-new-cart-page table.shop_table td.product-thumbnail,
body.academy-new-cart-page table.shop_table td.product-thumbnail a {
  display: inline-block !important;
}
body.academy-new-cart-page table.shop_table td.product-thumbnail img {
  width: 140px !important;
  height: 140px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  display: block !important;
}
/* (B-7) 加購商品在購物車的 dl.variation 顯示「商品類型: 加購商品」隱藏 */
body.academy-new-cart-page table.shop_table td.product-name dl.variation:has(.academy-addon-tag) {
  display: none !important;
}

/* ============================================
   加購卡 grid：寬度 300px / 高等比 / 自動換行
   每組最多 4 張（PHP 已限制）
   ============================================ */
body.academy-new-cart-page .academy-recommendations__grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, 300px) !important;
  gap: 16px !important;
  overflow: visible !important;
  scroll-snap-type: none !important;
  justify-content: flex-start !important;
}
body.academy-new-cart-page .academy-rec-card {
  flex: none !important;
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  scroll-snap-align: none !important;
  /* 2026-05-25 B-16.BW #63：強制直式 layout（圖→名→價→按鈕，上往下） */
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
  padding: 8px !important;
  box-sizing: border-box !important;
}
body.academy-new-cart-page .academy-rec-card__name {
  font-size: 13px !important;
  line-height: 1.3 !important;
  min-height: 2.6em !important;
}
body.academy-new-cart-page .academy-rec-card__price-orig {
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.6) !important;
}
body.academy-new-cart-page .academy-rec-card__price-sale {
  font-size: 14px !important;
}
body.academy-new-cart-page .academy-rec-card__btn {
  padding: 8px 4px !important;
  font-size: 12px !important;
}
body.academy-new-cart-page .academy-rec-card__btn .acad-cd-text {
  font-size: 12px !important;
}
/* 2026-05-25 B-16.BW #63.C2：電腦版 5×2 grid 一頁 10 卡 carousel（prev/next 切頁） */
@media (min-width: 769px) {
  body.academy-new-cart-page .academy-rec-carousel {
    padding: 0 56px !important;
    position: relative !important;
  }
  body.academy-new-cart-page .academy-rec-carousel__viewport {
    overflow: hidden !important;
    width: 100% !important;
  }
  /* track 用 grid 2-row × auto-flow column，卡片自動 fill 2 排 */
  /* 2026-05-29：grid-auto-columns 從 200px 改 240px（user 要求統一卡片寬 240px） */
  body.academy-new-cart-page .academy-rec-carousel__track {
    display: grid !important;
    grid-template-rows: repeat(2, auto) !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 240px !important;
    gap: 12px !important;
    transition: transform 0.4s ease !important;
  }
  body.academy-new-cart-page .academy-rec-carousel__nav {
    display: flex !important;
  }
  body.academy-new-cart-page .academy-rec-card__price {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 6px !important;
  }
}

/* B-16.BW #63.B (2026-05-25)：加購卡 badge 改頂部表頭（不再 absolute 在圖上） */
body.academy-new-cart-page .academy-rec-card__badge {
  position: static !important;
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  padding: 4px 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 4px 4px 0 0 !important;
  margin: -8px -8px 4px -8px !important;
  /* 維持原配色（cyan badge 樣式） */
  background: #39fff5 !important;
  color: #000 !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
}
body.academy-new-cart-page .academy-rec-card__img {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
}
body.academy-new-cart-page .academy-rec-card__img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
body.academy-new-cart-page .academy-rec-card__name {
  font-size: 13px !important;
  line-height: 1.4 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  min-height: 2.8em !important;
  text-align: left !important;
  margin: 0 !important;
}
body.academy-new-cart-page .academy-rec-card__price {
  align-items: flex-start !important;
  text-align: left !important;
  margin: 0 !important;
}
body.academy-new-cart-page .academy-rec-card__price-orig {
  font-size: 12px !important;
}
body.academy-new-cart-page .academy-rec-card__price-sale {
  font-size: 16px !important;
}
body.academy-new-cart-page .academy-rec-card__btn {
  width: 100% !important;
  padding: 8px 4px !important;
  font-size: 12px !important;
  margin: 0 !important;
}
body.academy-new-cart-page .academy-rec-card__btn .acad-cd-text {
  font-size: 12px !important;
}
/* 既有 grid template 用 300px 寫死 → 改成 170px */
body.academy-new-cart-page .academy-recommendations__grid {
  grid-template-columns: repeat(auto-fill, 170px) !important;
}

/* ============================================
   加購卡內價格：上下分行（原價 → 特價）+ 顏色強調
   ============================================ */
.academy-rec-card__price {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  text-align: center !important;
  align-items: center !important;
}
.academy-rec-card__price-orig {
  display: block !important;
  color: #888 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  text-decoration: line-through !important;
}
.academy-rec-card__price-sale {
  display: block !important;
  color: #39fff5 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

/* ============================================
   加購 Carousel：4 張可見 / 左右箭頭 / Loop
   箭頭使用 .academy-qty__btn 風格（圓形透明邊框）
   ============================================ */
body.academy-new-cart-page .academy-rec-carousel,
body.academy-new-checkout-page .academy-rec-carousel {
  position: relative !important;
  padding: 0 56px !important;
}

body.academy-new-cart-page .academy-rec-carousel__viewport,
body.academy-new-checkout-page .academy-rec-carousel__viewport {
  overflow: hidden !important;
  width: 100% !important;
}

body.academy-new-cart-page .academy-rec-carousel__track,
body.academy-new-checkout-page .academy-rec-carousel__track {
  display: flex !important;
  gap: 16px !important;
  transition: transform 0.4s ease !important;
}

/* 4 張卡片可見：(100% - 3*16px gap) / 4 */
body.academy-new-cart-page .academy-rec-carousel__track .academy-rec-card,
body.academy-new-checkout-page .academy-rec-carousel__track .academy-rec-card {
  flex: 0 0 calc((100% - 48px) / 4) !important;
  width: calc((100% - 48px) / 4) !important;
  min-width: 0 !important;
  max-width: none !important;
  scroll-snap-align: none !important;
}

/* 箭頭按鈕（同 .academy-qty__btn 風格） */
body.academy-new-cart-page .academy-rec-carousel__nav,
body.academy-new-checkout-page .academy-rec-carousel__nav {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: #fff !important;
  font-size: 22px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  z-index: 2 !important;
  box-shadow: none !important;
}
body.academy-new-cart-page .academy-rec-carousel__nav:hover,
body.academy-new-checkout-page .academy-rec-carousel__nav:hover {
  background: #fff !important;
  background-color: #fff !important;
  color: #1a1a1a !important;
  border-color: #fff !important;
}
body.academy-new-cart-page .academy-rec-carousel__nav--prev,
body.academy-new-checkout-page .academy-rec-carousel__nav--prev {
  left: 0 !important;
}
body.academy-new-cart-page .academy-rec-carousel__nav--next,
body.academy-new-checkout-page .academy-rec-carousel__nav--next {
  right: 0 !important;
}

/* 卡片不足 4 張時隱藏箭頭 */
body.academy-new-cart-page .academy-rec-carousel.is-no-loop .academy-rec-carousel__nav,
body.academy-new-checkout-page .academy-rec-carousel.is-no-loop .academy-rec-carousel__nav {
  display: none !important;
}

/* ============================================
   結帳頁訂單摘要：商品列改新佈局
   - 圖片左、標題右
   - 第二排：數量x1 / 原價（刪除線）/ 折扣後價格
   - 刪除按鈕：右上角圓形（同 .academy-qty__btn 風格）
   ============================================ */
/* 結帳頁訂單摘要商品列：圖 80x80 float left、文字流式包圍 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item {
  position: relative !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
  padding: 16px 50px 16px 12px !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  vertical-align: top !important;
  display: block !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name::after {
  content: '';
  display: block;
  clear: both;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name img {
  width: 80px !important;
  height: 80px !important;
  float: left !important;
  margin: 0 12px 8px 0 !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  display: block !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name a {
  display: inline !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .product-quantity {
  display: inline-block !important;
  color: rgba(255,255,255,0.7) !important;
  font-size: 14px !important;
  margin-left: 8px !important;
  font-weight: 400 !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-cart-selects {
  margin-left: 92px !important;
  margin-top: 6px !important;
  clear: none !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
  text-align: right !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  padding: 16px 0 !important;
}

/* 結帳頁原價 + 特價 */
body.academy-new-checkout-page .academy-cart-regular-price {
  color: #888 !important;
  text-decoration: line-through !important;
  font-size: 13px !important;
  margin-right: 6px !important;
  font-weight: 400 !important;
}
body.academy-new-checkout-page .academy-cart-regular-price__label {
  color: #888 !important;
  margin-right: 4px !important;
  text-decoration: none !important;
}
body.academy-new-checkout-page td.product-total > .woocommerce-Price-amount,
body.academy-new-checkout-page td.product-total > bdi {
  color: #39fff5 !important;
  font-weight: 700 !important;
  font-size: 16px !important;
}

/* 刪除按鈕：右上角圓形 .academy-qty__btn 風格 */
body.academy-new-checkout-page .academy-checkout-remove-btn {
  position: absolute !important;
  top: 12px !important;
  right: 8px !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  background: transparent !important;
  background-color: transparent !important;
  color: #fff !important;
  font-size: 16px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  z-index: 2 !important;
}
body.academy-new-checkout-page .academy-checkout-remove-btn:hover {
  background: #fff !important;
  background-color: #fff !important;
  color: #1a1a1a !important;
  border-color: #fff !important;
}

/* ============================================
   結帳頁加購卡：圖左、右側上下兩排
   - 上排：標題（一行）
   - 下排：原價（刪除線）+ 折扣後價格
   - CTA「立即加購」固定右下、文字大一點
   - 右側內容高 = 圖片高
   ============================================ */
body.academy-new-checkout-page .academy-rec-card {
  position: relative !important;
}
body.academy-new-checkout-page .academy-rec-card__row {
  display: flex !important;
  align-items: stretch !important;
  gap: 12px !important;
}
body.academy-new-checkout-page .academy-rec-card__img {
  flex: 0 0 100px !important;
  width: 100px !important;
  height: 100px !important;
  aspect-ratio: 1 / 1 !important;
}
body.academy-new-checkout-page .academy-rec-card__body {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-width: 0 !important;
  min-height: 100px !important;
}
body.academy-new-checkout-page .academy-rec-card__name {
  display: block !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: left !important;
}
body.academy-new-checkout-page .academy-rec-card__bottom {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
}
body.academy-new-checkout-page .academy-rec-card__price {
  display: flex !important;
  flex-direction: row !important;
  align-items: baseline !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}
body.academy-new-checkout-page .academy-rec-card__price-orig {
  color: #888 !important;
  font-size: 12px !important;
  text-decoration: line-through !important;
  font-weight: 400 !important;
}
body.academy-new-checkout-page .academy-rec-card__price-sale {
  color: #39fff5 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}
body.academy-new-checkout-page .academy-rec-card__btn {
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 10px 20px !important;
}

/* 結帳頁 carousel 同樣 4 卡可見（複用購物車 CSS，但 padding 縮小） */
body.academy-new-checkout-page .academy-rec-carousel {
  padding: 0 48px !important;
}

/* ============================================
   Carousel 修正：卡片填滿容器 / 箭頭外推
   ============================================ */
body.academy-new-cart-page .academy-rec-carousel,
body.academy-new-checkout-page .academy-rec-carousel {
  padding: 0 !important;
  margin: 0 !important;
}
body.academy-new-cart-page .academy-rec-carousel__nav--prev,
body.academy-new-checkout-page .academy-rec-carousel__nav--prev {
  left: -56px !important;
}
body.academy-new-cart-page .academy-rec-carousel__nav--next,
body.academy-new-checkout-page .academy-rec-carousel__nav--next {
  right: -56px !important;
}

/* 確保 academy-recommendations 有左右間距讓箭頭顯示 */
body.academy-new-cart-page .academy-recommendations,
body.academy-new-checkout-page .academy-recommendations {
  padding: 0 56px !important;
  position: relative !important;
}

/* ============================================
   購物車總計區塊：兩欄 grid（折價券左 / 小計總計右）
   ============================================ */
body.academy-new-cart-page .cart_totals {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 40px 60px !important;
  align-items: start !important;
}
body.academy-new-cart-page .cart_totals > h2 {
  grid-column: 1 / -1 !important;
  margin-bottom: 0 !important;
}
body.academy-new-cart-page .cart_totals > .academy-coupon-section {
  grid-column: 1 !important;
  grid-row: 2 !important;
  margin: 0 !important;
}
body.academy-new-cart-page .cart_totals > table.shop_table {
  grid-column: 2 !important;
  grid-row: 2 !important;
  margin: 0 !important;
}
body.academy-new-cart-page .cart_totals > .wc-proceed-to-checkout {
  grid-column: 2 !important;
  grid-row: 3 !important;
  margin: 0 !important;
}

/* RWD：手機改單欄 */
@media (max-width: 768px) {
  body.academy-new-cart-page .cart_totals {
    grid-template-columns: 1fr !important;
  }
  body.academy-new-cart-page .cart_totals > * {
    grid-column: 1 !important;
  }
  body.academy-new-cart-page .academy-rec-carousel__nav--prev {
    left: -10px !important;
  }
  body.academy-new-cart-page .academy-rec-carousel__nav--next {
    right: -10px !important;
  }
  body.academy-new-cart-page .academy-recommendations {
    padding: 0 30px !important;
  }
}

/* ============================================
   結帳頁加購 Carousel：容器較窄，每次顯示 2 張（覆寫 4 張）
   ============================================ */
body.academy-new-checkout-page .academy-rec-carousel__track .academy-rec-card {
  flex: 0 0 calc((100% - 16px) / 2) !important;
  width: calc((100% - 16px) / 2) !important;
}

/* badge 強制 nowrap、不超寬 */
body.academy-new-checkout-page .academy-rec-card__top-badge,
body.academy-new-cart-page .academy-rec-card__badge {
  white-space: nowrap !important;
  max-width: max-content !important;
  width: auto !important;
}

/* ============================================
   結帳輸入框：已填寫狀態 + 一般狀態 黑色 40% 背景
   ============================================ */
body.academy-new-checkout-page .form-row input.input-text,
body.academy-new-checkout-page .form-row textarea,
body.academy-new-checkout-page .form-row select,
body.academy-new-checkout-page .form-row .select2-selection {
  background: rgba(0,0,0,0.4) !important;
  background-color: rgba(0,0,0,0.4) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  color: #fff !important;
}
/* B-16.AZ 2026-05-18：hover/focus 合併 — 兩態都 cyan #39FFF5 2px + bg 變暗 20%（0.40 → 0.60）
   高 specificity selector 列舉所有可能 path，蓋過 .acad-name-row > .form-row input.input-text
   等局部 rule（line 8350）。實際完整版見檔尾 B-16.AZ-FINAL 區塊 */

/* B-16.AZ 2026-05-18：拿掉 woocommerce-invalid 紅色外框（改用一般框色，不視覺懲罰 user） */
body.academy-new-checkout-page .form-row.woocommerce-invalid input.input-text,
body.academy-new-checkout-page .form-row.woocommerce-invalid select,
body.academy-new-checkout-page .form-row.woocommerce-invalid textarea,
body.academy-new-checkout-page .form-row.woocommerce-invalid-required-field input.input-text,
body.academy-new-checkout-page .form-row.woocommerce-invalid-required-field select,
body.academy-new-checkout-page .form-row.woocommerce-invalid-required-field textarea {
  border: 1px solid rgba(255,255,255,0.12) !important;
}
body.academy-new-checkout-page .form-row input.input-text::placeholder {
  color: rgba(255,255,255,0.4) !important;
}

/* ============================================
   身分證字號 segmented control
   - 容器半透明背景襯底
   - 「台灣／海外」單選按鈕變左右切換
   ============================================ */
body.academy-new-checkout-page #billing_region_field,
body.academy-new-checkout-page #billing_member2_region_field {
  background: rgba(0,0,0,0.25) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 12px !important;
  padding: 16px !important;
}
body.academy-new-checkout-page #billing_region_field > label,
body.academy-new-checkout-page #billing_member2_region_field > label {
  margin-bottom: 12px !important;
  display: block !important;
  font-weight: 600 !important;
}
body.academy-new-checkout-page #billing_region_field .woocommerce-input-wrapper,
body.academy-new-checkout-page #billing_member2_region_field .woocommerce-input-wrapper {
  display: inline-flex !important;
  background: rgba(0,0,0,0.4) !important;
  border-radius: 30px !important;
  padding: 4px !important;
  gap: 0 !important;
}
body.academy-new-checkout-page #billing_region_field input[type="radio"],
body.academy-new-checkout-page #billing_member2_region_field input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}
body.academy-new-checkout-page #billing_region_field label.radio,
body.academy-new-checkout-page #billing_member2_region_field label.radio {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 10px 24px !important;
  border-radius: 30px !important;
  cursor: pointer !important;
  color: rgba(255,255,255,0.6) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  transition: background 0.2s, color 0.2s !important;
  white-space: nowrap !important;
}
body.academy-new-checkout-page #billing_region_field input[type="radio"]:checked + label,
body.academy-new-checkout-page #billing_member2_region_field input[type="radio"]:checked + label,
body.academy-new-checkout-page #billing_region_field label.radio:has(input:checked),
body.academy-new-checkout-page #billing_member2_region_field label.radio:has(input:checked) {
  background: transparent !important;
  color: #1a1a1a !important;
}

/* ============================================
   T-shirt 三欄位同排（強制水平）
   ============================================ */
body.academy-new-checkout-page .academy-tshirt-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  align-items: flex-end !important;
  margin-top: 12px !important;
}
body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_gender_field,
body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_size_field,
body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field,
body.academy-new-checkout-page .academy-tshirt-row.member2-tshirt-row > #billing_member2_tshirt_gender_field,
body.academy-new-checkout-page .academy-tshirt-row.member2-tshirt-row > #billing_member2_tshirt_size_field,
body.academy-new-checkout-page .academy-tshirt-row.member2-tshirt-row > .member2-size-chart-button-field {
  position: static !important;
  flex: 1 1 auto !important;
  width: auto !important;
  margin: 0 !important;
}
body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field,
body.academy-new-checkout-page .academy-tshirt-row > .member2-size-chart-button-field {
  flex: 0 0 auto !important;
}

/* ============================================
   結帳頁全域：欄位統一 black 20% 背景、8px 圓角、20px 間距
   ============================================ */
body.academy-new-checkout-page form.checkout .form-row {
  margin-bottom: 20px !important;
}
body.academy-new-checkout-page .form-row input.input-text,
body.academy-new-checkout-page .form-row textarea,
body.academy-new-checkout-page .form-row select,
body.academy-new-checkout-page .select2-container .select2-selection,
body.academy-new-checkout-page .select2-container--default .select2-selection--single {
  background: rgba(0,0,0,0.2) !important;
  background-color: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  color: #fff !important;
  padding: 12px 14px !important;
  height: auto !important;
  min-height: 44px !important;
}
body.academy-new-checkout-page .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #fff !important;
  line-height: 1.4 !important;
  padding: 0 !important;
}
body.academy-new-checkout-page .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100% !important;
  top: 0 !important;
  right: 8px !important;
}
body.academy-new-checkout-page .form-row input.input-text:focus,
body.academy-new-checkout-page .form-row textarea:focus,
body.academy-new-checkout-page .form-row select:focus {
  border-color: rgba(57,255,245,0.5) !important;
  outline: none !important;
}

/* ============================================
   身分證 segmented：移除半透明背景容器、寬度等於內容寬
   ============================================ */
body.academy-new-checkout-page #billing_region_field,
body.academy-new-checkout-page #billing_member2_region_field {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}
body.academy-new-checkout-page #billing_region_field > label,
body.academy-new-checkout-page #billing_member2_region_field > label {
  margin-bottom: 12px !important;
  display: block !important;
  font-weight: 600 !important;
}
body.academy-new-checkout-page #billing_region_field .woocommerce-input-wrapper,
body.academy-new-checkout-page #billing_member2_region_field .woocommerce-input-wrapper {
  display: inline-flex !important;
  background: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  padding: 4px !important;
  width: auto !important;
  max-width: 100% !important;
}
body.academy-new-checkout-page #billing_region_field input[type="radio"],
body.academy-new-checkout-page #billing_member2_region_field input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}
body.academy-new-checkout-page #billing_region_field label.radio,
body.academy-new-checkout-page #billing_member2_region_field label.radio {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 8px 20px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  color: rgba(255,255,255,0.6) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  transition: background 0.2s, color 0.2s !important;
  white-space: nowrap !important;
}
body.academy-new-checkout-page #billing_region_field input[type="radio"]:checked + label,
body.academy-new-checkout-page #billing_member2_region_field input[type="radio"]:checked + label,
body.academy-new-checkout-page #billing_region_field label.radio:has(input:checked),
body.academy-new-checkout-page #billing_member2_region_field label.radio:has(input:checked) {
  background: transparent !important;
  color: #1a1a1a !important;
}

/* 對應的填寫欄位寬度限制：跟 segmented 同寬（半欄） */
body.academy-new-checkout-page #billing_tw_id_number_field,
body.academy-new-checkout-page #billing_passport_number_field,
body.academy-new-checkout-page #billing_member2_tw_id_number_field,
body.academy-new-checkout-page #billing_member2_passport_number_field {
  width: 50% !important;
  max-width: 320px !important;
}

/* ============================================
   T-shirt 版型 segmented control（男版/女版）
   ============================================ */
body.academy-new-checkout-page #billing_tshirt_gender_field .woocommerce-input-wrapper,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field .woocommerce-input-wrapper {
  display: inline-flex !important;
  background: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  padding: 4px !important;
  width: auto !important;
  max-width: 100% !important;
}
body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"],
body.academy-new-checkout-page #billing_member2_tshirt_gender_field input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}
body.academy-new-checkout-page #billing_tshirt_gender_field label.radio,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 8px 20px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  color: rgba(255,255,255,0.6) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  white-space: nowrap !important;
}
body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"]:checked + label,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field input[type="radio"]:checked + label,
body.academy-new-checkout-page #billing_tshirt_gender_field label.radio:has(input:checked),
body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio:has(input:checked) {
  background: transparent !important;
  color: #1a1a1a !important;
}

/* T-shirt 版型容器跟 segmented 同寬（不要 48% 全寬） */
body.academy-new-checkout-page #billing_tshirt_gender_field,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field {
  width: auto !important;
  flex: 0 0 auto !important;
}

/* ============================================
   結帳頁加購區：用 grid 4 卡，無 carousel
   ============================================ */
body.academy-new-checkout-page .academy-recommendations__grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  overflow: visible !important;
  scroll-snap-type: none !important;
  padding: 0 !important;
}
body.academy-new-checkout-page .academy-recommendations__grid .academy-rec-card {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}
body.academy-new-checkout-page .academy-recommendations {
  padding: 0 !important;
}

/* ============================================
   結帳頁訂單摘要商品列再修：強制 block + float 圖
   覆寫之前 flex 衝突
   ============================================ */
body.academy-new-checkout-page table.shop_table tr.cart_item td.product-name {
  display: block !important;
  padding: 16px 50px 16px 12px !important;
  vertical-align: top !important;
  text-align: left !important;
}
body.academy-new-checkout-page table.shop_table tr.cart_item td.product-name::after {
  content: '' !important;
  display: block !important;
  clear: both !important;
}
body.academy-new-checkout-page table.shop_table tr.cart_item td.product-name img {
  width: 80px !important;
  height: 80px !important;
  float: left !important;
  margin: 0 12px 4px 0 !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  display: block !important;
}
body.academy-new-checkout-page table.shop_table tr.cart_item td.product-name a {
  display: inline !important;
  white-space: normal !important;
  word-break: break-word !important;
}

/* ============================================
   結帳頁全域：欄位間距改 10px（覆寫之前的 20px）
   ============================================ */
body.academy-new-checkout-page form.checkout .form-row {
  margin-bottom: 10px !important;
}

/* ============================================
   身分證區塊：region + tw_id + passport 包同一個半透明背景
   （JS wrapIdSection 後產生 .academy-id-section）
   ============================================ */
body.academy-new-checkout-page .academy-id-section {
  background: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 8px !important;
  padding: 16px !important;
  margin-bottom: 10px !important;
}
body.academy-new-checkout-page .academy-id-section > .form-row {
  margin-bottom: 10px !important;
  width: 100% !important;
}
body.academy-new-checkout-page .academy-id-section > .form-row:last-child {
  margin-bottom: 0 !important;
}
/* segmented 區塊內無雙重背景 */
body.academy-new-checkout-page .academy-id-section #billing_region_field,
body.academy-new-checkout-page .academy-id-section #billing_member2_region_field {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* ============================================
   T-shirt 版型 segmented：給容器半透明背景
   ============================================ */
body.academy-new-checkout-page #billing_tshirt_gender_field,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field {
  background: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
}

/* ============================================
   結帳頁訂單摘要商品列：定點修
   實際 HTML：td.product-name = img + remove + name + qty + selects
   - 圖 80x80 float left
   - remove 按鈕 absolute 右上
   - 文字流式包圍圖右
   - 場次選單 padding-left 92px 對齊圖右
   ============================================ */
body.academy-new-checkout-page table.shop_table tr.cart_item td.product-name {
  display: block !important;
  position: relative !important;
  padding: 16px 50px 16px 12px !important;
  text-align: left !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}
body.academy-new-checkout-page table.shop_table tr.cart_item td.product-name::after {
  content: '' !important;
  display: block !important;
  clear: both !important;
}
body.academy-new-checkout-page table.shop_table tr.cart_item td.product-name img {
  width: 80px !important;
  height: 80px !important;
  float: left !important;
  margin: 0 12px 6px 0 !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  display: block !important;
  background: transparent !important;
}
body.academy-new-checkout-page table.shop_table tr.cart_item td.product-name a:not(.academy-checkout-remove-btn) {
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  text-decoration: none !important;
  display: inline !important;
}
body.academy-new-checkout-page table.shop_table tr.cart_item .product-quantity {
  display: inline-block !important;
  color: rgba(255,255,255,0.7) !important;
  font-size: 14px !important;
  margin-left: 6px !important;
  font-weight: 400 !important;
}
body.academy-new-checkout-page table.shop_table tr.cart_item .academy-cart-selects {
  margin-top: 8px !important;
  padding-left: 92px !important;
  clear: none !important;
}
body.academy-new-checkout-page table.shop_table tr.cart_item .academy-cart-selects select {
  height: 36px !important;
  min-height: 36px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
}
body.academy-new-checkout-page .academy-checkout-remove-btn {
  position: absolute !important;
  top: 12px !important;
  right: 8px !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 16px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  z-index: 2 !important;
  margin: 0 !important;
}
body.academy-new-checkout-page .academy-checkout-remove-btn:hover {
  background: #fff !important;
  color: #1a1a1a !important;
  border-color: #fff !important;
}

/* ============================================
   ★ 最終修正 — 覆寫先前衝突規則
   ============================================ */

/* 1. 結帳頁加購區回橫卡（圖左文字右、一張接一張橫排） */
body.academy-new-checkout-page .academy-recommendations__grid {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 10px !important;
  overflow: visible !important;
}
body.academy-new-checkout-page .academy-recommendations__grid .academy-rec-card {
  width: 100% !important;
  flex: 0 0 auto !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* 2. 身分證區塊：直接給三個 form-row 背景，不依賴 JS wrap */
body.academy-new-checkout-page #billing_region_field,
body.academy-new-checkout-page #billing_member2_region_field {
  background: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 8px 8px 0 0 !important;
  padding: 16px 16px 12px !important;
  margin-bottom: 0 !important;
}
body.academy-new-checkout-page #billing_tw_id_number_field,
body.academy-new-checkout-page #billing_passport_number_field,
body.academy-new-checkout-page #billing_member2_tw_id_number_field,
body.academy-new-checkout-page #billing_member2_passport_number_field {
  background: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-top: none !important;
  border-radius: 0 0 8px 8px !important;
  padding: 8px 16px 16px !important;
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
}
/* 填寫欄位全寬 */
body.academy-new-checkout-page #billing_tw_id_number_field input.input-text,
body.academy-new-checkout-page #billing_passport_number_field input.input-text,
body.academy-new-checkout-page #billing_member2_tw_id_number_field input.input-text,
body.academy-new-checkout-page #billing_member2_passport_number_field input.input-text {
  width: 100% !important;
  max-width: 100% !important;
}

/* 3. T-shirt 整區塊（user 2026-05-11 要求移除 background） */
body.academy-new-checkout-page .academy-tshirt-row {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-bottom: 10px !important;
  margin-top: 10px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  align-items: flex-end !important;
}
/* 內部子欄位移除背景（避免雙重背景） */
body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_gender_field,
body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_size_field,
body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field,
body.academy-new-checkout-page .academy-tshirt-row > #billing_member2_tshirt_gender_field,
body.academy-new-checkout-page .academy-tshirt-row > #billing_member2_tshirt_size_field,
body.academy-new-checkout-page .academy-tshirt-row > .member2-size-chart-button-field {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  flex: 1 1 auto !important;
  position: static !important;
}
body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_gender_field,
body.academy-new-checkout-page .academy-tshirt-row > #billing_member2_tshirt_gender_field {
  flex: 0 0 auto !important;
}
body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field,
body.academy-new-checkout-page .academy-tshirt-row > .member2-size-chart-button-field {
  flex: 0 0 auto !important;
}

/* ============================================
   ★ 第二輪修正
   ============================================ */

/* 1. 商品圖強制 80x80（提高 specificity 避免被 attribute 寬高蓋） */
body.academy-new-checkout-page #order_review table.shop_table tr.cart_item td.product-name img,
body.academy-new-checkout-page .woocommerce-checkout-review-order-table .cart_item .product-name img {
  width: 80px !important;
  height: 80px !important;
  max-width: 80px !important;
  min-width: 80px !important;
  max-height: 80px !important;
  min-height: 80px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  float: left !important;
  margin: 0 12px 6px 0 !important;
  display: block !important;
}

/* 2. 加購卡上方 badge 全寬橫條 */
body.academy-new-checkout-page .academy-rec-card__top-badge {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  text-align: center !important;
  padding: 6px 12px !important;
  border-radius: 8px 8px 0 0 !important;
  background: #39fff5 !important;
  color: #1a1a1a !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  margin: 0 !important;
}
body.academy-new-checkout-page .academy-rec-card {
  padding: 0 !important;
  overflow: hidden !important;
}
body.academy-new-checkout-page .academy-rec-card__row {
  padding: 12px !important;
}

/* 3. 身分證 segmented 全寬（兩個按鈕加總 = 容器寬度） */
body.academy-new-checkout-page #billing_region_field .woocommerce-input-wrapper,
body.academy-new-checkout-page #billing_member2_region_field .woocommerce-input-wrapper {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  background: rgba(0,0,0,0.3) !important;
  border-radius: 6px !important;
  padding: 4px !important;
  gap: 4px !important;
}
body.academy-new-checkout-page #billing_region_field label.radio,
body.academy-new-checkout-page #billing_member2_region_field label.radio {
  flex: 1 1 50% !important;
  text-align: center !important;
  justify-content: center !important;
}

/* 4. T-shirt 男版/女版 segmented 加總 30% 寬 */
body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_gender_field,
body.academy-new-checkout-page .academy-tshirt-row > #billing_member2_tshirt_gender_field {
  flex: 0 0 30% !important;
  width: 30% !important;
  max-width: 30% !important;
}
body.academy-new-checkout-page #billing_tshirt_gender_field .woocommerce-input-wrapper,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field .woocommerce-input-wrapper {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 4px !important;
}
body.academy-new-checkout-page #billing_tshirt_gender_field label.radio,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio {
  flex: 1 1 50% !important;
  text-align: center !important;
  justify-content: center !important;
  padding: 8px 12px !important;
}

/* T-shirt 區塊：版型 label 獨佔第一排（標題在左上），欄位橫排在第二排 */
body.academy-new-checkout-page .academy-tshirt-row {
  flex-wrap: wrap !important;
  align-items: stretch !important;
}

/* ============================================
   ★ cart 頁同樣的 td.product-name 佈局（之前只給 checkout）
   ============================================ */
body.academy-new-cart-page table.shop_table tr.cart_item td.product-name,
body.academy-new-cart-page #order_review table.shop_table tr.cart_item td.product-name {
  display: block !important;
  position: relative !important;
  /* 2026-07-17：右 padding 50→12（50px 是為右上絕對定位刪除鈕預留，cart 頁沒有那顆鈕） */
  padding: 16px 12px !important;
  text-align: left !important;
  vertical-align: top !important;
  border-bottom: none !important;
}
body.academy-new-cart-page table.shop_table tr.cart_item td.product-name::after {
  content: '' !important;
  display: block !important;
  clear: both !important;
}
body.academy-new-cart-page table.shop_table tr.cart_item td.product-name img,
body.academy-new-cart-page #order_review table.shop_table tr.cart_item td.product-name img {
  width: 80px !important;
  height: 80px !important;
  max-width: 80px !important;
  min-width: 80px !important;
  max-height: 80px !important;
  min-height: 80px !important;
  float: left !important;
  margin: 0 12px 6px 0 !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  display: block !important;
}
body.academy-new-cart-page table.shop_table tr.cart_item td.product-name a:not(.academy-checkout-remove-btn):not(.academy-remove-btn) {
  color: #39FFF5 !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  text-decoration: none !important;
  display: inline !important;
  white-space: normal !important;
  word-break: break-word !important;
}
body.academy-new-cart-page table.shop_table tr.cart_item .product-quantity {
  display: inline-block !important;
  color: rgba(255,255,255,0.7) !important;
  font-size: 14px !important;
  margin-left: 6px !important;
  font-weight: 400 !important;
}
body.academy-new-cart-page table.shop_table tr.cart_item .academy-cart-selects {
  margin-top: 8px !important;
  padding-left: 0 !important;
  clear: none !important;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: flex-start !important;
  gap: 8px !important;
}
body.academy-new-cart-page table.shop_table tr.cart_item .academy-cart-selects label {
  display: block !important;
  font-size: 13px !important;
  margin-bottom: 4px !important;
  white-space: nowrap !important;
}
body.academy-new-cart-page table.shop_table tr.cart_item .academy-cart-selects select {
  display: block !important;
  width: 100% !important;
  min-width: 180px !important;
  height: 36px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  background: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 6px !important;
  color: #fff !important;
  white-space: normal !important;
}
body.academy-new-cart-page .academy-batch-select-wrap,
body.academy-new-cart-page .academy-identity-select-wrap {
  flex: 0 0 auto !important;
  min-width: 200px !important;
  display: block !important;
}
body.academy-new-cart-page table.shop_table tr.cart_item td.product-total {
  text-align: right !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

/* ============================================
   尺寸對照圖按鈕高度修正（不要全高、跟 input 同高）
   ============================================ */
body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field,
body.academy-new-checkout-page .academy-tshirt-row > .member2-size-chart-button-field {
  align-self: flex-end !important;
  flex: 0 0 auto !important;
}
body.academy-new-checkout-page .academy-tshirt-row .size-chart-btn,
body.academy-new-checkout-page .size-chart-button-field button,
body.academy-new-checkout-page .size-chart-button-field a.button {
  height: auto !important;
  min-height: auto !important;
  padding: 11px 24px !important;
  align-self: flex-end !important;
  border-radius: 8px !important;
}

/* ============================================
   結帳頁訂單摘要 table 溢出修正（2026-04-29）
   根因：`td.product-name { display: block }` 破壞 table cell 佈局
   修法：限定在 .woocommerce-checkout-review-order-table 內，恢復 cell + table-layout: fixed
   範圍：嚴格只動這張表，不影響其他元素
   ============================================ */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table {
  table-layout: fixed !important;
  width: 100% !important;
  max-width: 100% !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table th.product-name,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table td.product-name {
  width: 68% !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table th.product-total,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table td.product-total {
  width: 32% !important;
}
/* 取消之前 display:block 破壞，恢復 table-cell；維持 float img 視覺 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
  display: table-cell !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  position: relative !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name img {
  max-width: 80px !important;
  width: 80px !important;
  height: 80px !important;
  flex-shrink: 0 !important;
}
/* product-total 防溢出：允許數字垂直堆疊在窄畫面 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
  word-break: keep-all !important;
  white-space: normal !important;
  vertical-align: middle !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total .academy-cart-regular-price,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > .woocommerce-Price-amount {
  display: block !important;
}
/* 場次下拉避免內容溢出 cell */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table .academy-cart-selects,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table .academy-batch-select-wrap {
  max-width: 100% !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table .academy-batch-select {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* ============================================
   結帳頁訂單摘要 table 排版接續調整（2026-04-29）
   範圍：仍嚴格限定在 .woocommerce-checkout-review-order-table 內
   調整：thead 視覺輕量化、product-total 原價/特價垂直、tfoot 總計強調、RWD
   ============================================ */

/* thead：細字、cyan 細線分隔 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table thead th {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: rgba(255,255,255,0.7) !important;
  letter-spacing: 0.5px !important;
  padding: 10px 0 !important;
  border-bottom: 1px solid rgba(57,255,245,0.25) !important;
  text-transform: none !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table thead th.product-total {
  text-align: right !important;
}

/* product-name 內：標題、數量、場次 label 統一節奏 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #fff !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .product-quantity {
  color: rgba(255,255,255,0.5) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  margin-left: 6px !important;
  white-space: nowrap !important;
}

/* 場次 label 改 cyan 小字標籤、select 緊湊 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table .academy-cart-select-label {
  font-size: 11px !important;
  color: #39fff5 !important;
  letter-spacing: 0.5px !important;
  font-weight: 600 !important;
  display: block !important;
  margin-bottom: 4px !important;
  text-transform: uppercase !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table .academy-batch-select {
  padding: 8px 32px 8px 12px !important;
  font-size: 13px !important;
  height: auto !important;
}

/* product-total：原價刪除線小字（一行）→ 特價 cyan 大字（一行） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
  text-align: right !important;
  white-space: normal !important;
  vertical-align: middle !important;
  padding: 16px 0 16px 12px !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total .academy-cart-regular-price {
  display: block !important;
  margin-bottom: 4px !important;
  margin-right: 0 !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > .woocommerce-Price-amount {
  display: block !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
}

/* tfoot 小計列輕色 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr th,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr td {
  padding: 12px 0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr.cart-subtotal th,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr.cart-subtotal td {
  font-size: 14px !important;
  color: rgba(255,255,255,0.7) !important;
  font-weight: 500 !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr.cart-subtotal td .woocommerce-Price-amount {
  color: rgba(255,255,255,0.85) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

/* tfoot 總計列：cyan 上邊框 + 強調總額 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr.order-total th,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr.order-total td {
  border-bottom: none !important;
  border-top: 1px solid rgba(57,255,245,0.3) !important;
  padding-top: 16px !important;
  padding-bottom: 4px !important;
  font-size: 17px !important;
  color: #fff !important;
  font-weight: 700 !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr.order-total td strong {
  font-weight: inherit !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr.order-total td .woocommerce-Price-amount {
  color: #39fff5 !important;
  font-size: 22px !important;
  font-weight: 800 !important;
}

/* cart_item 列分隔線稍淡 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td {
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

/* RWD 540px↓：兩欄寬比例放寬給價格、圖片縮 */
@media (max-width: 540px) {
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table th.product-name,
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table td.product-name { width: 60% !important; }
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table th.product-total,
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table td.product-total { width: 40% !important; }
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name img {
    max-width: 64px !important;
    width: 64px !important;
    height: 64px !important;
    margin-right: 10px !important;
  }
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-cart-selects {
    margin-left: 74px !important;
  }
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr.order-total td .woocommerce-Price-amount {
    font-size: 19px !important;
  }
}

/* ============================================
   結帳頁 review-order table 3 排 layout（2026-04-29）
   - tr 變 block；兩 td 垂直堆疊
   - 第 1 排：圖 80x80 | 商品標題（td.product-name 內 float layout）
   - 第 2 排：場次（cart-selects 跨整列）
   - 第 3 排：原價（左）| 折價（右） — td.product-total 變 block + flex
   - 右上：[- N +] 數量按鈕（同 .academy-qty 風格）+ 移除 ×（並排在左）
   - 嚴格 scope 在 .woocommerce-checkout-review-order-table 內
   ============================================ */

/* tr.cart_item 變 block：取消 table row 行為 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item {
  display: block !important;
  position: relative !important;
  padding: 16px !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 兩個 td 都變 block + 全寬 + 0 padding，由 tr 統一 padding */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  border: none !important;
  box-sizing: border-box !important;
  vertical-align: top !important;
  text-align: left !important;
}

/* 第 1 排：圖左 + 標題右（float pattern） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #fff !important;
  padding-right: 130px !important;  /* 留位給右上數量+移除按鈕 */
  min-height: 80px !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name::after {
  content: '';
  display: block;
  clear: both;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name img {
  float: left !important;
  width: 80px !important;
  height: 80px !important;
  margin: 0 12px 0 0 !important;
  border-radius: 8px !important;
  object-fit: cover !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name a:not(.academy-checkout-remove-btn) {
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  display: inline !important;
}
/* 把原本的純文字「× 1」（如果未被取代）藏起來；數量已由 .academy-checkout-qty 顯示在右上 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .product-quantity {
  display: none !important;
}

/* 第 2 排：場次跨整列（清浮動到下一行） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-cart-selects {
  clear: both !important;
  width: 100% !important;
  margin: 12px 0 0 0 !important;
  box-sizing: border-box !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-batch-select-wrap {
  width: 100% !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-batch-select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* 第 3 排：原價（左）| 折價（右） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  margin-top: 14px !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  white-space: normal !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total .academy-cart-regular-price {
  display: inline-flex !important;
  align-items: baseline !important;
  margin: 0 !important;
  font-size: 13px !important;
  color: #888 !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > .woocommerce-Price-amount {
  display: inline-block !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #39fff5 !important;
  white-space: nowrap !important;
}

/* 右上：數量 +/- 按鈕（樣式同新版購物車 .academy-qty） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-checkout-qty {
  position: absolute !important;
  top: 12px !important;
  right: 48px !important;  /* 留位給 remove btn × */
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  z-index: 2 !important;
}
.academy-checkout-qty__btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: background 0.15s, color 0.15s, border-color 0.15s !important;
}
.academy-checkout-qty__btn:hover,
.academy-checkout-qty__btn:active {
  background: #fff !important;
  color: #1a1a1a !important;
  border-color: #fff !important;
}
.academy-checkout-qty__value {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 24px !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #fff !important;
}

/* 移除按鈕：右上角（與數量按鈕並排，居於最右） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-checkout-remove-btn {
  top: 12px !important;
  right: 12px !important;
}

/* RWD 540px↓：圖縮小 + padding 留位調整 */
@media (max-width: 540px) {
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item {
    padding: 14px !important;
  }
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
    padding-right: 0 !important;
    min-height: 0 !important;
  }
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name img {
    width: 64px !important;
    height: 64px !important;
    margin-right: 10px !important;
  }
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name a:not(.academy-checkout-remove-btn) {
    font-size: 14px !important;
  }
  /* 手機版：數量按鈕和移除按鈕往下挪到第三排（避免擋標題） */
}

/* ============================================
   結帳頁 review-order layout v2 修正（2026-04-29）
   - 取消第 1 排右側按鈕區（之前 padding-right: 130px 把標題擠成直書）
   - quantity + remove btn 改放第 3 排左側，跟原價/折價並排
   - 第 1 排：img | title（無 padding 干擾，標題自然 wrap）
   ============================================ */

/* 取消之前留位 padding（第 1 排恢復全寬） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
  padding-right: 0 !important;
  min-height: 0 !important;
}

/* 強制 td.product-name 內任何子元素都不能限制 width（防 ShopEngine wrap 影響） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name * {
  max-width: none !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name img {
  max-width: 80px !important;
}

/* quantity 按鈕 + remove × 從右上絕對定位移除，改為 inline-flex 放在第 3 排 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-checkout-qty {
  position: static !important;
  top: auto !important;
  right: auto !important;
  margin-right: auto !important; /* flex 內推到最左，價格推右 */
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-checkout-remove-btn {
  position: static !important;
  top: auto !important;
  right: auto !important;
  margin-left: 8px !important;
  vertical-align: middle !important;
}

/* 第 3 排重整：[- 1 +] [×] 左 | 原價 灰小字 | 折價 cyan 大字 右 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
  flex-wrap: wrap !important;
  gap: 8px !important;
}
/* 把 quantity + remove 用 ::before pseudo 處理太複雜；改用 JS 把它們搬到 td.product-total 開頭 */

/* 兜底：若 quantity 按鈕還在 product-name 內（JS 還沒移），保持 inline-flex 在標題下方 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .academy-checkout-qty {
  display: inline-flex !important;
  margin: 8px 0 0 92px !important; /* 對齊 img 右側起 */
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .academy-checkout-remove-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 8px 0 0 6px !important;
}

/* ============================================
   結帳頁 review-order layout v3 修正（2026-04-29）
   配合 academy-new-checkout-qty.php 的 wrapProductNameTitle JS：
   標題文字現在被包在 .acad-title-wrap div，可精準控寬度
   ============================================ */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .acad-title-wrap {
  display: block !important;
  margin-left: 92px !important;     /* 80px img + 12px gap */
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #fff !important;
  line-height: 1.4 !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  min-height: 80px !important;       /* 與 img 等高 */
  padding-right: 8px !important;
}

/* 數量 +/- 按鈕：移到第二排（場次上方），inline 顯示在標題下方 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .academy-checkout-qty {
  display: inline-flex !important;
  margin: 8px 0 0 92px !important;
  position: static !important;
  vertical-align: middle !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .academy-checkout-remove-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
  margin-left: 8px !important;
  vertical-align: middle !important;
  width: 28px !important;
  height: 28px !important;
}

/* 強制 td.product-name 不再有 padding-right 留按鈕區（按鈕已 inline） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
  padding-right: 0 !important;
}

/* RWD 540px↓：縮排對齊較小 img */
@media (max-width: 540px) {
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .acad-title-wrap,
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .academy-checkout-qty {
    margin-left: 76px !important;  /* 64 img + 12 gap */
  }
  body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .acad-title-wrap {
    min-height: 64px !important;
    font-size: 14px !important;
  }
}

/* ============================================
   結帳頁 review-order layout v4 修正（2026-04-29）
   配合 academy-new-checkout-qty.php 的 reorderRemoveBtn JS：
   - .academy-checkout-qty + .academy-checkout-remove-btn 並排在標題下方一行
   - td.product-total 強化 flex space-between（原價 | 折價分兩端）
   ============================================ */

/* 數量 + 移除並排：兩者都 inline-flex，配 + 選擇器設間距 */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .academy-checkout-qty + .academy-checkout-remove-btn {
  margin-left: 10px !important;
  margin-top: 8px !important;
  margin-right: 0 !important;
  vertical-align: middle !important;
}

/* 確保 td.product-total 是 flex 且兩端對齊（覆蓋 prior conflicting rules） */
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > .academy-cart-regular-price {
  flex: 0 0 auto !important;
  margin-right: auto !important;  /* 推到最左 */
}
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > .woocommerce-Price-amount,
body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > bdi {
  flex: 0 0 auto !important;
  margin-left: auto !important;  /* 推到最右 */
}

/* ============================================
   結帳頁 review-order 寬度修正 v5（2026-04-29）
   問題：商品清單 table 寬度沒撐滿父容器，跟 academy-recommendations__grid 不一致
   修法：從 #order_review 容器到 table、tbody、tr 一路強制 100% width
   ============================================ */
html body.academy-new-checkout-page #order_review,
html body.academy-new-checkout-page .woocommerce-checkout-review-order,
html body.academy-new-checkout-page form.checkout #order_review,
html body.academy-new-checkout-page form.checkout .woocommerce-checkout-review-order {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table,
html body.academy-new-checkout-page #order_review table.shop_table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  margin: 0 !important;
  table-layout: auto !important;  /* 改 auto，比 fixed 更 robust */
  box-sizing: border-box !important;
}

html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table thead,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tbody,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr {
  display: revert !important;  /* 取消之前 display: block */
  width: 100% !important;
  box-sizing: border-box !important;
}

/* tr.cart_item 仍要 block 才能垂直堆疊 td — 但 force width 100% */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* td 也 100% width 配合 tr block */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item > td {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* tfoot 維持 table-row layout，左 th + 右 td */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr {
  display: table-row !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr th,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tfoot tr td {
  display: table-cell !important;
}

/* ============================================
   結帳頁 review-order 寬度修正 v6（2026-04-29）
   診斷確認：tr.cart_item 用 display:block 時 width 100% 算出 222px（≠tbody 348px）
   修法：tr 改用 display:flex column，可正確繼承 parent 寬度
   ============================================ */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item > td {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;  /* 不被 flex 壓縮 */
  box-sizing: border-box !important;
}

/* ============================================
   結帳頁 review-order 寬度 v7（2026-04-29）— 整條 table chain 全 block
   v6 失敗原因：tbody 還是 table-row-group，tr 寬度 = fit-content (222px)
   v7：thead 隱藏；tbody/tr/td 全 display:block + width:100%；tfoot 維持 table 結構
   ============================================ */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
  box-sizing: border-box !important;
}

/* 隱藏表頭「商品 / 小計」（block 後堆疊不好看，且資訊不重要） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > thead {
  display: none !important;
}

/* tbody + cart_item tr + td 全 block + 100% 寬 */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tbody {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tbody > tr.cart_item {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  position: relative !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tbody > tr.cart_item > td {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* tfoot 維持 table 結構（左 th 右 td 並排） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot {
  display: table !important;
  width: 100% !important;
  table-layout: auto !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot > tr {
  display: table-row !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot > tr > th,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot > tr > td {
  display: table-cell !important;
  width: auto !important;
}

/* ============================================
   結帳頁 review-order layout v8（2026-04-29）
   - 加區塊標題「購買課程清單」
   - 隱藏數量 +/- 按鈕，只留 × 移除
   - × 移到區塊右上絕對定位
   - 場次 select 100% 寬（取消 92px 縮排）
   - 刪除所有水平分隔線（除了總計上方）
   ============================================ */

/* 1. 區塊標題「購買課程清單」 */
html body.academy-new-checkout-page #order_review .academy-checkout-section-title {
  margin: 0 0 16px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #fff !important;
  letter-spacing: 0.3px !important;
  padding-left: 10px !important;
  border-left: 3px solid #39fff5 !important;
  line-height: 1.4 !important;
}

/* 2. 隱藏數量 +/- 按鈕 */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table .academy-checkout-qty {
  display: none !important;
}

/* 3. × 移除按鈕：放區塊右上絕對定位 */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-checkout-remove-btn {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  margin: 0 !important;
  width: 28px !important;
  height: 28px !important;
  z-index: 2 !important;
}

/* 4. 場次區塊 100% 寬 — 取消 92px 縮排 */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-cart-selects {
  margin: 14px 0 0 0 !important;
  padding: 0 !important;
  width: 100% !important;
  display: block !important;
  clear: both !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-batch-select-wrap {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-batch-select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
}

/* 5. 移除所有水平線（cart_item 底、product-total 上、tfoot 上下、thead 已 hide） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tbody > tr.cart_item {
  border-bottom: none !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tbody > tr.cart_item > td {
  border: none !important;
  border-bottom: none !important;
  border-top: none !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tbody > tr.cart_item > td.product-total {
  border-top: none !important;
  margin-top: 14px !important;
  padding-top: 0 !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot tr th,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot tr td {
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
}

/* 唯一保留：總計上方那條（cyan 細線） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot tr.order-total th,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot tr.order-total td {
  border-top: 1px solid rgba(57,255,245,0.35) !important;
  padding-top: 14px !important;
}

/* 內部所有元素 box-sizing border-box（防 100% width 撐爆 padding） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table * {
  box-sizing: border-box !important;
}

/* ============================================
   結帳頁 review-order layout v9（2026-04-29）
   - DOM 移除 +/- 按鈕（JS removeQtyButtons）
   - × 按鈕移到商品標題右上（圖右側、第 1 排內）
   - 商品列左右邊距對齊 cart-subtotal/order-total
   ============================================ */

/* 對齊內邊距：商品列 padding 改 16px 0；tfoot 內 cell 加 padding-left/right 16px */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tbody > tr.cart_item {
  padding: 16px 0 !important;  /* 取消左右 padding，改由內部 padding 處理 */
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tbody > tr.cart_item > td.product-name,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tbody > tr.cart_item > td.product-total {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* tfoot 內 cell 沒 padding（確保跟商品列一致對齊兩端） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot tr th {
  padding-left: 0 !important;
  text-align: left !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table > tfoot tr td {
  padding-right: 0 !important;
  text-align: right !important;
}

/* × 移除按鈕：放第 1 排右上（標題的右邊，緊貼 row 右側） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-checkout-remove-btn {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  width: 28px !important;
  height: 28px !important;
  z-index: 2 !important;
}

/* 確保 +/- DOM 已被 JS 移除後，CSS 也徹底 hide（雙保險） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-checkout-qty {
  display: none !important;
}

/* ============================================
   結帳頁 review-order layout v10（2026-04-29）
   - × 強制 absolute 右上（用最高 specificity 蓋過之前的 inline-flex/static rules）
   ============================================ */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name a.academy-checkout-remove-btn,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item a.academy-checkout-remove-btn {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 16px !important;
  line-height: 1 !important;
  text-decoration: none !important;
  vertical-align: top !important;
  z-index: 5 !important;
  flex: 0 0 auto !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item a.academy-checkout-remove-btn:hover {
  background: #fff !important;
  color: #1a1a1a !important;
  border-color: #fff !important;
}

/* v11: × 往上移 20px（user 要求） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name a.academy-checkout-remove-btn,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item a.academy-checkout-remove-btn {
  top: -20px !important;
}

/* v11: 移除按鈕改放照片左上（覆蓋在 img 左上角） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name a.academy-checkout-remove-btn,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item a.academy-checkout-remove-btn {
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  width: 24px !important;
  height: 24px !important;
  font-size: 18px !important;
  line-height: 1 !important;
  background: rgba(0,0,0,0.55) !important;  /* 半透明深底，蓋在圖上不刺眼 */
  border: 1px solid rgba(255,255,255,0.4) !important;
  color: #fff !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item a.academy-checkout-remove-btn:hover {
  background: rgba(0,0,0,0.85) !important;
  border-color: #fff !important;
  color: #fff !important;
}

/* ============================================
   結帳頁 layout v12（2026-04-29）
   - 場次對齊商品標題下方
   - 左欄縮 10%（60%）/ 右欄加 10%（40%）
   - 付款區挪到頁面底部跨整列
   - 付款方式 tab 切換
   - 條款一行 + 圓形勾選
   ============================================ */

/* 1. 場次：對齊商品標題下方（image 右側 92px 縮排） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-cart-selects {
  margin: 14px 0 0 92px !important;
  width: calc(100% - 92px) !important;
  clear: none !important;
  display: block !important;
}

/* 2. 左右欄比例：v13 revert，layout 由 elementor 自決（v12 跑版） */

/* 3. 付款區挪底（跨整列，限定容器寬 1170px） */
html body.academy-new-checkout-page #payment {
  width: 100% !important;
  max-width: 1170px !important;
  margin: 32px auto 0 !important;
  float: none !important;
  clear: both !important;
  padding: 24px !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
}

/* 4. 付款方式 tab segmented control */
html body.academy-new-checkout-page .academy-payment-tabs {
  display: flex !important;
  gap: 4px !important;
  width: 100% !important;
  padding: 4px !important;
  background: rgba(255,255,255,0.05) !important;
  border-radius: 12px !important;
  margin-bottom: 20px !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .academy-payment-tab-btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  padding: 12px 8px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: rgba(255,255,255,0.65) !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  white-space: nowrap !important;
  text-align: center !important;
  transition: background 0.2s, color 0.2s, border-color 0.2s !important;
}
html body.academy-new-checkout-page .academy-payment-tab-btn:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.04) !important;
}
html body.academy-new-checkout-page .academy-payment-tab-btn.is-active {
  background: #39fff5 !important;
  color: #1a1a1a !important;
  border-color: #39fff5 !important;
}

/* tab 啟用後隱藏 radio + label，只顯示對應 payment_box */
html body.academy-new-checkout-page #payment ul.payment_methods {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page #payment ul.payment_methods > li > input[type="radio"],
html body.academy-new-checkout-page #payment ul.payment_methods > li > label {
  display: none !important;
}
html body.academy-new-checkout-page #payment ul.payment_methods > li {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page #payment ul.payment_methods > li:not(.is-active) > .payment_box {
  display: none !important;
}
html body.academy-new-checkout-page #payment ul.payment_methods > li.is-active > .payment_box {
  display: block !important;
  margin: 0 !important;
  padding: 16px 0 0 !important;
  background: transparent !important;
}

/* 5. 條款與條件：一排 + 白字 + 10% 黑底 + 圓形勾選 */
html body.academy-new-checkout-page form.checkout > .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout > .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page form.checkout #payment .terms,
html body.academy-new-checkout-page form.checkout > .terms {
  background: rgba(0,0,0,0.1) !important;
  padding: 14px 18px !important;
  border-radius: 8px !important;
  margin-top: 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}
html body.academy-new-checkout-page .wc-terms-and-conditions,
html body.academy-new-checkout-page .form-row.terms,
html body.academy-new-checkout-page .form-row.validate-required.terms {
  background: rgba(0,0,0,0.1) !important;
  padding: 14px 18px !important;
  border-radius: 8px !important;
  margin: 16px 0 0 !important;
  display: flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .wc-terms-and-conditions label,
html body.academy-new-checkout-page .form-row.terms label,
html body.academy-new-checkout-page .form-row.terms .woocommerce-terms-and-conditions-checkbox-text {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  gap: 8px !important;
}
/* 2026-05-15 B-16.AJ：條款 link 內部「條款與條件」也加 nowrap */
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-checkbox-text,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-checkbox-text a,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-link {
  white-space: nowrap !important;
}
/* 2026-05-15 B-16.AK：把 label 內 <span> 跟 <abbr> 中間的 &nbsp; text node 視為 0 寬度
   原因：label 是 inline-flex，&nbsp; 變成獨立 flex item，造成「文字 →空格 →星號」中間多一個欄位
   做法：對 .form-row.terms label 加 font-size: 0 給直接 text node + 對 span/abbr 還原 14px */
html body.academy-new-checkout-page .form-row.terms label,
html body.academy-new-checkout-page .wc-terms-and-conditions label {
  font-size: 0 !important;
}
html body.academy-new-checkout-page .form-row.terms label > *,
html body.academy-new-checkout-page .wc-terms-and-conditions label > * {
  font-size: 14px !important;
}

/* 圓形勾選按鈕（2026-05-26 縮成 10px，跟文字垂直對齊由 label flex align-items:center 控制） */
html body.academy-new-checkout-page .form-row.terms input[type="checkbox"],
html body.academy-new-checkout-page .wc-terms-and-conditions input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 10px !important;
  height: 10px !important;
  min-width: 10px !important;
  max-width: 10px !important;
  max-height: 10px !important;
  border-radius: 50% !important;
  border: 1.5px solid rgba(255,255,255,0.5) !important;
  background: transparent !important;
  cursor: pointer !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
  transition: all 0.2s !important;
}
html body.academy-new-checkout-page .form-row.terms input[type="checkbox"]:hover,
html body.academy-new-checkout-page .wc-terms-and-conditions input[type="checkbox"]:hover {
  border-color: #39fff5 !important;
}
html body.academy-new-checkout-page .form-row.terms input[type="checkbox"]:checked,
html body.academy-new-checkout-page .wc-terms-and-conditions input[type="checkbox"]:checked {
  background: #39fff5 !important;
  border-color: #39fff5 !important;
}
html body.academy-new-checkout-page .form-row.terms input[type="checkbox"]:checked::after,
html body.academy-new-checkout-page .wc-terms-and-conditions input[type="checkbox"]:checked::after {
  content: '' !important;
  position: absolute !important;
  width: 4px !important;
  height: 4px !important;
  border-radius: 50% !important;
  background: #1a1a1a !important;
  border: none !important;
  transform: translate(-50%, -50%) !important;
  left: 50% !important;
  top: 50% !important;
}

/* v14 已 revert（45% 把 review-order 縮到 180px）— layout 由 elementor 自決 */

/* ============================================
   v15 (2026-04-29) /new-cart/ 加購區塊
   - 寬度 100% 父容器（移除 max-width 1140px、左右 padding 56px）
   - 移除上下水平線（border-top）
   ============================================ */
body.academy-new-cart-page .academy-recommendations {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  border-top: none !important;
  border-bottom: none !important;
  /* 2026-05-25 B-16.BW #63.G：上下 50px 間距（電腦版） */
  margin-top: 50px !important;
  margin-bottom: 50px !important;
}
/* 2026-05-25 手機版間距：top 10px / bottom 80px（user 要求） */
@media (max-width: 768px) {
  html body.academy-new-cart-page .academy-recommendations {
    margin-top: 10px !important;
    margin-bottom: 80px !important;
  }
}
/* 相鄰 .academy-recommendations 之間（合併後通常只剩一個，但保留兼容） */
body.academy-new-cart-page .academy-recommendations + .academy-recommendations {
  margin-top: 50px !important;
}

/* ============================================
   v16 (2026-04-29) /new-checkout/ form grid 鎖死
   問題：1 秒後左欄變 100%、右欄被擠出去
   修法：強制 form grid 1fr/400px、強制 #customer_details = col 1、
         強制 #order_review = col 2，任何其他 children 跨整列在 row 2
   ============================================ */
html body.academy-new-checkout-page form.checkout,
html body.academy-new-checkout-page form.woocommerce-checkout {
  display: grid !important;
  grid-template-columns: 1fr 400px !important;
  gap: 32px !important;
  align-items: start !important;
}
html body.academy-new-checkout-page form.checkout > #customer_details,
html body.academy-new-checkout-page form.checkout > .col2-set,
html body.academy-new-checkout-page form.woocommerce-checkout > #customer_details,
html body.academy-new-checkout-page form.woocommerce-checkout > .col2-set {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  float: none !important;
}
html body.academy-new-checkout-page form.checkout > #order_review,
html body.academy-new-checkout-page form.checkout > #order_review_heading,
html body.academy-new-checkout-page form.woocommerce-checkout > #order_review,
html body.academy-new-checkout-page form.woocommerce-checkout > #order_review_heading {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  float: none !important;
}
/* form 內任何其他 children（含 #payment 萬一被拉回 form 末端）→ 跨整列在 row 2 */
html body.academy-new-checkout-page form.checkout > *:not(#customer_details):not(.col2-set):not(#order_review):not(#order_review_heading),
html body.academy-new-checkout-page form.woocommerce-checkout > *:not(#customer_details):not(.col2-set):not(#order_review):not(#order_review_heading) {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
}

/* ============================================
   v17 (2026-04-29) 場次下拉位置 + 標題色 + 寬度
   注意：不改 .academy-batch-select-wrap 的 flex/width，
         避免影響到 td.product-name 內的 img 佈局
   ============================================ */

/* /new-checkout/ — 場次貼齊標題下方（移除 clear:both 造成的空白） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .academy-cart-selects {
  clear: none !important;
  margin: 6px 0 0 92px !important;
  width: calc(100% - 92px) !important;
  display: block !important;
}

/* /new-cart/ — 商品標題用重點色（高特異性蓋過 line 3475 的 #fff） */
html body.academy-new-cart-page table.shop_table tr.cart_item td.product-name a:not(.academy-checkout-remove-btn),
html body.academy-new-cart-page #order_review table.shop_table tr.cart_item td.product-name a:not(.academy-checkout-remove-btn) {
  color: #39fff5 !important;
}

/* /new-cart/ — 只動 SELECT 元素本身的寬度 300px，不動 wrap container */
html body.academy-new-cart-page table.shop_table tr.cart_item .academy-cart-selects select,
html body.academy-new-cart-page table.shop_table tr.cart_item .academy-batch-select {
  width: 300px !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

/* ============================================
   v22 (2026-05-04) /new-checkout/ 付款區塊重做
   結構（buildPaymentTabs 動態建立）：
   #payment.academy-payment-relocated
     ├── .academy-payment-tabs（左欄 220px，4 顆 tab 直向）
     ├── ul.wc_payment_methods（右欄；li.is-active > .payment_box 顯示）
     ├── .form-row.terms / .woocommerce-terms-and-conditions-wrapper（跨整列）
     └── .place-order（跨整列，下單按鈕）
   設計：卡片化容器 + 左右明確分區 + 充足留白 + 重點色 #39FFF5
   ============================================ */

/* 整個 #payment 卡片化（書籤緊貼外部頂邊，所以 margin-top 留給 tabs）
   背景跟 active 書籤同色（rgba 0,0,0,0.5），讓 active tab 跟卡片連成一體 */
html body.academy-new-checkout-page #payment {
  display: block !important;
  position: relative !important;
  background: rgba(0, 0, 0, 0.5) !important;
  border: none !important;
  border-radius: 0 0 14px 14px !important;
  padding: 24px !important;
  margin-top: 48px !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

/* 書籤列：absolute 定位到 #payment 外部正上方，緊貼頂邊；4 顆等分 100% 寬、無 gap */
html body.academy-new-checkout-page .academy-payment-tabs {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 100% !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  z-index: 2 !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .academy-payment-tab-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
  padding: 10px 14px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
  background-color: rgba(255, 255, 255, 0.03) !important;
  border: none !important;
  border-radius: 10px 10px 0 0 !important;
  color: #39FFF5 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  text-align: center !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
  line-height: 1.4 !important;
  /* 2026-05-26 B-16.BW #65：切換時顏色淡入（350ms ease），不要瞬間變色 */
  transition: background-color 0.35s ease, background 0.35s ease, color 0.35s ease, flex 0.35s ease, flex-grow 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease !important;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.18), 1px 0 0 rgba(255, 255, 255, 0.04) !important;
  text-shadow: none !important;
  text-transform: none !important;
  height: auto !important;
  margin: 0 !important;
  filter: none !important;
  position: relative !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
/* tab text 由 ::before 從 data-short / data-full 渲染（解決 active 顯示短版的時序問題） */
html body.academy-new-checkout-page .academy-payment-tab-btn::before {
  content: attr(data-short);
  display: inline-block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page .academy-payment-tab-btn.is-active::before {
  content: attr(data-full);
}
html body.academy-new-checkout-page .academy-payment-tab-btn:hover,
html body.academy-new-checkout-page .academy-payment-tab-btn:focus {
  background: rgba(57, 255, 245, 0.08) !important;
  background-color: rgba(57, 255, 245, 0.08) !important;
  color: #39FFF5 !important;
  outline: none !important;
  /* 2026-05-26 hover/focus 維持「上有圓角、下無」，跟 base 一致，不可全圓角 */
  border-radius: 10px 10px 0 0 !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
html body.academy-new-checkout-page .academy-payment-tab-btn.is-active {
  flex: 2.5 1 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  background-image: none !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  color: #39FFF5 !important;
  box-shadow: none !important;
  z-index: 3 !important;
  /* 2026-05-26 active 維持「上有圓角、下無」，下方緊貼 #payment 上緣 */
  border-radius: 10px 10px 0 0 !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* payment_methods 容器（在 tabs 下方） */
html body.academy-new-checkout-page #payment ul.payment_methods {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  min-width: 0 !important;
  display: block !important;
}
html body.academy-new-checkout-page #payment ul.payment_methods > li {
  list-style: none !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page #payment ul.payment_methods > li > input[type="radio"],
html body.academy-new-checkout-page #payment ul.payment_methods > li > label {
  display: none !important;
}
html body.academy-new-checkout-page #payment ul.payment_methods > li:not(.is-active) > .payment_box,
html body.academy-new-checkout-page #payment ul.payment_methods > li:not(.is-active) > div.payment_box {
  display: none !important;
}
html body.academy-new-checkout-page #payment ul.payment_methods > li.is-active > .payment_box,
html body.academy-new-checkout-page #payment ul.payment_methods > li.is-active > div.payment_box {
  display: block !important;
  margin: 0 !important;
  padding: 6px 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 1 !important;
}
html body.academy-new-checkout-page #payment ul.payment_methods > li.is-active > .payment_box::before {
  display: none !important;
  content: none !important;
}

/* payment_box 內排版 */
html body.academy-new-checkout-page #payment .payment_box h3,
html body.academy-new-checkout-page #payment .payment_box h4 {
  margin: 0 0 12px !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
}
html body.academy-new-checkout-page #payment .payment_box p {
  margin: 0 0 10px !important;
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
}
html body.academy-new-checkout-page #payment .payment_box p:last-child {
  margin-bottom: 0 !important;
}
html body.academy-new-checkout-page #payment .payment_box label {
  display: block !important;
  margin: 0 0 6px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.2px !important;
}
html body.academy-new-checkout-page #payment .payment_box input[type="text"],
html body.academy-new-checkout-page #payment .payment_box input[type="tel"],
html body.academy-new-checkout-page #payment .payment_box input[type="email"],
html body.academy-new-checkout-page #payment .payment_box input[type="number"],
html body.academy-new-checkout-page #payment .payment_box select,
html body.academy-new-checkout-page #payment .payment_box .tpfield {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 11px 14px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 8px !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: border-color 0.15s, background 0.15s !important;
}
html body.academy-new-checkout-page #payment .payment_box input:focus,
html body.academy-new-checkout-page #payment .payment_box select:focus {
  border-color: #39FFF5 !important;
  background: rgba(255, 255, 255, 0.08) !important;
}
html body.academy-new-checkout-page #payment .payment_box .form-row {
  margin: 0 0 14px !important;
}
html body.academy-new-checkout-page #payment .payment_box .form-row:last-child {
  margin-bottom: 0 !important;
}

/* 條款 + 下單按鈕：跨整列 */
html body.academy-new-checkout-page #payment > .form-row,
html body.academy-new-checkout-page #payment > .woocommerce-NoticeGroup,
html body.academy-new-checkout-page #payment > .terms,
html body.academy-new-checkout-page #payment > .place-order,
html body.academy-new-checkout-page #payment > .wc_payment_method,
html body.academy-new-checkout-page #payment > .woocommerce-terms-and-conditions-wrapper {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
}
html body.academy-new-checkout-page #payment > .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page #payment > .form-row.terms,
html body.academy-new-checkout-page #payment > .form-row.validate-required.terms,
html body.academy-new-checkout-page #payment > .terms {
  margin: 4px 0 0 !important;
  padding: 16px 20px !important;
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page #payment > .place-order {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}
html body.academy-new-checkout-page #payment > .place-order button#place_order,
html body.academy-new-checkout-page #payment > .place-order button[name="woocommerce_checkout_place_order"] {
  display: block !important;
  width: 100% !important;
  padding: 16px 24px !important;
  background: linear-gradient(135deg, #39FFF5 0%, #1ec9c0 100%) !important;
  background-color: #39FFF5 !important;
  background-image: linear-gradient(135deg, #39FFF5 0%, #1ec9c0 100%) !important;
  border: none !important;
  border-radius: 12px !important;
  color: #0a0a0a !important;
  font-family: inherit !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  letter-spacing: 0.6px !important;
  cursor: pointer !important;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s !important;
  box-shadow: 0 8px 24px rgba(57, 255, 245, 0.22) !important;
  text-shadow: none !important;
  text-transform: none !important;
  filter: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  height: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page #payment > .place-order button#place_order:hover,
html body.academy-new-checkout-page #payment > .place-order button#place_order:focus {
  opacity: 0.94 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 28px rgba(57, 255, 245, 0.3) !important;
  filter: none !important;
  outline: none !important;
}

/* 手機版（≤768px）：tabs 改為頂部橫向、payment_box 在下 */
@media (max-width: 768px) {
  html body.academy-new-checkout-page #payment {
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
    row-gap: 16px !important;
    padding: 18px !important;
  }
  html body.academy-new-checkout-page .academy-payment-tabs {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    grid-column: 1 / -1 !important;
  }
  html body.academy-new-checkout-page .academy-payment-tab-btn {
    flex: 1 1 calc(50% - 3px) !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 11px 8px !important;
    font-size: 13px !important;
    /* 2026-05-15 B-16.AJ：手機版圓角統一（不再用桌機版「融合下方 payment_box」設計） */
    border-radius: 10px !important;
  }
  /* 2026-05-26 B-16.BW #65 修正：手機版 tab 配色比照電腦版
     之前 B-16.AJ 為了 2x2 wrap 不相鄰 #payment 用 cyan 高亮獨立視覺，
     現在已改 4 顆 nowrap + 在 #payment 之前 sibling，恢復「黑色融入 #payment + cyan 字」設計跟電腦版一致 */
  html body.academy-new-checkout-page .academy-payment-tab-btn.is-active {
    background: rgba(0, 0, 0, 0.5) !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    color: #39FFF5 !important;
    box-shadow: none !important;
    border-color: transparent !important;
  }
  html body.academy-new-checkout-page .academy-payment-tab-btn.is-active:hover,
  html body.academy-new-checkout-page .academy-payment-tab-btn.is-active:focus {
    background: rgba(0, 0, 0, 0.5) !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    color: #39FFF5 !important;
  }
  html body.academy-new-checkout-page #payment ul.payment_methods {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
  html body.academy-new-checkout-page #payment ul.payment_methods > li.is-active > .payment_box {
    padding: 16px 14px !important;
  }
  html body.academy-new-checkout-page #payment > .place-order button#place_order {
    font-size: 16px !important;
    padding: 14px 16px !important;
  }
}

/* ============================================
   v18 (2026-04-29) /new-cart/ 防呆：強制商品圖 80x80
   為什麼要這條：用戶反映圖片變超大，加最高特異性 + !important
   保證 img 規則贏過任何衝突
   ============================================ */
html body.academy-new-cart-page table.shop_table tr.cart_item td.product-name img,
html body.academy-new-cart-page table.shop_table tr.cart_item td.product-name a img,
html body.academy-new-cart-page #order_review table.shop_table tr.cart_item td.product-name img,
html body.academy-new-cart-page #order_review table.shop_table tr.cart_item td.product-name a img {
  width: 80px !important;
  height: 80px !important;
  max-width: 80px !important;
  max-height: 80px !important;
  min-width: 80px !important;
  min-height: 80px !important;
  object-fit: cover !important;
  display: block !important;
  float: left !important;
  margin: 0 12px 6px 0 !important;
  border-radius: 8px !important;
  flex: 0 0 80px !important;
}

/* ============================================
   v20 (2026-04-30) 加購卡片倒數按鈕
   結構：「加購倒數 HH:MM」單一文字、置中
   按鈕高度 +6px（padding 11px），加購卡片價格同行
   ============================================ */
.academy-rec-card__btn,
a.academy-rec-card__btn,
a.academy-rec-card__btn:visited,
a.academy-rec-card__btn:link {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 11px 12px !important;
  text-decoration: none !important;
  text-align: center !important;
}
.academy-rec-card__btn .acad-cd-text {
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  color: #1a1a1a !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.academy-rec-card__btn .acad-cd-num {
  font-variant-numeric: tabular-nums !important;
  font-weight: 800 !important;
  margin-left: 2px !important;
}

/* 加購卡片價格：原價 + 特價同行 */
.academy-rec-card__price {
  flex-direction: row !important;
  justify-content: center !important;
  align-items: baseline !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}


/* ============================================
   主商品彈窗 — 對齊「商品卡管理」pricing-card 風格
   結構：header(深灰) + body(淺灰) + footer(白底)
   桌機 4×2，手機 2×4
   ============================================ */
.academy-main-modal[hidden] { display: none !important; }
.academy-main-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.academy-main-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.academy-main-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: #1a1a1a;
  border: 1px solid rgba(57, 255, 245, 0.18);
  border-radius: 12px;
  padding: 36px 28px 24px;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.academy-main-modal .academy-main-modal__close,
.academy-main-modal button.academy-main-modal__close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border: none !important;
  background: rgba(255, 255, 255, 0.06) !important;
  background-image: none !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
  box-shadow: none !important;
  text-shadow: none !important;
  min-width: 0 !important;
  letter-spacing: 0 !important;
}
.academy-main-modal .academy-main-modal__close:hover,
.academy-main-modal button.academy-main-modal__close:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #39FFF5 !important;
}
.academy-main-modal__title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}
.academy-main-modal__subtitle {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
}
.academy-main-modal__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .academy-main-modal__grid { grid-template-columns: repeat(2, 1fr); }
  .academy-main-modal__dialog { padding: 28px 14px 18px; }
  .academy-main-modal__title { font-size: 17px; }
}

/* === 主商品卡 — 對齊 B 站課程頁 pricing-card 實際呈現 === */
.academy-main-modal .academy-main-card {
  display: flex !important;
  flex-direction: column !important;
  background: #1f1f1f !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-align: left;
  padding: 0 !important;
  min-height: 100%;
}
.academy-main-modal .academy-main-card:hover {
  transform: translateY(-2px);
  border-color: rgba(57, 255, 245, 0.4) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.academy-main-modal .academy-main-card.is-loading { opacity: 0.5; pointer-events: none; }

/* Banner 區（圖滿幅 + type label + 標題 overlay） */
.academy-main-modal .academy-main-card__banner {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #2a2a2a;
  overflow: hidden;
}
.academy-main-modal .academy-main-card__img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}
.academy-main-modal .academy-main-card__type {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  background: rgba(0, 0, 0, 0.55) !important;
  color: #39FFF5 !important;
  border: 1px solid #39FFF5 !important;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

/* 內容區 — 全部置中 */
.academy-main-modal .academy-main-card__body {
  background: #1f1f1f !important;
  padding: 14px 14px 16px !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center !important;
  gap: 8px;
  text-align: center !important;
}
.academy-main-modal .academy-main-card__title {
  margin: 0 !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  text-shadow: none !important;
}
.academy-main-modal .academy-main-card__subtitle {
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  text-align: center !important;
}
.academy-main-modal .academy-main-card__total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1.2;
  margin-top: auto;
  text-align: center;
}
.academy-main-modal .academy-main-card__price-orig {
  color: rgba(255, 255, 255, 0.4) !important;
  font-size: 12px !important;
  text-decoration: line-through;
}
.academy-main-modal .academy-main-card__price-orig .woocommerce-Price-amount,
.academy-main-modal .academy-main-card__price-orig bdi { color: inherit !important; }
.academy-main-modal .academy-main-card__price-sale {
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}
.academy-main-modal .academy-main-card__price-sale .woocommerce-Price-amount,
.academy-main-modal .academy-main-card__price-sale bdi { color: inherit !important; }
html body .academy-main-modal button.academy-main-card__cta,
html body .academy-main-modal [type="button"].academy-main-card__cta {
  display: block !important;
  width: 100% !important;
  padding: 9px 12px !important;
  margin: 0 !important;
  text-align: center !important;
  background: #39FFF5 !important;
  background-image: none !important;
  background-color: #39FFF5 !important;
  color: #0a0a0a !important;
  border: 1px solid #39FFF5 !important;
  border-radius: 6px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.3px !important;
  cursor: pointer !important;
  transition: opacity 0.15s !important;
  box-shadow: none !important;
  text-shadow: none !important;
  text-transform: none !important;
  min-width: 0 !important;
  height: auto !important;
  filter: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
html body .academy-main-modal button.academy-main-card__cta:hover,
html body .academy-main-modal button.academy-main-card__cta:focus,
html body .academy-main-modal button.academy-main-card__cta:active {
  background: #39FFF5 !important;
  background-color: #39FFF5 !important;
  background-image: none !important;
  color: #0a0a0a !important;
  border-color: #39FFF5 !important;
  opacity: 0.85 !important;
  outline: none !important;
  filter: none !important;
}

body.academy-modal-open { overflow: hidden; }

/* ============================================
   購物車「請選擇主商品」自訂 notice + 按鈕
   （全 !important 強化 specificity，避免 theme button 預設黃色蓋過）
   ============================================ */
body.academy-new-cart-page .academy-main-required-notice {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  padding: 14px 18px !important;
  margin: 0 0 16px !important;
  background: rgba(57, 255, 245, 0.08) !important;
  border: 1px solid rgba(57, 255, 245, 0.4) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
body.academy-new-cart-page .academy-main-required-notice__text {
  color: #39FFF5 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  flex: 1 !important;
  min-width: 220px !important;
  background: transparent !important;
  text-shadow: none !important;
}
html body.academy-new-cart-page button.academy-main-required-notice__btn,
html body.academy-new-cart-page .academy-main-required-notice button.academy-main-required-notice__btn,
html body.academy-new-cart-page .academy-main-required-notice [type="button"].academy-main-required-notice__btn {
  display: inline-block !important;
  padding: 8px 20px !important;
  background: #39FFF5 !important;
  background-image: none !important;
  background-color: #39FFF5 !important;
  color: #0a0a0a !important;
  border: 1px solid #39FFF5 !important;
  border-radius: 6px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  cursor: pointer !important;
  transition: opacity 0.15s !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  text-shadow: none !important;
  text-transform: none !important;
  letter-spacing: 0.3px !important;
  min-width: 0 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  filter: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
html body.academy-new-cart-page button.academy-main-required-notice__btn:hover,
html body.academy-new-cart-page button.academy-main-required-notice__btn:focus,
html body.academy-new-cart-page button.academy-main-required-notice__btn:active,
html body.academy-new-cart-page .academy-main-required-notice button.academy-main-required-notice__btn:hover,
html body.academy-new-cart-page .academy-main-required-notice button.academy-main-required-notice__btn:focus,
html body.academy-new-cart-page .academy-main-required-notice button.academy-main-required-notice__btn:active {
  background: #39FFF5 !important;
  background-color: #39FFF5 !important;
  background-image: none !important;
  color: #0a0a0a !important;
  border-color: #39FFF5 !important;
  opacity: 0.85 !important;
  outline: none !important;
  filter: none !important;
}

/* ============================================
   v23 (2026-05-04) /new-cart/ + /new-checkout/
   notice 內按鈕（dismiss / wc-forward / restore）— 改成主題重點色
   修正截圖中黃色方塊「x」與 yellow 按鈕（被 theme button 預設樣式吃掉）
   ============================================ */
html body.academy-new-cart-page .woocommerce-notices-wrapper .button,
html body.academy-new-cart-page .woocommerce-notices-wrapper a.button,
html body.academy-new-cart-page .woocommerce-notices-wrapper button,
html body.academy-new-cart-page .woocommerce-message .button,
html body.academy-new-cart-page .woocommerce-message a.button,
html body.academy-new-cart-page .woocommerce-message button,
html body.academy-new-cart-page .woocommerce-info .button,
html body.academy-new-cart-page .woocommerce-info a.button,
html body.academy-new-cart-page .woocommerce-info button,
html body.academy-new-cart-page .woocommerce-error .button,
html body.academy-new-cart-page .woocommerce-error a.button,
html body.academy-new-cart-page .woocommerce-error button,
html body.academy-new-cart-page .woocommerce-NoticeGroup .button,
html body.academy-new-cart-page .woocommerce-NoticeGroup a.button,
html body.academy-new-cart-page .woocommerce-NoticeGroup button,
html body.academy-new-checkout-page .woocommerce-notices-wrapper .button,
html body.academy-new-checkout-page .woocommerce-notices-wrapper a.button,
html body.academy-new-checkout-page .woocommerce-notices-wrapper button,
html body.academy-new-checkout-page .woocommerce-message .button,
html body.academy-new-checkout-page .woocommerce-message a.button,
html body.academy-new-checkout-page .woocommerce-message button,
html body.academy-new-checkout-page .woocommerce-info .button,
html body.academy-new-checkout-page .woocommerce-info a.button,
html body.academy-new-checkout-page .woocommerce-info button,
html body.academy-new-checkout-page .woocommerce-error .button,
html body.academy-new-checkout-page .woocommerce-error a.button,
html body.academy-new-checkout-page .woocommerce-error button,
html body.academy-new-checkout-page .woocommerce-NoticeGroup .button,
html body.academy-new-checkout-page .woocommerce-NoticeGroup a.button,
html body.academy-new-checkout-page .woocommerce-NoticeGroup button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: #39FFF5 !important;
  border: 1px solid #39FFF5 !important;
  border-radius: 6px !important;
  padding: 6px 14px !important;
  margin: 0 0 0 12px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.3px !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
  text-transform: none !important;
  text-decoration: none !important;
  min-width: 0 !important;
  width: auto !important;
  height: auto !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  flex: 0 0 auto !important;
}
html body.academy-new-cart-page .woocommerce-notices-wrapper .button:hover,
html body.academy-new-cart-page .woocommerce-notices-wrapper a.button:hover,
html body.academy-new-cart-page .woocommerce-notices-wrapper button:hover,
html body.academy-new-cart-page .woocommerce-message .button:hover,
html body.academy-new-cart-page .woocommerce-message button:hover,
html body.academy-new-cart-page .woocommerce-info .button:hover,
html body.academy-new-cart-page .woocommerce-info button:hover,
html body.academy-new-cart-page .woocommerce-error .button:hover,
html body.academy-new-cart-page .woocommerce-error button:hover,
html body.academy-new-checkout-page .woocommerce-notices-wrapper .button:hover,
html body.academy-new-checkout-page .woocommerce-notices-wrapper a.button:hover,
html body.academy-new-checkout-page .woocommerce-notices-wrapper button:hover,
html body.academy-new-checkout-page .woocommerce-message .button:hover,
html body.academy-new-checkout-page .woocommerce-message button:hover,
html body.academy-new-checkout-page .woocommerce-info .button:hover,
html body.academy-new-checkout-page .woocommerce-info button:hover,
html body.academy-new-checkout-page .woocommerce-error .button:hover,
html body.academy-new-checkout-page .woocommerce-error button:hover {
  background: #39FFF5 !important;
  background-color: #39FFF5 !important;
  background-image: none !important;
  color: #0a0a0a !important;
  border-color: #39FFF5 !important;
  filter: none !important;
  outline: none !important;
}

/* ============================================
   v24 (2026-05-04) notice 內 .academy-notice-close（× 關閉按鈕）
   PHP line 1280 jQuery prepend 進來的元素，用 CSS 絕對定位到右側
   修正截圖中黃色方塊「×」 → 圓型半透明、hover 重點色
   ============================================ */
html body.academy-new-cart-page .woocommerce-notices-wrapper .woocommerce-message,
html body.academy-new-cart-page .woocommerce-notices-wrapper .woocommerce-info,
html body.academy-new-cart-page .woocommerce-notices-wrapper .woocommerce-error,
html body.academy-new-cart-page .woocommerce-NoticeGroup,
html body.academy-new-cart-page .woocommerce-message,
html body.academy-new-cart-page .woocommerce-info,
html body.academy-new-cart-page .woocommerce-error,
html body.academy-new-checkout-page .woocommerce-notices-wrapper .woocommerce-message,
html body.academy-new-checkout-page .woocommerce-notices-wrapper .woocommerce-info,
html body.academy-new-checkout-page .woocommerce-notices-wrapper .woocommerce-error,
html body.academy-new-checkout-page .woocommerce-NoticeGroup,
html body.academy-new-checkout-page .woocommerce-message,
html body.academy-new-checkout-page .woocommerce-info,
html body.academy-new-checkout-page .woocommerce-error {
  position: relative !important;
  padding-right: 52px !important;
}

/* × 按鈕本體 — 用 html body button 高 specificity 蓋過 theme/inline 樣式 */
html body button.academy-notice-close,
html body .woocommerce-message > button.academy-notice-close,
html body .woocommerce-info > button.academy-notice-close,
html body .woocommerce-error > button.academy-notice-close,
html body .woocommerce-NoticeGroup > button.academy-notice-close,
html body .woocommerce-notices-wrapper button.academy-notice-close {
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 50% !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-family: inherit !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
  text-transform: none !important;
  text-decoration: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  min-height: 0 !important;
  flex: 0 0 auto !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  z-index: 2 !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s !important;
}
html body button.academy-notice-close:hover,
html body button.academy-notice-close:focus,
html body button.academy-notice-close:active,
html body .woocommerce-notices-wrapper button.academy-notice-close:hover,
html body .woocommerce-notices-wrapper button.academy-notice-close:focus {
  background: rgba(57, 255, 245, 0.18) !important;
  background-color: rgba(57, 255, 245, 0.18) !important;
  border-color: #39FFF5 !important;
  color: #39FFF5 !important;
  outline: none !important;
  filter: none !important;
}

/* ============================================
   v25 (2026-05-05) /new-checkout/ 帳單資訊區塊精簡
   - 隱藏「帳單資訊」h3 標題
   - 隱藏 billing_country_field（Taiwan-only 站台不需顯示國家 select）
   ============================================ */
html body.academy-new-checkout-page .woocommerce-billing-fields > h3,
html body.academy-new-checkout-page h3.woocommerce-billing-heading,
html body.academy-new-checkout-page .woocommerce-billing-fields h3:first-child {
  display: none !important;
}
html body.academy-new-checkout-page #billing_country_field,
html body.academy-new-checkout-page p.form-row#billing_country_field {
  display: none !important;
}

/* 「名字/姓氏」上方空白條的真兇 — WC Order Attribution web component
   PHP do_action('woocommerce_after_checkout_billing_form') 注入的 <wc-order-attribution-inputs>
   web component 預設 display: block 變成空白橫條 */
html body.academy-new-checkout-page wc-order-attribution-inputs,
html body.academy-new-checkout-page wc-order-attribution-inputs * {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

/* ============================================
   v26 (2026-05-05) 手機版整體優化（≤768px）
   - /new-cart/ 商品列、加購卡、場次下拉
   - /new-checkout/ form 單欄、帳單 fields、書籤 tab、payment_box
   - 不影響電腦版
   ============================================ */
@media (max-width: 768px) {
  /* === /new-checkout/ form 變單欄 === */
  html body.academy-new-checkout-page form.checkout,
  html body.academy-new-checkout-page form.woocommerce-checkout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  html body.academy-new-checkout-page form.checkout > #customer_details,
  html body.academy-new-checkout-page form.woocommerce-checkout > #customer_details,
  html body.academy-new-checkout-page form.checkout > .col2-set,
  html body.academy-new-checkout-page form.woocommerce-checkout > .col2-set {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  html body.academy-new-checkout-page form.checkout > #order_review,
  html body.academy-new-checkout-page form.woocommerce-checkout > #order_review,
  html body.academy-new-checkout-page form.checkout > #order_review_heading,
  html body.academy-new-checkout-page form.woocommerce-checkout > #order_review_heading {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  /* 帳單區「名字 / 姓氏」mobile 變單欄 */
  html body.academy-new-checkout-page .woocommerce-billing-fields__field-wrapper > p.form-row.form-row-first,
  html body.academy-new-checkout-page .woocommerce-billing-fields__field-wrapper > p.form-row.form-row-last {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-bottom: 12px !important;
  }

  /* === 付款書籤 tab mobile 適配 === */
  html body.academy-new-checkout-page #payment {
    padding: 18px !important;
  }
  html body.academy-new-checkout-page .academy-payment-tabs {
    gap: 4px !important;
    flex-wrap: wrap !important;
  }
  html body.academy-new-checkout-page .academy-payment-tab-btn {
    flex: 1 1 calc(50% - 2px) !important;
    padding: 10px 6px !important;
    font-size: 12px !important;
    white-space: normal !important;
    line-height: 1.3 !important;
    text-align: center !important;
    word-break: break-word !important;
    border-radius: 10px 10px 0 0 !important;
  }
  html body.academy-new-checkout-page #payment ul.payment_methods > li.is-active > .payment_box {
    padding: 16px 14px !important;
    border-radius: 10px !important;
  }
  html body.academy-new-checkout-page #payment > .place-order button#place_order {
    font-size: 16px !important;
    padding: 14px 16px !important;
  }

  /* === /new-cart/ 商品列 mobile === */
  html body.academy-new-cart-page table.shop_table tr.cart_item td {
    padding: 12px 8px !important;
  }
  html body.academy-new-cart-page table.shop_table tr.cart_item td.product-name img,
  html body.academy-new-cart-page table.shop_table tr.cart_item td.product-name a img,
  html body.academy-new-cart-page #order_review table.shop_table tr.cart_item td.product-name img,
  html body.academy-new-cart-page #order_review table.shop_table tr.cart_item td.product-name a img {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    margin: 0 10px 4px 0 !important;
  }
  /* 場次/身份下拉 mobile 全寬，左對齊 */
  html body.academy-new-cart-page table.shop_table tr.cart_item .academy-cart-selects {
    margin-left: 0 !important;
    width: 100% !important;
  }
  html body.academy-new-cart-page table.shop_table tr.cart_item .academy-cart-selects select,
  html body.academy-new-cart-page table.shop_table tr.cart_item .academy-batch-select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  /* 結帳頁訂單摘要：場次下拉 mobile 對齊文字底（移除 92px 縮排） */
  html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name .academy-cart-selects {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* === /new-cart/ 加購區 mobile：舊規則拿掉（2026-05-25 B-16.BW #63.M：改為下方橫滑 swiper） === */

  /* === /new-checkout/ 加購卡 mobile === */
  body.academy-new-checkout-page .academy-rec-card__row {
    gap: 10px !important;
  }
  body.academy-new-checkout-page .academy-rec-card__img {
    flex: 0 0 80px !important;
    width: 80px !important;
    height: 80px !important;
  }
  body.academy-new-checkout-page .academy-rec-card__name {
    font-size: 14px !important;
    white-space: normal !important;
    line-height: 1.35 !important;
  }
  body.academy-new-checkout-page .academy-rec-card__btn {
    font-size: 14px !important;
    padding: 9px 14px !important;
  }
  body.academy-new-checkout-page .academy-rec-card__price-orig {
    font-size: 11px !important;
  }
  body.academy-new-checkout-page .academy-rec-card__price-sale {
    font-size: 15px !important;
  }

  /* === 購物車總計 mobile 變單欄 === */
  body.academy-new-cart-page .cart_totals {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* notice notice-close 按鈕在 mobile 縮小 */
  html body button.academy-notice-close {
    width: 24px !important;
    height: 24px !important;
    right: 8px !important;
    font-size: 16px !important;
  }
}

/* ============================================
   v27 (2026-05-05) 隱私政策 + 條款 文字置中、白字、連結 cyan
   無 hover / focus / active 樣式變化
   ============================================ */
html body.academy-new-checkout-page .woocommerce-privacy-policy-text,
html body.academy-new-checkout-page .woocommerce-privacy-policy-text p,
html body.academy-new-checkout-page form.checkout .woocommerce-privacy-policy-text {
  color: #fff !important;
  font-size: 14px !important;
  text-align: center !important;
  margin: 0 0 12px !important;
  line-height: 1.6 !important;
}
html body.academy-new-checkout-page .woocommerce-privacy-policy-text a,
html body.academy-new-checkout-page .woocommerce-privacy-policy-text a:hover,
html body.academy-new-checkout-page .woocommerce-privacy-policy-text a:focus,
html body.academy-new-checkout-page .woocommerce-privacy-policy-text a:active,
html body.academy-new-checkout-page .woocommerce-privacy-policy-text a:visited {
  color: #39FFF5 !important;
  text-decoration: none !important;
  opacity: 1 !important;
  background: transparent !important;
  outline: none !important;
}

html body.academy-new-checkout-page form.checkout > .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout > .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page form.checkout #payment .terms,
html body.academy-new-checkout-page form.checkout > .terms,
html body.academy-new-checkout-page #payment > .form-row.terms,
html body.academy-new-checkout-page #payment > .form-row.validate-required.terms,
html body.academy-new-checkout-page .wc-terms-and-conditions,
html body.academy-new-checkout-page .form-row.terms,
html body.academy-new-checkout-page .form-row.validate-required.terms {
  justify-content: center !important;
  text-align: center !important;
}
html body.academy-new-checkout-page .wc-terms-and-conditions label,
html body.academy-new-checkout-page .form-row.terms label,
html body.academy-new-checkout-page .form-row.terms .woocommerce-terms-and-conditions-checkbox-text,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-checkbox-text {
  color: #fff !important;
  text-align: center !important;
  justify-content: center !important;
}
html body.academy-new-checkout-page .form-row.terms a,
html body.academy-new-checkout-page .wc-terms-and-conditions a,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-checkbox-text a,
html body.academy-new-checkout-page .form-row.terms a:hover,
html body.academy-new-checkout-page .wc-terms-and-conditions a:hover,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-checkbox-text a:hover,
html body.academy-new-checkout-page .form-row.terms a:focus,
html body.academy-new-checkout-page .wc-terms-and-conditions a:focus,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-checkbox-text a:focus,
html body.academy-new-checkout-page .form-row.terms a:active,
html body.academy-new-checkout-page .wc-terms-and-conditions a:active,
html body.academy-new-checkout-page .form-row.terms a:visited,
html body.academy-new-checkout-page .wc-terms-and-conditions a:visited {
  color: #39FFF5 !important;
  text-decoration: none !important;
  opacity: 1 !important;
  background: transparent !important;
  outline: none !important;
}

/* ============================================
   v28 (2026-05-05) /new-checkout/ privacy + terms
   - 上方水平線 + 20px 間距
   - 強化 specificity 確保置中
   ============================================ */
html body.academy-new-checkout-page form.checkout .woocommerce-privacy-policy-text,
html body.academy-new-checkout-page form.woocommerce-checkout .woocommerce-privacy-policy-text,
html body.academy-new-checkout-page #payment .woocommerce-privacy-policy-text,
html body.academy-new-checkout-page .woocommerce-privacy-policy-text {
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  padding-top: 20px !important;
  margin-top: 20px !important;
  margin-bottom: 12px !important;
  text-align: center !important;
  color: #fff !important;
  background: transparent !important;
  display: block !important;
}
html body.academy-new-checkout-page form.checkout .woocommerce-privacy-policy-text p,
html body.academy-new-checkout-page form.woocommerce-checkout .woocommerce-privacy-policy-text p,
html body.academy-new-checkout-page #payment .woocommerce-privacy-policy-text p,
html body.academy-new-checkout-page .woocommerce-privacy-policy-text p {
  text-align: center !important;
  color: #fff !important;
  margin: 0 !important;
  line-height: 1.6 !important;
}

/* terms 區塊：置中 + 移除 flex left-align + 拿掉黑底卡片化效果（用戶要整體深色） */
html body.academy-new-checkout-page form.checkout .form-row.terms,
html body.academy-new-checkout-page form.checkout .form-row.validate-required.terms,
html body.academy-new-checkout-page form.woocommerce-checkout .form-row.terms,
html body.academy-new-checkout-page #payment > .form-row.terms,
html body.academy-new-checkout-page #payment > .form-row.validate-required.terms,
html body.academy-new-checkout-page .form-row.terms,
html body.academy-new-checkout-page .wc-terms-and-conditions {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  text-align: center !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page form.checkout .form-row.terms label,
html body.academy-new-checkout-page form.checkout .form-row.validate-required.terms label,
html body.academy-new-checkout-page #payment > .form-row.terms label,
html body.academy-new-checkout-page .form-row.terms label,
html body.academy-new-checkout-page .wc-terms-and-conditions label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  color: #fff !important;
}

/* ============================================
   v29 (2026-05-05) /new-checkout/ payment 內部 80% 寬 + 下單按鈕 300px
   - #payment 子元素內縮到 80% 並水平置中
   - terms wrapper 用 flex column center
   - .academy-id-section 整段隱藏
   ============================================ */
html body.academy-new-checkout-page #payment > ul.payment_methods,
html body.academy-new-checkout-page #payment > .woocommerce-privacy-policy-text,
html body.academy-new-checkout-page #payment > .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page #payment > .form-row.terms,
html body.academy-new-checkout-page #payment > .form-row.validate-required.terms,
html body.academy-new-checkout-page #payment > .terms,
html body.academy-new-checkout-page #payment > .place-order,
html body.academy-new-checkout-page #payment > .form-row.place-order {
  width: 90% !important;
  max-width: 90% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 下單購買按鈕：300px 寬，水平置中 */
html body.academy-new-checkout-page #payment > .place-order button#place_order,
html body.academy-new-checkout-page #payment > .place-order button[name="woocommerce_checkout_place_order"],
html body.academy-new-checkout-page #payment .place-order button#place_order {
  display: block !important;
  width: 300px !important;
  max-width: 300px !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* terms wrapper：flex column align center width 100% — 套用用戶提供的規則 */
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page form.checkout .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page #payment .woocommerce-terms-and-conditions-wrapper {
  color: #fff !important;
  font-size: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  margin: 0 !important;
}

/* .academy-id-section 整段隱藏（CSS 強制，JS 蓋不掉時的後盾） */
html body .academy-id-section,
html body.academy-new-checkout-page .academy-id-section,
.academy-id-section {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* ============================================
   v31 (2026-05-05) 電腦版改三段式排版（單欄垂直）
   1. 購買課程清單（#order_review 含 review-order-table）
   2. 購買者資訊（#customer_details）
   3. 付款方式（#payment — 需 JS 從 #order_review 移到 form 末尾）
   覆蓋 v16 grid 兩欄佈局
   ============================================ */
html body.academy-new-checkout-page form.checkout,
html body.academy-new-checkout-page form.woocommerce-checkout {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 32px !important;
  align-items: stretch !important;
}
html body.academy-new-checkout-page form.checkout > #order_review_heading,
html body.academy-new-checkout-page form.woocommerce-checkout > #order_review_heading {
  order: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-column: auto !important;
  grid-row: auto !important;
}
html body.academy-new-checkout-page form.checkout > #order_review,
html body.academy-new-checkout-page form.woocommerce-checkout > #order_review {
  order: 2 !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-column: auto !important;
  grid-row: auto !important;
}
html body.academy-new-checkout-page form.checkout > #customer_details,
html body.academy-new-checkout-page form.woocommerce-checkout > #customer_details,
html body.academy-new-checkout-page form.checkout > .col2-set,
html body.academy-new-checkout-page form.woocommerce-checkout > .col2-set {
  order: 3 !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-column: auto !important;
  grid-row: auto !important;
}
html body.academy-new-checkout-page form.checkout > #payment,
html body.academy-new-checkout-page form.woocommerce-checkout > #payment {
  order: 4 !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-column: auto !important;
  grid-row: auto !important;
  margin-top: 48px !important; /* 給絕對定位的 .academy-payment-tabs 留空間 */
  margin-bottom: 60px !important; /* 2026-05-26 電腦版底部 60px 跟下方按鈕區分開 */
}

/* ============================================
   v30 (2026-05-05) 手機版付款區重疊修正
   - .academy-payment-tabs 在 mobile 改回 in-flow（不 absolute）
   - #payment 用 flex order 推到 #order_review 最底
   - #order_review 用 flex column 確保子元素垂直排列
   ============================================ */
@media (max-width: 768px) {
  html body.academy-new-checkout-page .academy-payment-tabs {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    margin: 0 0 0 0 !important;
    z-index: auto !important;
  }
  html body.academy-new-checkout-page #payment {
    margin-top: 0 !important;
    padding-top: 18px !important;
    order: 999 !important;
    /* 2026-05-26 B-16.BW #65：手機版 tab 改在 #payment 外，box 只剩 bottom radius（跟電腦版一致） */
    border-radius: 0 0 14px 14px !important;
  }
  html body.academy-new-checkout-page form.checkout #order_review,
  html body.academy-new-checkout-page form.woocommerce-checkout #order_review {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
  html body.academy-new-checkout-page #order_review > #payment,
  html body.academy-new-checkout-page #order_review > #payment.academy-payment-relocated {
    order: 999 !important;
    margin-top: 0 !important;
  }
  /* 2026-05-26 B-16.BW #65：tab 已移到 #payment 之前的 sibling，#payment 的 margin-top 全部歸 0，讓 tab 跟 box 緊貼無縫；底部加 50px 跟下方按鈕分開 */
  html body.academy-new-checkout-page form.checkout > #payment,
  html body.academy-new-checkout-page form.woocommerce-checkout > #payment,
  html body.academy-new-checkout-page #payment.woocommerce-checkout-payment {
    margin-top: 0 !important;
    margin-bottom: 50px !important;
  }
  /* 書籤底部圓角去掉，跟 payment_box 連續 */
  html body.academy-new-checkout-page .academy-payment-tab-btn {
    border-radius: 10px 10px 0 0 !important;
  }
}

/* ============================================
   v32 (2026-05-06) 結帳頁 8 項微調
   #1 購買課程清單 cart_item 改左右兩欄（圖+標題 vs 價格）
   #5 標題「結帳」→「付款詳情」置中 + 頂部重要提醒區塊
   #6 原價 / 折價在右欄上下排列、靠右
   #7 地址欄位一排兩欄 + 「主要收件地址」標題
   #8 /new-cart/ 折價券按鈕 +10% + 外框包住
   ============================================ */

/* ---------- #5 付款詳情標題置中 + 重要提醒區塊 ---------- */
html body.academy-new-checkout-page #order_review_heading,
html body.academy-new-checkout-page form.checkout > #order_review_heading {
  text-align: center !important;
  font-size: 28px !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin: 0 0 24px !important;
  letter-spacing: 1px !important;
}
html body.academy-new-checkout-page form.checkout > .academy-checkout-notice {
  order: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 16px !important;
  padding: 18px 22px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(57, 255, 245, 0.35) !important;
  border-left: 3px solid #39FFF5 !important;
  border-radius: 8px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
  letter-spacing: 0.3px !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .academy-checkout-notice__title {
  display: block !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #39FFF5 !important;
  margin: 0 0 8px !important;
  letter-spacing: 0.5px !important;
}
html body.academy-new-checkout-page .academy-checkout-notice ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page .academy-checkout-notice li {
  position: relative !important;
  padding-left: 16px !important;
  margin: 4px 0 !important;
}
html body.academy-new-checkout-page .academy-checkout-notice li::before {
  content: '' !important;
  position: absolute !important;
  left: 4px !important;
  top: 10px !important;
  width: 5px !important;
  height: 5px !important;
  border-radius: 50% !important;
  background: #39FFF5 !important;
}

/* ---------- #1 / #6 購買課程清單 改左右兩欄（覆蓋 v3/v4 block layout） ---------- */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto) !important;
  grid-template-rows: auto !important;
  column-gap: 16px !important;
  row-gap: 8px !important;
  align-items: start !important;
  padding: 16px !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}
/* 左欄：圖 + 標題 + 場次 + 數量 */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
  grid-column: 1 / 2 !important;
  grid-row: 1 / 2 !important;
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  padding: 0 !important;
  border: none !important;
}
/* 場次下拉拉到左欄底（保留在 td.product-name 內，自然 flow） */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item .academy-cart-selects {
  margin: 10px 0 0 92px !important;
  width: calc(100% - 92px) !important;
}

/* 右欄：原價（上）+ 折價（下），統一靠右 */
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
  grid-column: 2 / 3 !important;
  grid-row: 1 / 2 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  text-align: right !important;
  white-space: nowrap !important;
  min-width: 100px !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > .academy-cart-regular-price {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 12px !important;
  color: #888 !important;
  text-align: right !important;
  text-decoration: line-through !important;
  flex: 0 0 auto !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > .academy-cart-regular-price .woocommerce-Price-amount,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > .academy-cart-regular-price bdi {
  text-decoration: line-through !important;
  color: #888 !important;
  font-size: 12px !important;
}
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > .woocommerce-Price-amount,
html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total > bdi {
  display: block !important;
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #39FFF5 !important;
  text-align: right !important;
  flex: 0 0 auto !important;
}

/* RWD ≤ 540px：恢復單欄垂直 */
@media (max-width: 540px) {
  html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item {
    grid-template-columns: 1fr !important;
  }
  html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-name {
    grid-column: 1 / 2 !important;
    grid-row: 1 / 2 !important;
  }
  html body.academy-new-checkout-page table.woocommerce-checkout-review-order-table tr.cart_item td.product-total {
    grid-column: 1 / 2 !important;
    grid-row: 2 / 3 !important;
    margin-top: 10px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    flex-direction: column !important;
    align-items: flex-end !important;
  }
}

/* ---------- #7 billing 欄位容器：B-12.8 改為 flex column 直排（mid-row 自己處理左右兩欄）---------- */
html body.academy-new-checkout-page .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 20px !important;
}
/* shipping 區還保留兩欄 grid（不在這次改造範圍內） */
html body.academy-new-checkout-page .woocommerce-shipping-fields .shipping_address,
html body.academy-new-checkout-page .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  column-gap: 14px !important;
  row-gap: 14px !important;
}
/* 不該被切成半寬的欄位拉回整列：Email、地址 1、地址 2 */
html body.academy-new-checkout-page #billing_email_field,
html body.academy-new-checkout-page #shipping_email_field,
html body.academy-new-checkout-page #billing_address_1_field,
html body.academy-new-checkout-page #billing_address_2_field,
html body.academy-new-checkout-page #shipping_address_1_field,
html body.academy-new-checkout-page #shipping_address_2_field,
html body.academy-new-checkout-page #order_comments_field {
  grid-column: 1 / -1 !important;
}
/* WC 預設 form-row-first / -last 在 grid 內可能殘留 width 50%；歸零 */
html body.academy-new-checkout-page .woocommerce-billing-fields .form-row,
html body.academy-new-checkout-page .woocommerce-shipping-fields .form-row {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
}
@media (max-width: 540px) {
  html body.academy-new-checkout-page .woocommerce-shipping-fields .shipping_address,
  html body.academy-new-checkout-page .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
  html body.academy-new-checkout-page .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper {
    display: block !important;
  }
}

/* 「主要收件地址」標題（JS 把 #ship-to-different-address > label 的文字改寫後此區生效） */
html body.academy-new-checkout-page h3#ship-to-different-address {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin: 24px 0 12px !important;
  letter-spacing: 0.5px !important;
}
html body.academy-new-checkout-page h3#ship-to-different-address .woocommerce-form__label,
html body.academy-new-checkout-page h3#ship-to-different-address label {
  cursor: default !important;
  display: inline-block !important;
}
/* 隱藏「運送到不同地址」的 checkbox（已改為純標題） */
html body.academy-new-checkout-page #ship-to-different-address-checkbox {
  display: none !important;
}

/* ---------- #8 /new-cart/ 使用折價券按鈕 +10% + 外框包住 ---------- */
body.academy-new-cart-page .academy-coupon-section {
  border: 1px solid rgba(57, 255, 245, 0.3) !important;
  border-radius: 10px !important;
  padding: 14px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  margin-top: 16px !important;
}
body.academy-new-cart-page button.academy-coupon-toggle {
  font-size: 16.5px !important;       /* 原 ~15 → +10% */
  padding: 13.2px 22px !important;     /* 原 12px 20px → +10% */
  letter-spacing: 0.5px !important;
}
body.academy-new-cart-page .academy-coupon-form {
  margin-top: 12px !important;
}

/* ============================================
   v33 (2026-05-06) B-11 結帳頁版型改造
   結構（由 JS 在 #ship-to-different-address 之前建好）：
     form.checkout
       └── .acad-shell (max-width 1140)
             ├── .academy-checkout-notice (full)
             ├── .acad-row.acad-row--1  → flex 兩欄
             │     ├── .acad-col--info
             │     └── .acad-col--payment
             └── .acad-row.acad-row--2  → flex 兩欄
                   ├── .acad-col--cart
                   └── .acad-col--addon
   重點：
   - form.checkout 維持 block；shell 控制最大寬度
   - 直接重置 v16/v31/v32 的 grid/flex 在 form.checkout 上的設定，避免 conflict
   - 行內元素以 flex (容易處理 children 寬度) 不用 grid
   - 1140px 是頁面容器最大寬，shell 居中
   ============================================ */

/* 重置 form.checkout 為單純 block：v16/v31 是 grid/flex，會干擾 .acad-shell 內部排版 */
html body.academy-new-checkout-page form.checkout,
html body.academy-new-checkout-page form.woocommerce-checkout {
  display: block !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  flex-direction: unset !important;
  gap: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* shell：1140 居中容器 */
html body.academy-new-checkout-page .acad-shell {
  width: 100% !important;
  max-width: 1140px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  padding: 0 !important;
}

/* 重置「heading + notice 是 form 直接子元素」這類舊規則的影響：
   它們現在被搬進 .acad-shell 裡，作為一般 block 子元素 */
html body.academy-new-checkout-page .acad-shell > #order_review_heading {
  display: none !important;
}
html body.academy-new-checkout-page .acad-shell > .academy-checkout-notice {
  margin: 0 0 24px !important;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

/* row：兩欄 flex（gap 28，子元素 1:1 拉伸） */
html body.academy-new-checkout-page .acad-shell .acad-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 28px !important;
  align-items: stretch !important;
  margin: 0 0 28px !important;
  width: 100% !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page .acad-shell .acad-row:last-child {
  margin-bottom: 0 !important;
}
html body.academy-new-checkout-page .acad-shell .acad-col {
  flex: 1 1 0 !important;
  min-width: 0 !important; /* 防止 flex 子元素被內部寬度撐爆 */
  width: 50% !important;
  max-width: 50% !important;
  box-sizing: border-box !important;
  padding: 18px 20px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 12px !important;
  display: block !important;
}
/* 全寬 row：col 佔滿整個容器 */
html body.academy-new-checkout-page .acad-shell .acad-row--full .acad-col {
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 100% !important;
}
/* 2026-05-11 #0：重要提醒區 — 20% 白底 + 8px 圓角 + 重點色連結 + 純白文字 */
html body.academy-new-checkout-page .acad-shell > .academy-checkout-notice,
html body.academy-new-checkout-page .academy-checkout-notice {
  border: none !important;
  border-left: none !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  padding: 16px 20px !important;
  margin: 0 0 24px !important;
  order: 0 !important;
  color: #fff !important;
}
html body.academy-new-checkout-page .academy-checkout-notice,
html body.academy-new-checkout-page .academy-checkout-notice * {
  color: #fff !important;
}
html body.academy-new-checkout-page .academy-checkout-notice a,
html body.academy-new-checkout-page .academy-checkout-notice a *,
html body.academy-new-checkout-page .academy-checkout-notice a:hover,
html body.academy-new-checkout-page .academy-checkout-notice a:visited,
html body.academy-new-checkout-page .academy-checkout-notice a:focus {
  color: #39FFF5 !important;
}

/* 重置：被搬進 col 內的 #customer_details / #payment / #order_review / .academy-recommendations
   不要再被舊規則設 grid-column / grid-row / order / position absolute 等 */
html body.academy-new-checkout-page .acad-col > #customer_details,
html body.academy-new-checkout-page .acad-col > .col2-set,
html body.academy-new-checkout-page .acad-col > #order_review,
html body.academy-new-checkout-page .acad-col > #payment,
html body.academy-new-checkout-page .acad-col > .academy-recommendations {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  grid-column: auto !important;
  grid-row: auto !important;
  order: unset !important;
  float: none !important;
  background: transparent !important;
  border: none !important;
}
/* col 內 col2-set 的 .col-1 / .col-2 也歸零（WC 預設 50%） */
html body.academy-new-checkout-page .acad-col .col2-set .col-1,
html body.academy-new-checkout-page .acad-col .col2-set .col-2 {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
}

/* 區塊標題（B-12.7：移除底線，標題與下方欄位區塊間距 — 2026-05-14 user：改 20px） */
html body.academy-new-checkout-page .acad-shell .acad-section-title {
  display: block !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin: 0 0 20px !important;
  padding: 0 !important;
  border-bottom: 0 !important;
  letter-spacing: 0.5px !important;
}
html body.academy-new-checkout-page .acad-shell .acad-section-title::before {
  content: '' !important;
  display: inline-block !important;
  width: 4px !important;
  height: 14px !important;
  background: #39FFF5 !important;
  margin-right: 10px !important;
  vertical-align: -1px !important;
  border-radius: 2px !important;
}

/* B6 / B-12.19：不同收件地址 — 簡化為跟 acad-section-title 一致的視覺，
   只留圓形勾選 + 文字，不再是大圓角面板
   B-12.21：上下 20px 間距 */
html body.academy-new-checkout-page h3#ship-to-different-address {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  color: #fff !important;
  margin: 20px 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: color 0.2s !important;
}
html body.academy-new-checkout-page h3#ship-to-different-address:hover {
  color: #39FFF5 !important;
}
html body.academy-new-checkout-page h3#ship-to-different-address label {
  cursor: pointer !important;
  margin: 0 !important;
  font: inherit !important;
  color: inherit !important;
  flex: 1 1 auto !important;
}
html body.academy-new-checkout-page h3#ship-to-different-address #ship-to-different-address-checkbox {
  display: none !important;
}

/* 自訂圓形勾選方塊 */
html body.academy-new-checkout-page .acad-ship-toggle {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  width: 22px !important;
  height: 22px !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  align-items: center !important;
  justify-content: center !important;
  transition: border-color 0.2s, background 0.2s !important;
}
html body.academy-new-checkout-page .acad-ship-toggle.is-checked {
  border-color: #39FFF5 !important;
  background: #39FFF5 !important;
}
html body.academy-new-checkout-page .acad-ship-toggle__circle {
  display: block !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: transparent !important;
  transition: background 0.2s !important;
}
html body.academy-new-checkout-page .acad-ship-toggle.is-checked .acad-ship-toggle__circle {
  background: #1a1a1a !important;
}

/* 預設不勾 → 隱藏 shipping_address fields；勾選 → 顯示 */
html body.academy-new-checkout-page:not(.acad-shipping-open) .shipping_address {
  display: none !important;
}
html body.academy-new-checkout-page.acad-shipping-open .shipping_address {
  display: grid !important;
}

/* B4：T-shirt 尺寸對照按鈕 inline 在版型 row 右側 */
html body.academy-new-checkout-page .acad-size-chart-inline {
  display: inline-flex !important;
  margin-left: 12px !important;
  vertical-align: middle !important;
}
html body.academy-new-checkout-page .acad-size-chart-inline .size-chart-btn {
  appearance: none !important;
  background: transparent !important;
  border: 1px solid #39FFF5 !important;
  color: #39FFF5 !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  letter-spacing: 0.3px !important;
  transition: background 0.2s, color 0.2s !important;
  white-space: nowrap !important;
}
html body.academy-new-checkout-page .acad-size-chart-inline .size-chart-btn:hover {
  background: #39FFF5 !important;
  color: #1a1a1a !important;
}
/* T-shirt 版型 row：把 wrapper 改 flex 讓按鈕能 inline */
html body.academy-new-checkout-page #billing_tshirt_gender_field {
  position: relative !important;
}
html body.academy-new-checkout-page #billing_tshirt_gender_field .woocommerce-input-wrapper {
  display: inline-flex !important;
  align-items: center !important;
}
/* B4：尺寸對照 modal */
.acad-size-chart-modal[hidden] { display: none !important; }
.acad-size-chart-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.acad-size-chart-modal__backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}
.acad-size-chart-modal__dialog {
  position: relative !important;
  background: #1a1a1a !important;
  border: 1px solid rgba(57, 255, 245, 0.3) !important;
  border-radius: 12px !important;
  padding: 32px !important;
  max-width: 500px !important;
  width: 92vw !important;
  color: #fff !important;
}
.acad-size-chart-modal__close {
  position: absolute !important;
  top: 12px !important;
  right: 16px !important;
  background: transparent !important;
  border: 0 !important;
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 24px !important;
  cursor: pointer !important;
  line-height: 1 !important;
}
.acad-size-chart-modal__title {
  margin: 0 0 20px !important;
  font-size: 22px !important;
  color: #39FFF5 !important;
  text-align: center !important;
}
.acad-size-chart-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 14px !important;
}
.acad-size-chart-table th,
.acad-size-chart-table td {
  padding: 10px 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  text-align: center !important;
}
.acad-size-chart-table thead th {
  color: #39FFF5 !important;
  font-weight: 700 !important;
}
.acad-size-chart-modal__note {
  margin: 18px 0 0 !important;
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.5) !important;
  text-align: center !important;
}

/* B1：郵遞區號預覽（小字提示） */
html body.academy-new-checkout-page .acad-postcode-preview {
  display: block !important;
  margin-top: 6px !important;
  font-size: 12px !important;
  color: rgba(57, 255, 245, 0.7) !important;
  letter-spacing: 0.3px !important;
}

/* ============================================
   v33 欄位 grid 位置精確指定（覆蓋 v32 auto-flow 亂配對）
   v32 grid-template-columns: 1fr 1fr 預設 2 col；用 grid-column: 1 / -1 強制全寬，其餘自動配對
   ============================================ */

/* 全寬欄位（覆蓋整個 row） */
html body.academy-new-checkout-page #billing_english_name_field,
html body.academy-new-checkout-page #billing_region_field,
html body.academy-new-checkout-page #billing_address_1_field,
html body.academy-new-checkout-page #billing_address_2_field,
html body.academy-new-checkout-page #billing_member2_section_field,
html body.academy-new-checkout-page #billing_member2_english_name_field,
html body.academy-new-checkout-page #billing_member2_region_field,
html body.academy-new-checkout-page .academy-tshirt-row,
html body.academy-new-checkout-page #billing_tshirt_size_field,
html body.academy-new-checkout-page #billing_member2_tshirt_size_field {
  grid-column: 1 / -1 !important;
}

/* T-shirt row 全寬，內部 flex 三欄橫排（B-12.14 重排）
   比例：男/女 toggle 50% + 尺寸 dropdown 25% + 尺寸對照按鈕 25% */
html body.academy-new-checkout-page .academy-tshirt-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 45px !important;
}
html body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_gender_field {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_size_field {
  flex: 1 1 25% !important;
  min-width: 0 !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* B-12.14：強制顯示對照按鈕（蓋過 inline display: none） */
html body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field {
  flex: 1 1 25% !important;
  min-width: 0 !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}
html body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field > .size-chart-btn,
html body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field > button {
  width: 100% !important;
  height: 45px !important;
  padding: 0 14px !important;
  background: rgba(0, 0, 0, 0.40) !important;
  border: 1px solid #39FFF5 !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.15s, color 0.15s !important;
}
html body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field > .size-chart-btn:hover,
html body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field > button:hover {
  background: #39FFF5 !important;
  color: #0a0a0a !important;
}

/* B-12.14：T-shirt 版型欄位 — 隱藏外層 label，內部包成 segmented toggle */
html body.academy-new-checkout-page #billing_tshirt_gender_field > label {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
html body.academy-new-checkout-page #billing_tshirt_gender_field > .woocommerce-input-wrapper {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: rgba(0, 0, 0, 0.80) !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"].input-radio {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #C2C2C2 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 2px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
/* 2026-05-11 user 回饋：T-shirt 滑塊 hover 不要淡 cyan 殘影；checked 改純 #39FFF5 + 黑字 */
html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio:hover {
  background: transparent !important;
  color: #fff !important;
}
html body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"].input-radio:checked + label.radio,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field input[type="radio"].input-radio:checked + label.radio {
  /* 2026-05-14 B-16.N：label bg 改 transparent，cyan 由 wrapper::before pill 唯一提供（消除兩塊 cyan 殘影） */
  background: transparent !important;
  color: #0a0a0a !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

/* B-12.14：T-shirt 尺寸下拉 — 隱藏外層 label，select 套深底 + 圓角 */
html body.academy-new-checkout-page #billing_tshirt_size_field > label {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
html body.academy-new-checkout-page #billing_tshirt_size_field > .woocommerce-input-wrapper {
  width: 100% !important;
  height: 45px !important;
  display: block !important;
}
html body.academy-new-checkout-page #billing_tshirt_size_field select {
  width: 100% !important;
  height: 45px !important;
  padding: 0 36px 0 16px !important;
  border-radius: 8px !important;
  border: 0 !important;
  background-color: rgba(0, 0, 0, 0.40) !important;
  color: #fff !important;
  font-size: 14px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2339FFF5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

/* 隱藏：v33 不顯示這些欄位（country / postcode 由地址 JS 自動填） */
html body.academy-new-checkout-page #billing_country_field,
html body.academy-new-checkout-page #billing_member2_size_chart_button_field {
  display: none !important;
}
/* 注意：size_chart_button_field 不能 display: none（在 academy-tshirt-row 內，需要顯示按鈕） */

/* B-12.14b：保險強制 gender / size 欄位顯示（蓋過任何 display: none 來源） */
html body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_gender_field,
html body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_size_field {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
}
html body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_gender_field > .woocommerce-input-wrapper,
html body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_size_field > .woocommerce-input-wrapper {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 撤銷 v32 把 email 設成 1/-1 全寬：改回半寬讓它跟 LINE ID 配對 */
html body.academy-new-checkout-page #billing_email_field {
  grid-column: auto !important;
}
/* LINE ID 半寬，配對 email */
html body.academy-new-checkout-page #billing_line_id_field {
  grid-column: auto !important;
}
/* 出生年月日 + 聯絡電話 半寬配對（PHP 已把 phone priority 改 41 接在 birth 39 後） */
html body.academy-new-checkout-page #billing_birth_date_field,
html body.academy-new-checkout-page #billing_phone_field {
  grid-column: auto !important;
}
/* 縣市 / 區域 半寬配對（state 70 + city 80 自然相鄰） */
html body.academy-new-checkout-page #billing_state_field,
html body.academy-new-checkout-page #billing_city_field {
  grid-column: auto !important;
}
/* 身分證/護照：根據選中身份只顯示一個，但容器全寬避免空缺 */
html body.academy-new-checkout-page #billing_tw_id_number_field,
html body.academy-new-checkout-page #billing_passport_number_field {
  grid-column: 1 / -1 !important;
}

/* ============================================
   v33 地區書籤 tabs + 地址欄位 panel（40% 黑線框）
   結構：
     .acad-address-block (form-row 全寬, 40% 黑線框)
       ├── .acad-addr-tabs (頂部書籤列)
       │     ├── .acad-addr-tab[data-mode="taiwan"]
       │     └── .acad-addr-tab[data-mode="overseas"]
       └── .acad-address-panel (grid 兩欄，所有地址欄位都在這裡)
             ├── .acad-tw-row [state, city, postcode]   (台灣模式)
             ├── #billing_address_1_field
             ├── #billing_address_2_field               (國外模式)
             └── #billing_country_field                 (國外模式)
   ============================================ */

/* 包圍整塊：40% 黑色線框 */
html body.academy-new-checkout-page .acad-address-block {
  grid-column: 1 / -1 !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 8px 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.4) !important;
  border-radius: 10px !important;
  background: rgba(0, 0, 0, 0.05) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* 頂部書籤列 */
html body.academy-new-checkout-page .acad-addr-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.2) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4) !important;
}
html body.academy-new-checkout-page .acad-addr-tab {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 14px 16px !important;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 0 !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  cursor: pointer !important;
  transition: background 0.15s, color 0.15s !important;
  margin: 0 !important;
  height: auto !important;
  line-height: 1.4 !important;
  text-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  position: relative !important;
}
html body.academy-new-checkout-page .acad-addr-tab:last-child {
  border-right: none !important;
}
html body.academy-new-checkout-page .acad-addr-tab:hover,
html body.academy-new-checkout-page .acad-addr-tab:focus {
  background: rgba(57, 255, 245, 0.08) !important;
  color: #39FFF5 !important;
  outline: none !important;
}
html body.academy-new-checkout-page .acad-addr-tab.is-active {
  background: rgba(0, 0, 0, 0.5) !important;
  color: #39FFF5 !important;
  box-shadow: inset 0 -2px 0 #39FFF5 !important;
}

/* 下方 panel：flex column，3 個 sub-row 容器 */
html body.academy-new-checkout-page .acad-address-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding: 18px !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Taiwan 模式 row：30% 縣市區 + 70% 街道地址 */
html body.academy-new-checkout-page .acad-tw-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page .acad-tw-row > #billing_city_field {
  flex: 0 0 30% !important;
  max-width: 30% !important;
  min-width: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page .acad-tw-row > #billing_address_1_field {
  flex: 1 1 70% !important;
  max-width: 70% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

/* 國外模式 row 1：55% 國家 + 45% (state + postcode 子 flex) */
html body.academy-new-checkout-page .acad-os-row-1 {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 14px !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page .acad-os-row-1 > #billing_country_field {
  /* 2026-05-14 B-16.T：用 flex-grow 比例分（不是固定 55%），gap 14px 會被 flex 自動扣掉，避免右邊溢出 */
  flex: 55 1 0 !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page .acad-os-state-postcode {
  flex: 45 1 0 !important;
  max-width: none !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
}
html body.academy-new-checkout-page .acad-os-state-postcode > #billing_state_field {
  flex: 1 1 60% !important;
  min-width: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page .acad-os-state-postcode > #billing_postcode_field {
  flex: 1 1 40% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

/* 國外模式 row 2：addr1 + addr2 上下排各佔 100%（user 2026-05-14 — 容器寬度跟上方 row 對齊） */
html body.academy-new-checkout-page .acad-os-row-2 {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 14px !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page .acad-os-row-2 > .form-row {
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

/* ----- 模式顯隱（billing 獨立用 .acad-tw-row / .acad-os-row-*） ----- */
body.academy-new-checkout-page.acad-addr-taiwan .acad-tw-row { display: flex !important; }
body.academy-new-checkout-page.acad-addr-taiwan .acad-os-row-1,
body.academy-new-checkout-page.acad-addr-taiwan .acad-os-row-2 { display: none !important; }

body.academy-new-checkout-page.acad-addr-overseas .acad-tw-row { display: none !important; }
body.academy-new-checkout-page.acad-addr-overseas .acad-os-row-1,
body.academy-new-checkout-page.acad-addr-overseas .acad-os-row-2 { display: flex !important; }
body.academy-new-checkout-page.acad-addr-overseas #billing_city_field { display: none !important; }
body.academy-new-checkout-page.acad-addr-overseas #billing_country_field,
body.academy-new-checkout-page.acad-addr-overseas p.form-row#billing_country_field {
  display: block !important;
}
body.academy-new-checkout-page.acad-addr-taiwan #billing_country_field {
  display: none !important;
}

/* ----- 模式顯隱（shipping 獨立用 .acad-ship-tw-row / .acad-ship-os-row-*） ----- */
/* 預設 Taiwan（無 acad-ship-addr-* class 時也是 Taiwan） */
body.academy-new-checkout-page .acad-ship-tw-row { display: flex; }
body.academy-new-checkout-page .acad-ship-os-row-1,
body.academy-new-checkout-page .acad-ship-os-row-2 { display: none; }

body.academy-new-checkout-page.acad-ship-addr-taiwan .acad-ship-tw-row { display: flex !important; }
body.academy-new-checkout-page.acad-ship-addr-taiwan .acad-ship-os-row-1,
body.academy-new-checkout-page.acad-ship-addr-taiwan .acad-ship-os-row-2 { display: none !important; }
body.academy-new-checkout-page.acad-ship-addr-taiwan #shipping_country_field { display: none !important; }

body.academy-new-checkout-page.acad-ship-addr-overseas .acad-ship-tw-row { display: none !important; }
body.academy-new-checkout-page.acad-ship-addr-overseas .acad-ship-os-row-1,
body.academy-new-checkout-page.acad-ship-addr-overseas .acad-ship-os-row-2 { display: flex !important; }
body.academy-new-checkout-page.acad-ship-addr-overseas #shipping_city_field { display: none !important; }
body.academy-new-checkout-page.acad-ship-addr-overseas #shipping_country_field {
  display: block !important;
}

/* ============================================
   v33 shipping address layout — rules 複製自 billing 的 .acad-tw-row / .acad-os-row-*
   shipping 用 .acad-ship-* prefix 完全分離，避免 jQuery selector 同時匹配兩邊
   ============================================ */
html body.academy-new-checkout-page .acad-ship-address-block {
  grid-column: 1 / -1 !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 8px 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.4) !important;
  border-radius: 10px !important;
  background: rgba(0, 0, 0, 0.05) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
html body.academy-new-checkout-page .acad-ship-addr-tabs {
  display: flex !important;
  flex-direction: row !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.2) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.4) !important;
}
html body.academy-new-checkout-page .acad-ship-addr-tab {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 14px 16px !important;
  background: transparent !important;
  border: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 0 !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background 0.15s, color 0.15s !important;
  margin: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
html body.academy-new-checkout-page .acad-ship-addr-tab:last-child { border-right: none !important; }
html body.academy-new-checkout-page .acad-ship-addr-tab:hover {
  background: rgba(57, 255, 245, 0.08) !important;
  color: #39FFF5 !important;
}
html body.academy-new-checkout-page .acad-ship-addr-tab.is-active {
  background: rgba(0, 0, 0, 0.5) !important;
  color: #39FFF5 !important;
  box-shadow: inset 0 -2px 0 #39FFF5 !important;
}
html body.academy-new-checkout-page .acad-ship-address-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding: 18px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* ship Taiwan row：30% 縣市區 + 70% 街道地址 */
html body.academy-new-checkout-page .acad-ship-tw-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 14px !important;
  width: 100% !important;
}
html body.academy-new-checkout-page .acad-ship-tw-row > #shipping_city_field {
  flex: 0 0 30% !important; max-width: 30% !important; min-width: 0 !important; margin: 0 !important;
}
html body.academy-new-checkout-page .acad-ship-tw-row > #shipping_address_1_field {
  flex: 1 1 70% !important; max-width: 70% !important; min-width: 0 !important; margin: 0 !important;
}
/* ship OS row 1：比照 billing — flex-grow 55/45，gap 自動扣 */
html body.academy-new-checkout-page .acad-ship-os-row-1 {
  display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 14px !important; width: 100% !important; max-width: 100% !important; margin: 0 !important;
}
html body.academy-new-checkout-page .acad-ship-os-row-1 > #shipping_country_field {
  flex: 55 1 0 !important; max-width: none !important; min-width: 0 !important; margin: 0 !important;
}
html body.academy-new-checkout-page .acad-ship-os-state-postcode {
  flex: 45 1 0 !important; max-width: none !important; min-width: 0 !important; display: flex !important; flex-direction: row !important; gap: 10px !important;
}
html body.academy-new-checkout-page .acad-ship-os-state-postcode > #shipping_state_field {
  flex: 1 1 60% !important; min-width: 0 !important; margin: 0 !important;
}
html body.academy-new-checkout-page .acad-ship-os-state-postcode > #shipping_postcode_field {
  flex: 1 1 40% !important; min-width: 0 !important; margin: 0 !important;
  display: block !important;
}
/* ship OS row 2：比照 billing — column + 100%，addr1 / addr2 上下各撐 */
html body.academy-new-checkout-page .acad-ship-os-row-2 {
  display: flex !important; flex-direction: column !important; flex-wrap: nowrap !important; gap: 14px !important; width: 100% !important; max-width: 100% !important; margin: 0 !important;
}
html body.academy-new-checkout-page .acad-ship-os-row-2 > .form-row {
  flex: 1 1 100% !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; margin: 0 !important;
}
/* shipping 國外模式：隱藏 city（city 是台灣模式才用） */
body.academy-new-checkout-page.acad-ship-addr-overseas #shipping_city_field {
  display: none !important;
}
@media (max-width: 768px) {
  html body.academy-new-checkout-page .acad-ship-tw-row,
  html body.academy-new-checkout-page .acad-ship-os-row-1,
  html body.academy-new-checkout-page .acad-ship-os-row-2,
  html body.academy-new-checkout-page .acad-ship-os-state-postcode {
    flex-direction: column !important;
  }
  html body.academy-new-checkout-page .acad-ship-tw-row > #shipping_city_field,
  html body.academy-new-checkout-page .acad-ship-tw-row > #shipping_address_1_field,
  html body.academy-new-checkout-page .acad-ship-os-row-1 > #shipping_country_field,
  html body.academy-new-checkout-page .acad-ship-os-state-postcode,
  html body.academy-new-checkout-page .acad-ship-os-row-2 > .form-row {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }
}

/* ----- 身分證 segmented 與其下方 id_number/passport input 之間不要間距（視覺上是一組） ----- */
html body.academy-new-checkout-page #billing_region_field,
html body.academy-new-checkout-page #billing_member2_region_field {
  margin-bottom: 4px !important;
}
html body.academy-new-checkout-page #billing_tw_id_number_field,
html body.academy-new-checkout-page #billing_passport_number_field,
html body.academy-new-checkout-page #billing_member2_tw_id_number_field,
html body.academy-new-checkout-page #billing_member2_passport_number_field {
  margin-top: 0 !important;
}

/* ----- 姓氏 + 名字 + 服務單位 三欄 ----- */
html body.academy-new-checkout-page .acad-name-row {
  grid-column: 1 / -1 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 14px !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page .acad-name-row > .form-row {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  float: none !important;
}

/* RWD ≤768px：地址內所有 row 改單欄 */
@media (max-width: 768px) {
  html body.academy-new-checkout-page .acad-tw-row,
  html body.academy-new-checkout-page .acad-os-row-1,
  html body.academy-new-checkout-page .acad-os-row-2,
  html body.academy-new-checkout-page .acad-os-state-postcode,
  html body.academy-new-checkout-page .acad-name-row {
    flex-direction: column !important;
  }
  html body.academy-new-checkout-page .acad-tw-row > #billing_city_field,
  html body.academy-new-checkout-page .acad-tw-row > #billing_address_1_field,
  html body.academy-new-checkout-page .acad-os-row-1 > #billing_country_field,
  html body.academy-new-checkout-page .acad-os-state-postcode,
  html body.academy-new-checkout-page .acad-os-row-2 > .form-row,
  html body.academy-new-checkout-page .acad-name-row > .form-row {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }
  html body.academy-new-checkout-page .acad-addr-tab {
    padding: 12px 10px !important;
    font-size: 14px !important;
  }
}

/* ============================================
   v33 不同收件地址（shipping fields）— 套用跟 billing 一樣的 grid 規則
   ============================================ */

/* 全寬欄位 */
html body.academy-new-checkout-page #shipping_address_1_field,
html body.academy-new-checkout-page #shipping_address_2_field {
  grid-column: 1 / -1 !important;
}

/* 隱藏：國家自動 TW（postcode 由 B-16.AM 統一改為國外模式顯示，跟 billing 一致） */
html body.academy-new-checkout-page #shipping_country_field {
  display: none !important;
}

/* 半寬配對：first/last name、state/city */
html body.academy-new-checkout-page #shipping_first_name_field,
html body.academy-new-checkout-page #shipping_last_name_field,
html body.academy-new-checkout-page #shipping_state_field,
html body.academy-new-checkout-page #shipping_city_field,
html body.academy-new-checkout-page #shipping_company_field {
  grid-column: auto !important;
}

/* shipping fields 在 form-row 級別清掉 width:50% 殘留 */
html body.academy-new-checkout-page .woocommerce-shipping-fields .form-row {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
}

/* shipping_address 容器：跟 billing 一樣 grid 兩欄
   注意：跟 B6 顯隱 toggle 整合 — 預設 hide，勾選 acad-shipping-open 後才 show 為 grid */
html body.academy-new-checkout-page:not(.acad-shipping-open) .shipping_address {
  display: none !important;
}
html body.academy-new-checkout-page.acad-shipping-open .shipping_address {
  display: block !important;
  column-gap: 14px !important;
  row-gap: 14px !important;
}

/* ============================================
   v33 容器對齊修正：避免 col 內部 input/select 被父層 padding 推擠超出
   ============================================ */
html body.academy-new-checkout-page .acad-col input.input-text,
html body.academy-new-checkout-page .acad-col textarea,
html body.academy-new-checkout-page .acad-col select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* col 內所有 form-row 寬度 100%、無 margin（grid 用 gap 處理） */
html body.academy-new-checkout-page .acad-col .form-row {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* col 內 woocommerce-input-wrapper width 100% */
html body.academy-new-checkout-page .acad-col .woocommerce-input-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

/* B3：Email + LINE ID 並排（PHP priority email=100, line_id=105，配合 grid 自動） */
/* B2：phone + birth_date 並排（priority 39 + 100 — 強制讓 birth_date 進 grid 兩欄） */
/* （上述兩個由現有 v32 #7 grid 1fr 1fr 自動處理，不另寫） */

/* B5：發票欄位 — 索取方式（左）+ 憑證號碼/統編/捐贈（右）兩欄並排 + 增加 spacing */
html body.academy-new-checkout-page #cw-ecpei_fields {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  column-gap: 24px !important;
  row-gap: 18px !important;
  margin-top: 24px !important;
  padding: 18px 0 !important;
}
html body.academy-new-checkout-page #cw-ecpei_fields > h3 {
  grid-column: 1 / -1 !important;
  margin: 0 0 8px !important;
}
html body.academy-new-checkout-page #cw-ecpei_fields > p {
  grid-column: 1 / -1 !important;
  margin: 0 0 8px !important;
}
/* 第 1 欄（索取方式 select）— 跨 10 row 占住 col 1，避免右側多 input 時出現空格 */
html body.academy-new-checkout-page #cw-ecpei_field-flag {
  grid-column: 1 / 2 !important;
  grid-row: 1 / span 10 !important;
  align-self: start !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* 第 2 欄包裝 div：憑證號碼 / 統編 / 捐贈 等 — 都堆在右側（auto-place 在 col 2 row 1, 2, 3...）*/
html body.academy-new-checkout-page #cw-ecpei_fields > div:not(#cw-ecpei_field-flag) {
  grid-column: 2 / 3 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page #cw-ecpei_fields > div:not(#cw-ecpei_field-flag) > p {
  margin: 0 !important;
}
/* B-11 #B7（2026-05-07）：統編模式 ubn-title + ubn 兩 input 標籤上方提示樣式統一 */
html body.academy-new-checkout-page #cw-ecpei_field-ubn-title label,
html body.academy-new-checkout-page #cw-ecpei_field-ubn label {
  display: block !important;
  margin: 0 0 4px !important;
  font-size: 13px !important;
  color: rgba(255,255,255,0.78) !important;
  letter-spacing: 0.02em !important;
}
html body.academy-new-checkout-page #cw-ecpei_field-ubn input,
html body.academy-new-checkout-page #cw-ecpei_field-ubn-title input {
  width: 100% !important;
  box-sizing: border-box !important;
}
/* 統一編號為 8 碼，限制最大寬避免太長 */
html body.academy-new-checkout-page #cw-ecpei_field-ubn input {
  max-width: 220px !important;
  letter-spacing: 0.12em !important;
  font-variant-numeric: tabular-nums !important;
}

/* ============================================
   placeholder：focus 時淡出（focus 後會繼續顯示，輸入時透明）
   ============================================ */
html body.academy-new-checkout-page input::placeholder,
html body.academy-new-checkout-page textarea::placeholder,
html body.academy-new-checkout-page select::placeholder {
  color: rgba(255,255,255,0.4) !important;
  transition: opacity 0.18s ease !important;
  opacity: 1 !important;
}
html body.academy-new-checkout-page input:focus::placeholder,
html body.academy-new-checkout-page textarea:focus::placeholder {
  opacity: 0 !important;
}

/* ===== 手機版 ≤768px：row 改 column，col 全寬 ===== */
@media (max-width: 768px) {
  html body.academy-new-checkout-page .acad-shell {
    max-width: 100% !important;
    padding: 0 12px !important;
  }
  html body.academy-new-checkout-page .acad-shell .acad-row {
    flex-direction: column !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
  }
  html body.academy-new-checkout-page .acad-shell .acad-col {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    padding: 16px !important;
  }
  html body.academy-new-checkout-page #cw-ecpei_fields {
    grid-template-columns: 1fr !important;
  }
  html body.academy-new-checkout-page #cw-ecpei_fields > div:not(#cw-ecpei_field-flag) {
    display: block !important;
    grid-column: 1 / -1 !important;
  }
  html body.academy-new-checkout-page .acad-size-chart-inline {
    display: block !important;
    margin: 8px 0 0 !important;
  }
}

/* ============================================
   B-11 #B7（2026-05-07）：國家欄位 autocomplete 樣式
   - 取代 select2 下拉
   - input 與其它表單 input 同款式
   - 下拉清單黑底 / cyan hover
   ============================================ */
html body.academy-new-checkout-page .acad-country-search {
  position: relative !important;
  width: 100% !important;
}
html body.academy-new-checkout-page .acad-country-search__input {
  width: 100% !important;
  height: 56px !important;
  padding: 12px 16px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.18s ease, background-color 0.18s ease !important;
}
html body.academy-new-checkout-page .acad-country-search__input::placeholder {
  color: rgba(255, 255, 255, 0.45) !important;
  opacity: 1 !important;
}
html body.academy-new-checkout-page .acad-country-search__input:focus::placeholder {
  opacity: 0 !important;
}
html body.academy-new-checkout-page .acad-country-search__input:focus {
  border-color: #39FFF5 !important;
  background: rgba(57, 255, 245, 0.05) !important;
}
html body.academy-new-checkout-page .acad-country-search__list {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  max-height: 280px !important;
  overflow-y: auto !important;
  margin: 0 !important;
  padding: 6px 0 !important;
  list-style: none !important;
  background: #0e0e10 !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6) !important;
}
html body.academy-new-checkout-page .acad-country-search__list[hidden] {
  display: none !important;
}
html body.academy-new-checkout-page .acad-country-search__item {
  padding: 10px 16px !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  cursor: pointer !important;
  transition: background-color 0.12s ease, color 0.12s ease !important;
  margin: 0 !important;
  list-style: none !important;
}
html body.academy-new-checkout-page .acad-country-search__item:hover,
html body.academy-new-checkout-page .acad-country-search__item.is-active {
  background: rgba(57, 255, 245, 0.16) !important;
  color: #39FFF5 !important;
}
html body.academy-new-checkout-page .acad-country-search__empty {
  padding: 12px 16px !important;
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 14px !important;
  font-style: italic !important;
  margin: 0 !important;
  list-style: none !important;
}
/* 隱藏原本的 select2 容器（雙保險，JS 會 destroy + remove） */
html body.academy-new-checkout-page #billing_country_field .select2,
html body.academy-new-checkout-page #billing_country_field .select2-container,
html body.academy-new-checkout-page #shipping_country_field .select2,
html body.academy-new-checkout-page #shipping_country_field .select2-container {
  display: none !important;
}

/* ============================================
   B-11 #B8（2026-05-07 13:00）：用戶 12:43 提的 11 項視覺微調
   ============================================ */

/* #1：清掉 input/select/textarea 在 macOS / autofill 下的白底 */
html body.academy-new-checkout-page input.input-text,
html body.academy-new-checkout-page input[type="text"],
html body.academy-new-checkout-page input[type="email"],
html body.academy-new-checkout-page input[type="tel"],
html body.academy-new-checkout-page input[type="number"],
html body.academy-new-checkout-page input[type="password"],
html body.academy-new-checkout-page select,
html body.academy-new-checkout-page textarea,
html body.academy-new-checkout-page .acad-country-search__input {
  background-color: rgba(255, 255, 255, 0.04) !important;
  -webkit-text-fill-color: #fff !important;
  color: #fff !important;
}
html body.academy-new-checkout-page input:-webkit-autofill,
html body.academy-new-checkout-page select:-webkit-autofill,
html body.academy-new-checkout-page textarea:-webkit-autofill,
html body.academy-new-checkout-page input:-webkit-autofill:hover,
html body.academy-new-checkout-page input:-webkit-autofill:focus,
html body.academy-new-checkout-page .acad-country-search__input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px rgba(20, 22, 26, 1) inset !important;
  box-shadow: 0 0 0 1000px rgba(20, 22, 26, 1) inset !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff !important;
  transition: background-color 0s 600000s ease !important;
}
/* state select 下拉選項在系統 dropdown 內 (browser 控制)，但 select 本身禁止白底 */
html body.academy-new-checkout-page select option {
  background: #14161a !important;
  color: #fff !important;
}

/* #2：驗證紅字移除 — invalid label 維持白色，只保留必填星號的紅 */
html body.academy-new-checkout-page .form-row.woocommerce-invalid label,
html body.academy-new-checkout-page .form-row.woocommerce-invalid > label,
html body.academy-new-checkout-page .form-row.woocommerce-invalid .required_field {
  color: rgba(255, 255, 255, 0.85) !important;
}
html body.academy-new-checkout-page .form-row.woocommerce-invalid label .required {
  color: #ff4d6d !important;
}
/* invalid input 邊框也用比較柔和的顏色 */
html body.academy-new-checkout-page .form-row.woocommerce-invalid input.input-text,
html body.academy-new-checkout-page .form-row.woocommerce-invalid select,
html body.academy-new-checkout-page .form-row.woocommerce-invalid textarea,
html body.academy-new-checkout-page .form-row.woocommerce-invalid .acad-country-search__input {
  border-color: rgba(255, 100, 120, 0.5) !important;
  box-shadow: none !important;
}

/* #3：書籤按鈕區塊背景統一 — 移除 acad-address-block / tabs 的雙層底色 */
html body.academy-new-checkout-page .acad-address-block,
html body.academy-new-checkout-page .acad-ship-address-block {
  border: none !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}
html body.academy-new-checkout-page .acad-addr-tabs,
html body.academy-new-checkout-page .acad-ship-addr-tabs {
  background: transparent !important;
  border: none !important;
  border-bottom: none !important;
}
html body.academy-new-checkout-page .acad-address-panel,
html body.academy-new-checkout-page .acad-ship-address-panel {
  padding: 0 !important;
  background: transparent !important;
}
html body.academy-new-checkout-page .acad-addr-tab,
html body.academy-new-checkout-page .acad-ship-addr-tab {
  border-right: none !important;
}
/* tab 啟動態：底線提示，不再加 inset 色塊 */
html body.academy-new-checkout-page .acad-addr-tab.is-active,
html body.academy-new-checkout-page .acad-ship-addr-tab.is-active {
  background: transparent !important;
  box-shadow: none !important;
}

/* #4 (REMOVED 2026-05-13 by B-15): DEPRECATED 圓點 radio 舊樣式 — 跟 B-11 #B12.2 segmented slider 衝突造成「兩層按鈕」
   原樣式：input::after 圓點 + label background 高亮 + ::before pill
   現整段刪除，統一改用 line 7995 起的 segmented slider + line 9334 ::before pill */

/* #5：欄位高度統一 — input / select / acad-country-search__input 都 56px */
html body.academy-new-checkout-page .acad-col input.input-text,
html body.academy-new-checkout-page .acad-col input[type="text"],
html body.academy-new-checkout-page .acad-col input[type="email"],
html body.academy-new-checkout-page .acad-col input[type="tel"],
html body.academy-new-checkout-page .acad-col input[type="number"],
html body.academy-new-checkout-page .acad-col input[type="password"],
html body.academy-new-checkout-page .acad-col select,
html body.academy-new-checkout-page .acad-col .acad-country-search__input {
  height: 56px !important;
  min-height: 56px !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .acad-col textarea {
  min-height: 56px !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
}

/* #6：尺寸對照按鈕跟尺寸選擇欄位等高且水平
   結構：.academy-tshirt-row 內含 #billing_tshirt_gender_field + #billing_tshirt_size_field + .size-chart-button-field */
html body.academy-new-checkout-page .academy-tshirt-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 14px !important;
  align-items: flex-end !important;
  grid-column: 1 / -1 !important;
  margin: 0 0 14px !important;
}
html body.academy-new-checkout-page .academy-tshirt-row > .form-row {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
}
html body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field > label {
  display: none !important;
}
html body.academy-new-checkout-page .academy-tshirt-row .size-chart-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 18px !important;
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  background: transparent !important;
  border: 1.5px solid #39FFF5 !important;
  color: #39FFF5 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background 0.18s ease, color 0.18s ease !important;
}
html body.academy-new-checkout-page .academy-tshirt-row .size-chart-btn:hover {
  background: rgba(57, 255, 245, 0.14) !important;
}
/* 老的 inline span（已不用）— 隱藏避免雙顯 */
html body.academy-new-checkout-page .acad-size-chart-inline {
  display: none !important;
}

/* #7：電子發票 索取方式 select 跟右側第一個 input 水平對齊 */
html body.academy-new-checkout-page #cw-ecpei_fields {
  align-items: start !important;
}
html body.academy-new-checkout-page #cw-ecpei_field-flag {
  margin: 0 !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page #cw-ecpei_field-flag label,
html body.academy-new-checkout-page #cw-ecpei_fields > div:not(#cw-ecpei_field-flag) > p > label {
  display: block !important;
  margin: 0 0 6px !important;
  font-size: 14px !important;
  color: rgba(255, 255, 255, 0.85) !important;
  height: auto !important;
}
html body.academy-new-checkout-page #cw-ecpei_field-flag select,
html body.academy-new-checkout-page #cw-ecpei_fields > div:not(#cw-ecpei_field-flag) > p input[type="text"] {
  height: 56px !important;
  min-height: 56px !important;
  box-sizing: border-box !important;
}
/* 索取方式跟右側 input 的 baseline 對齊：兩欄 label height 一致 */
html body.academy-new-checkout-page #cw-ecpei_field-flag > label,
html body.academy-new-checkout-page #cw-ecpei_field-flag-num > label,
html body.academy-new-checkout-page #cw-ecpei_field-ubn-title > label,
html body.academy-new-checkout-page #cw-ecpei_field-ubn > label {
  line-height: 1.4 !important;
  min-height: 22px !important;
  margin: 0 0 6px !important;
}

/* #8 (A)：移除 ship-to-different-address h3 的 float: left（WC 預設 col-2 規則）*/
html body.academy-new-checkout-page #add_payment_method .checkout .col-2 h3#ship-to-different-address,
html body.academy-new-checkout-page .woocommerce-cart .checkout .col-2 h3#ship-to-different-address,
html body.academy-new-checkout-page .woocommerce-checkout .checkout .col-2 h3#ship-to-different-address,
html body.academy-new-checkout-page .checkout .col-2 h3#ship-to-different-address,
html body.academy-new-checkout-page h3#ship-to-different-address {
  float: none !important;
  clear: both !important;
}

/* #9：每個區塊（acad-row）結束底部水平線（最後一個不加）*/
html body.academy-new-checkout-page .acad-shell .acad-row:not(:last-child) {
  position: relative !important;
  padding-bottom: 28px !important;
  margin-bottom: 28px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* #10：付款方式 row 不要背景 */
html body.academy-new-checkout-page .acad-shell .acad-row--payment .acad-col,
html body.academy-new-checkout-page .acad-shell .acad-col--payment {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* #11：title 文字置中（已在頂部 .academy-new-title 加 text-align: center）+ 確保在新版頁也居中 */
html body.academy-new-checkout-page .academy-new-title {
  text-align: center !important;
}


/* ============================================
   B-11 #B12（2026-05-08）：聚焦修整 T-shirt 區 + 區塊小標題格式
   - 不動結構，只 cosmetic 對齊設計圖
   - selector chain 提權重，必要才用 !important
   ============================================ */

/* ---- 區塊小標題：cyan 直立線 + 字（拿掉原本的 border-bottom）---- */
body.academy-new-checkout-page .acad-shell .acad-section-title {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 0 0 20px;
  padding: 0;
  border: none !important;
  border-bottom: none !important;
  background: transparent;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 5px;
  color: #fff;
}
body.academy-new-checkout-page .acad-shell .acad-section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 27px;
  background: #39FFF5;
  flex: 0 0 3px;
  margin: 0;
  vertical-align: baseline;
  border-radius: 0;
}

/* ============================================
   T-shirt 區（眼前最亂的一塊）
   - 三欄 row：男/女 segmented | size select | size-chart-btn
   - 隱藏 form-row label（hint 走 placeholder）
   - 各欄 45px 高、等寬、垂直 center 對齊
   ============================================ */
body.academy-new-checkout-page .academy-tshirt-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 16px !important;
  margin: 0 !important;
  width: 100% !important;
}
body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_gender_field,
body.academy-new-checkout-page .academy-tshirt-row > #billing_tshirt_size_field,
body.academy-new-checkout-page .academy-tshirt-row > #billing_member2_tshirt_gender_field,
body.academy-new-checkout-page .academy-tshirt-row > #billing_member2_tshirt_size_field {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}
body.academy-new-checkout-page .academy-tshirt-row > .size-chart-button-field,
body.academy-new-checkout-page .academy-tshirt-row > .member2-size-chart-button-field {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
  display: flex !important;
  align-items: center !important;
}
/* 隱藏 T-shirt row 內所有 form-row label（hint 改 placeholder） */
body.academy-new-checkout-page .academy-tshirt-row > .form-row > label,
body.academy-new-checkout-page .academy-tshirt-row #billing_tshirt_gender_field > label,
body.academy-new-checkout-page .academy-tshirt-row #billing_tshirt_size_field > label,
body.academy-new-checkout-page .academy-tshirt-row #billing_member2_tshirt_gender_field > label,
body.academy-new-checkout-page .academy-tshirt-row #billing_member2_tshirt_size_field > label,
body.academy-new-checkout-page .academy-tshirt-row .size-chart-button-field > label,
body.academy-new-checkout-page .academy-tshirt-row .member2-size-chart-button-field > label {
  display: none !important;
}

/* 男版/女版 segmented：撐滿欄位寬 + cyan 啟動 */
body.academy-new-checkout-page .academy-tshirt-row #billing_tshirt_gender_field .woocommerce-input-wrapper,
body.academy-new-checkout-page .academy-tshirt-row #billing_member2_tshirt_gender_field .woocommerce-input-wrapper {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.80) !important;
  position: relative !important;
  overflow: hidden !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
  gap: 0 !important;
}
body.academy-new-checkout-page .academy-tshirt-row #billing_tshirt_gender_field input.input-radio,
body.academy-new-checkout-page .academy-tshirt-row #billing_member2_tshirt_gender_field input.input-radio {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.academy-new-checkout-page .academy-tshirt-row #billing_tshirt_gender_field label.radio,
body.academy-new-checkout-page .academy-tshirt-row #billing_member2_tshirt_gender_field label.radio {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #C2C2C2 !important;
  font-family: "Noto Sans TC", sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 3px !important;
  cursor: pointer !important;
  /* 2026-05-14 B-16.N：移除 background transition（殘影元兇），只保留 color */
  transition: color 0.18s ease !important;
  white-space: nowrap !important;
}
body.academy-new-checkout-page .academy-tshirt-row #billing_tshirt_gender_field input.input-radio:checked + label.radio,
body.academy-new-checkout-page .academy-tshirt-row #billing_member2_tshirt_gender_field input.input-radio:checked + label.radio {
  background: transparent !important;
  color: #171A1D !important;
  font-weight: 600 !important;
}

/* 尺寸 select：dark bg + cyan SVG 箭頭 + 45 高 */
body.academy-new-checkout-page .academy-tshirt-row #billing_tshirt_size_field select,
body.academy-new-checkout-page .academy-tshirt-row #billing_member2_tshirt_size_field select {
  width: 100% !important;
  height: 45px !important;
  min-height: 45px !important;
  padding: 14px 44px 12px 15px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  background: rgba(0, 0, 0, 0.40) !important;
  color: #fff !important;
  font-family: "Noto Sans TC", sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 3px !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 19 19' fill='none'><path d='M12.6667 9.33333L9.33333 12.6667L6 9.33333M9.33333 12.6667V6M17.6667 9.33333C17.6667 13.9357 13.9357 17.6667 9.33333 17.6667C4.73096 17.6667 1 13.9357 1 9.33333C1 4.73096 4.73096 1 9.33333 1C13.9357 1 17.6667 4.73096 17.6667 9.33333Z' stroke='%2339FFF5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 17px 17px !important;
}
body.academy-new-checkout-page .academy-tshirt-row #billing_tshirt_size_field select:focus,
body.academy-new-checkout-page .academy-tshirt-row #billing_member2_tshirt_size_field select:focus {
  border-color: #39FFF5 !important;
  outline: none !important;
}

/* 尺寸對照按鈕：cyan 邊框 + 暗 cyan 底 + cyan 文字 */
body.academy-new-checkout-page .academy-tshirt-row .size-chart-btn,
body.academy-new-checkout-page .academy-tshirt-row .size-chart-button-field button,
body.academy-new-checkout-page .academy-tshirt-row .size-chart-button-field a.button,
body.academy-new-checkout-page .academy-tshirt-row .member2-size-chart-button-field button {
  width: 100% !important;
  height: 45px !important;
  min-height: 45px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid #39FFF5 !important;
  border-radius: 8px !important;
  background: rgba(15, 63, 60, 0.60) !important;
  color: #39FFF5 !important;
  font-family: "Noto Sans TC", sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 3px !important;
  cursor: pointer !important;
  transition: background 0.18s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}
body.academy-new-checkout-page .academy-tshirt-row .size-chart-btn:hover,
body.academy-new-checkout-page .academy-tshirt-row .size-chart-button-field button:hover {
  background: rgba(57, 255, 245, 0.20) !important;
}

/* RWD ≤768px：T-shirt 三欄變單欄 */
@media (max-width: 768px) {
  body.academy-new-checkout-page .academy-tshirt-row {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  body.academy-new-checkout-page .academy-tshirt-row > .form-row {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* ============================================
   B-11 #B12.2（2026-05-08）：補地址 segmented slider + 隱藏訂單備註
   ============================================ */

/* 地址區（台灣 / 國外）segmented slider — markup: input radio + label.radio */
body.academy-new-checkout-page .acad-region-tabs,
body.academy-new-checkout-page .acad-addr-tabs.acad-region-tabs,
body.academy-new-checkout-page .acad-ship-addr-tabs.acad-region-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 !important;
  margin: 0 0 14px !important;
  border-radius: 8px !important;
  border: none !important;
  background: rgba(0, 0, 0, 0.80) !important;
  position: relative !important;
  overflow: hidden !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
  gap: 0 !important;
}
body.academy-new-checkout-page .acad-region-tabs input[type="radio"].input-radio {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
body.academy-new-checkout-page .acad-region-tabs label.radio {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
  border: none !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #C2C2C2 !important;
  font-family: "Noto Sans TC", sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 3px !important;
  cursor: pointer !important;
  transition: background 0.18s ease, color 0.18s ease !important;
  white-space: nowrap !important;
}
body.academy-new-checkout-page .acad-region-tabs input[type="radio"].input-radio:checked + label.radio {
  background: transparent !important;
  color: #171A1D !important;
  font-weight: 600 !important;
}

/* 身分證 / 護照（#billing_region_field）也套同款 segmented slider */
body.academy-new-checkout-page #billing_region_field > label {
  display: none !important;
}
body.academy-new-checkout-page #billing_region_field > .woocommerce-input-wrapper {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 8px !important;
  border: none !important;
  background: rgba(0, 0, 0, 0.80) !important;
  position: relative !important;
  overflow: hidden !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
  gap: 0 !important;
}
body.academy-new-checkout-page #billing_region_field input.input-radio {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.academy-new-checkout-page #billing_region_field label.radio {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
  border: none !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #C2C2C2 !important;
  font-family: "Noto Sans TC", sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 3px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
body.academy-new-checkout-page #billing_region_field input.input-radio:checked + label.radio {
  background: transparent !important;
  color: #171A1D !important;
  font-weight: 600 !important;
}

/* 隱藏訂單備註（設計圖無）*/
body.academy-new-checkout-page #order_comments_field,
body.academy-new-checkout-page .woocommerce-additional-fields {
  display: none !important;
}

/* 隱藏 ship-to-different-address 內 WC 預設 checkbox（用 acad-ship-toggle 自訂 UI 取代） */
body.academy-new-checkout-page #ship-to-different-address-checkbox {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ============================================
   B-12（2026-05-08）：依設計稿視覺對齊
   - label 隱藏（伺服器 placeholder 已帶 attribute）
   - toggle 按鈕加高 (45 → 56) + 加強深色文字
   - Row 2-3 explicit grid placement（出生 + region toggle 同列；電話 + ID 同列）
   - 分區標題樣式
   ============================================ */

/* === label 隱藏（visually hidden 維持 a11y） — 列舉所有需隱藏 label 的欄位 ID === */
body.academy-new-checkout-page #billing_first_name_field > label,
body.academy-new-checkout-page #billing_last_name_field > label,
body.academy-new-checkout-page #billing_english_name_field > label,
body.academy-new-checkout-page #billing_company_field > label,
body.academy-new-checkout-page #billing_birth_date_field > label,
body.academy-new-checkout-page #billing_phone_field > label,
body.academy-new-checkout-page #billing_line_id_field > label,
body.academy-new-checkout-page #billing_email_field > label,
body.academy-new-checkout-page #billing__field > label,
body.academy-new-checkout-page #billing_tw_id_number_field > label,
body.academy-new-checkout-page #billing_passport_number_field > label,
body.academy-new-checkout-page #billing_address_1_field > label,
body.academy-new-checkout-page #billing_address_2_field > label,
body.academy-new-checkout-page #billing_city_field > label,
body.academy-new-checkout-page #billing_state_field > label,
body.academy-new-checkout-page #billing_postcode_field > label,
body.academy-new-checkout-page #billing_country_field > label,
body.academy-new-checkout-page #shipping_first_name_field > label,
body.academy-new-checkout-page #shipping_last_name_field > label,
body.academy-new-checkout-page #shipping_company_field > label,
body.academy-new-checkout-page #shipping_address_1_field > label,
body.academy-new-checkout-page #shipping_address_2_field > label,
body.academy-new-checkout-page #shipping_city_field > label,
body.academy-new-checkout-page #shipping_state_field > label,
body.academy-new-checkout-page #shipping_postcode_field > label,
body.academy-new-checkout-page #shipping_country_field > label,
body.academy-new-checkout-page #cw-ecpei_field-flag-num > label,
body.academy-new-checkout-page #cw-ecpei_field-ubn-title > label,
body.academy-new-checkout-page #cw-ecpei_field-ubn > label,
body.academy-new-checkout-page #billing_member2_first_name_field > label,
body.academy-new-checkout-page #billing_member2_last_name_field > label,
body.academy-new-checkout-page #billing_member2_english_name_field > label,
body.academy-new-checkout-page #billing_member2_birth_date_field > label,
body.academy-new-checkout-page #billing_member2_phone_field > label,
body.academy-new-checkout-page #billing_member2_email_field > label,
body.academy-new-checkout-page #billing_member2_tw_id_number_field > label,
body.academy-new-checkout-page #billing_member2_passport_number_field > label {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* === B-12.8：toggle 改 45px（規格） === */
body.academy-new-checkout-page .acad-region-tabs,
body.academy-new-checkout-page .acad-addr-tabs.acad-region-tabs,
body.academy-new-checkout-page .acad-ship-addr-tabs.acad-region-tabs,
body.academy-new-checkout-page #billing_region_field > .woocommerce-input-wrapper {
  height: 45px !important;
  border-radius: 8px !important;
}
body.academy-new-checkout-page .acad-region-tabs label.radio,
body.academy-new-checkout-page #billing_region_field label.radio {
  height: 45px !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  letter-spacing: 2px !important;
}
body.academy-new-checkout-page .acad-region-tabs input[type="radio"].input-radio:checked + label.radio,
body.academy-new-checkout-page #billing_region_field input.input-radio:checked + label.radio {
  background: transparent !important;
  color: #0a0a0a !important;
  font-weight: 700 !important;
}

/* === Row 2-3 explicit grid placement ===
   billing wrapper grid 是 1fr 1fr：name-row 全寬佔 row 1（grid-column 1/-1）
   row 2 col 1 = 出生年月日；col 2 = region toggle (身分證 / 海外)
   row 3 col 1 = 聯絡電話；col 2 = tw_id_number 或 passport_number（依選擇顯一）
   row 4 = LINE ID + Email auto-pair */
/* B-12.8：birth/phone 改放在 .acad-left-col 內，移除 grid 位置 */
html body.academy-new-checkout-page #billing_birth_date_field {
  grid-row: auto !important;
  grid-column: auto !important;
}
/* B-12.8 → B-12.18e：mid-row 改為 2×2 grid。
   - 左右兩欄用 display:contents，其下的 form-row 直接成為 grid 子格
   - row 1/row 2 都鎖死 45px、row-gap 20、column-gap 20
   - 自然消除 flex stretch 導致兩欄高度不一造成的偏移 */
html body.academy-new-checkout-page .acad-mid-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 45px 45px !important;
  column-gap: 16px !important;
  row-gap: 20px !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
/* B-12.18e：left-col / right-pair 不再自己當 flex 容器；改為 display:contents
   讓裡面的 form-row 直接交給 mid-row 的 grid 排版，徹底解決等高/對齊問題 */
html body.academy-new-checkout-page .acad-left-col,
html body.academy-new-checkout-page .acad-right-pair {
  display: contents !important;
}
/* B-12.18e：mid-row 內 4 個 form-row 各自指定 grid 位置（左欄 col 1、右欄 col 2） */
html body.academy-new-checkout-page .acad-left-col > #billing_birth_date_field {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .acad-left-col > #billing_phone_field {
  grid-column: 1 !important;
  grid-row: 2 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .acad-right-pair > #billing_region_field {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .acad-right-pair > #billing_tw_id_number_field,
html body.academy-new-checkout-page .acad-right-pair > #billing_passport_number_field {
  grid-column: 2 !important;
  grid-row: 2 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
/* B-12.12：身分證/護照輸入框 — 跟 toggle 同款（45 高、無邊框、bg 0.80）讓視覺整齊 */
html body.academy-new-checkout-page .acad-right-pair #billing_tw_id_number_field input.input-text,
html body.academy-new-checkout-page .acad-right-pair #billing_passport_number_field input.input-text {
  display: flex !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 16px !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: rgba(0, 0, 0, 0.80) !important;
  color: #fff !important;
  box-sizing: border-box !important;
}
/* email + line_id auto-pair row 4（保持 auto） */
html body.academy-new-checkout-page #billing_email_field,
html body.academy-new-checkout-page #billing_line_id_field {
  grid-row: auto !important;
  grid-column: auto !important;
}

/* === acad-sub-title 已棄用（B-12.8 後續分區標題改 acad-section-title） === */

/* === B-12.8：acad-name-row 規格 — height 45, gap 20, 每格 padding 15, bg 0.40, radius 8 === */
body.academy-new-checkout-page .acad-name-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 45px !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
body.academy-new-checkout-page .acad-name-row > .form-row {
  display: flex !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  height: 45px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
}
/* name-row 內 input 套外殼底色（每格 padding 15、bg 0.40、radius 8） */
body.academy-new-checkout-page .acad-name-row > .form-row input.input-text,
body.academy-new-checkout-page .acad-name-row > .form-row .woocommerce-input-wrapper > input.input-text,
body.academy-new-checkout-page .acad-name-row > .form-row .woocommerce-input-wrapper {
  display: flex !important;
  width: 100% !important;
  height: 45px !important;
  padding: 15px !important;
  align-items: center !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.40) !important;
  border: 0 !important;
  box-sizing: border-box !important;
}
body.academy-new-checkout-page .acad-name-row > .form-row .woocommerce-input-wrapper {
  padding: 0 !important;
  background: transparent !important;
}

/* === B-12.8：col--info flex column gap 20px（規格） === */
body.academy-new-checkout-page .acad-col--info {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 20px !important;
  align-self: stretch !important;
}

/* === B-12.8：birth + phone 輸入框統一規格（45px / padding 15 / bg 0.40） === */
body.academy-new-checkout-page #billing_birth_date_field input.input-text,
body.academy-new-checkout-page #billing_phone_field input.input-text {
  display: flex !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 15px !important;
  align-items: center !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.40) !important;
  border: 0 !important;
  color: #fff !important;
  box-sizing: border-box !important;
}

/* B-16.AZ 2026-05-18：生日欄位 picker icon 換白色蛋糕 SVG + 靠右 */
body.academy-new-checkout-page #billing_birth_date_field input[type="date"],
body.academy-new-checkout-page #billing_member2_birth_date_field input[type="date"],
body.academy-new-checkout-page #billing_member3_birth_date_field input[type="date"] {
  position: relative !important;
  background-color: rgba(0, 0, 0, 0.40) !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2zm4.6 9.99l-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V21c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-4.61c-.56.38-1.23.61-1.96.61-.92 0-1.79-.36-2.44-1.01zM18 9h-5V7h-2v2H6c-1.66 0-3 1.34-3 3v1.54c0 1.08.88 1.96 1.96 1.96.52 0 1.02-.2 1.38-.57l2.14-2.13 2.13 2.13c.74.74 2.03.74 2.77 0l2.14-2.13 2.13 2.13c.37.37.86.57 1.38.57 1.08 0 1.96-.88 1.96-1.96V12c0-1.66-1.34-3-3-3z'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 15px center !important;
  background-size: 20px 20px !important;
  padding-right: 45px !important;
}
/* 隱藏 webkit 原生 calendar icon，讓蛋糕 icon 接管 + 全 input 可點觸發 picker */
body.academy-new-checkout-page #billing_birth_date_field input[type="date"]::-webkit-calendar-picker-indicator,
body.academy-new-checkout-page #billing_member2_birth_date_field input[type="date"]::-webkit-calendar-picker-indicator,
body.academy-new-checkout-page #billing_member3_birth_date_field input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  background: transparent !important;
}

/* B-16.AZ 2026-05-18：生日蛋糕 icon hover 切換為重點色 #39FFF5 */
@media (hover: hover) {
  body.academy-new-checkout-page #billing_birth_date_field input[type="date"]:hover,
  body.academy-new-checkout-page #billing_member2_birth_date_field input[type="date"]:hover,
  body.academy-new-checkout-page #billing_member3_birth_date_field input[type="date"]:hover {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2339FFF5'><path d='M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2zm4.6 9.99l-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V21c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-4.61c-.56.38-1.23.61-1.96.61-.92 0-1.79-.36-2.44-1.01zM18 9h-5V7h-2v2H6c-1.66 0-3 1.34-3 3v1.54c0 1.08.88 1.96 1.96 1.96.52 0 1.02-.2 1.38-.57l2.14-2.13 2.13 2.13c.74.74 2.03.74 2.77 0l2.14-2.13 2.13 2.13c.37.37.86.57 1.38.57 1.08 0 1.96-.88 1.96-1.96V12c0-1.66-1.34-3-3-3z'/></svg>") !important;
  }
}

/* === B-12.9：mid-row 內 form-row p 強制 45px 高，水平對齊
       B-12.10：保留原有 inline display:none（passport / tw_id 切換時隱藏單一） === */
body.academy-new-checkout-page .acad-left-col > .form-row:not([style*="display: none"]):not([style*="display:none"]),
body.academy-new-checkout-page .acad-right-pair > .form-row:not([style*="display: none"]):not([style*="display:none"]) {
  height: 45px !important;
  min-height: 45px !important;
  max-height: 45px !important;
  display: flex !important;
  align-items: stretch !important;
}
body.academy-new-checkout-page .acad-right-pair > .form-row[style*="display: none"],
body.academy-new-checkout-page .acad-right-pair > .form-row[style*="display:none"] {
  display: none !important;
}
body.academy-new-checkout-page .acad-left-col > .form-row > .woocommerce-input-wrapper,
body.academy-new-checkout-page .acad-right-pair > .form-row > .woocommerce-input-wrapper {
  width: 100% !important;
  height: 45px !important;
  display: flex !important;
  align-items: stretch !important;
}

/* === B-12.9：bottom-row（LINE ID + Email）左右配對 === */
body.academy-new-checkout-page .acad-bottom-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 16px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
body.academy-new-checkout-page .acad-bottom-row > .form-row {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: stretch !important;
}
body.academy-new-checkout-page .acad-bottom-row > .form-row > .woocommerce-input-wrapper {
  width: 100% !important;
  height: 45px !important;
  display: flex !important;
  align-items: stretch !important;
}
body.academy-new-checkout-page .acad-bottom-row input.input-text {
  width: 100% !important;
  height: 45px !important;
  padding: 0 15px !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.40) !important;
  border: 0 !important;
  color: #fff !important;
  box-sizing: border-box !important;
}

/* === 2026-05-11 #3：新 row 結構 — row-2 / row-3-id / line-row 共用 bottom-row 樣式 === */
body.academy-new-checkout-page .acad-row-2,
body.academy-new-checkout-page .acad-row-3-id,
body.academy-new-checkout-page .acad-line-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 16px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
body.academy-new-checkout-page .acad-row-2 > .form-row,
body.academy-new-checkout-page .acad-row-3-id > .form-row,
body.academy-new-checkout-page .acad-line-row > .form-row {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}
body.academy-new-checkout-page .acad-row-2 > .form-row > .woocommerce-input-wrapper,
body.academy-new-checkout-page .acad-row-3-id > .form-row > .woocommerce-input-wrapper,
body.academy-new-checkout-page .acad-line-row > .form-row > .woocommerce-input-wrapper {
  width: 100% !important;
  display: flex !important;
  align-items: stretch !important;
}
body.academy-new-checkout-page .acad-row-2 input.input-text,
body.academy-new-checkout-page .acad-row-3-id input.input-text,
body.academy-new-checkout-page .acad-line-row input.input-text {
  width: 100% !important;
  height: 45px !important;
  padding: 0 15px !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.40) !important;
  border: 0 !important;
  color: #fff !important;
  box-sizing: border-box !important;
}
/* REMOVED 2026-05-13 by B-16: 舊 .acad-row-3-id > #billing_region_field segmented 樣式 — 跟 B-15.A 統一 slider 衝突造成殘影。整段刪除，由 B-15.A + B-16 acad-info-grid 接手。 */
/* region toggle label 隱藏（保留，無衝突） */
html body.academy-new-checkout-page #billing_region_field > label.required_field,
html body.academy-new-checkout-page #billing_member2_region_field > label.required_field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
/* line-row 單欄佔滿 */
body.academy-new-checkout-page .acad-line-row > .form-row {
  flex: 1 1 100% !important;
}
/* 非實體課時把 region/tw_id/passport 強制隱藏（PHP 也加 hide，這裡 double-cover） */
body.academy-new-checkout-page:not(.acad-has-physical) #billing_region_field,
body.academy-new-checkout-page:not(.acad-has-physical) #billing_tw_id_number_field,
body.academy-new-checkout-page:not(.acad-has-physical) #billing_passport_number_field {
  display: none !important;
}

/* === 2026-05-11 #1：團報滑塊 + 第 2/3 位學員姓名 row === */
/* 整 row：滑塊在最左 + 姓名欄位並排 */
body.academy-new-checkout-page .acad-member-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important; /* B-16.AY：垂直置中讓滑塊跟欄位水平對齊 */
  gap: 20px !important; /* B-16.AY：user 要求 16 → 20px */
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
/* B-16.AY：隱藏第 2/3 位學員姓名欄位的 label（label 文字已移到 input placeholder） */
body.academy-new-checkout-page .acad-member-row > .form-row > label {
  display: none !important;
}
/* B-16.AZ 2026-05-18：拿掉 form-row 全域 clearfix 偽元素
   .acad-member-row 是 flex 容器，::before display:table 會佔 flex 位，
   讓 gap 20px 在 ::before 跟 slider 之間生效 → slider 被推開 20px */
body.academy-new-checkout-page .acad-member-row::before,
body.academy-new-checkout-page .acad-member-row::after {
  display: none !important;
  content: none !important;
}
/* 滑塊 (2人 / 3人) — segmented control
   B-16.AZ 2026-05-18：拿掉 container inner padding/gap、按鈕加寬 padding 32px、
   active 框與外框左右邊重合 → 整體寬度加大 + 左側跟上方 input 對齊 */
body.academy-new-checkout-page .acad-group-slider {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: stretch !important;
  height: 45px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.40) !important;
  gap: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
body.academy-new-checkout-page .acad-group-slider__opt {
  appearance: none !important;
  border: 0 !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  height: 45px !important;
  padding: 0 32px !important;
  cursor: pointer !important;
  border-radius: 0 !important;
  transition: background 120ms ease, color 120ms ease !important;
  box-sizing: border-box !important;
}
body.academy-new-checkout-page .acad-group-slider__opt:hover {
  color: #fff !important;
}
body.academy-new-checkout-page .acad-group-slider__opt.is-active {
  background: #39FFF5 !important;
  color: #000 !important;
}
/* member 姓名欄位 */
body.academy-new-checkout-page .acad-member-row > .form-row {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}
body.academy-new-checkout-page .acad-member-row > .form-row > .woocommerce-input-wrapper {
  width: 100% !important;
  display: flex !important;
  align-items: stretch !important;
}
body.academy-new-checkout-page .acad-member-row input.input-text {
  width: 100% !important;
  height: 45px !important;
  padding: 0 15px !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.40) !important;
  border: 0 !important;
  color: #fff !important;
  box-sizing: border-box !important;
}
/* group_count=2 時隱藏第 3 位欄位 */
body.academy-new-checkout-page.acad-group-count-2 #billing_member3_name_field {
  display: none !important;
}

/* 永久隱藏 member2 額外欄位（業主 2026-05-11 決議：第 2/3 人只填姓名）+ hidden 欄位 */
body.academy-new-checkout-page .member2-extra-field,
body.academy-new-checkout-page #billing_group_count_field,
body.academy-new-checkout-page .acad-group-count-hidden {
  display: none !important;
}

/* B-16.AZ 2026-05-18：取消第 2 位學員 T-shirt 區塊（只保留姓名） */
body.academy-new-checkout-page .member2-section-heading,
body.academy-new-checkout-page .academy-tshirt-row.member2-tshirt-row {
  display: none !important;
}

/* 非團報時隱藏 member-row 整區 */
body.academy-new-checkout-page:not(.acad-has-group-buy) .acad-member-row,
body.academy-new-checkout-page:not(.acad-has-group-buy) #billing_member2_name_field,
body.academy-new-checkout-page:not(.acad-has-group-buy) #billing_member3_name_field,
body.academy-new-checkout-page:not(.acad-has-group-buy) #billing_member2_section_field {
  display: none !important;
}

/* === B-12.10：placeholder 色 + toggle hover 深色字 === */
body.academy-new-checkout-page .acad-shell input.input-text::placeholder,
body.academy-new-checkout-page .acad-shell input.input-text::-webkit-input-placeholder,
body.academy-new-checkout-page .acad-shell input.input-text::-moz-placeholder,
body.academy-new-checkout-page .acad-shell input.input-text:-ms-input-placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
  opacity: 1 !important;
}
/* region tabs / addr tabs：hover 文字深色 */
body.academy-new-checkout-page .acad-region-tabs label.radio:hover,
body.academy-new-checkout-page .acad-addr-tabs label.radio:hover,
body.academy-new-checkout-page .acad-ship-addr-tabs label.radio:hover,
body.academy-new-checkout-page #billing_region_field label.radio:hover {
  color: #0a0a0a !important;
  background: rgba(57, 255, 245, 0.55) !important;
}
/* hover 已選中的 → 文字保持深色，不再加 bg（slider pseudo 負責呈現） */
body.academy-new-checkout-page .acad-region-tabs input.input-radio:checked + label.radio:hover,
body.academy-new-checkout-page #billing_region_field input.input-radio:checked + label.radio:hover {
  background: transparent !important;
  color: #0a0a0a !important;
}

/* === B-12.9：手機版 ≤768px 全部改由上往下單欄堆疊
       B-12.18e：mid-row 改 grid 1 欄、auto rows 順序排 === */
@media (max-width: 768px) {
  body.academy-new-checkout-page .acad-name-row,
  body.academy-new-checkout-page .acad-bottom-row {
    flex-direction: column !important;
    height: auto !important;
    gap: 12px !important;
  }
  body.academy-new-checkout-page .acad-mid-row {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    row-gap: 12px !important;
  }
  body.academy-new-checkout-page .acad-mid-row > .acad-left-col > .form-row,
  body.academy-new-checkout-page .acad-mid-row > .acad-right-pair > .form-row {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
  body.academy-new-checkout-page .acad-name-row > .form-row,
  body.academy-new-checkout-page .acad-bottom-row > .form-row {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body.academy-new-checkout-page .acad-left-col,
  body.academy-new-checkout-page .acad-right-pair {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ============================================
   B-12.14c（2026-05-08）：T-shirt row 終極強制 — 最高優先序最後一塊覆蓋規則
   ============================================ */
html body.academy-new-checkout-page form.checkout .academy-tshirt-row,
html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 16px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  visibility: visible !important;
}
html body.academy-new-checkout-page form.checkout .academy-tshirt-row > p#billing_tshirt_gender_field,
html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > p#billing_tshirt_gender_field {
  display: flex !important;
  flex: 1 1 50% !important;
  flex-direction: column !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  background: transparent !important;
  border: 0 !important;
}
html body.academy-new-checkout-page form.checkout .academy-tshirt-row > p#billing_tshirt_size_field,
html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > p#billing_tshirt_size_field {
  display: flex !important;
  flex: 1 1 25% !important;
  flex-direction: column !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  background: transparent !important;
  border: 0 !important;
}
html body.academy-new-checkout-page form.checkout .academy-tshirt-row > p.size-chart-button-field,
html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > p.size-chart-button-field {
  display: flex !important;
  flex: 1 1 25% !important;
  align-items: center !important;
  justify-content: stretch !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  background: transparent !important;
  border: 0 !important;
}
html body.academy-new-checkout-page form.checkout .academy-tshirt-row > .form-row > label,
html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > .form-row > label {
  display: none !important;
}
html body.academy-new-checkout-page form.checkout #billing_tshirt_gender_field > .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout #billing_tshirt_gender_field > .woocommerce-input-wrapper {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.80) !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html body.academy-new-checkout-page form.checkout #billing_tshirt_gender_field input[type="radio"],
html body.academy-new-checkout-page form.woocommerce-checkout #billing_tshirt_gender_field input[type="radio"] {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page form.checkout #billing_tshirt_gender_field label.radio,
html body.academy-new-checkout-page form.woocommerce-checkout #billing_tshirt_gender_field label.radio {
  display: flex !important;
  flex: 1 1 50% !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #C2C2C2 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 2px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html body.academy-new-checkout-page form.checkout #billing_tshirt_gender_field input[type="radio"]:checked + label.radio,
html body.academy-new-checkout-page form.woocommerce-checkout #billing_tshirt_gender_field input[type="radio"]:checked + label.radio {
  /* 2026-05-14 B-16.N：label bg 改 transparent，cyan 由 wrapper::before pill 唯一提供（消除兩塊 cyan 殘影） */
  background: transparent !important;
  color: #0a0a0a !important;
  font-weight: 700 !important;
}
html body.academy-new-checkout-page form.checkout #billing_tshirt_size_field > .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout #billing_tshirt_size_field > .woocommerce-input-wrapper {
  display: block !important;
  width: 100% !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html body.academy-new-checkout-page form.checkout #billing_tshirt_size_field select,
html body.academy-new-checkout-page form.woocommerce-checkout #billing_tshirt_size_field select {
  display: block !important;
  width: 100% !important;
  height: 45px !important;
  min-height: 45px !important;
  padding: 0 36px 0 16px !important;
  border-radius: 8px !important;
  border: 0 !important;
  background-color: rgba(0, 0, 0, 0.40) !important;
  color: #fff !important;
  font-size: 14px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2339FFF5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  cursor: pointer !important;
  visibility: visible !important;
  opacity: 1 !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page form.checkout .academy-tshirt-row .size-chart-btn,
html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row .size-chart-btn,
html body.academy-new-checkout-page form.checkout .academy-tshirt-row .size-chart-button-field button,
html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row .size-chart-button-field button {
  display: flex !important;
  width: 100% !important;
  height: 45px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  border: 1px solid #39FFF5 !important;
  background: rgba(0, 0, 0, 0.40) !important;
  color: #39FFF5 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  visibility: visible !important;
  opacity: 1 !important;
}


/* ============================================
   B-12.15（2026-05-09）：電子發票區 — 上下堆疊，欄位寬度一致 16px gap
   ============================================ */
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  align-items: stretch !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}
/* 隱藏 plugin 自帶的 h3 與空 placeholder div（已有外部 section title）*/
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields > h3,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields > h3,
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields > div,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields > div {
  display: none !important;
}
/* 所有 form-row 都 100% 寬，45 高 */
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields > p.form-row,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields > p.form-row {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
  flex: 0 0 auto !important;
}
/* flag select 樣式（45 高、深底、cyan 箭頭） */
html body.academy-new-checkout-page form.checkout #cw-ecpei_flag_field > label,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_flag_field > label {
  display: none !important;
}
html body.academy-new-checkout-page form.checkout #cw-ecpei_flag_field .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_flag_field .woocommerce-input-wrapper {
  display: block !important;
  width: 100% !important;
  height: 45px !important;
}
html body.academy-new-checkout-page form.checkout #cw-ecpei_flag,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_flag,
html body.academy-new-checkout-page #cw-ecpei_flag {
  display: block !important;
  width: 100% !important;
  height: 50px !important;
  min-height: 50px !important;
  padding: 0 44px 0 18px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  background-color: rgba(0, 0, 0, 0.40) !important;
  color: #fff !important;
  font-size: 16px !important;
  letter-spacing: 0.5px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  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='%2339FFF5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s, background-color 0.2s !important;
}
html body.academy-new-checkout-page #cw-ecpei_flag:hover,
html body.academy-new-checkout-page #cw-ecpei_flag:focus {
  border-color: #39FFF5 !important;
  outline: none !important;
}
/* placeholder option（value=""）字色淡，呈現提示效果 */
html body.academy-new-checkout-page #cw-ecpei_flag option[value=""] {
  color: rgba(255,255,255,0.55) !important;
  background: #1a1a1a !important;
}
html body.academy-new-checkout-page #cw-ecpei_flag option {
  color: #fff !important;
  background: #1a1a1a !important;
  padding: 8px !important;
}
/* 右欄（flag-num / ubn-title / ubn / love-codes）的 input/select 樣式 */
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) > label,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) > label {
  display: none !important;
}
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) .woocommerce-input-wrapper {
  display: block !important;
  width: 100% !important;
  height: 45px !important;
}
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) input.input-text,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) input.input-text,
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) select,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) select {
  display: block !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  border: 1px solid #39FFF5 !important;
  background: rgba(0, 0, 0, 0.40) !important;
  color: #fff !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) select,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields p.form-row:not(#cw-ecpei_flag_field) select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 36px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2339FFF5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
}
/* ============================================
   B-12.16（2026-05-09）：運送到不同的地址區 — 寬度 / 對齊 / 間距 全面對齊基本資料區
   位於檔案最後以最高 cascade 優先序覆蓋前面所有 shipping 規則。
   ============================================ */

/* address-block 外框：去掉前期 0.05 bg + 額外 border，讓內部 row 跟 name-row 視覺等寬 */
html body.academy-new-checkout-page form.checkout .acad-ship-address-block,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-address-block {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  overflow: visible !important;
}

/* 台灣 / 國外 切換 tab bar：自成一塊，高 45 圓角 8 */
html body.academy-new-checkout-page form.checkout .acad-ship-addr-tabs,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-addr-tabs {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  height: 45px !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: rgba(0, 0, 0, 0.40) !important;
  overflow: hidden !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page form.checkout .acad-ship-addr-tab,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-addr-tab {
  flex: 1 1 50% !important;
  height: 45px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
}
html body.academy-new-checkout-page form.checkout .acad-ship-addr-tab.is-active,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-addr-tab.is-active {
  background: #39FFF5 !important;
  color: #0a0a0a !important;
  box-shadow: none !important;
}
html body.academy-new-checkout-page form.checkout .acad-ship-addr-tab:hover,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-addr-tab:hover {
  background: rgba(57, 255, 245, 0.55) !important;
  color: #0a0a0a !important;
}
html body.academy-new-checkout-page form.checkout .acad-ship-addr-tab.is-active:hover,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-addr-tab.is-active:hover {
  background: #39FFF5 !important;
  color: #0a0a0a !important;
}

/* 內層 panel：去除原 18px 內距，讓內容跟外層 name-row 對齊；上下間距 20px */
html body.academy-new-checkout-page form.checkout .acad-ship-address-panel,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-address-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  background: transparent !important;
}

/* 台灣 row：城市 / 地址 各 50% 等寬（只在 taiwan mode 才 display；overseas 時隱藏，否則會留下一條空白） */
html body.academy-new-checkout-page.acad-ship-addr-taiwan form.checkout .acad-ship-tw-row,
html body.academy-new-checkout-page.acad-ship-addr-taiwan form.woocommerce-checkout .acad-ship-tw-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 16px !important;
  width: 100% !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page form.checkout .acad-ship-tw-row > .form-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-tw-row > .form-row {
  flex: 1 1 50% !important;
  max-width: 50% !important;
  min-width: 0 !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: stretch !important;
}

/* 國外 row 1：Country / State-postcode 各 50%（只在 overseas mode 才 display） */
html body.academy-new-checkout-page.acad-ship-addr-overseas form.checkout .acad-ship-os-row-1,
html body.academy-new-checkout-page.acad-ship-addr-overseas form.woocommerce-checkout .acad-ship-os-row-1 {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 16px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page.acad-ship-addr-overseas form.checkout .acad-ship-os-row-1 > #shipping_country_field,
html body.academy-new-checkout-page.acad-ship-addr-overseas form.woocommerce-checkout .acad-ship-os-row-1 > #shipping_country_field {
  flex: 1 1 50% !important;
  max-width: 50% !important;
  min-width: 0 !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: stretch !important;
}
html body.academy-new-checkout-page.acad-ship-addr-overseas form.checkout .acad-ship-os-row-1 > .acad-ship-os-state-postcode,
html body.academy-new-checkout-page.acad-ship-addr-overseas form.woocommerce-checkout .acad-ship-os-row-1 > .acad-ship-os-state-postcode {
  flex: 1 1 50% !important;
  max-width: 50% !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 16px !important;
}
html body.academy-new-checkout-page form.checkout .acad-ship-os-state-postcode > #shipping_state_field,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-state-postcode > #shipping_state_field {
  flex: 1 1 100% !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: stretch !important;
}
/* B-16.AM 2026-05-15：shipping_postcode 在國外模式顯示（跟 billing 一致）— 移除原本 display:none */
html body.academy-new-checkout-page.acad-ship-addr-overseas form.checkout .acad-ship-os-state-postcode > #shipping_postcode_field,
html body.academy-new-checkout-page.acad-ship-addr-overseas form.woocommerce-checkout .acad-ship-os-state-postcode > #shipping_postcode_field {
  display: flex !important;
  flex: 1 1 0;
  min-width: 0;
}

/* 國外 row 2：address_1 / address_2 各 50%（只在 overseas mode 才 display） */
html body.academy-new-checkout-page.acad-ship-addr-overseas form.checkout .acad-ship-os-row-2,
html body.academy-new-checkout-page.acad-ship-addr-overseas form.woocommerce-checkout .acad-ship-os-row-2 {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 16px !important;
  width: 100% !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page form.checkout .acad-ship-os-row-2 > .form-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-2 > .form-row {
  flex: 1 1 50% !important;
  max-width: 50% !important;
  min-width: 0 !important;
  height: 45px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: stretch !important;
}

/* B-16.AM 2026-05-15：國外模式 shipping_address_2 隱藏、addr_1 撐滿（跟 billing 國外一致 — 只一條 addr_1） */
html body.academy-new-checkout-page.acad-ship-addr-overseas form.checkout .acad-ship-os-row-2 > #shipping_address_2_field,
html body.academy-new-checkout-page.acad-ship-addr-overseas form.woocommerce-checkout .acad-ship-os-row-2 > #shipping_address_2_field {
  display: none !important;
}
html body.academy-new-checkout-page.acad-ship-addr-overseas form.checkout .acad-ship-os-row-2 > #shipping_address_1_field,
html body.academy-new-checkout-page.acad-ship-addr-overseas form.woocommerce-checkout .acad-ship-os-row-2 > #shipping_address_1_field {
  flex: 1 1 100% !important;
  max-width: 100% !important;
}

/* 所有 shipping 欄位的 input/select 統一規格 — 45 高 / bg 0.40 / radius 8 / padding 15（無 border） */
html body.academy-new-checkout-page form.checkout .acad-ship-name-row > .form-row .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.checkout .acad-ship-tw-row > .form-row .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.checkout .acad-ship-os-row-1 > .form-row .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.checkout .acad-ship-os-row-2 > .form-row .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.checkout .acad-ship-os-state-postcode > .form-row .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-name-row > .form-row .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-tw-row > .form-row .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-1 > .form-row .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-2 > .form-row .woocommerce-input-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-state-postcode > .form-row .woocommerce-input-wrapper {
  display: flex !important;
  width: 100% !important;
  height: 45px !important;
  align-items: stretch !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
html body.academy-new-checkout-page form.checkout .acad-ship-tw-row input.input-text,
html body.academy-new-checkout-page form.checkout .acad-ship-os-row-1 input.input-text,
html body.academy-new-checkout-page form.checkout .acad-ship-os-row-2 input.input-text,
html body.academy-new-checkout-page form.checkout .acad-ship-os-state-postcode input.input-text,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-tw-row input.input-text,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-1 input.input-text,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-2 input.input-text,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-state-postcode input.input-text {
  display: block !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 15px !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: rgba(0, 0, 0, 0.40) !important;
  color: #fff !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
}
/* country / state select 樣式統一 */
html body.academy-new-checkout-page form.checkout #shipping_country_field select,
html body.academy-new-checkout-page form.checkout #shipping_state_field select,
html body.academy-new-checkout-page form.woocommerce-checkout #shipping_country_field select,
html body.academy-new-checkout-page form.woocommerce-checkout #shipping_state_field select {
  display: block !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 36px 0 15px !important;
  border-radius: 8px !important;
  border: 0 !important;
  background-color: rgba(0, 0, 0, 0.40) !important;
  color: #fff !important;
  font-size: 14px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2339FFF5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}
/* select2 (country) 套同樣高 / bg / radius，避免雙層樣式錯位 */
html body.academy-new-checkout-page form.checkout #shipping_country_field .select2-container,
html body.academy-new-checkout-page form.woocommerce-checkout #shipping_country_field .select2-container {
  width: 100% !important;
  height: 45px !important;
}
html body.academy-new-checkout-page form.checkout #shipping_country_field .select2-selection,
html body.academy-new-checkout-page form.woocommerce-checkout #shipping_country_field .select2-selection {
  height: 45px !important;
  padding: 0 15px !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: rgba(0, 0, 0, 0.40) !important;
}
html body.academy-new-checkout-page form.checkout #shipping_country_field .select2-selection__rendered,
html body.academy-new-checkout-page form.woocommerce-checkout #shipping_country_field .select2-selection__rendered {
  line-height: 45px !important;
  color: #fff !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page form.checkout #shipping_country_field .select2-selection__arrow,
html body.academy-new-checkout-page form.woocommerce-checkout #shipping_country_field .select2-selection__arrow {
  height: 45px !important;
}

/* shipping_address 外層 flex column gap 20 */
html body.academy-new-checkout-page.acad-shipping-open form.checkout .shipping_address,
html body.academy-new-checkout-page.acad-shipping-open form.woocommerce-checkout .shipping_address {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* RWD ≤768px：所有 row 改單欄堆疊 */
@media (max-width: 768px) {
  html body.academy-new-checkout-page form.checkout .acad-ship-tw-row,
  html body.academy-new-checkout-page form.checkout .acad-ship-os-row-1,
  html body.academy-new-checkout-page form.checkout .acad-ship-os-row-2,
  html body.academy-new-checkout-page form.checkout .acad-ship-os-state-postcode,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-tw-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-1,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-2,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-state-postcode {
    flex-direction: column !important;
    height: auto !important;
    gap: 12px !important;
  }
  html body.academy-new-checkout-page form.checkout .acad-ship-tw-row > .form-row,
  html body.academy-new-checkout-page form.checkout .acad-ship-os-row-1 > .form-row,
  html body.academy-new-checkout-page form.checkout .acad-ship-os-row-1 > .acad-ship-os-state-postcode,
  html body.academy-new-checkout-page form.checkout .acad-ship-os-row-2 > .form-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-tw-row > .form-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-1 > .form-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-1 > .acad-ship-os-state-postcode,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-os-row-2 > .form-row {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* RWD ≤768px：保持單欄堆疊（已是 flex column） */

/* ============================================
   B-12.17（2026-05-09）：分區標題分隔線 + 區塊間距 / 內距規範
   - section-title 上方 30px、下方 0；後續分區 title 上方多一條 1px 白 0.2 分隔線，line 與 prev block 間距 40px
   - 每個 block 外部不加 padding；block 內 row 間距 20px
   - 所有輸入欄位高度 45px
   ============================================ */

/* 第 1 段 title（基本資料，無 data-key）：保留原 margin（用戶要求移除 -20px 抵消） */

/* 後續分區 title（data-key 屬性）：上方加 1px 白 0.2 分隔線
   flex gap 20 + margin-top 20 = 40（line 與上方 block 距離）
   padding-top 30（line 與 title 文字距離）
   margin-bottom 0：保留 flex gap 20，title 與下方 block 間距 20px */
html body.academy-new-checkout-page form.checkout .acad-shell .acad-section-title[data-key],
html body.academy-new-checkout-page form.woocommerce-checkout .acad-shell .acad-section-title[data-key] {
  margin: 20px 0 0 0 !important;
  padding-top: 30px !important;
  padding-bottom: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
}

/* block 內部 row gap 統一 20px */
/* shipping address-panel：tab + tw-row（或 os 系列）之間 20px */
html body.academy-new-checkout-page form.checkout .acad-ship-address-panel,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-address-panel {
  gap: 20px !important;
}
/* shipping_address 外層 flex column 也 20 */
html body.academy-new-checkout-page.acad-shipping-open form.checkout .shipping_address,
html body.academy-new-checkout-page.acad-shipping-open form.woocommerce-checkout .shipping_address {
  gap: 20px !important;
}
/* 電子發票區內 form-row 之間 20px */
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields {
  gap: 20px !important;
}

/* 所有輸入框 / select 統一 45px 高（防漏網之魚） */
html body.academy-new-checkout-page form.checkout .acad-shell input.input-text,
html body.academy-new-checkout-page form.checkout .acad-shell select,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-shell input.input-text,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-shell select {
  height: 45px !important;
  min-height: 45px !important;
  box-sizing: border-box !important;
}

/* ============================================
   B-12.19（2026-05-09）：左右切換 toggle 真的滑動動畫
   - 用 ::before pseudo 當作會滑動的 cyan pill
   - :has(input[value="overseas"]:checked) 時往右滑
   - 適用所有 segmented toggle：基本資料身分證、收件地址、運送地址、會員2 身分證
   ============================================ */
.academy-new-checkout-page .acad-region-tabs,
.academy-new-checkout-page #billing_region_field > .woocommerce-input-wrapper,
.academy-new-checkout-page #billing_member2_region_field > .woocommerce-input-wrapper {
  position: relative;
}
.academy-new-checkout-page .acad-region-tabs::before,
.academy-new-checkout-page #billing_region_field > .woocommerce-input-wrapper::before,
.academy-new-checkout-page #billing_member2_region_field > .woocommerce-input-wrapper::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: rgba(57, 255, 245, 0.80);
  border-radius: 5.5px;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
}
.academy-new-checkout-page .acad-region-tabs:has(input[value="overseas"]:checked)::before,
.academy-new-checkout-page #billing_region_field > .woocommerce-input-wrapper:has(input[value="overseas"]:checked)::before,
.academy-new-checkout-page #billing_member2_region_field > .woocommerce-input-wrapper:has(input[value="overseas"]:checked)::before {
  transform: translateX(100%);
}
/* labels 站在 pseudo 上方 */
.academy-new-checkout-page .acad-region-tabs label.radio,
.academy-new-checkout-page #billing_region_field label.radio,
.academy-new-checkout-page #billing_member2_region_field label.radio {
  position: relative;
  z-index: 1;
}

/* T-shirt 男版/女版 同款滑塊（用 :nth-of-type(2):checked 判斷右移）
   B-13 (2026-05-09)：補上 body 前綴避免污染其他頁（盤點 B-12.22-#1/#2） */
body.academy-new-checkout-page #billing_tshirt_gender_field .woocommerce-input-wrapper,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field .woocommerce-input-wrapper {
  position: relative;
}
body.academy-new-checkout-page #billing_tshirt_gender_field .woocommerce-input-wrapper::before,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field .woocommerce-input-wrapper::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: rgba(57, 255, 245, 0.80);
  border-radius: 6px;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
}
body.academy-new-checkout-page #billing_tshirt_gender_field .woocommerce-input-wrapper:has(input:nth-of-type(2):checked)::before,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field .woocommerce-input-wrapper:has(input:nth-of-type(2):checked)::before {
  transform: translateX(100%);
}
body.academy-new-checkout-page #billing_tshirt_gender_field label.radio,
body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio {
  position: relative;
  z-index: 1;
}

/* 「運送到不同的地址」h3 上下 20px 間距 */
.academy-new-checkout-page h3#ship-to-different-address {
  margin-top: 20px !important;
  margin-bottom: 20px !important;
}
/* 台灣地區 / 國外地址 tab bar 下方 20px 間距（已透過 panel gap，多一層保險） */
.academy-new-checkout-page .acad-ship-addr-tabs {
  margin-bottom: 0 !important;  /* gap 由 panel 控制 */
}

/* B-12.20：所有切換 toggle hover 不再加 bg（純切換按鈕，無 hover 狀態） */
body.academy-new-checkout-page form.checkout .acad-region-tabs label.radio:hover,
body.academy-new-checkout-page form.checkout #billing_region_field label.radio:hover,
body.academy-new-checkout-page form.checkout #billing_member2_region_field label.radio:hover,
body.academy-new-checkout-page form.checkout #billing_tshirt_gender_field label.radio:hover,
body.academy-new-checkout-page form.checkout #billing_member2_tshirt_gender_field label.radio:hover,
body.academy-new-checkout-page form.woocommerce-checkout .acad-region-tabs label.radio:hover,
body.academy-new-checkout-page form.woocommerce-checkout #billing_region_field label.radio:hover,
body.academy-new-checkout-page form.woocommerce-checkout #billing_member2_region_field label.radio:hover,
body.academy-new-checkout-page form.woocommerce-checkout #billing_tshirt_gender_field label.radio:hover,
body.academy-new-checkout-page form.woocommerce-checkout #billing_member2_tshirt_gender_field label.radio:hover {
  background: transparent !important;
  color: inherit !important;
}

/* B-12.20：覆蓋 .form-row 全域 margin-bottom 10px，避免推開 row 之間距離大於 20px
   .acad-name-row / .acad-mid-row / .acad-bottom-row / .acad-ship-name-row 等都帶 form-row class */
body.academy-new-checkout-page form.checkout .acad-name-row,
body.academy-new-checkout-page form.checkout .acad-mid-row,
body.academy-new-checkout-page form.checkout .acad-bottom-row,
body.academy-new-checkout-page form.checkout .acad-ship-name-row,
body.academy-new-checkout-page form.checkout .acad-ship-address-block,
body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row,
body.academy-new-checkout-page form.woocommerce-checkout .acad-mid-row,
body.academy-new-checkout-page form.woocommerce-checkout .acad-bottom-row,
body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-name-row,
body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-address-block {
  margin: 0 !important;
}

/* ============================================
   B-12.21（2026-05-09）：橫向 16px / 直向 20px 統一收尾
   1. h3#ship-to-different-address 上下 20px（已在 6427 修）
   2. acad-shell 內所有 form-row 與直接子層去除 margin，避免破壞 col--info 的 gap 控制
   3. 確保所有欄位 / select / select2 高度 45px（防漏）
   4. B-12.18e 後 mid-row 是 grid，row-gap 20、column-gap 16
   5. 「電子發票索取方式」cw-ecpei_fields gap 20、內 form-row margin 0
   ============================================ */

/* acad-col--info 內所有層級 form-row margin 歸零（除 acad-shell 自家 row container 由各自規則控制） */
body.academy-new-checkout-page form.checkout .acad-col--info .form-row,
body.academy-new-checkout-page form.woocommerce-checkout .acad-col--info .form-row {
  margin: 0 !important;
}

/* 電子發票區內 form-row margin 歸零（避免 .form-row 全域 10px margin 在 #cw-ecpei_fields 內擾亂 gap） */
body.academy-new-checkout-page form.checkout #cw-ecpei_fields .form-row,
body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields .form-row {
  margin: 0 !important;
}

/* shipping_address 內所有 form-row margin 歸零 */
body.academy-new-checkout-page form.checkout .shipping_address .form-row,
body.academy-new-checkout-page form.woocommerce-checkout .shipping_address .form-row {
  margin: 0 !important;
}

/* 強制所有結帳表單欄位高度 45px：input / select / select2 結果區 / .woocommerce-input-wrapper */
body.academy-new-checkout-page form.checkout .acad-shell input.input-text,
body.academy-new-checkout-page form.checkout .acad-shell input[type="text"],
body.academy-new-checkout-page form.checkout .acad-shell input[type="email"],
body.academy-new-checkout-page form.checkout .acad-shell input[type="tel"],
body.academy-new-checkout-page form.checkout .acad-shell input[type="date"],
body.academy-new-checkout-page form.checkout .acad-shell select,
body.academy-new-checkout-page form.checkout .acad-shell .select2-container .select2-selection,
body.academy-new-checkout-page form.woocommerce-checkout .acad-shell input.input-text,
body.academy-new-checkout-page form.woocommerce-checkout .acad-shell input[type="text"],
body.academy-new-checkout-page form.woocommerce-checkout .acad-shell input[type="email"],
body.academy-new-checkout-page form.woocommerce-checkout .acad-shell input[type="tel"],
body.academy-new-checkout-page form.woocommerce-checkout .acad-shell input[type="date"],
body.academy-new-checkout-page form.woocommerce-checkout .acad-shell select,
body.academy-new-checkout-page form.woocommerce-checkout .acad-shell .select2-container .select2-selection {
  height: 45px !important;
  min-height: 45px !important;
  max-height: 45px !important;
  box-sizing: border-box !important;
}

/* ============================================
   B-13 (2026-05-10) | 基本資料區排版最終修正（CSS-only，繞過 PHP 雙檔問題）

   診斷結果：
   1. line 7165 .acad-name-row { gap:14px; margin:0 0 16px } 用 'html body...' 高 specificity
      蓋住我之前 line 8285 的 16px → 線上實際 gap 是 14px、margin-bottom 16px
   2. line 6346 .acad-shell .acad-col { display:block } specificity 高於 .acad-col--info →
      .acad-col--info 渲染為 block，gap: 20px 失效
   3. .acad-col--info 直接 children 是 H3 + #customer_details，rows 是孫節點，
      所以 col--info 的 gap 即使生效也不會作用到 row-to-row

   解法：直接在每個 row 容器上設 margin-bottom: 20px，獨立於父容器布局，
   用 'html body...form.checkout .row' = (0,3,3) specificity 確保贏過所有舊規則
   ============================================ */

/* row-to-row 20px：直接 margin-bottom，不依賴父容器 gap */
html body.academy-new-checkout-page form.checkout .acad-name-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 16px !important;
  margin: 0 0 20px !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 45px !important;
  box-sizing: border-box !important;
}

html body.academy-new-checkout-page form.checkout .acad-mid-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-mid-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 45px 45px !important;
  column-gap: 16px !important;
  row-gap: 20px !important;
  margin: 0 0 20px !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body.academy-new-checkout-page form.checkout .acad-bottom-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-bottom-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 各 row 內 form-row 等寬撐滿 */
html body.academy-new-checkout-page form.checkout .acad-name-row > .form-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row > .form-row {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
}

html body.academy-new-checkout-page form.checkout .acad-bottom-row > .form-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-bottom-row > .form-row {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
}

/* ============================================
   B-12.22（2026-05-09）：用戶回饋第二輪修正
   1. shipping fields wrapper 由 grid 改 flex column → 內容全寬
   2. 移除 shipping 區的姓名/姓氏/公司欄位（含 .acad-ship-name-row 容器）
   3. cw-ecpei_fields 改 flex column 統一 20px gap、移除舊 grid
   4. mid-row 內 .acad-right-pair 強制 margin 0（避免 form-row 全域 10px 殘留）
   ============================================ */

/* 1. shipping wrapper flex column 全寬：覆蓋 line 6213 grid 設定 */
html body.academy-new-checkout-page .woocommerce-shipping-fields .shipping_address,
html body.academy-new-checkout-page .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
  grid-template-columns: none !important;
  column-gap: 0 !important;
  row-gap: 20px !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* 2. shipping 區隱藏姓名/姓氏/公司欄位與 .acad-ship-name-row 容器 */
/* PENDING B-13: 隱藏 shipping 姓名欄位待業主確認，可能需要 backend hook 將 billing 姓名 copy 到 shipping
   來源：盤點報告 B-12.22-#4。SOP § 6.3 line 568 要求 shipping 欄位都有正確存入訂單，若隱藏前端
   而 backend 沒做 copy，shipping 訂單會缺收件人姓名。等 nicole 與業主決策後再定案 */
body.academy-new-checkout-page #shipping_first_name_field,
body.academy-new-checkout-page #shipping_last_name_field,
body.academy-new-checkout-page #shipping_company_field,
body.academy-new-checkout-page .acad-ship-name-row {
  display: none !important;
}

/* REMOVED 2026-05-13 by B-14: DEPRECATED B-13 cw-ecpei_fields flex column 段整段刪除
   原註解明確標記「等 § 改動 #2 執行時整段刪除」— B-14.A 已用 grid 2 col 取代，
   這段強制 flex column 會跟 B-14.A grid 規則衝突造成上下堆疊（user 反映） */

/* 4. .acad-right-pair / .acad-left-col 雖 display:contents，仍清掉 form-row class 帶來的 margin */
body.academy-new-checkout-page form.checkout .acad-right-pair,
body.academy-new-checkout-page form.checkout .acad-left-col,
body.academy-new-checkout-page form.woocommerce-checkout .acad-right-pair,
body.academy-new-checkout-page form.woocommerce-checkout .acad-left-col {
  margin: 0 !important;
  padding: 0 !important;
}

/* cw-ecpei 內所有 input/select/textarea 統一 45px 高 */
html body.academy-new-checkout-page #cw-ecpei_fields input.input-text,
html body.academy-new-checkout-page #cw-ecpei_fields input[type="text"],
html body.academy-new-checkout-page #cw-ecpei_fields input[type="email"],
html body.academy-new-checkout-page #cw-ecpei_fields select {
  height: 45px !important;
  min-height: 45px !important;
  box-sizing: border-box !important;
}

/* === 2026-05-11 v2 修補（user 回饋）=== */
/* 1. 「運送到不同地址」未勾選時，整個 shipping 區（含 toggle 下方的 acad-ship-* 結構、name-row）強制 hide */
body.academy-new-checkout-page:not(.acad-shipping-open) .shipping_address,
body.academy-new-checkout-page:not(.acad-shipping-open) .woocommerce-shipping-fields .acad-ship-name-row,
body.academy-new-checkout-page:not(.acad-shipping-open) .woocommerce-shipping-fields .acad-ship-address-block,
body.academy-new-checkout-page:not(.acad-shipping-open) .woocommerce-shipping-fields .acad-ship-address-panel,
body.academy-new-checkout-page:not(.acad-shipping-open) .woocommerce-shipping-fields .acad-ship-tw-row,
body.academy-new-checkout-page:not(.acad-shipping-open) .woocommerce-shipping-fields .acad-ship-os-row-1,
body.academy-new-checkout-page:not(.acad-shipping-open) .woocommerce-shipping-fields .acad-ship-os-row-2,
body.academy-new-checkout-page:not(.acad-shipping-open) .woocommerce-shipping-fields .acad-ship-os-state-postcode,
body.academy-new-checkout-page:not(.acad-shipping-open) .woocommerce-shipping-fields p[id^="shipping_"],
body.academy-new-checkout-page:not(.acad-shipping-open) .woocommerce-shipping-fields div[id^="shipping_"] {
  display: none !important;
}
/* 勾選時（acad-shipping-open）才顯示 */
body.academy-new-checkout-page.acad-shipping-open .woocommerce-shipping-fields .acad-ship-address-block {
  display: block !important;
}
/* 2026-05-11 user 回饋 #3：shipping 內部各 row 之間 20px gap */
body.academy-new-checkout-page.acad-shipping-open .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}
body.academy-new-checkout-page.acad-shipping-open .woocommerce-shipping-fields .acad-ship-address-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

/* 2. 「上方一排空白」修補：非實體課時 .acad-row-3-id 整個容器 hide（避免空 div 留 padding） */
body.academy-new-checkout-page:not(.acad-has-physical) .acad-row-3-id {
  display: none !important;
}
/* 同理：team report 滑塊區若沒 has-group-buy 整個 hide */
body.academy-new-checkout-page:not(.acad-has-group-buy) .acad-member-row {
  display: none !important;
}
/* LINE ID 欄位若 PHP 沒 register（billing__field 不存在）則 wrap 容器 hide */
body.academy-new-checkout-page .acad-line-row:empty {
  display: none !important;
}
/* form-row 全域 margin 清乾淨，避免空 row 造成多 10px 空白 */
body.academy-new-checkout-page .acad-row-2:empty,
body.academy-new-checkout-page .acad-row-3-id:empty,
body.academy-new-checkout-page .acad-line-row:empty,
body.academy-new-checkout-page .acad-member-row:empty {
  margin: 0 !important;
  padding: 0 !important;
  display: none !important;
}

/* === 2026-05-11 #8：手機版 stack — 三排 row + 團報 member-row + row-3-id 在窄螢幕全部直立 === */
@media (max-width: 768px) {
  body.academy-new-checkout-page .acad-row-2,
  body.academy-new-checkout-page .acad-row-3-id,
  body.academy-new-checkout-page .acad-line-row,
  body.academy-new-checkout-page .acad-member-row {
    flex-direction: column !important;
    gap: 12px !important;
  }
  body.academy-new-checkout-page .acad-row-2 > .form-row,
  body.academy-new-checkout-page .acad-row-3-id > .form-row,
  body.academy-new-checkout-page .acad-line-row > .form-row,
  body.academy-new-checkout-page .acad-member-row > .form-row {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  body.academy-new-checkout-page .acad-row-3-id #billing_region_field {
    min-width: 0 !important;
    width: 100% !important;
  }
  body.academy-new-checkout-page .acad-group-slider {
    width: 100% !important;
    justify-content: stretch !important;
  }
  body.academy-new-checkout-page .acad-group-slider__opt {
    flex: 1 1 50% !important;
    text-align: center !important;
  }
}

/* ============================================
   B-13 (2026-05-11) | 用戶回饋第二批最終修正
   - T-shirt 男/女 toggle slider 殘影修正
   - 購買清單 / 加購商品區塊 70/30 寬度
   ============================================ */

/* B-13.A | T-shirt label.radio 強制透明背景 + slider ::before 加 will-change（消除切換殘影） */
html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}
html body.academy-new-checkout-page #billing_tshirt_gender_field .woocommerce-input-wrapper::before,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field .woocommerce-input-wrapper::before {
  will-change: transform !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

/* B-13.B | 購買清單區塊 60% / 加購商品區塊 40% （桌面版，2026-05-11 user 微調） */
@media (min-width: 769px) {
  html body.academy-new-checkout-page .acad-row--products {
    display: flex !important;
    flex-direction: row !important;
    gap: 24px !important;
    width: 100% !important;
  }
  html body.academy-new-checkout-page .acad-row--products > .acad-col--cart {
    flex: 0 0 calc(60% - 12px) !important;
    max-width: calc(60% - 12px) !important;
    min-width: 0 !important;
    width: auto !important;
  }
  html body.academy-new-checkout-page .acad-row--products > .acad-col--addon {
    flex: 0 0 calc(40% - 12px) !important;
    max-width: calc(40% - 12px) !important;
    min-width: 0 !important;
    width: auto !important;
  }
}

/* B-13.C (2026-05-13) | 付款方式選後的說明文字用重點色 */
html body.academy-new-checkout-page #payment .payment_box > p {
  color: #39FFF5 !important;
}

/* B-13.D (2026-05-13) | 付款說明寬度 + 字體大小（第一行 20px / 其他 16px）
   寬度跟 .woocommerce-privacy-policy-text 一致（100% 滿欄寬，無 max-width 限縮）。 */
html body.academy-new-checkout-page #payment .payment_box {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* 第一段付款說明 description → 20px */
html body.academy-new-checkout-page #payment .payment_box > p:first-child {
  font-size: 20px !important;
  line-height: 1.5 !important;
  margin-bottom: 14px !important;
}
/* payment_box 內其他文字（label / select / span / 後續 p / div 文字）統一 16px */
html body.academy-new-checkout-page #payment .payment_box,
html body.academy-new-checkout-page #payment .payment_box label,
html body.academy-new-checkout-page #payment .payment_box select,
html body.academy-new-checkout-page #payment .payment_box span,
html body.academy-new-checkout-page #payment .payment_box p:not(:first-child),
html body.academy-new-checkout-page #payment .payment_box .description {
  font-size: 16px !important;
}

/* ============================================
   B-14 (2026-05-13) | 基本資料區終版覆蓋規則 — 最小改動版
   策略：
   - B-14.A 電子發票區 grid 2 col（user task #20）— selector specificity (1,3,3) > 舊 (1,2,3)
   - B-14.B shipping 收件地址只調 flex-wrap + address_2 第 2 行全寬（user task #21）
     **不動** display:flex（保留現有 flex layout 避免 grid 跑版）
   - billing 區 .acad-tw-row 完全不動（user 第一次截圖看 OK）
   ============================================ */

/* B-14.A (2026-05-13 修正版) | 電子發票區上下排（user 要求改回 vertical）
   策略：flex column，所有 form-row 一個一行依序排
   隱藏：內部 wrapper div / h3 / cw-ecpei_field-flag 容器（避免空白格） */
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  width: 100% !important;
  height: auto !important;
}
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields > h3,
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields > div:not([id]),
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields > #cw-ecpei_field-flag,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields > h3,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields > div:not([id]),
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields > #cw-ecpei_field-flag {
  display: none !important;
}
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields > p.form-row,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields > p.form-row {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: unset !important;
  grid-column: unset !important;
  grid-row: unset !important;
}

/* B-14.B | shipping 收件地址
   1) 預設 hide（user 未勾「運送到不同的地址」toggle 時）
   2) tw-row 內 city + address_1 並排 50/50，address_2 第 2 行全寬 */

/* 1) 預設 hide：body 沒 .acad-shipping-open class 時（升級 specificity 蓋過舊規則） */
html body.academy-new-checkout-page:not(.acad-shipping-open) form.checkout .acad-ship-name-row,
html body.academy-new-checkout-page:not(.acad-shipping-open) form.checkout .acad-ship-address-block,
html body.academy-new-checkout-page:not(.acad-shipping-open) form.woocommerce-checkout .acad-ship-name-row,
html body.academy-new-checkout-page:not(.acad-shipping-open) form.woocommerce-checkout .acad-ship-address-block {
  display: none !important;
}

/* 2) 地區切換 tabs 跟下方欄位 row 之間加 20px 間距（billing + shipping 都套用） */
html body.academy-new-checkout-page form.checkout .acad-address-block > .acad-region-tabs,
html body.academy-new-checkout-page form.checkout .acad-ship-address-block > .acad-region-tabs,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-address-block > .acad-region-tabs,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-address-block > .acad-region-tabs {
  margin-bottom: 20px !important;
}

/* 2) 展開時 layout：flex-wrap row + 50/50 + 備註欄全寬 */
html body.academy-new-checkout-page.acad-ship-addr-taiwan form.checkout .acad-ship-tw-row,
html body.academy-new-checkout-page.acad-ship-addr-taiwan form.woocommerce-checkout .acad-ship-tw-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  column-gap: 16px !important;
  row-gap: 12px !important;
  height: auto !important;
  align-items: start !important;
  width: 100% !important;
}
/* city + address_1 各佔 50% */
html body.academy-new-checkout-page form.checkout .acad-ship-tw-row > #shipping_city_field,
html body.academy-new-checkout-page form.checkout .acad-ship-tw-row > #shipping_address_1_field,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-tw-row > #shipping_city_field,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-tw-row > #shipping_address_1_field {
  flex: 0 0 calc(50% - 8px) !important;
  max-width: calc(50% - 8px) !important;
  min-width: 0 !important;
  height: auto !important;
}
/* address_2（收件備註欄）第 2 行全寬 */
html body.academy-new-checkout-page form.checkout .acad-ship-tw-row > #shipping_address_2_field,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-ship-tw-row > #shipping_address_2_field {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: auto !important;
}

/* B-14.C (2026-05-13 修正版) | 電子發票區手機版無需特殊處理（已是 flex column） */

/* B-14.D (2026-05-13) | 避免「進入頁面後 JS 重組造成閃爍」
   策略：form 預設 hide（PHP echo 後立即 hide），JS refreshCheckoutItemLayout 跑完加 body.acad-form-ready → 顯示
   2026-05-15 B-16.AF：原本用 visibility: hidden 但無效 — 多處 children 用 visibility: visible !important
   蓋過 parent hidden。改用 opacity: 0 + pointer-events: none（children 無法 override parent opacity）
   保險：1.5s 後 forced fallback 顯示（避免 JS error 時 form 永久 hidden） */
html body.academy-new-checkout-page form.checkout,
html body.academy-new-checkout-page form.woocommerce-checkout {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.15s linear;
}
html body.academy-new-checkout-page.acad-form-ready form.checkout,
html body.academy-new-checkout-page.acad-form-ready form.woocommerce-checkout {
  opacity: 1 !important;
  pointer-events: auto !important;
}
/* 保險 fallback：3s 後自動顯示（JS 沒跑完也不會卡住）
   2026-05-15 B-16.AG：1.5s 改 3s — 等 WC init_checkout + updated_checkout 跑完才合理（通常 1.6s 左右） */
@keyframes acad-form-fallback-show {
  to { opacity: 1; pointer-events: auto; }
}
html body.academy-new-checkout-page form.checkout,
html body.academy-new-checkout-page form.woocommerce-checkout {
  animation: acad-form-fallback-show 0s linear 3s forwards;
}
html body.academy-new-checkout-page.acad-form-ready form.checkout,
html body.academy-new-checkout-page.acad-form-ready form.woocommerce-checkout {
  animation: none;
}

/* B-14.E (2026-05-13) | shipping 姓名 row 整段隱藏（user 不要這段，shipping 沿用 billing 姓名）
   .acad-name-row.acad-ship-name-row 是 JS setupShippingAddressFields 建立的 wrapper，
   包 shipping_first_name + shipping_last_name + shipping_company 3 個欄位 */
html body.academy-new-checkout-page form.checkout .acad-name-row.acad-ship-name-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row.acad-ship-name-row {
  display: none !important;
}

/* ============================================
   B-15 (2026-05-13) | user 6 項回饋修復
   #1 T-shirt 滑塊背景殘影
   #4 身分/海外滑塊內部多餘按鈕 + 樣式統一
   #5 身分/護照欄位疊位
   #3 運送到不同地址間距過大
   #6 進頁 flicker 加強
   ============================================ */

/* B-15.A | 統一所有 segmented slider 樣式（pill 唯一高亮，移除 label 多餘 background）
   套用範圍：
     - .acad-region-tabs（地址 / 收件地址 台灣 vs 國外）
     - #billing_region_field（身分證 vs 護照）
     - #billing_member2_region_field（會員 2 身分證）
     - #billing_tshirt_gender_field（T-shirt 男版 vs 女版）
     - #billing_member2_tshirt_gender_field（會員 2 T-shirt）
   策略：
     1) container 統一：45px 高、bg rgba(0,0,0,0.80)、radius 8px
     2) input radio 完全隱藏
     3) label 預設透明 bg + 灰字；checked 黑字 + bold（**background 強制 transparent**）
     4) container::before 滑動 cyan pill 作唯一高亮指示
*/
html body.academy-new-checkout-page .acad-region-tabs,
html body.academy-new-checkout-page #billing_region_field > .woocommerce-input-wrapper,
html body.academy-new-checkout-page #billing_member2_region_field > .woocommerce-input-wrapper,
html body.academy-new-checkout-page #billing_tshirt_gender_field > .woocommerce-input-wrapper,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field > .woocommerce-input-wrapper {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  height: 45px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: rgba(0, 0, 0, 0.80) !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  gap: 0 !important;
  align-items: stretch !important;
}
/* input radio 完全隱藏 */
html body.academy-new-checkout-page .acad-region-tabs input[type="radio"].input-radio,
html body.academy-new-checkout-page #billing_region_field input[type="radio"].input-radio,
html body.academy-new-checkout-page #billing_member2_region_field input[type="radio"].input-radio,
html body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"].input-radio,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field input[type="radio"].input-radio {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* label 內視覺：透明 bg + 居中 + 灰字 */
html body.academy-new-checkout-page .acad-region-tabs label.radio,
html body.academy-new-checkout-page #billing_region_field label.radio,
html body.academy-new-checkout-page #billing_member2_region_field label.radio,
html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio {
  flex: 1 1 50% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 45px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #C2C2C2 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 2px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  position: relative !important;
  z-index: 2 !important;
  transition: color 0.2s !important;
}
/* hover：純文字變白，無背景殘影 */
html body.academy-new-checkout-page .acad-region-tabs label.radio:hover,
html body.academy-new-checkout-page #billing_region_field label.radio:hover,
html body.academy-new-checkout-page #billing_member2_region_field label.radio:hover,
html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio:hover,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio:hover {
  background: transparent !important;
  color: #fff !important;
}
/* checked：文字黑 + bold；background **強制 transparent**（讓 pill 是唯一高亮） */
html body.academy-new-checkout-page .acad-region-tabs input[type="radio"]:checked + label.radio,
html body.academy-new-checkout-page #billing_region_field input[type="radio"]:checked + label.radio,
html body.academy-new-checkout-page #billing_member2_region_field input[type="radio"]:checked + label.radio,
html body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"]:checked + label.radio,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field input[type="radio"]:checked + label.radio,
html body.academy-new-checkout-page .acad-region-tabs label.radio:has(input:checked),
html body.academy-new-checkout-page #billing_region_field label.radio:has(input:checked),
html body.academy-new-checkout-page #billing_member2_region_field label.radio:has(input:checked),
html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio:has(input:checked),
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio:has(input:checked) {
  background: transparent !important;
  color: #0a0a0a !important;
  font-weight: 700 !important;
}
/* 移除 input::after 圓點殘留（line 7600 舊規則） */
html body.academy-new-checkout-page .acad-region-tabs input[type="radio"]:checked::after,
html body.academy-new-checkout-page #billing_region_field input[type="radio"]:checked::after,
html body.academy-new-checkout-page #billing_member2_region_field input[type="radio"]:checked::after {
  display: none !important;
  content: none !important;
}
/* pill（::before）統一樣式 */
html body.academy-new-checkout-page .acad-region-tabs::before,
html body.academy-new-checkout-page #billing_region_field > .woocommerce-input-wrapper::before,
html body.academy-new-checkout-page #billing_member2_region_field > .woocommerce-input-wrapper::before,
html body.academy-new-checkout-page #billing_tshirt_gender_field > .woocommerce-input-wrapper::before,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field > .woocommerce-input-wrapper::before {
  content: '' !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: calc(50% - 3px) !important;
  height: calc(100% - 6px) !important;
  background: #39FFF5 !important;
  border-radius: 6px !important;
  transform: translateX(0) !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  z-index: 1 !important;
  pointer-events: none !important;
}
/* region (taiwan/overseas)：overseas 選中時 pill 右移 */
html body.academy-new-checkout-page .acad-region-tabs:has(input[value="overseas"]:checked)::before,
html body.academy-new-checkout-page #billing_region_field > .woocommerce-input-wrapper:has(input[value="overseas"]:checked)::before,
html body.academy-new-checkout-page #billing_member2_region_field > .woocommerce-input-wrapper:has(input[value="overseas"]:checked)::before {
  transform: translateX(100%) !important;
}
/* T-shirt gender (male/female)：female 選中時 pill 右移
   注意：用 :nth-of-type(2) 判斷而非 value，因為 tshirt 選項可能是 male/female 或其他 */
html body.academy-new-checkout-page #billing_tshirt_gender_field > .woocommerce-input-wrapper:has(input:nth-of-type(2):checked)::before,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field > .woocommerce-input-wrapper:has(input:nth-of-type(2):checked)::before {
  transform: translateX(100%) !important;
}

/* B-15.B | 「運送到不同的地址」標題跟欄位間距收窄
   原 h3#ship-to-different-address margin-top/bottom 20px → 改 8px / 4px */
html body.academy-new-checkout-page h3#ship-to-different-address,
html body.academy-new-checkout-page form.checkout h3#ship-to-different-address,
html body.academy-new-checkout-page form.woocommerce-checkout h3#ship-to-different-address {
  margin-top: 8px !important;
  margin-bottom: 4px !important;
  padding: 0 !important;
}
/* shipping_address container 上方 margin 也壓小 */
html body.academy-new-checkout-page .woocommerce-shipping-fields,
html body.academy-new-checkout-page form.checkout .woocommerce-shipping-fields,
html body.academy-new-checkout-page form.woocommerce-checkout .woocommerce-shipping-fields {
  margin-top: 4px !important;
  padding-top: 0 !important;
}
html body.academy-new-checkout-page .shipping_address {
  margin-top: 4px !important;
  padding-top: 0 !important;
}

/* B-15.C | 身分/護照欄位疊位修正（用 :has 直接 CSS 控制顯示，不靠 jQuery .hide()）
   - billing_region radio 選 taiwan → 隱藏 passport
   - billing_region radio 選 overseas → 隱藏 tw_id_number
   注意：用 form 路徑提升 specificity 蓋過 grid 規則 */
html body.academy-new-checkout-page form.checkout:has(input[name="billing_region"][value="taiwan"]:checked) #billing_passport_number_field,
html body.academy-new-checkout-page form.woocommerce-checkout:has(input[name="billing_region"][value="taiwan"]:checked) #billing_passport_number_field {
  display: none !important;
}
html body.academy-new-checkout-page form.checkout:has(input[name="billing_region"][value="overseas"]:checked) #billing_tw_id_number_field,
html body.academy-new-checkout-page form.woocommerce-checkout:has(input[name="billing_region"][value="overseas"]:checked) #billing_tw_id_number_field {
  display: none !important;
}
/* member2 同樣處理 */
html body.academy-new-checkout-page form.checkout:has(input[name="billing_member2_region"][value="taiwan"]:checked) #billing_member2_passport_number_field,
html body.academy-new-checkout-page form.woocommerce-checkout:has(input[name="billing_member2_region"][value="taiwan"]:checked) #billing_member2_passport_number_field {
  display: none !important;
}
html body.academy-new-checkout-page form.checkout:has(input[name="billing_member2_region"][value="overseas"]:checked) #billing_member2_tw_id_number_field,
html body.academy-new-checkout-page form.woocommerce-checkout:has(input[name="billing_member2_region"][value="overseas"]:checked) #billing_member2_tw_id_number_field {
  display: none !important;
}

/* B-15.D | 進頁 flicker 加強
   B-14.D 已 hide form 直到 acad-form-ready，但仍有 0.1-0.2s flicker
   再加：
     1) visibility !important 強化
     2) updated_checkout 期間 form 暫時 hide */
html body.academy-new-checkout-page form.checkout,
html body.academy-new-checkout-page form.woocommerce-checkout {
  visibility: hidden !important;
}
html body.academy-new-checkout-page.acad-form-ready form.checkout,
html body.academy-new-checkout-page.acad-form-ready form.woocommerce-checkout {
  visibility: visible !important;
}
/* REMOVED 2026-05-13 by B-16: 移除 .processing hide form — 勾「運送到不同地址」會 trigger WC processing 造成整個表單消失 2 秒。flicker 只靠首次 visibility hidden + acad-form-ready 補 visible 即可。 */

/* ============================================
   B-16 (2026-05-13) | 基本資料區排版重構 + 電子發票預設不展開
   - 上 1 排 4 欄（既有 .acad-name-row）
   - 下 2 欄各 3 列：左 [出生年月日, 電話, LINE ID] / 右 [region slider, 證號, Email]
   ============================================ */

/* B-16.A / B-16.H / B-16.I | .acad-info-grid 用 4 col grid，每個 form-row span 2 → 中間分隔線跟 .acad-name-row 4 欄完全對齊 */
html body.academy-new-checkout-page .acad-info-grid,
html body.academy-new-checkout-page form.checkout .acad-info-grid,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-info-grid,
html body.academy-new-checkout-page .acad-info-grid.form-row,
html body.academy-new-checkout-page .woocommerce-billing-fields__field-wrapper > .acad-info-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  gap: 20px !important;
  row-gap: 20px !important;
  column-gap: 20px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  float: none !important;
  clear: both !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
/* 預設每個 form-row 占 2 col（跟下排 2 欄各 50% 一致） */
html body.academy-new-checkout-page .acad-info-grid > p.form-row,
html body.academy-new-checkout-page .acad-info-grid > .form-row {
  grid-column: span 2 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  float: none !important;
}
/* 第 2-4 排：每個 form-row 用 ID 強制 grid 位置（避免其他 CSS / 殘留 element 干擾 auto-flow）*/
html body.academy-new-checkout-page .acad-info-grid > #billing_birth_date_field {
  grid-column: 1 / span 2 !important;
  grid-row: 1 !important;
}
html body.academy-new-checkout-page .acad-info-grid > #billing_phone_field {
  grid-column: 3 / span 2 !important;
  grid-row: 1 !important;
}
html body.academy-new-checkout-page .acad-info-grid > #billing__field {
  grid-column: 1 / span 2 !important;
  grid-row: 2 !important;
}
html body.academy-new-checkout-page .acad-info-grid > #billing_email_field {
  grid-column: 3 / span 2 !important;
  grid-row: 2 !important;
}
html body.academy-new-checkout-page .acad-info-grid > #billing_region_field {
  grid-column: 1 / span 2 !important;
  grid-row: 3 !important;
}
html body.academy-new-checkout-page .acad-info-grid > #billing_tw_id_number_field,
html body.academy-new-checkout-page .acad-info-grid > #billing_passport_number_field {
  grid-column: 3 / span 2 !important;
  grid-row: 3 !important;
}
html body.academy-new-checkout-page .acad-info-grid__col > .form-row,
html body.academy-new-checkout-page .acad-info-grid__col > p.form-row {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  float: none !important;
  clear: both !important;
  display: block !important;
}
html body.academy-new-checkout-page .acad-info-grid input.input-text {
  width: 100% !important;
  height: 45px !important;
  padding: 0 15px !important;
  border-radius: 8px !important;
  background: rgba(0, 0, 0, 0.40) !important;
  border: 0 !important;
  color: #fff !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .acad-info-grid .woocommerce-input-wrapper {
  width: 100% !important;
  max-width: 100% !important;
}
/* 右欄 region slider 內部 segmented 撐滿 cell */
html body.academy-new-checkout-page .acad-info-grid__col--right > #billing_region_field > .woocommerce-input-wrapper,
html body.academy-new-checkout-page .acad-info-grid__col--right > #billing_member2_region_field > .woocommerce-input-wrapper {
  width: 100% !important;
  height: 45px !important;
}

/* B-16.B | 電子發票預設不展開：用 attribute selector 把所有 cw-ecpei_xxx 子欄位 hide（除 flag 容器與 flag select 本身） */
html body.academy-new-checkout-page #cw-ecpei_fields:not(.acad-einv-has-extra) [id^="cw-ecpei_"]:not(#cw-ecpei_fields):not(#cw-ecpei_flag_field):not(#cw-ecpei_field-flag):not(#cw-ecpei_flag) {
  display: none !important;
}
/* 也擋住 plugin 原本 div wrapper 在 flag 後面 — #cw-ecpei_field-flag + div 內所有子 div 也 hide */
html body.academy-new-checkout-page #cw-ecpei_fields:not(.acad-einv-has-extra) #cw-ecpei_field-flag + div {
  display: none !important;
}

/* B-16.C | 手機 RWD：grid 改 1 欄上下堆疊 */
@media (max-width: 768px) {
  html body.academy-new-checkout-page .acad-info-grid {
    grid-template-columns: 1fr !important;
  }
}

/* B-16.D | 強化 .acad-info-grid 滿版（B-16.I 改 4 欄 grid） */
html body.academy-new-checkout-page .woocommerce-billing-fields__field-wrapper > .acad-info-grid,
html body.academy-new-checkout-page form.checkout .woocommerce-billing-fields__field-wrapper > .acad-info-grid,
html body.academy-new-checkout-page form.woocommerce-checkout .woocommerce-billing-fields__field-wrapper > .acad-info-grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  float: none !important;
  clear: both !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  gap: 20px !important;
}

/* B-16.J | 移除 #billing_region_field 區塊背景色（user 2026-05-14 要求） */
html body.academy-new-checkout-page .acad-info-grid > #billing_region_field,
html body.academy-new-checkout-page .acad-info-grid > #billing_tw_id_number_field,
html body.academy-new-checkout-page .acad-info-grid > #billing_passport_number_field {
  background: transparent !important;
  background-color: transparent !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}
/* region label 隱藏（保留 a11y）+ slider 內部容器透明 */
html body.academy-new-checkout-page .acad-info-grid > #billing_region_field > label.required_field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* B-16.G | .acad-name-row 4 欄強制等寬 + 滿版 + 20px gap（user 2026-05-14 統一間距） */
html body.academy-new-checkout-page .acad-name-row,
html body.academy-new-checkout-page form.checkout .acad-name-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row,
html body.academy-new-checkout-page .woocommerce-billing-fields__field-wrapper > .acad-name-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
html body.academy-new-checkout-page .acad-name-row > .form-row,
html body.academy-new-checkout-page .acad-name-row > p.form-row {
  flex: 1 1 0 !important;
  flex-basis: 0 !important;
  flex-grow: 1 !important;
  flex-shrink: 1 !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
}
/* 內部 input 強制 100% 撐滿 cell（避免 input size 屬性撐開）*/
html body.academy-new-checkout-page .acad-name-row > .form-row input.input-text,
html body.academy-new-checkout-page .acad-name-row > .form-row .woocommerce-input-wrapper {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* B-16.E | 付款區 payment_box 內 input/select 文字白色 + 高度拉高（信用卡欄位看得清楚 + 好點） */
html body.academy-new-checkout-page #payment div.payment_box input,
html body.academy-new-checkout-page #payment div.payment_box select,
html body.academy-new-checkout-page #payment div.payment_box textarea,
html body.academy-new-checkout-page #payment div.payment_box .input-text,
html body.academy-new-checkout-page #payment .payment_box input,
html body.academy-new-checkout-page #payment .payment_box select,
html body.academy-new-checkout-page #payment .payment_box .tpfield {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: rgba(255,255,255,0.10) !important;
  border: 1px solid rgba(255,255,255,0.25) !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
  min-height: 50px !important;
  height: 50px !important;
  box-sizing: border-box !important;
  font-size: 16px !important;
}
html body.academy-new-checkout-page #payment div.payment_box input::placeholder,
html body.academy-new-checkout-page #payment .payment_box input::placeholder {
  color: rgba(255,255,255,0.55) !important;
}
/* select option 在 dropdown 展開時是 OS native 控件，但 select 本體文字白色 */
html body.academy-new-checkout-page #payment div.payment_box select option {
  color: #000 !important;
  background: #fff !important;
}
/* TapPay iframe 容器外觀（iframe 內部由 plugin config 控制，這裡只能改容器） */
html body.academy-new-checkout-page #payment div.payment_box iframe,
html body.academy-new-checkout-page #payment div.payment_box .tpfield {
  background: rgba(255,255,255,0.10) !important;
  border: 1px solid rgba(255,255,255,0.25) !important;
  border-radius: 8px !important;
  min-height: 50px !important;
  height: 50px !important;
  width: 100% !important;
}

/* B-16.F | 中租分期 / 線上分期 期數下拉強制顯示（plugin 可能 inline display:none）*/
html body.academy-new-checkout-page #payment ul.payment_methods > li.is-active .payment_box select,
html body.academy-new-checkout-page #payment ul.payment_methods > li.is-active .payment_box .form-row {
  display: block !important;
  visibility: visible !important;
}

/* B-16.K | 修第一排寬度 — flex 容器頭尾各吃了 20px 空白（console 量出 cell[0].left=name-row.left+20、cell[3].right=name-row.right-20），改用 grid 4 col 徹底消除（user 2026-05-14） */
html body.academy-new-checkout-page form.checkout .acad-name-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  column-gap: 20px !important;
  row-gap: 0 !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 20px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  height: auto !important;
  align-items: center !important;
}
html body.academy-new-checkout-page form.checkout .acad-name-row > .form-row,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row > .form-row {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: unset !important;
  flex-basis: auto !important;
  height: 45px !important;
}
/* 防 flex/grid pseudo 元素撐空白 */
html body.academy-new-checkout-page form.checkout .acad-name-row::before,
html body.academy-new-checkout-page form.checkout .acad-name-row::after,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row::before,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row::after {
  content: none !important;
  display: none !important;
}
/* 覆蓋 line 6620 #billing_english_name_field grid-column: 1 / -1（拼音被它撐成整行寬，導致掉到第 2 行）
   selector specificity (1,3,3) > line 6620 的 (1,1,2)，後寫贏 */
html body.academy-new-checkout-page form.checkout .acad-name-row > #billing_english_name_field,
html body.academy-new-checkout-page form.checkout .acad-name-row > #billing_company_field,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row > #billing_english_name_field,
html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row > #billing_company_field {
  grid-column: auto !important;
  grid-row: auto !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* B-16.L | 台灣/海外 slider + 身分證/護照 輸入欄 包進 .acad-id-group 視覺容器（60% 黑底 + 圓角，user 2026-05-14） */
html body.academy-new-checkout-page .acad-info-grid > .acad-id-group {
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  column-gap: 20px !important;
  row-gap: 0 !important;
  background: rgba(0, 0, 0, 0.60) !important;
  border-radius: 8px !important;
  padding: 8px !important;
  box-sizing: border-box !important;
  align-items: center !important;
}
/* group 內 form-row 透明 + 重設 grid 位置（覆蓋 B-16.I ID-rule 的 grid-column/row）*/
html body.academy-new-checkout-page .acad-id-group > #billing_region_field,
html body.academy-new-checkout-page .acad-id-group > #billing_tw_id_number_field,
html body.academy-new-checkout-page .acad-id-group > #billing_passport_number_field {
  grid-column: auto !important;
  grid-row: auto !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* B-16.M | 手機版 RWD：第一排 4 欄 + 基本資料區 grid + .acad-id-group 統一改 1 col 上下排（user 2026-05-14） */
@media (max-width: 768px) {
  /* user 2026-05-14：手機版基本資料區 container 距離視窗左右各 20px，內部 padding 縮小 */
  html body.academy-new-checkout-page .acad-shell {
    padding: 0 8px !important;
  }
  html body.academy-new-checkout-page .acad-shell .acad-col {
    padding: 14px 12px !important;
  }

  html body.academy-new-checkout-page form.checkout .acad-name-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row {
    grid-template-columns: 1fr !important;
    row-gap: 12px !important;
    column-gap: 0 !important;
    gap: 12px !important;
    height: auto !important;
  }
  html body.academy-new-checkout-page .acad-info-grid {
    grid-template-columns: 1fr !important;
    row-gap: 12px !important;
  }
  /* 手機版清除 .acad-info-grid 內各 form-row 的桌機 grid-column / grid-row 強制設定 */
  html body.academy-new-checkout-page .acad-info-grid > #billing_birth_date_field,
  html body.academy-new-checkout-page .acad-info-grid > #billing_phone_field,
  html body.academy-new-checkout-page .acad-info-grid > #billing__field,
  html body.academy-new-checkout-page .acad-info-grid > #billing_email_field {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
  /* id-group 改 1 col，背景照樣包住 region + id 兩行 */
  html body.academy-new-checkout-page .acad-info-grid > .acad-id-group {
    grid-template-columns: 1fr !important;
    grid-row: auto !important;
    row-gap: 8px !important;
    column-gap: 0 !important;
    padding: 10px !important;
  }
}

/* B-16.N | T-shirt 男女版 slider 切換殘影根除（user 2026-05-14 — 還會看到色塊在裡面跑）
   兩條方案：
   1) 強制清掉 label / input 的 ::before / ::after pseudo + tap highlight
   2) pill ::before 的 transition 從 0.3s 縮到 0.15s，視覺切換更乾脆 */
html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio {
  background: transparent !important;
  background-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
  transition: color 0.15s !important;
  -webkit-tap-highlight-color: transparent !important;
}
html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio::before,
html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio::after,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio::before,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
}
html body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"]::before,
html body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"]::after,
html body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"]:checked::before,
html body.academy-new-checkout-page #billing_tshirt_gender_field input[type="radio"]:checked::after,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field input[type="radio"]::before,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field input[type="radio"]::after,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field input[type="radio"]:checked::before,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field input[type="radio"]:checked::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
}
/* pill 切換 transition 縮短，殘影感降低 */
html body.academy-new-checkout-page #billing_tshirt_gender_field > .woocommerce-input-wrapper::before,
html body.academy-new-checkout-page #billing_member2_tshirt_gender_field > .woocommerce-input-wrapper::before {
  transition: transform 0.15s ease-out !important;
}

/* B-16.O | 電子發票 flag 6 選項對應子欄位顯隱（用 :has() CSS-only 控制，user 2026-05-14）
   - value="2" 自然人憑證號碼  → 只顯示 flag-num
   - value="100" 營業用電子發票 → 只顯示 ubn-title + ubn
   - value="-1" 我要捐贈發票    → 只顯示 love-codes
   - value="3" 手機條碼載具    → 只顯示 flag-num
   - value="0" Email 索取      → 全部 extra hide
   策略：對 #cw-ecpei_fields:has(#cw-ecpei_flag option[value="X"]:checked) 配「該選項不需要的欄位」hide */

/* value="2" 自然人憑證號碼 → hide ubn-title / ubn / love-codes */
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="2"]:checked) #cw-ecpei_ubn-title_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="2"]:checked) #cw-ecpei_ubn_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="2"]:checked) #cw-ecpei_love-codes_field {
  display: none !important;
}
/* value="100" 營業用電子發票 → hide flag-num / love-codes */
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="100"]:checked) #cw-ecpei_flag-num_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="100"]:checked) #cw-ecpei_love-codes_field {
  display: none !important;
}
/* value="-1" 我要捐贈發票 → hide ubn-title / ubn / flag-num */
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="-1"]:checked) #cw-ecpei_ubn-title_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="-1"]:checked) #cw-ecpei_ubn_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="-1"]:checked) #cw-ecpei_flag-num_field {
  display: none !important;
}
/* value="0" Email 索取 → hide 全部 extra */
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="0"]:checked) #cw-ecpei_ubn-title_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="0"]:checked) #cw-ecpei_ubn_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="0"]:checked) #cw-ecpei_flag-num_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="0"]:checked) #cw-ecpei_love-codes_field {
  display: none !important;
}
/* value="3" 手機條碼載具 → hide ubn-title / ubn / love-codes */
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="3"]:checked) #cw-ecpei_ubn-title_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="3"]:checked) #cw-ecpei_ubn_field,
html body.academy-new-checkout-page #cw-ecpei_fields:has(#cw-ecpei_flag option[value="3"]:checked) #cw-ecpei_love-codes_field {
  display: none !important;
}

/* B-16.P | 手機版 RWD 補強（user 2026-05-14）
   1) 基本資料區外框再向視窗兩側放寬：shell padding 0 → col padding 8px → input 離視窗 ≈ 8-10px
   2) segmented slider 文字壓縮修正：letter-spacing 縮 0、font-size 縮小、padding 縮小
   3) T-shirt 區改 grid 兩排：男女 slider 上排佔滿 / 下拉 + 對照圖各 50% 並排 */
@media (max-width: 768px) {
  /* 1. 容器再加寬 */
  html body.academy-new-checkout-page .acad-shell {
    padding: 0 4px !important;
    margin: 0 auto !important;
    max-width: 100% !important;
  }
  html body.academy-new-checkout-page .acad-shell .acad-col {
    padding: 14px 10px !important;
  }

  /* 2. segmented slider 文字壓縮修正（身分證 + T-shirt 男女） */
  html body.academy-new-checkout-page #billing_region_field label.radio,
  html body.academy-new-checkout-page #billing_member2_region_field label.radio,
  html body.academy-new-checkout-page #billing_tshirt_gender_field label.radio,
  html body.academy-new-checkout-page #billing_member2_tshirt_gender_field label.radio,
  html body.academy-new-checkout-page .acad-region-tabs label.radio {
    letter-spacing: 0 !important;
    font-size: 13px !important;
    padding: 0 6px !important;
    white-space: nowrap !important;
  }

  /* 3. T-shirt 區手機版 2 排：男女 slider 在上、size + size-chart 並排在下
     注意：B-12.14c (line 8588) 用 html body.page form.checkout .row (0,3,3) 死死綁 flex，
           B-16.P 必須也升到 (0,3,3) 並後寫才贏 */
  html body.academy-new-checkout-page form.checkout .academy-tshirt-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "gender gender"
      "size   chart" !important;
    gap: 10px !important;
    height: auto !important;
    min-height: auto !important;
    flex-wrap: unset !important;
    flex-direction: unset !important;
  }
  html body.academy-new-checkout-page form.checkout .academy-tshirt-row > #billing_tshirt_gender_field,
  html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > #billing_tshirt_gender_field,
  html body.academy-new-checkout-page form.checkout .academy-tshirt-row > #billing_member2_tshirt_gender_field,
  html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > #billing_member2_tshirt_gender_field {
    grid-area: gender !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: unset !important;
  }
  html body.academy-new-checkout-page form.checkout .academy-tshirt-row > #billing_tshirt_size_field,
  html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > #billing_tshirt_size_field,
  html body.academy-new-checkout-page form.checkout .academy-tshirt-row > #billing_member2_tshirt_size_field,
  html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > #billing_member2_tshirt_size_field {
    grid-area: size !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: unset !important;
  }
  html body.academy-new-checkout-page form.checkout .academy-tshirt-row > .size-chart-button-field,
  html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > .size-chart-button-field,
  html body.academy-new-checkout-page form.checkout .academy-tshirt-row > .member2-size-chart-button-field,
  html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row > .member2-size-chart-button-field {
    grid-area: chart !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: unset !important;
  }
}

/* B-16.Q | acad-section-title 全面調整（user 2026-05-14）
   1) font-size 18→16、font-weight 700→500
   2) 帶 [data-key] 的標題（非「基本資料」標題）加 margin-bottom: 30px 與下方 block 對齊間距 */
html body.academy-new-checkout-page .acad-shell .acad-section-title {
  font-size: 16px !important;
  font-weight: 500 !important;
}
html body.academy-new-checkout-page form.checkout .acad-shell .acad-section-title[data-key],
html body.academy-new-checkout-page form.woocommerce-checkout .acad-shell .acad-section-title[data-key] {
  margin-bottom: 20px !important;
  padding-bottom: 0 !important;
}

/* ============================================
   B-16.U（2026-05-14）：電子發票對應欄位用 CSS 預設 hide，避免 updated_checkout 後 1 秒閃動
   原邏輯：JS hide/show inline style → WC 重新整理時 inline 被洗掉 → 全顯示 1 秒
   新邏輯：CSS 預設 hide 所有非 flag 子欄位 → JS 加 .acad-einv-show class 才顯示
   ============================================ */
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields > p.form-row:not(#cw-ecpei_flag_field):not(.acad-einv-show),
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields > p.form-row:not(#cw-ecpei_flag_field):not(.acad-einv-show) {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
html body.academy-new-checkout-page form.checkout #cw-ecpei_fields > p.form-row.acad-einv-show,
html body.academy-new-checkout-page form.woocommerce-checkout #cw-ecpei_fields > p.form-row.acad-einv-show {
  display: block !important;
  height: 45px !important;
}

/* ============================================
   B-16.W（2026-05-14）：信用卡分期 tab 展開區 — 玉山 / 中信 radio segmented
   ============================================ */
html body.academy-new-checkout-page .academy-installment-box {
  width: 100%;
  margin: 14px 0 0;
  padding: 0;
}
html body.academy-new-checkout-page .academy-installment-box .academy-installment-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  background: rgba(0,0,0,0.40);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 6px;
  box-sizing: border-box;
}
html body.academy-new-checkout-page .academy-installment-box .academy-installment-option {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin: 0;
}
html body.academy-new-checkout-page .academy-installment-box .academy-installment-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255,255,255,0.45);
  border-radius: 50%;
  margin: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
html body.academy-new-checkout-page .academy-installment-box .academy-installment-option input[type="radio"]:checked {
  border-color: #0a0a0a;
  background: #0a0a0a;
}
html body.academy-new-checkout-page .academy-installment-box .academy-installment-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #39FFF5;
  border-radius: 50%;
}
html body.academy-new-checkout-page .academy-installment-box .academy-installment-option:has(input:checked) {
  background: #39FFF5;
  color: #0a0a0a;
}

/* ============================================
   B-16.Z（2026-05-14）：付款區 payment_box 內 input / select 樣式比照基本資料欄位（#billing_email 等）
   ============================================ */
html body.academy-new-checkout-page #payment .payment_box input[type="text"],
html body.academy-new-checkout-page #payment .payment_box input[type="number"],
html body.academy-new-checkout-page #payment .payment_box input[type="tel"],
html body.academy-new-checkout-page #payment .payment_box input[type="email"],
html body.academy-new-checkout-page #payment .payment_box input[type="password"],
html body.academy-new-checkout-page #payment .payment_box textarea,
html body.academy-new-checkout-page #payment .payment_box select {
  width: 100% !important;
  background: rgba(0,0,0,0.2) !important;
  background-color: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  color: #fff !important;
  padding: 12px 14px !important;
  height: auto !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
  font-size: 14px !important;
}
html body.academy-new-checkout-page #payment .payment_box input:focus,
html body.academy-new-checkout-page #payment .payment_box textarea:focus,
html body.academy-new-checkout-page #payment .payment_box select:focus {
  border-color: rgba(57,255,245,0.5) !important;
  outline: none !important;
}
html body.academy-new-checkout-page #payment .payment_box input::placeholder,
html body.academy-new-checkout-page #payment .payment_box textarea::placeholder {
  color: rgba(255,255,255,0.5) !important;
}
/* TapPay / 信用卡 iframe 容器 — 套同樣外框 */
html body.academy-new-checkout-page #payment .payment_box iframe,
html body.academy-new-checkout-page #payment .payment_box .tpfield,
html body.academy-new-checkout-page #payment .payment_box [class*="card-number"],
html body.academy-new-checkout-page #payment .payment_box [class*="card-expiration"],
html body.academy-new-checkout-page #payment .payment_box [class*="card-ccv"] {
  background: rgba(0,0,0,0.2) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  min-height: 44px !important;
  padding: 12px 14px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

/* 信用卡付款 tab：隱藏 plugin 自帶的分期 radio（user 只能用一般刷卡） */
html body.academy-new-checkout-page #payment .payment_box.acad-credit-no-install input[type="radio"][value*="install"],
html body.academy-new-checkout-page #payment .payment_box.acad-credit-no-install input[type="radio"][id*="install"],
html body.academy-new-checkout-page #payment .payment_box.acad-credit-no-install input[type="radio"][name*="install"],
html body.academy-new-checkout-page #payment .payment_box.acad-credit-no-install label[for*="install"] {
  display: none !important;
}

/* B-16.AD：TapPay iframe 內部字色透過 style.style.color 設白色無效（v5.16 內部 ignore）
   用 CSS filter invert + hue-rotate 把整個 iframe 反相：白底→黑底、黑字→白字、紅色保留
   B-16.AH (2026-05-15)：iframe 預設 opacity 0、延遲 0.5s fade-in
   原因：iframe SDK 用 width:1px + min-width:100% 撐開，container 寬度測量晚 → user 看到右側 MM/YY 從窄變寬「往右滑」 */
html body.academy-new-checkout-page #cwtpfw_iframe iframe,
html body.academy-new-checkout-page #cwtp2nd_iframe iframe {
  filter: invert(1) hue-rotate(180deg) !important;
  opacity: 0;
  animation: acad-tappay-iframe-show 0s linear 0.5s forwards;
}
@keyframes acad-tappay-iframe-show {
  to { opacity: 1; }
}

/* ============================================
   B-16.AP (2026-05-15) — 完全隱藏「運送到不同的地址」區塊（user 要求拿掉）
   ============================================ */
html body.academy-new-checkout-page #ship-to-different-address,
html body.academy-new-checkout-page .woocommerce-shipping-fields,
html body.academy-new-checkout-page .acad-ship-address-block,
html body.academy-new-checkout-page .acad-ship-name-row,
html body.academy-new-checkout-page .shipping_address {
  display: none !important;
}

/* ============================================
   B-16.AN (2026-05-15)
   1) state hidden 時 postcode 撐滿 + country 跟 state-postcode 各 50%（避免 SG/MY 等沒 state 國家比例怪）
   2) cloak 遮罩：update_checkout 期間 acad-* 容器淡出，避免欄位亂跳
   3) 返回修改購物車按鈕樣式
   ============================================ */

/* 1) state hidden 時的比例修正 */
html body.academy-new-checkout-page .acad-os-state-postcode.acad-no-state > #billing_postcode_field,
html body.academy-new-checkout-page .acad-ship-os-state-postcode.acad-no-state > #shipping_postcode_field {
  flex: 1 1 100% !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page .acad-os-row-1:has(> .acad-os-state-postcode.acad-no-state) > #billing_country_field,
html body.academy-new-checkout-page .acad-ship-os-row-1:has(> .acad-ship-os-state-postcode.acad-no-state) > #shipping_country_field {
  flex: 50 1 0 !important;
}
html body.academy-new-checkout-page .acad-os-row-1:has(> .acad-os-state-postcode.acad-no-state) > .acad-os-state-postcode,
html body.academy-new-checkout-page .acad-ship-os-row-1:has(> .acad-ship-os-state-postcode.acad-no-state) > .acad-ship-os-state-postcode {
  flex: 50 1 0 !important;
}

/* 2) cloak — WC update_checkout 重渲染期間遮掉 acad-* 容器 */
body.academy-new-checkout-page.acad-rebuilding .acad-info-grid,
body.academy-new-checkout-page.acad-rebuilding .acad-name-row,
body.academy-new-checkout-page.acad-rebuilding .acad-ship-name-row,
body.academy-new-checkout-page.acad-rebuilding .acad-tw-row,
body.academy-new-checkout-page.acad-rebuilding .acad-os-row-1,
body.academy-new-checkout-page.acad-rebuilding .acad-os-state-postcode,
body.academy-new-checkout-page.acad-rebuilding .acad-os-row-2,
body.academy-new-checkout-page.acad-rebuilding .acad-ship-tw-row,
body.academy-new-checkout-page.acad-rebuilding .acad-ship-os-row-1,
body.academy-new-checkout-page.acad-rebuilding .acad-ship-os-state-postcode,
body.academy-new-checkout-page.acad-rebuilding .acad-ship-os-row-2 {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.15s ease;
}
body.academy-new-checkout-page .acad-info-grid,
body.academy-new-checkout-page .acad-name-row,
body.academy-new-checkout-page .acad-ship-name-row,
body.academy-new-checkout-page .acad-tw-row,
body.academy-new-checkout-page .acad-os-row-1,
body.academy-new-checkout-page .acad-os-state-postcode,
body.academy-new-checkout-page .acad-os-row-2,
body.academy-new-checkout-page .acad-ship-tw-row,
body.academy-new-checkout-page .acad-ship-os-row-1,
body.academy-new-checkout-page .acad-ship-os-state-postcode,
body.academy-new-checkout-page .acad-ship-os-row-2 {
  transition: opacity 0.15s ease;
}

/* 3) 返回修改購物車按鈕 — 次要按鈕風格（透明底 + 重點色邊框） */
html body.academy-new-checkout-page form.checkout .form-row.place-order,
html body.academy-new-checkout-page form.woocommerce-checkout .form-row.place-order {
  text-align: center !important;
  margin-top: 30px !important;
  padding-top: 0 !important;
}
html body.academy-new-checkout-page a.acad-cart-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  height: 50px;
  margin-right: 30px;
  border: 1px solid #39FFF5;
  border-radius: 8px;
  background: transparent;
  color: #39FFF5;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  vertical-align: middle;
}
html body.academy-new-checkout-page a.acad-cart-back-btn:hover,
html body.academy-new-checkout-page a.acad-cart-back-btn:focus {
  background: rgba(57, 255, 245, 0.1);
  color: #39FFF5;
  text-decoration: none;
}
@media (max-width: 768px) {
  html body.academy-new-checkout-page a.acad-cart-back-btn {
    display: flex;
    width: 100%;
    margin: 30px 0 30px 0;
  }
}

/* ============================================
   B-16.AX (2026-05-18) — WC Subscriptions「第一次續訂」膠囊樣式
   selector: .first-payment-date small（plugin echo 出來的固定結構）
   要求：白色文字 + padding 10px + 2px 膠囊外匡 + 無背景
   ============================================ */
html body.academy-new-cart-page .first-payment-date,
html body.academy-new-checkout-page .first-payment-date {
  display: block;
  margin-top: 10px;
  text-align: right;
}
html body.academy-new-cart-page .first-payment-date small,
html body.academy-new-checkout-page .first-payment-date small {
  display: inline-block;
  color: #fff !important;
  background: transparent !important;
  border: 2px solid #39FFF5 !important;
  border-radius: 999px !important;
  padding: 10px 18px !important;
  font-size: 13px !important;
  font-weight: 500;
  letter-spacing: 0.5px;
  line-height: 1;
}

/* ============================================
   B-16.AZ-FINAL2 2026-05-19：hover = focus 平滑漸變
   做法：
   1. 用 box-shadow inset 模擬 2px 框（不佔 layout 寬度、不會 1px→2px 跳）
   2. transition 250ms 平滑淡入；初始 box-shadow cyan 0 alpha → hover/focus cyan 1.0 alpha，
      從透明漸變到 cyan，不會經過白色中介
   3. background 也加 transition 同步漸變
   ============================================ */
body.academy-new-checkout-page .form-row input.input-text,
body.academy-new-checkout-page .form-row input[type="date"],
body.academy-new-checkout-page .form-row input[type="email"],
body.academy-new-checkout-page .form-row input[type="tel"],
body.academy-new-checkout-page .form-row textarea,
body.academy-new-checkout-page .form-row select,
body.academy-new-checkout-page .form-row .select2-selection,
body.academy-new-checkout-page .acad-name-row > .form-row input.input-text,
body.academy-new-checkout-page .acad-name-row > .form-row .woocommerce-input-wrapper > input.input-text,
body.academy-new-checkout-page .acad-info-grid input.input-text,
body.academy-new-checkout-page .acad-info-grid select,
body.academy-new-checkout-page .acad-member-row input,
body.academy-new-checkout-page .acad-shell input.input-text,
body.academy-new-checkout-page .acad-shell textarea,
body.academy-new-checkout-page .acad-shell select,
body.academy-new-checkout-page #billing_birth_date_field input[type="date"],
body.academy-new-checkout-page #billing_phone_field input.input-text,
body.academy-new-checkout-page #billing_email_field input.input-text {
  box-shadow: inset 0 0 0 1px rgba(57, 255, 245, 0) !important;
  transition: box-shadow 250ms ease, background-color 250ms ease !important;
}

@media (hover: hover) {
  body.academy-new-checkout-page .form-row input.input-text:hover,
  body.academy-new-checkout-page .form-row input[type="date"]:hover,
  body.academy-new-checkout-page .form-row input[type="email"]:hover,
  body.academy-new-checkout-page .form-row input[type="tel"]:hover,
  body.academy-new-checkout-page .form-row textarea:hover,
  body.academy-new-checkout-page .form-row select:hover,
  body.academy-new-checkout-page .form-row .select2-selection:hover,
  body.academy-new-checkout-page .acad-name-row > .form-row input.input-text:hover,
  body.academy-new-checkout-page .acad-name-row > .form-row .woocommerce-input-wrapper > input.input-text:hover,
  body.academy-new-checkout-page .acad-info-grid input.input-text:hover,
  body.academy-new-checkout-page .acad-info-grid select:hover,
  body.academy-new-checkout-page .acad-member-row input:hover,
  body.academy-new-checkout-page .acad-shell input.input-text:hover,
  body.academy-new-checkout-page .acad-shell textarea:hover,
  body.academy-new-checkout-page .acad-shell select:hover,
  body.academy-new-checkout-page #billing_birth_date_field input[type="date"]:hover,
  body.academy-new-checkout-page #billing_phone_field input.input-text:hover,
  body.academy-new-checkout-page #billing_email_field input.input-text:hover {
    box-shadow: inset 0 0 0 1px rgba(57, 255, 245, 0.7) !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    outline: none !important;
  }
}
body.academy-new-checkout-page .form-row input.input-text:focus,
body.academy-new-checkout-page .form-row input[type="date"]:focus,
body.academy-new-checkout-page .form-row input[type="email"]:focus,
body.academy-new-checkout-page .form-row input[type="tel"]:focus,
body.academy-new-checkout-page .form-row textarea:focus,
body.academy-new-checkout-page .form-row select:focus,
body.academy-new-checkout-page .form-row .select2-selection:focus,
body.academy-new-checkout-page .form-row .select2-container--focus .select2-selection,
body.academy-new-checkout-page .acad-name-row > .form-row input.input-text:focus,
body.academy-new-checkout-page .acad-name-row > .form-row .woocommerce-input-wrapper > input.input-text:focus,
body.academy-new-checkout-page .acad-info-grid input.input-text:focus,
body.academy-new-checkout-page .acad-info-grid select:focus,
body.academy-new-checkout-page .acad-member-row input:focus,
body.academy-new-checkout-page .acad-shell input.input-text:focus,
body.academy-new-checkout-page .acad-shell textarea:focus,
body.academy-new-checkout-page .acad-shell select:focus,
body.academy-new-checkout-page #billing_birth_date_field input[type="date"]:focus,
body.academy-new-checkout-page #billing_phone_field input.input-text:focus,
body.academy-new-checkout-page #billing_email_field input.input-text:focus {
  box-shadow: inset 0 0 0 1px rgba(57, 255, 245, 0.7) !important;
  background-color: rgba(0, 0, 0, 0.6) !important;
  outline: none !important;
}

/* B-16.AZ-FINAL：.acad-col--info 上下 padding 30px（蓋過 6422 的 18px）+ 拿掉底部水平線 */
html body.academy-new-checkout-page .acad-shell .acad-col.acad-col--info {
  padding-top: 30px !important;
  padding-bottom: 30px !important;
  border-bottom: 0 !important;
}

/* ============================================
   B-16.BC 2026-05-19：結帳頁錯誤訊息浮動（不影響填表）
   - .woocommerce-NoticeGroup-checkout / .woocommerce-NoticeGroup-updateOrderReview 改 fixed 浮在頂部
   - 不佔 form 流的空間 → 不會把整頁推下去 / 不會 scroll 回頂部
   - 5 秒後自動淡出（CSS animation）
   ============================================ */
/* B-16.BR 2026-05-21：完全隱藏浮動 notice 框，改 JS scroll + focus 第一個 invalid 欄位 */
html body.academy-new-checkout-page .woocommerce-NoticeGroup-checkout,
html body.academy-new-checkout-page .woocommerce-NoticeGroup-updateOrderReview,
html body.academy-new-checkout-page > .woocommerce-error,
html body.academy-new-checkout-page form.checkout > .woocommerce-error,
html body.academy-new-checkout-page form.woocommerce-checkout > .woocommerce-error,
html body.academy-new-checkout-page ul.woocommerce-error {
  display: none !important;
}
@keyframes acad-notice-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes acad-notice-out {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; visibility: hidden; }
}
/* 手機版 */
@media (max-width: 768px) {
  body.academy-new-checkout-page .woocommerce-NoticeGroup-checkout,
  body.academy-new-checkout-page .woocommerce-NoticeGroup-updateOrderReview,
  body.academy-new-checkout-page > .woocommerce-error,
  body.academy-new-checkout-page form.checkout > .woocommerce-error {
    top: 70px !important;
    width: 95vw !important;
  }
}

/* ============================================
   B-16.BM 2026-05-21：IP 偵測只決定預設 mode（JS 端處理）
   兩個 tabs（台灣地區 / 國外地址）都保留可見，user 仍可手動切換
   CSS 不再強制 hide tabs 或 panel
   ============================================ */

/* B-16.BT 2026-05-21：必填欄位空白時 pulse 2 次 cyan 提示 */
body.academy-new-checkout-page .acad-invalid-pulse {
  animation: acad-invalid-pulse 600ms ease-in-out 2 !important;
  border-radius: 8px;
}
@keyframes acad-invalid-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(57, 255, 245, 0.7); }
  50%  { box-shadow: 0 0 0 6px rgba(57, 255, 245, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(57, 255, 245, 0); }
}

/* B-16.BW #63.P (2026-05-25)：滑軌指示器電腦版隱藏（只 mobile @media 顯示） */
.acad-rec-progress { display: none; }

/* ===========================================================================
   B-16.BW (2026-05-25) — 新版購物車 / 結帳頁的全域 layout 修正（task #59 + #60）
   - #59 結帳頁拿掉加購區（PHP 已 early return，這裡 CSS 保險網）
   - #60 兩頁 footer 整段隱藏（電腦+手機，scope 限縮 body class 不影響其他頁）
   =========================================================================== */
body.academy-new-checkout-page .academy-recommendations,
body.academy-new-checkout-page .academy-rec-carousel,
body.academy-new-checkout-page .acad-col--addon,
html body.academy-new-checkout-page .acad-row--products > .acad-col--addon,
html body.academy-new-checkout-page .acad-col--addon {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  flex: 0 !important;
  visibility: hidden !important;
}
/* 結帳頁清單區拿掉加購欄後，cart col 升級全寬（高 specificity 覆蓋舊 grid 規則） */
html body.academy-new-checkout-page .acad-shell .acad-row.acad-row--products,
html body.academy-new-checkout-page .acad-row.acad-row--products {
  display: block !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  width: 100% !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page .acad-shell .acad-row.acad-row--products > .acad-col.acad-col--cart,
html body.academy-new-checkout-page .acad-row.acad-row--products > .acad-col.acad-col--cart {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: none !important;
  grid-column: auto !important;
  margin: 0 !important;
}

/* B-16.BW #65 (2026-05-26) — 付款區 4 顆 tab 由 JS 移到 #payment 之前的 sibling 位置（真正在區塊外） */
/* tab 底部緊貼 #payment 區塊上緣，視覺像 tab「黏」在 box 頂部 */
body.academy-new-checkout-page .acad-col--payment .academy-payment-tabs,
body.academy-new-checkout-page form.checkout .academy-payment-tabs,
body.academy-new-checkout-page .academy-payment-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  /* 緊貼下方 #payment：底部 0 margin，配合下方 #payment top 0 margin */
}
body.academy-new-checkout-page .acad-col--payment .academy-payment-tabs + #payment,
body.academy-new-checkout-page form.checkout .academy-payment-tabs + #payment,
body.academy-new-checkout-page .academy-payment-tabs + #payment {
  margin-top: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}
body.academy-new-checkout-page .academy-payment-tab-btn {
  border-radius: 8px 8px 0 0 !important;
  margin: 0 !important;
  /* tab 底部 padding 0，視覺上跟 #payment 邊框緊貼 */
}
/* 手機版：4 個 tab 強制平分 viewport 寬度（不 wrap 換行） */
/* 用 html body + 多層 ancestor 拉高 specificity 超過 base 規則 */
@media (max-width: 768px) {
  html body.academy-new-checkout-page .acad-col--payment .academy-payment-tabs,
  html body.academy-new-checkout-page form.checkout .academy-payment-tabs,
  html body.academy-new-checkout-page .academy-payment-tabs {
    flex-wrap: nowrap !important;
    gap: 2px !important;
  }
  html body.academy-new-checkout-page .acad-col--payment .academy-payment-tab-btn,
  html body.academy-new-checkout-page form.checkout .academy-payment-tab-btn,
  html body.academy-new-checkout-page .academy-payment-tab-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    font-size: 12px !important;
    padding: 10px 4px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    /* 2026-05-26 配色比照電腦版（base rule 4946 inactive 淡白 / active 黑色融入 box），不再 override background */
  }
  /* 手機版 hover/active 也維持「上 8 下 0」，下方緊貼 #payment 上緣 */
  html body.academy-new-checkout-page .academy-payment-tab-btn,
  html body.academy-new-checkout-page .academy-payment-tab-btn:hover,
  html body.academy-new-checkout-page .academy-payment-tab-btn:focus,
  html body.academy-new-checkout-page .academy-payment-tab-btn.is-active {
    border-radius: 8px 8px 0 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
}
/* footer 整段隱藏（電腦+手機，只影響這兩頁） */
body.academy-new-cart-page footer.elementor-location-footer,
body.academy-new-checkout-page footer.elementor-location-footer,
body.academy-new-cart-page footer[data-elementor-type="footer"],
body.academy-new-checkout-page footer[data-elementor-type="footer"] {
  display: none !important;
}
/* footer 隱藏後留下的下方空白：清掉 main / content-area 預留的 padding/margin */
body.academy-new-cart-page,
body.academy-new-checkout-page {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
body.academy-new-cart-page .site-main,
body.academy-new-checkout-page .site-main,
body.academy-new-cart-page .academy-new-content-area,
body.academy-new-checkout-page .academy-new-content-area,
body.academy-new-cart-page .academy-new-main,
body.academy-new-checkout-page .academy-new-main {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
body.academy-new-cart-page .site-main::after,
body.academy-new-checkout-page .site-main::after {
  content: none !important;
  display: none !important;
}

/* ===========================================================================
   B-16.BW #61 + #62 (2026-05-25) — 手機版新版購物車 sticky 底部結帳 bar
   - 預設一行：總金額 + 結帳按鈕
   - 點總金額 → 向上展開明細
   - 折扣碼 toggle row 向上展開輸入欄
   - 只在手機+平板 (≤1024px) 出現，桌機完全 hide
   =========================================================================== */
.acad-mbar { display: none; }

@media (max-width: 1024px) {
  body.academy-new-cart-page .acad-mbar {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9998;
    background: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 -6px 20px rgba(0,0,0,0.4);
    font-family: 'Noto Sans TC', sans-serif;
  }
  /* 主列：總金額 + 結帳按鈕 */
  body.academy-new-cart-page .acad-mbar__main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
  }
  body.academy-new-cart-page .acad-mbar__toggle {
    flex: 1;
    background: transparent;
    border: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
  }
  body.academy-new-cart-page .acad-mbar__total-label {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
  }
  body.academy-new-cart-page .acad-mbar__total-val {
    font-size: 18px;
    font-weight: 700;
    color: #39fff5;
    font-family: 'Oxanium', sans-serif;
  }
  body.academy-new-cart-page .acad-mbar__total-val .woocommerce-Price-amount {
    color: inherit;
  }
  /* caret：線條風格 cyan（chevron），預設朝上 ▲ 代表「點擊向上展開」 */
  body.academy-new-cart-page .acad-mbar__caret {
    margin-left: auto;
    width: 10px;
    height: 10px;
    border: 0;
    border-right: 2px solid #39fff5;
    border-bottom: 2px solid #39fff5;
    transform: rotate(-135deg);
    transition: transform 200ms ease;
  }
  body.academy-new-cart-page .acad-mbar.is-details-open .acad-mbar__caret {
    transform: rotate(45deg);
  }
  body.academy-new-cart-page .acad-mbar__checkout {
    background: #39fff5;
    color: #000;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 150ms ease;
  }
  body.academy-new-cart-page .acad-mbar__checkout:hover,
  body.academy-new-cart-page .acad-mbar__checkout:active {
    filter: brightness(0.9);
    color: #000;
    text-decoration: none;
  }

  /* 折扣碼 toggle row */
  body.academy-new-cart-page .acad-mbar__coupon-row {
    border-top: 1px solid rgba(255,255,255,0.08);
    position: relative;
    padding-bottom: 21px !important; /* 10 上 + 1 線 + 10 下 = 21 */
    height: auto !important;
  }
  /* 底部 90% 寬 1px 30%白色線條，上下各 10px 留白 */
  body.academy-new-cart-page .acad-mbar__coupon-row::after {
    content: '';
    position: absolute;
    left: 5%;
    bottom: 10px;
    width: 90%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
  }
  body.academy-new-cart-page .acad-mbar__coupon-toggle {
    width: 100%;
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.75);
    padding: 10px 16px;
    height: auto !important;
    text-align: left;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  /* 箭頭：cyan 線條風格 chevron（預設朝下 ▼，展開後朝上 ▲） */
  body.academy-new-cart-page .acad-mbar__coupon-toggle::after {
    content: '';
    width: 10px;
    height: 10px;
    border: 0;
    border-right: 2px solid #39fff5;
    border-bottom: 2px solid #39fff5;
    transform: rotate(45deg);
    transition: transform 200ms ease;
  }
  body.academy-new-cart-page .acad-mbar.is-coupon-open .acad-mbar__coupon-toggle::after {
    transform: rotate(-135deg);
  }
  /* 折扣碼 form（向上展開，容器總高 60px、上下各 10px padding、內部 input 區 40px） */
  /* 不畫 border-top：toggle row 已有 ::after 30%白線一條，避免重複 */
  body.academy-new-cart-page .acad-mbar__coupon-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    height: 60px !important;
    align-items: center;
    border-top: 0 !important;
    background: #141414;
    box-sizing: border-box;
  }
  body.academy-new-cart-page .acad-mbar__coupon-form[hidden] { display: none; }
  body.academy-new-cart-page .acad-mbar__coupon-input {
    flex: 1;
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #fff !important;
    padding: 0 12px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    min-height: auto !important;
    height: 40px !important;
    box-sizing: border-box !important;
  }
  body.academy-new-cart-page .acad-mbar__coupon-input::placeholder {
    color: rgba(255,255,255,0.4);
  }
  body.academy-new-cart-page .acad-mbar__coupon-apply {
    background: #39fff5 !important;
    color: #000 !important;
    border: 0 !important;
    padding: 0 18px !important;
    height: 40px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer;
    box-sizing: border-box !important;
  }

  /* 明細展開區（向上滑出） */
  body.academy-new-cart-page .acad-mbar__details {
    background: #1a1a1a;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    max-height: 50vh;
    overflow-y: auto;
    /* 防止 details 內 touch swipe 卡住 page scroll */
    overscroll-behavior: contain;
  }
  body.academy-new-cart-page .acad-mbar__details[hidden] { display: none; }
  body.academy-new-cart-page .acad-mbar__details-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  body.academy-new-cart-page .acad-mbar__close {
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.7);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
  }
  body.academy-new-cart-page .acad-mbar__details-body table {
    width: 100%;
    color: #fff;
    border-collapse: collapse;
    font-size: 14px;
  }
  body.academy-new-cart-page .acad-mbar__details-body table th,
  body.academy-new-cart-page .acad-mbar__details-body table td {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: left;
    color: #fff;
  }
  body.academy-new-cart-page .acad-mbar__details-body table td {
    text-align: right;
  }
  body.academy-new-cart-page .acad-mbar__details-body table tr.order-total th,
  body.academy-new-cart-page .acad-mbar__details-body table tr.order-total td {
    font-weight: 700;
    font-size: 16px;
    color: #39fff5;
    border-bottom: 0;
    padding-top: 12px;
  }
  /* 強制 th 顯示（WC shop_table_responsive 預設手機版 hide th，但 sticky bar 內要顯示）+ 清掉 td::before 加的 ': ' */
  body.academy-new-cart-page .acad-mbar__details-body table th {
    display: table-cell !important;
    visibility: visible !important;
  }
  body.academy-new-cart-page .acad-mbar__details-body table td::before,
  body.academy-new-cart-page .acad-mbar__details-body table th::before,
  body.academy-new-cart-page .acad-mbar__details-body table td::after,
  body.academy-new-cart-page .acad-mbar__details-body table th::after {
    content: none !important;
    display: none !important;
  }
  /* 隱藏小計、貨件 row（這兩個 row 沒實質意義，總計已含小計，貨件免運不用列） */
  body.academy-new-cart-page .acad-mbar__details-body table tr.cart-subtotal,
  body.academy-new-cart-page .acad-mbar__details-body table tr.woocommerce-shipping-totals,
  body.academy-new-cart-page .acad-mbar__details-body table tr.shipping {
    display: none !important;
  }

  /* 總金額 button 被 WC .button 染色 → 強制透明背景 */
  body.academy-new-cart-page .acad-mbar .acad-mbar__toggle,
  body.academy-new-cart-page .acad-mbar button.acad-mbar__toggle {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #fff !important;
  }
  body.academy-new-cart-page .acad-mbar .acad-mbar__coupon-toggle,
  body.academy-new-cart-page .acad-mbar button.acad-mbar__coupon-toggle {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  body.academy-new-cart-page .acad-mbar .acad-mbar__close,
  body.academy-new-cart-page .acad-mbar button.acad-mbar__close {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  /* 隱藏頁面內原本的 cart_totals / coupon / checkout（手機版改由 sticky bar 顯示） */
  /* 連外層 .cart-collaterals 整個 hide，避免容器 padding/margin 留下空白 */
  body.academy-new-cart-page .cart-collaterals,
  body.academy-new-cart-page .cart-collaterals .cart_totals,
  body.academy-new-cart-page .academy-coupon-section,
  body.academy-new-cart-page .wc-proceed-to-checkout {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }
  /* cart form / 商品表底下的 margin 全部清掉（避免商品列表 → 限時加購中間留大空白） */
  body.academy-new-cart-page .woocommerce-cart-form,
  body.academy-new-cart-page form.woocommerce-cart-form,
  body.academy-new-cart-page .woocommerce-cart-form table.shop_table {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  /* cart-form 下方的 actions row（更新購物車按鈕）也清掉空白 */
  body.academy-new-cart-page .woocommerce-cart-form table.shop_table tr td.actions {
    padding: 0 !important;
  }

  /* 給 body 預留 sticky bar 高度，避免內容被遮 */
  body.academy-new-cart-page {
    padding-bottom: 80px !important;
  }
}

/* ===========================================================================
   B-16.BW (2026-05-25) — 手機版商品清單修正
   - 縮圖被切掉（140px img 塞 80px column）→ 縮成 80x80
   - 每個 td::before 顯示「: 」（shop_table_responsive 預設）→ 移除
   =========================================================================== */
@media (max-width: 768px) {
  html body.academy-new-cart-page table.shop_table.cart td.product-thumbnail img,
  html body.academy-new-cart-page table.shop_table.cart_item td.product-thumbnail img {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    margin: 0 !important;
    object-fit: cover !important;
  }
  html body.academy-new-cart-page table.shop_table.cart tr.cart_item td::before,
  html body.academy-new-cart-page table.shop_table.cart tr.cart_item td::after {
    content: none !important;
    display: none !important;
  }
}

/* ===========================================================================
   B-16.BW #63.M (2026-05-25) — 手機版加購區改橫向 swiper 單列滑動
   電腦版仍 grid，手機版 (≤768px) 強制單列 carousel 樣式
   =========================================================================== */
@media (max-width: 768px) {
  /* 加購區外殼 carousel 在手機版用 scroll-snap + 橫滑，padding 歸零讓卡剛好填滿 */
  body.academy-new-cart-page .academy-rec-carousel {
    padding: 0 !important;
  }
  body.academy-new-cart-page .academy-rec-carousel__viewport {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-padding: 0 !important;
    scroll-snap-stop: always !important;
  }
  body.academy-new-cart-page .academy-rec-carousel__viewport::-webkit-scrollbar {
    display: none;
  }
  body.academy-new-cart-page .academy-rec-carousel__track {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    transform: none !important;
    transition: none !important;
    flex-wrap: nowrap !important;
  }
  /* 手機版加購卡：每屏完整顯示 2 張（carousel padding 0、gap 6px → 卡寬 = 50vw - 3px） */
  html body.academy-new-cart-page .academy-recommendations .academy-rec-carousel__track .academy-rec-card,
  html body.academy-new-cart-page .academy-rec-card {
    flex: 0 0 calc(46vw - 3px) !important;
    width: calc(46vw - 3px) !important;
    min-width: calc(46vw - 3px) !important;
    max-width: calc(46vw - 3px) !important;
    scroll-snap-align: start !important;
    scroll-snap-stop: always !important;
    padding: 8px !important;
    gap: 6px !important;
    /* 卡內 text 全置中 */
    text-align: center !important;
    align-items: center !important;
  }
  /* 卡內所有 text 元素置中 */
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__name,
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__price,
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__price-orig,
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__price-sale {
    text-align: center !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: center !important;
  }
  /* 按鈕 padding 加大，避免文字被切 */
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__btn {
    padding: 10px 6px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: 36px !important;
    white-space: nowrap !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  /* 手機版隱藏「XX 折優惠」badge */
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__badge {
    display: none !important;
  }
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__img {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
  }
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__name {
    font-size: 11px !important;
    line-height: 1.3 !important;
    min-height: 2.2em !important;
  }
  /* 原價 + 優惠價同一排：price wrapper 改 flex row + center；原價小字 + 60% 白 */
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__price {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 6px !important;
  }
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__price-orig {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    text-decoration: line-through !important;
  }
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__price-sale {
    font-size: 14px !important;
  }
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__btn {
    padding: 5px 4px !important;
    font-size: 10px !important;
  }
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__btn .acad-cd-text,
  html body.academy-new-cart-page .academy-recommendations .academy-rec-card__btn .acad-cd-num {
    font-size: 14px !important;
  }
  /* 手機版改用 scroll snap，左右箭頭隱藏（用手指滑） */
  body.academy-new-cart-page .academy-rec-carousel__nav {
    display: none !important;
  }
  /* 2026-05-25 B-16.BW #63.P：手機版加購區下方滑軌指示器（user 提供尺寸：底層 2px 50%白色全寬、滑塊 3px x 30px cyan、距 carousel 20px） */
  body.academy-new-cart-page .acad-rec-progress {
    display: block !important;
    position: relative;
    width: 100%;
    height: 3px;
    margin: 20px auto 0;
    background: transparent;
    cursor: pointer;
    touch-action: none;
  }
  body.academy-new-cart-page .acad-rec-progress::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 2px;
    background: rgba(255, 255, 255, 0.5);
  }
  body.academy-new-cart-page .acad-rec-progress__thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: #39fff5;
    border-radius: 0;
    transition: left 100ms ease;
    will-change: left;
  }
}

/* 2026-05-26 B-16.BW #65：#terms checkbox 樣式（圓形 10px + 跟文字垂直對齊 + label gap 8px）
   用 #terms id + .woocommerce-terms-and-conditions-wrapper 雙保險，避免被 WC 預設或主題覆蓋
   原 .form-row.terms 那組規則在本頁 HTML 上未匹配（parent 是 .form-row.validate-required，沒 .terms class） */
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper p.form-row,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper .form-row.validate-required {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper label,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper label.checkbox,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper .woocommerce-form__label-for-checkbox {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  line-height: 1.4 !important;
  color: #fff !important;
}
html body.academy-new-checkout-page input#terms,
html body.academy-new-checkout-page input#terms[type="checkbox"],
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper input[type="checkbox"][name="terms"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  border-radius: 50% !important;
  border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  cursor: pointer !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  vertical-align: middle !important;
  display: inline-block !important;
  box-sizing: border-box !important;
  outline: none !important;
  transition: all 0.2s !important;
}
html body.academy-new-checkout-page input#terms[type="checkbox"]:hover {
  border-color: #39fff5 !important;
}
html body.academy-new-checkout-page input#terms[type="checkbox"]:checked {
  background: #39fff5 !important;
  background-color: #39fff5 !important;
  border-color: #39fff5 !important;
}
html body.academy-new-checkout-page input#terms[type="checkbox"]:checked::after {
  content: '' !important;
  position: absolute !important;
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  background: #1a1a1a !important;
  border: none !important;
  transform: translate(-50%, -50%) !important;
  left: 50% !important;
  top: 50% !important;
}

/* ============================================================
   2026-05-29 #13~17：new-cart 加購區電腦版微調
   全部包在 @media (min-width: 769px) 內，手機版完全不動
   selector 加 html 提升 specificity，覆寫 source order 在後的 flex rule
   ============================================================ */
@media (min-width: 769px) {
  /* carousel：原樣（不要 buffer 區，避免下一頁 column 從 viewport 邊洩漏） */
  html body.academy-new-cart-page .academy-rec-carousel {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  /* 電腦版隱藏原側邊 prev/next（手機版仍正常顯示） */
  html body.academy-new-cart-page .academy-rec-carousel > .academy-rec-carousel__nav {
    display: none !important;
  }
  /* viewport overflow hidden 切左右 column（避免下一頁洩漏），寬度限 984px 居中 */
  html body.academy-new-cart-page .academy-rec-carousel__viewport {
    overflow: hidden !important;
    width: 100% !important;
    max-width: calc(4 * 240px + 3 * 8px) !important;
    margin: 0 auto !important;
  }
  /* track 強制 grid 2 行 × 自動 column，覆寫 line 2722 的 display: flex；gap 8px */
  html body.academy-new-cart-page .academy-rec-carousel__track {
    display: grid !important;
    grid-template-rows: repeat(2, auto) !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 240px !important;
    gap: 8px !important;
    flex-direction: initial !important;
  }

  /* 卡片寬度統一 240px + relative（讓 badge absolute 在左上）+ cursor pointer（整張可點） */
  html body.academy-new-cart-page .academy-rec-card,
  html body.academy-new-cart-page .academy-rec-carousel__track .academy-rec-card {
    position: relative !important;
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    flex: 0 0 240px !important;
    cursor: pointer !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
  }
  /* hover：邊框 50% + inset 內側光暈（用 inset 才不會被 viewport overflow hidden 切） */
  html body.academy-new-cart-page .academy-rec-card:hover,
  html body.academy-new-cart-page .academy-rec-carousel__track .academy-rec-card:hover {
    border-color: rgba(57,255,245,0.5) !important;
    box-shadow: inset 0 0 18px rgba(57,255,245,0.4) !important;
  }

  /* title-row：h3「限時加購」+ pager 並排在同一行 */
  html body.academy-new-cart-page .academy-rec-title-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
  }
  /* h3 在 title-row 內取消預設 margin */
  html body.academy-new-cart-page .academy-rec-title-row .academy-recommendations__title {
    margin: 0 !important;
  }

  /* pager bar：左箭頭 + 1/N + 右箭頭，放在 H3 右側 */
  html body.academy-new-cart-page .acad-rec-pager {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    margin-top: 0 !important;
  }
  html body.academy-new-cart-page .acad-rec-pager__btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.5) !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s !important;
  }
  html body.academy-new-cart-page .acad-rec-pager__btn:hover {
    background: #fff !important;
    color: #1a1a1a !important;
    border-color: #fff !important;
  }
  html body.academy-new-cart-page .acad-rec-pager__indicator {
    color: #fff !important;
    font-size: 14px !important;
    min-width: 48px !important;
    text-align: center !important;
    font-variant-numeric: tabular-nums !important;
  }

  /* #14：折扣標籤改回左上 absolute + 膠囊體 + 縮小體積（覆寫頂部全寬橫條） */
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__badge {
    position: absolute !important;
    top: 6px !important;
    left: 6px !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    display: inline-block !important;
    padding: 2px 10px !important;
    margin: 0 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    border-radius: 999px !important;
    background: #39fff5 !important;
    color: #1a1a1a !important;
    text-align: center !important;
    white-space: nowrap !important;
    z-index: 2 !important;
  }

  /* #16：商品標題置中（覆寫原本 text-align: left） */
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__name {
    text-align: center !important;
  }

  /* #15：原價（劃線）+ 優惠價同一行
     改用 display: block + white-space: nowrap + children inline-block，
     避開 flex container 因 children width 加總超過父寬就強制 wrap 的邊界問題 */
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__price {
    display: block !important;
    flex-direction: initial !important;
    white-space: nowrap !important;
    text-align: center !important;
    gap: 0 !important;
    overflow: visible !important;
  }
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__price .academy-rec-card__price-orig,
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__price .academy-rec-card__price-sale {
    display: inline-block !important;
    width: auto !important;
    vertical-align: baseline !important;
    margin: 0 !important;
  }
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__price .academy-rec-card__price-orig {
    margin-right: 6px !important;
  }

  /* #17：加購倒數按鈕文字完整顯露（增加 line-height + 上下 padding） */
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__btn {
    line-height: 1.5 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    min-height: 0 !important;
    height: auto !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__btn .acad-cd-left,
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__btn .acad-cd-right,
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__btn .acad-cd-num,
  html body.academy-new-cart-page .academy-rec-card .academy-rec-card__btn .acad-cd-text {
    line-height: 1.5 !important;
    display: inline !important;
  }

  /* ============================================================
     2026-05-29 #13.B：三個區塊背景統一（電腦版專用）
     - 加購區整體容器寬 1100px + 黑底 37% + radius 12 + padding 8 24
     - 上方商品清單 + 結帳小計兩區塊背景統一改 rgba(0,0,0,0.37)
     ============================================================ */
  html body.academy-new-cart-page .academy-recommendations {
    width: 1100px !important;
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background: rgb(0 0 0 / 37%) !important;
    border-radius: 12px !important;
    /* 左右 padding 58px（不是 60）讓內可用 = 1100 - 116 = 984 = 4 卡 + 3 gap，避免第 1 頁第 4 卡右側被切 */
    padding: 30px 58px !important;
    box-sizing: border-box !important;
  }
  /* cart 頁外層 flex container 移除 gap:32px（電腦版專用） */
  html body.woocommerce-cart .woocommerce {
    gap: 0 !important;
  }
  /* 商品清單背景統一 0.37 */
  html body.woocommerce-cart table.shop_table.cart {
    background: rgb(0 0 0 / 37%) !important;
  }
  /* 結帳小計背景統一 0.37 */
  html body.woocommerce-cart .woocommerce > .cart-collaterals .cart_totals,
  html body.woocommerce-cart .woocommerce .cart-collaterals .cart_totals {
    background: rgb(0 0 0 / 37%) !important;
  }

  /* ============================================================
     2026-05-29 #18：商品 row grid 重排（電腦版專用）
     product-name 跨 row 1+2、quantity 右上、subtotal 右下對齊
     讓「原價+優惠價」底部跟「身份下拉選單」底部切齊
     ============================================================ */
  html body.academy-new-cart-page table.shop_table tbody tr.cart_item td.product-name {
    grid-column: 2 !important;
    grid-row: 1 / -1 !important;
  }
  html body.academy-new-cart-page table.shop_table tbody tr.cart_item td.product-quantity {
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: start !important;
  }
  html body.academy-new-cart-page table.shop_table tbody tr.cart_item td.product-subtotal {
    grid-column: 3 !important;
    grid-row: 2 !important;
    align-self: end !important;
    justify-self: end !important;
    width: auto !important;
    margin: 0 !important;
    text-align: right !important;
  }

  /* #19：頁面底部留 60px 空間，避免區塊貼底 */
  html body.academy-new-cart-page {
    padding-bottom: 60px !important;
  }

  /* #23：原位置 coupon section (cart_form 後) 預設 hide，只在 cart_totals 內 visible
     避免 page load 前 0.1 秒看到 coupon 空殼，relocate JS 後才搬到 cart_totals */
  html body.academy-new-cart-page .academy-coupon-section {
    display: none !important;
  }
  html body.academy-new-cart-page .cart_totals .academy-coupon-section {
    display: block !important;
  }

  /* #24：區塊間距統一 40px（加購區 / cart_totals 之間） */
  html body.academy-new-cart-page .academy-recommendations {
    margin-top: 0 !important;
    margin-bottom: 40px !important;
  }
  html body.academy-new-cart-page .cart-collaterals {
    margin-top: 0 !important;
  }
  html body.academy-new-cart-page .cart-collaterals .cart_totals {
    margin-top: 0 !important;
  }
}

/* 手機版：強制隱藏 pager（雙重保險，JS 已不會建，但若 race condition 建出來也要 hide） */
@media (max-width: 768px) {
  html body.academy-new-cart-page .acad-rec-pager {
    display: none !important;
  }
}

/* 2026-05-29: checkout terms wrapper margin-bottom 50px + place-order row buttons inline + centered */
@media (min-width: 769px) {
  html body.academy-new-checkout-page label.checkbox:has(#terms),
  html body.academy-new-checkout-page p.form-row:has(#terms),
  html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper {
    margin-bottom: 40px !important;
    display: block !important;
  }
  html body.academy-new-checkout-page .form-row.place-order {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
  }
  html body.academy-new-checkout-page .form-row.place-order .acad-cart-back-btn,
  html body.academy-new-checkout-page .form-row.place-order #place_order,
  html body.academy-new-checkout-page #payment .place-order button#place_order {
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 8px !important;
  }

  /* unified payment_box description paragraph style — override line 9931 first-child 20px rule */
  html body.academy-new-checkout-page #payment .payment_box p,
  html body.academy-new-checkout-page #payment .payment_box > p,
  html body.academy-new-checkout-page #payment .payment_box > p:first-child,
  html body.academy-new-checkout-page #payment .payment_box p:first-child,
  html body.academy-new-checkout-page #payment .payment_box p:not(:first-child) {
    font-size: 16px !important;
    line-height: 1.5 !important;
    margin-bottom: 14px !important;
    margin-top: 30px !important;
  }
  html body.academy-new-checkout-page #payment .payment_box.acad-center-text p {
    text-align: center !important;
  }

  /* terms checkbox: 6px gap to text + 2px up */
  html body.academy-new-checkout-page label.checkbox #terms,
  html body.academy-new-checkout-page input#terms[type="checkbox"] {
    margin-right: 6px !important;
    transform: translateY(-2px) !important;
    vertical-align: middle !important;
  }
}

/* 2026-05-29 #11.I：必填欄位沒填 → 重點色陰影呼吸 2 下 → 顯示泡泡標籤 */
@keyframes acad-pulse-invalid-shadow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(57, 255, 245, 0.7); }
  50%      { box-shadow: 0 0 0 10px rgba(57, 255, 245, 0); }
}
html body.academy-new-checkout-page .acad-pulse-invalid select,
html body.academy-new-checkout-page .acad-pulse-invalid input[type="text"],
html body.academy-new-checkout-page .acad-pulse-invalid input[type="number"],
html body.academy-new-checkout-page .acad-pulse-invalid input[type="email"],
html body.academy-new-checkout-page .acad-pulse-invalid input[type="tel"],
html body.academy-new-checkout-page .acad-pulse-invalid input[type="date"],
html body.academy-new-checkout-page .acad-pulse-invalid input[type="password"],
html body.academy-new-checkout-page .acad-pulse-invalid input[type="url"],
html body.academy-new-checkout-page .acad-pulse-invalid input[type="search"],
html body.academy-new-checkout-page .acad-pulse-invalid textarea,
html body.academy-new-checkout-page .acad-pulse-invalid .select2-selection {
  animation: acad-pulse-invalid-shadow 1.4s ease-in-out 1 !important;
  border-radius: 6px !important;
}
html body.academy-new-checkout-page .acad-pulse-invalid .woocommerce-input-wrapper,
html body.academy-new-checkout-page .acad-pulse-invalid .acad-region-tabs {
  border-radius: 8px !important;
  animation: acad-pulse-invalid-shadow 1.4s ease-in-out 1 !important;
}

/* baseline: required field while empty shows faint accent-color 2px border */
html body.academy-new-checkout-page .form-row.validate-required input[type="text"]:placeholder-shown,
html body.academy-new-checkout-page .form-row.validate-required input[type="number"]:placeholder-shown,
html body.academy-new-checkout-page .form-row.validate-required input[type="email"]:placeholder-shown,
html body.academy-new-checkout-page .form-row.validate-required input[type="tel"]:placeholder-shown,
html body.academy-new-checkout-page .form-row.validate-required input[type="date"]:not(:focus):not([value]),
html body.academy-new-checkout-page .form-row.validate-required input[type="password"]:placeholder-shown,
html body.academy-new-checkout-page .form-row.validate-required input[type="url"]:placeholder-shown,
html body.academy-new-checkout-page .form-row.validate-required input[type="search"]:placeholder-shown,
html body.academy-new-checkout-page .form-row.validate-required textarea:placeholder-shown,
html body.academy-new-checkout-page .form-row.validate-required select:invalid,
html body.academy-new-checkout-page .form-row.validate-required select.acad-empty {
  border: 2px solid rgba(57, 255, 245, 0.35) !important;
}

/* 呼吸結束後 JS 加 .acad-pulse-tooltip → 顯示泡泡標籤浮在欄位上層
   higher-specificity selectors to override container-level position: static */
html body.academy-new-checkout-page p.acad-pulse-tooltip,
html body.academy-new-checkout-page div.acad-pulse-tooltip,
html body.academy-new-checkout-page .form-row.acad-pulse-tooltip,
html body.academy-new-checkout-page .acad-pulse-tooltip {
  position: relative !important;
}
html body.academy-new-checkout-page .acad-pulse-tooltip::before {
  content: attr(data-acad-tooltip);
  position: absolute;
  top: 10px;
  left: 0;
  /* extend 20px outside the field's left edge */
  transform: translateX(-20px) translateY(-100%) scale(0.7);
  transform-origin: left bottom;
  background: rgba(255, 255, 255, 0.45);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  backdrop-filter: blur(10px) saturate(180%);
  color: #1a1a1a;
  font-size: 14px !important;
  font-weight: 700;
  padding: 3px 9px;
  border: none;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  pointer-events: none;
  opacity: 1;
  animation: acad-tooltip-enter 0.2s ease-out;
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}
@keyframes acad-tooltip-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* focus on field: tooltip slides up 15px + slightly transparent */
html body.academy-new-checkout-page .acad-pulse-tooltip:focus-within::before {
  transform: translateX(-20px) translateY(calc(-100% - 15px)) scale(0.7);
  opacity: 0.55;
}
/* exit: slides down 15px + fades out (JS adds .acad-pulse-tooltip-exit when user starts typing) */
html body.academy-new-checkout-page .acad-pulse-tooltip.acad-pulse-tooltip-exit::before {
  transform: translateX(-20px) translateY(calc(-100% + 15px)) scale(0.7);
  opacity: 0;
}

/* shake animation for terms label when user clicks 下單購買 without checking the box */
@keyframes acad-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}
html body.academy-new-checkout-page .acad-shake {
  animation: acad-shake 0.6s ease-in-out;
}

/* 2026-05-29 #11.C：結帳頁 country change 時 WC blockUI 黑遮罩蓋過 form 5 秒造成視覺「閃」
   把 overlay 透明化（仍存在但視覺看不到），不影響 WC 內部 ajax 流程 */
html body.academy-new-checkout-page .blockUI.blockOverlay,
html body.academy-new-checkout-page .blockOverlay,
html body.academy-new-cart-page .blockUI.blockOverlay,
html body.academy-new-cart-page .blockOverlay {
  opacity: 0 !important;
  background: transparent !important;
}
html body.academy-new-checkout-page .blockUI.blockMsg,
html body.academy-new-cart-page .blockUI.blockMsg {
  background: transparent !important;
  color: transparent !important;
}

/* ============================================
   2026-07-17 手機版結帳修正（iPhone 15 Pro 回報）
   1) 生日欄位：grid 內不可撐破容器 + iOS 專屬修正
   2) 縣市 autocomplete wrapper（取代 datalist，沿用 country-search 下拉樣式）
   ============================================ */

/* 縣市 autocomplete wrapper（包住原 #billing_city / #shipping_city input） */
html body.academy-new-checkout-page .acad-city-search {
  position: relative !important;
  display: block !important;
  width: 100% !important;
}

/* 生日欄位：p.form-row 是 grid item，min-width:auto 會被 iOS date input
   的固有寬度撐破 → 歸零；wrapper 改 block 讓 input width:100% 有依據 */
html body.academy-new-checkout-page #billing_birth_date_field {
  min-width: 0 !important;
  max-width: 100% !important;
}
html body.academy-new-checkout-page #billing_birth_date_field .woocommerce-input-wrapper {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

/* iOS Safari 專屬（@supports -webkit-touch-callout 僅 iOS 成立） */
@supports (-webkit-touch-callout: none) {
  html body.academy-new-checkout-page #billing_birth_date_field input[type="date"],
  html body.academy-new-checkout-page #billing_member2_birth_date_field input[type="date"],
  html body.academy-new-checkout-page #billing_member3_birth_date_field input[type="date"] {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 45px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    text-align: left !important;
  }
  /* iOS 的日期值顯示區：靠左 + 保留行高（避免空值時整欄塌陷成空白） */
  html body.academy-new-checkout-page #billing_birth_date_field input[type="date"]::-webkit-date-and-time-value,
  html body.academy-new-checkout-page #billing_member2_birth_date_field input[type="date"]::-webkit-date-and-time-value,
  html body.academy-new-checkout-page #billing_member3_birth_date_field input[type="date"]::-webkit-date-and-time-value {
    text-align: left !important;
    min-height: 1.4em !important;
    margin: 0 !important;
  }
  /* 桌機用的透明 icon 覆蓋層（width/height 100% + opacity 0）在 iOS 會攔截
     點擊卻開不了日期輪盤 → iOS 直接移除，點 input 本體即開原生選擇器 */
  html body.academy-new-checkout-page #billing_birth_date_field input[type="date"]::-webkit-calendar-picker-indicator,
  html body.academy-new-checkout-page #billing_member2_birth_date_field input[type="date"]::-webkit-calendar-picker-indicator,
  html body.academy-new-checkout-page #billing_member3_birth_date_field input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
  }
}


/* ============================================
   2026-07-17：iOS 生日欄位空值顯示「年/月/日」提示
   iOS 的空 date input 原生完全空白，JS 掛 acad-date-empty class 時
   用 ::before 疊提示字（僅 iOS：@supports -webkit-touch-callout）
   ============================================ */
@supports (-webkit-touch-callout: none) {
  html body.academy-new-checkout-page #billing_birth_date_field .woocommerce-input-wrapper,
  html body.academy-new-checkout-page #billing_member2_birth_date_field .woocommerce-input-wrapper,
  html body.academy-new-checkout-page #billing_member3_birth_date_field .woocommerce-input-wrapper {
    position: relative !important;
  }
  html body.academy-new-checkout-page #billing_birth_date_field .woocommerce-input-wrapper.acad-date-empty::before,
  html body.academy-new-checkout-page #billing_member2_birth_date_field .woocommerce-input-wrapper.acad-date-empty::before,
  html body.academy-new-checkout-page #billing_member3_birth_date_field .woocommerce-input-wrapper.acad-date-empty::before {
    content: '年/月/日';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 16px;
    font-family: 'Noto Sans TC', sans-serif;
    pointer-events: none;
    z-index: 2;
  }
}


/* ============================================
   2026-07-21：手機版 ≤768px 間距修正
   1. 團報 T-shirt 每組列（主列 + 第2/3位 clone）之間 16px（現況貼在一起）
   2. .acad-name-row（姓氏/名字/英文拼音/服務單位）改直向堆疊、欄位間 16px
      （B-13 line ~9677 的 row+nowrap+height:45px 高 specificity 規則在手機也生效，
       蓋掉了 B-12.9 的 column 規則 → 這裡用更高 specificity 於檔尾覆蓋，僅手機）
   ============================================ */
@media (max-width: 768px) {
  html body.academy-new-checkout-page form.checkout .academy-tshirt-row + .academy-tshirt-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row + .academy-tshirt-row {
    margin-top: 16px !important;
  }
  html body.academy-new-checkout-page form.checkout .acad-name-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    height: auto !important;
    gap: 16px !important;
  }
  html body.academy-new-checkout-page form.checkout .acad-name-row > .form-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-name-row > .form-row {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  /* 尺寸對照圖按鈕（團報模式移到最後一組列之後的 sibling）上方 16px；
     非團報時按鈕在 row 內是 child，不會被 + 選到，桌機不受影響 */
  html body.academy-new-checkout-page form.checkout .academy-tshirt-row + .size-chart-button-field,
  html body.academy-new-checkout-page form.woocommerce-checkout .academy-tshirt-row + .size-chart-button-field {
    margin-top: 16px !important;
  }
  /* 團報人數滑塊 + 第2/3位姓名整塊（.acad-member-row）上方 16px
     （疊 .form-row 提高 specificity，壓過 .acad-col--info .form-row { margin:0 }） */
  html body.academy-new-checkout-page form.checkout .acad-member-row.form-row,
  html body.academy-new-checkout-page form.woocommerce-checkout .acad-member-row.form-row {
    margin-top: 16px !important;
  }
}

/* ============================================================
   2026-07-28 條款內嵌區修復（手機爆版＋電腦版同步整理）
   問題：.woocommerce-terms-and-conditions-wrapper 被上方規則設成
   display:flex + nowrap（原意是勾選列一排），條款內容一展開就跟
   隱私文字、勾選列擠成同一排；且內嵌的條款頁內容（無 class 的
   button／h2）吃到主題預設樣式而爆版。
   ============================================================ */
html body.academy-new-checkout-page form.checkout > .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout > .woocommerce-terms-and-conditions-wrapper {
  flex-wrap: wrap !important;
}
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper > .woocommerce-privacy-policy-text,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper > .woocommerce-terms-and-conditions,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper > .form-row {
  flex: 1 1 100% !important;
  min-width: 0 !important;
}

/* 內嵌條款內容框：限高可捲動、深色卡片化 */
html body.academy-new-checkout-page .woocommerce-terms-and-conditions {
  max-height: 320px !important;
  overflow-y: auto !important;
  background: rgba(0,0,0,0.25) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  padding: 16px 18px !important;
  margin: 12px 0 !important;
  font-size: 13px !important;
  line-height: 1.8 !important;
  color: rgba(255,255,255,0.78) !important;
}
html body.academy-new-checkout-page .woocommerce-terms-and-conditions h1,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions h2,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions h3 {
  font-size: 16px !important;
  line-height: 1.5 !important;
  color: #fff !important;
  margin: 18px 0 8px !important;
  padding: 0 !important;
  background: none !important;
}
html body.academy-new-checkout-page .woocommerce-terms-and-conditions p,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions li {
  font-size: 13px !important;
  line-height: 1.8 !important;
  color: rgba(255,255,255,0.78) !important;
  margin: 0 0 8px !important;
}
html body.academy-new-checkout-page .woocommerce-terms-and-conditions ol,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions ul {
  padding-left: 20px !important;
  margin: 0 0 10px !important;
}
html body.academy-new-checkout-page .woocommerce-terms-and-conditions a {
  color: #39fff5 !important;
}
html body.academy-new-checkout-page .woocommerce-terms-and-conditions table {
  max-width: 100% !important;
  font-size: 12px !important;
}
html body.academy-new-checkout-page .woocommerce-terms-and-conditions img {
  max-width: 100% !important;
  height: auto !important;
}
/* 內嵌後無作用的跳轉鈕（原條款頁頂部「課程購買暨服務契約／退費通知」button）隱藏 */
html body.academy-new-checkout-page .woocommerce-terms-and-conditions button {
  display: none !important;
}

@media (max-width: 768px) {
  html body.academy-new-checkout-page .woocommerce-terms-and-conditions {
    max-height: 260px !important;
    padding: 14px 14px !important;
  }
}

/* ============================================================
   2026-07-28 手機版付款頁籤文字完整顯示
   問題：頁籤被 nowrap + ellipsis 截成「信用卡…」。
   檔尾最後宣告（同 specificity 後者勝）：允許換行、縮小字級，
   讓「信用卡付款／信用卡分期」完整顯示。
   ============================================================ */
@media (max-width: 768px) {
  html body.academy-new-checkout-page .acad-col--payment .academy-payment-tab-btn,
  html body.academy-new-checkout-page form.checkout .academy-payment-tab-btn,
  html body.academy-new-checkout-page .academy-payment-tab-btn {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    padding: 9px 3px !important;
    min-width: 0 !important;
    word-break: keep-all !important;
  }
}

/* 2026-07-28 補強①：條款容器實際位於 #payment .place-order 底下，補中選 selector */
html body.academy-new-checkout-page #payment .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page .place-order .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper {
  flex-wrap: wrap !important;
}
html body.academy-new-checkout-page #payment .woocommerce-terms-and-conditions-wrapper > .woocommerce-privacy-policy-text,
html body.academy-new-checkout-page #payment .woocommerce-terms-and-conditions-wrapper > .woocommerce-terms-and-conditions,
html body.academy-new-checkout-page #payment .woocommerce-terms-and-conditions-wrapper > .form-row {
  flex: 1 1 100% !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* 2026-07-28 補強②：手機頁籤字級被更強 selector 蓋過，用 button 元素限定詞提高權重 */
@media (max-width: 768px) {
  html body.academy-new-checkout-page button.academy-payment-tab-btn,
  html body.academy-new-checkout-page form.checkout button.academy-payment-tab-btn,
  html body.academy-new-checkout-page .acad-col--payment button.academy-payment-tab-btn,
  html body.academy-new-checkout-page .academy-payment-tabs button.academy-payment-tab-btn {
    font-size: 13px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.3 !important;
    padding: 9px 3px !important;
  }
}

/* ============================================================
   2026-07-28 條款容器改 block（最終版）
   flex（column）+ wrap 會讓展開的條款內容折到右側第二欄跑版；
   改 display:block 讓 隱私文字 → 條款內容 → 勾選列 自然由上往下。
   勾選列本身的 .form-row 仍是 flex（勾選框+文字一排）不受影響。
   ============================================================ */
html body.academy-new-checkout-page form.checkout > .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page form.woocommerce-checkout > .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page #payment .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page .place-order .woocommerce-terms-and-conditions-wrapper,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper {
  display: block !important;
}
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper > .woocommerce-privacy-policy-text,
html body.academy-new-checkout-page .woocommerce-terms-and-conditions-wrapper > .woocommerce-terms-and-conditions {
  width: 100% !important;
  max-width: 100% !important;
}

/* ============================================================
   2026-07-28 最終決定（用戶指示）：內嵌條款內容一律不顯示，
   條款區只保留「隱私說明文字 + 勾選同意」一兩行。
   ============================================================ */
html body.academy-new-checkout-page .woocommerce-terms-and-conditions {
  display: none !important;
}

/* ============================================================
   2026-07-28 付款錯誤提示可見化
   ①金流外掛（TapPay）卡片資訊不完整的自訂提示 .acad-pay-error
   ②WC 欄位下方 inline 錯誤字改為符合設計的樣式（原為刺眼紅字）
   ============================================================ */
html body.academy-new-checkout-page .acad-pay-error {
  background: rgba(255, 138, 149, 0.12) !important;
  border: 1px solid rgba(255, 138, 149, 0.5) !important;
  color: #ff8a95 !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  margin: 0 0 14px !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}
html body.academy-new-checkout-page .checkout-inline-error-message,
html body.academy-new-checkout-page .woocommerce-inline-error,
html body.academy-new-checkout-page form.checkout .checkout-inline-error-message {
  color: #ff8a95 !important;
  font-size: 12.5px !important;
  line-height: 1.5 !important;
  margin: 6px 0 0 !important;
  padding: 0 !important;
  background: none !important;
}

/* ============================================================
   2026-07-28 儲存卡選擇 UI（原本 radio 被隱藏、無選取樣式，看不出選了哪張）
   卡片式選項＋自製選取圈；input:checked + label 驅動選中樣式
   ============================================================ */
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods {
  list-style: none !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods li > label {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  cursor: pointer !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: rgba(255,255,255,0.85) !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: border-color .2s, background-color .2s, color .2s !important;
  margin: 0 !important;
}
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods li > label::before {
  content: '' !important;
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 auto !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255,255,255,0.4) !important;
  background: transparent !important;
  box-sizing: border-box !important;
  transition: border-color .2s, background-color .2s, box-shadow .2s !important;
}
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods li > label:hover {
  border-color: rgba(57,255,245,0.55) !important;
}
/* 選中狀態：亮青邊框＋淡青底＋圓點填色 */
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods li > input:checked + label {
  border-color: #39FFF5 !important;
  background: rgba(57,255,245,0.10) !important;
  color: #fff !important;
  font-weight: 600 !important;
}
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods li > input:checked + label::before {
  border-color: #39FFF5 !important;
  background: #39FFF5 !important;
  box-shadow: inset 0 0 0 3px #1f262c !important;
}

/* ============================================================
   2026-07-28 儲存卡選取標記 v2（用戶指示）
   ①選中改打勾 icon ②與文字間隔 10px ③修正圓圈被壓扁成直線
   ============================================================ */
html body.academy-new-checkout-page .payment_box .woocommerce-SavedPaymentMethods li > label,
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods li > label {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
}
html body.academy-new-checkout-page .payment_box .woocommerce-SavedPaymentMethods li > label::before,
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods li > label::before {
  content: '' !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  flex: 0 0 18px !important;
  margin-right: 10px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255,255,255,0.4) !important;
  background: transparent !important;
  box-sizing: border-box !important;
  font-size: 12px !important;
  line-height: 1 !important;
  box-shadow: none !important;
}
html body.academy-new-checkout-page .payment_box .woocommerce-SavedPaymentMethods li > input:checked + label::before,
html body.academy-new-checkout-page .woocommerce-SavedPaymentMethods li > input:checked + label::before {
  content: '✓' !important;
  background: #39FFF5 !important;
  border-color: #39FFF5 !important;
  color: #1a1d22 !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}
