/* FW Checkout · Shopify 造型（SparkNest 结构 + 紫色主题） */

:root {
  --fw-ch-accent: #5a31f4;
  --fw-ch-accent-hover: #4c28d9;
  --fw-ch-blue: #2c6ecb;
  --fw-ch-sidebar: #fafafa;
  --fw-ch-border: #dedede;
  --fw-ch-muted: #6d7175;
  --fw-ch-radius: 8px;
  --fw-ch-card-radius: 12px;
}

body.fw-checkout-shopify {
  background: #fff;
  font-family: var(--font-body, "Nunito Sans", system-ui, sans-serif);
  font-size: 14px;
  color: #303030;
}

body.fw-checkout-shopify .page-header {
  display: none !important;
}

/* ── 结账页 Elementor 页眉：仅 Logo · 白底居中（Shopify） ── */
body.fw-checkout-shopify .elementor-location-header {
  background: #fff !important;
  border-bottom: 1px solid #e8e8e8;
  box-shadow: none !important;
}

/* 公告条 */
body.fw-checkout-shopify .elementor-location-header .elementor-element-9870585,
body.fw-checkout-shopify .elementor-location-header .announcement {
  display: none !important;
}

/* 结账只保留一条页眉（桌面 d071970），隐藏手机条 c68c77f，避免两个 Logo */
body.fw-checkout-shopify .elementor-location-header .elementor-element-c68c77f {
  display: none !important;
}

/* 覆盖 elementor-hidden-tablet / mobile，全端只显示这一条 */
body.fw-checkout-shopify .elementor-location-header .elementor-element-d071970 {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  padding: 1rem 1.25rem !important;
  background: #fff !important;
  border: none !important;
}

body.fw-checkout-shopify .elementor-location-header .elementor-element-d071970 .elementor-element-4130acc,
body.fw-checkout-shopify .elementor-location-header .elementor-element-d071970 .elementor-element-336b293 {
  display: none !important;
}

body.fw-checkout-shopify .elementor-location-header .elementor-element-d071970 .elementor-element-0680104 {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: 100%;
  justify-content: center !important;
}

body.fw-checkout-shopify .elementor-location-header .elementor-element-c91feae,
body.fw-checkout-shopify .elementor-location-header .elementor-element-c91feae a {
  display: block !important;
  text-align: center;
  margin: 0 auto;
}

body.fw-checkout-shopify .elementor-location-header .elementor-element-c91feae img {
  display: block;
  max-height: 48px;
  width: auto;
  max-width: min(260px, 72vw);
  height: auto;
  margin: 0 auto;
}

/* 语言切换等插件按钮（若仍在页眉内） */
body.fw-checkout-shopify .elementor-location-header .gtranslate_wrapper,
body.fw-checkout-shopify .elementor-location-header .wpml-ls,
body.fw-checkout-shopify .elementor-location-header .trp-language-switcher,
body.fw-checkout-shopify .elementor-location-header .pll-switcher {
  display: none !important;
}

/* ── Shell & grid ── */
body.fw-checkout-shopify .fw-checkout-wrap {
  margin: 0;
  padding: 0;
  border: none;
}

body.fw-checkout-shopify .fw-checkout-shell {
  padding-top: 1.5rem;
  padding-bottom: 5rem;
}

body.fw-checkout-shopify .fw-checkout-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--fw-ch-accent);
  text-decoration: none;
}

body.fw-checkout-shopify .fw-checkout-back:hover {
  color: var(--fw-ch-accent-hover);
}

body.fw-checkout-shopify .fw-checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(420px, 38vw);
  gap: 2rem;
  align-items: start;
}

body.fw-checkout-shopify .fw-checkout-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 640px;
}

body.fw-checkout-shopify .fw-checkout-aside {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

/* 图1：Ship / Pickup 隐藏 */
body.fw-checkout-shopify .fw-ch-delivery {
  display: none !important;
}

/* ── Cards ── */
body.fw-checkout-shopify .fw-checkout-card {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: var(--fw-ch-card-radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

body.fw-checkout-shopify .fw-checkout-card__eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fw-ch-accent);
}

body.fw-checkout-shopify .fw-checkout-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #303030;
}

body.fw-checkout-shopify .fw-checkout-card__sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--fw-ch-muted);
}

body.fw-checkout-shopify .fw-checkout-card__head {
  margin-bottom: 1.25rem;
}


body.fw-checkout-shopify .fw-ch-shipping-block {
  margin-top: 1.25rem;
}

body.fw-checkout-shopify .fw-ch-shipping-block__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

body.fw-checkout-shopify .fw-ch-shipping-block__hint {
  margin: 0;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fw-ch-muted);
  background: #f3f3f3;
  border: 1px solid var(--fw-ch-border);
  border-radius: var(--fw-ch-radius);
}

/* ── Fields ── */
body.fw-checkout-shopify .fw-checkout-fields .woocommerce-billing-fields > h3,
body.fw-checkout-shopify .fw-checkout-fields .woocommerce-shipping-fields > h3:not(#ship-to-different-address) {
  display: none !important;
}

body.fw-checkout-shopify #billing_email_field {
  margin-bottom: 0.25rem !important;
}

body.fw-checkout-shopify #ship-to-different-address {
  display: block !important;
  margin: 1.35rem 0 1rem;
  padding: 0;
  border: none;
  font-size: 14px;
}

body.fw-checkout-shopify #ship-to-different-address label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

body.fw-checkout-shopify #ship-to-different-address label span:empty::before {
  content: "Ship to a different address?";
}

body.fw-checkout-shopify .woocommerce-billing-fields__field-wrapper,
body.fw-checkout-shopify .woocommerce-shipping-fields__field-wrapper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 12px;
}

body.fw-checkout-shopify .woocommerce-billing-fields__field-wrapper .form-row,
body.fw-checkout-shopify .woocommerce-shipping-fields__field-wrapper .form-row {
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  float: none !important;
  clear: none !important;
}

body.fw-checkout-shopify .woocommerce-billing-fields__field-wrapper .form-row-wide,
body.fw-checkout-shopify .woocommerce-shipping-fields__field-wrapper .form-row-wide {
  grid-column: 1 / -1;
}

body.fw-checkout-shopify #billing_first_name_field,
body.fw-checkout-shopify #shipping_first_name_field {
  grid-column: 1 / 4;
}

body.fw-checkout-shopify #billing_last_name_field,
body.fw-checkout-shopify #shipping_last_name_field {
  grid-column: 4 / 7;
}

body.fw-checkout-shopify #billing_city_field,
body.fw-checkout-shopify #shipping_city_field {
  grid-column: 1 / 3;
}

body.fw-checkout-shopify #billing_state_field,
body.fw-checkout-shopify #shipping_state_field {
  grid-column: 3 / 5;
}

body.fw-checkout-shopify #billing_postcode_field,
body.fw-checkout-shopify #shipping_postcode_field {
  grid-column: 5 / 7;
}

body.fw-checkout-shopify .form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--fw-ch-muted);
}

body.fw-checkout-shopify .input-text,
body.fw-checkout-shopify input[type="text"],
body.fw-checkout-shopify input[type="email"],
body.fw-checkout-shopify input[type="tel"],
body.fw-checkout-shopify textarea {
  width: 100% !important;
  min-height: 48px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid var(--fw-ch-border);
  border-radius: var(--fw-ch-radius);
  box-sizing: border-box;
  background: #f1f1f1;
  transition: border-color 0.15s, box-shadow 0.15s;
}

body.fw-checkout-shopify select {
  width: 100% !important;
  height: 48px;
  min-height: 48px;
  padding: 0 2.25rem 0 12px;
  font-size: 14px;
  line-height: 48px;
  border: 1px solid var(--fw-ch-border);
  border-radius: var(--fw-ch-radius);
  box-sizing: border-box;
  background: #f1f1f1;
  transition: border-color 0.15s, box-shadow 0.15s;
}

body.fw-checkout-shopify .input-text:focus,
body.fw-checkout-shopify select:focus {
  border-color: var(--fw-ch-blue);
  box-shadow: 0 0 0 1px var(--fw-ch-blue);
  outline: none;
}

body.fw-checkout-shopify .select2-container {
  width: 100% !important;
}

body.fw-checkout-shopify .select2-container--default .select2-selection--single {
  height: 48px !important;
  min-height: 48px;
  display: flex;
  align-items: center;
  border: 1px solid var(--fw-ch-border);
  border-radius: var(--fw-ch-radius);
  background: #f1f1f1;
}

body.fw-checkout-shopify .select2-container--default .select2-selection--single .select2-selection__rendered {
  display: flex !important;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 2rem 0 12px !important;
  line-height: 1.4 !important;
  color: #303030;
}

body.fw-checkout-shopify .select2-container--default .select2-selection--single .select2-selection__arrow {
  position: absolute;
  top: 0;
  right: 10px;
  bottom: 0;
  width: 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.fw-checkout-shopify .select2-container--default .select2-selection--single .select2-selection__arrow b {
  position: static;
  top: auto;
  left: auto;
  margin: 0;
  border-color: #6d7175 transparent transparent transparent;
  border-width: 5px 4px 0 4px;
}

body.fw-checkout-shopify .woocommerce-form__input-checkbox {
  accent-color: var(--fw-ch-blue);
}

/* ── Payment（SparkNest 卡片式） ── */
body.fw-checkout-shopify .fw-checkout-wrap #payment {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

body.fw-checkout-shopify .fw-checkout-wrap #payment ul.payment_methods {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

body.fw-checkout-shopify .fw-checkout-wrap #payment ul.payment_methods > li.wc_payment_method {
  position: relative;
  margin: 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.1s;
}

body.fw-checkout-shopify .fw-checkout-wrap #payment ul.payment_methods > li.wc_payment_method:hover {
  transform: translateY(-1px);
}

body.fw-checkout-shopify .fw-checkout-wrap #payment ul.payment_methods > li.wc_payment_method:has(input:checked) {
  border-color: var(--fw-ch-blue);
  background: #f0f5ff;
  box-shadow: 0 6px 18px rgba(44, 110, 203, 0.1);
}

body.fw-checkout-shopify .fw-checkout-wrap #fw-payment-section #payment ul.payment_methods > li.wc_payment_method > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  font-size: 0.93rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}

body.fw-checkout-shopify .fw-checkout-wrap #payment ul.payment_methods > li.wc_payment_method > label img {
  max-width: 88px;
  max-height: 26px;
  width: auto;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

body.fw-checkout-shopify .fw-checkout-wrap #payment .payment_box {
  margin: 0.85rem 0 0 !important;
  padding: 1rem !important;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
}

body.fw-checkout-shopify .fw-checkout-wrap #payment .payment_box::before {
  display: none;
}

body.fw-checkout-shopify .fw-checkout-wrap #payment .payment_box p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #475569;
}

body.fw-checkout-shopify .fw-checkout-wrap #place_order {
  width: 100%;
  margin-top: 1rem;
  min-height: 56px;
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff !important;
  background: var(--fw-ch-accent) !important;
  border: none !important;
  border-radius: var(--fw-ch-radius) !important;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}

body.fw-checkout-shopify .fw-checkout-wrap #place_order:hover {
  background: var(--fw-ch-accent-hover) !important;
  box-shadow: 0 10px 24px rgba(90, 49, 244, 0.22);
}

body.fw-checkout-shopify .fw-checkout-wrap #place_order:active {
  transform: scale(0.99);
}

body.fw-checkout-shopify .woocommerce-terms-and-conditions-wrapper {
  margin: 1rem 0 0;
  font-size: 12px;
  color: var(--fw-ch-muted);
}

body.fw-checkout-shopify .woocommerce-terms-and-conditions-wrapper label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* CusRev 邀请评价勾选 — 隐藏 */
body.fw-checkout-shopify .cr-customer-consent,
body.fw-checkout-shopify p.cr-customer-consent,
body.fw-checkout-shopify #cr_customer_consent_field,
body.fw-checkout-shopify label[for="cr_customer_consent"],
body.fw-checkout-shopify .cr-customer-consent-checkbox {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* ── Order summary：整块 #F1F1F1，无卡片分层 ── */
body.fw-checkout-shopify #order_review.fw-checkout-card--summary,
body.fw-checkout-shopify .fw-checkout-card.fw-checkout-card--summary {
  padding: 1.5rem;
  background: #f1f1f1 !important;
  border: none !important;
  border-radius: 8px;
  box-shadow: none !important;
}

body.fw-checkout-shopify #order_review {
  padding: 0;
  background: #f1f1f1;
  border: none;
  box-shadow: none;
}

body.fw-checkout-shopify .fw-checkout-summary__title {
  margin: 0 0 1rem;
  padding: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #303030;
  background: transparent;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table {
  width: 100%;
  border: none;
  border-collapse: collapse;
  background: transparent;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table thead {
  display: none;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table tbody tr.cart_item td {
  padding: 0 0 1rem;
  border: none;
  vertical-align: middle;
  background: transparent;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table tbody tr.cart_item td:first-child,
body.fw-checkout-shopify .woocommerce-checkout-review-order-table tbody tr.cart_item td:last-child {
  border-radius: 0;
}

body.fw-checkout-shopify .fw-checkout-review-line {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

body.fw-checkout-shopify .fw-checkout-review-thumb {
  position: relative;
  flex-shrink: 0;
  display: block;
}

body.fw-checkout-shopify .fw-checkout-review-thumb__img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  display: block;
}

body.fw-checkout-shopify .fw-checkout-review-qty {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
  color: #fff;
  background: #303030;
  border-radius: 999px;
}

body.fw-checkout-shopify .fw-checkout-review-line__text {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table .product-total {
  text-align: right;
  white-space: nowrap;
  font-weight: 500;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table tfoot th,
body.fw-checkout-shopify .woocommerce-checkout-review-order-table tfoot td {
  padding: 16px 0;
  border: none;
  font-size: 14px;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table tfoot td {
  text-align: right;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table .cart-subtotal th,
body.fw-checkout-shopify .woocommerce-checkout-review-order-table .cart-subtotal td {
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
  background: transparent;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table tfoot tr {
  background: transparent;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table tfoot td,
body.fw-checkout-shopify .woocommerce-checkout-review-order-table tfoot th {
  background: transparent;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals th,
body.fw-checkout-shopify .woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals td {
  padding-top: 18px;
  padding-bottom: 18px;
}

body.fw-checkout-shopify .woocommerce-checkout-review-order-table .order-total th,
body.fw-checkout-shopify .woocommerce-checkout-review-order-table .order-total td {
  padding-top: 20px;
  font-size: 1.25rem;
  font-weight: 600;
}

/* 图2：优惠码隐藏 */
body.fw-checkout-shopify .woocommerce-form-coupon-toggle,
body.fw-checkout-shopify form.checkout_coupon {
  display: none !important;
}

/* 图3：订单备注隐藏 */
body.fw-checkout-shopify .woocommerce-additional-fields,
body.fw-checkout-shopify #order_comments_field {
  display: none !important;
}

/* ── Mobile sticky bar ── */
#fw-mobile-checkout-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e8e8e8;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

#fw-mobile-checkout-bar.fw-mobile-visible {
  display: flex;
}

#fw-mobile-checkout-bar .fw-mobile-total {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--fw-ch-muted);
}

#fw-mobile-checkout-bar .fw-mobile-amount {
  font-size: 18px;
  font-weight: 700;
  color: #303030;
}

#fw-mobile-checkout-bar .fw-mobile-place-order {
  flex: 1;
  max-width: 200px;
  min-height: 48px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--fw-ch-accent);
  border: none;
  border-radius: var(--fw-ch-radius);
  cursor: pointer;
}

body.fw-mobile-bar-open {
  padding-bottom: 88px;
}

/* ── Responsive ── */
@media (max-width: 1023px) {
  body.fw-checkout-shopify .fw-checkout-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  body.fw-checkout-shopify .fw-checkout-aside {
    order: -1;
    position: relative;
    top: auto;
    margin-bottom: 1.25rem;
    padding: 0;
    border: none;
    border-radius: 0;
  }

  body.fw-checkout-shopify #order_review.fw-checkout-card--summary {
    border-radius: 8px;
  }

  body.fw-checkout-shopify .fw-checkout-main {
    max-width: none;
  }

  body.fw-checkout-shopify .fw-checkout-card {
    padding: 1rem;
    border-radius: 10px;
  }
}

@media (max-width: 639px) {
  body.fw-checkout-shopify .woocommerce-billing-fields__field-wrapper,
  body.fw-checkout-shopify .woocommerce-shipping-fields__field-wrapper {
    grid-template-columns: 1fr !important;
  }

  body.fw-checkout-shopify .woocommerce-billing-fields__field-wrapper .form-row,
  body.fw-checkout-shopify .woocommerce-shipping-fields__field-wrapper .form-row {
    grid-column: 1 / -1 !important;
  }
}
