/* ==========================================================================
   Timeline — 结账页（R15：Shopify 原生结账模板口径）
   作用域：.f15-co（form.checkout）内的所有视觉都在这里；不改 Woo 结账逻辑。
   契约：#customer_details / #order_review / #payment / #place_order 保持原 id。
   ========================================================================== */

.f15-checkout-page form.checkout.f15-co,
.f15-co {
  --f15-line: #e6e6e6;
  --f15-hair: #eeeeee;
  --f15-field: #d9d9d9;
  --f15-ink: #111;
  --f15-muted: #6b6b6b;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 0 64px;
  color: var(--f15-ink);
  font-size: 15px;
}

/* 右栏（摘要）在窄屏排到最前，宽屏排到右侧 */
@media screen and (min-width: 990px) {
  .f15-co {
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: 48px;
    row-gap: 0;
    align-items: start;
  }
  .f15-co #customer_details { grid-column: 1; grid-row: 1; }
  .f15-co .f15-sum { display: contents; }
  .f15-co .f15-sum__items  { grid-column: 2; grid-row: 1; }
  .f15-co .f15-sum__totals { grid-column: 2; grid-row: 2; }
  .f15-co #payment        { grid-column: 1; grid-row: 2; }
}

/* 区块：白底、无灰盒、无粗边框，靠 1px 细线与留白分区 */
.f15-co-section { padding: 0 0 24px; margin: 0 0 24px; border-bottom: 1px solid var(--f15-hair); }
.f15-co-section:last-child { border-bottom: 0; }
.f15-co-h { font-size: 17px; font-weight: 600; margin: 0 0 14px; letter-spacing: 0; }
.f15-co-hint { font-size: 13px; color: var(--f15-muted); margin: 0; }

/* Contact 行：Email + Sign in（同一行，右侧链接） */
.f15-co-contact-row { display: flex; align-items: flex-end; gap: 14px; }
.f15-co-contact-row .form-row { flex: 1 1 auto; margin: 0; }
.f15-co-signin { flex: 0 0 auto; font-size: 13px; padding-bottom: 14px; white-space: nowrap; }

/* 字段 */
.f15-co .form-row { margin: 0 0 14px; padding: 0; }
.f15-co .form-row label {
  display: block; font-size: 13px; color: #4a4a4a; margin: 0 0 6px; font-weight: 400;
}
.f15-co .form-row .required { color: #b32d2e; text-decoration: none; }
.f15-co .form-row input.input-text,
.f15-co .form-row select,
.f15-co .form-row textarea,
.f15-co .select2-container--default .select2-selection--single {
  height: 48px; font-size: 16px; line-height: 46px; border: 1px solid var(--f15-field);
  border-radius: 8px; padding: 0 14px; width: 100%; box-sizing: border-box; background: #fff; color: var(--f15-ink);
  box-shadow: none; -webkit-appearance: none; appearance: none;
}
.f15-co .form-row input.input-text:focus,
.f15-co .form-row select:focus,
.f15-co .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #111; outline: none; box-shadow: 0 0 0 1px #111 inset;
}
.f15-co .form-row textarea { height: auto; min-height: 84px; line-height: 1.5; padding: 12px 14px; }
.f15-co .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 46px; padding-left: 14px; }
.f15-co .select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; right: 10px; }
.f15-co .select2-dropdown { border-color: var(--f15-field); border-radius: 8px; }

/* 三列：City / State / ZIP */
.f15-co .f15-co-fields { display: flex; flex-wrap: wrap; gap: 0 14px; }
.f15-co .f15-co-fields .form-row { flex: 1 1 100%; }
.f15-co .f15-co-fields .form-row-first,
.f15-co .f15-co-fields .form-row-last { flex: 0 0 calc(50% - 7px); }
.f15-co .f15-co-fields .form-row-third { flex: 0 0 calc(33.333% - 9.4px); }
.f15-co .f15-co-fields .form-row-wide { flex: 1 1 100%; }

/* live tracking 勾选 */
.f15-co .form-row.f15-checkbox-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 0; }
.f15-co .form-row.f15-checkbox-row label {
  display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: #333;
}
.f15-co .form-row.f15-checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px; min-height: 0; margin: 0; border: 1px solid var(--f15-field); border-radius: 4px;
}

/* 右栏：摘要 */
.f15-co .f15-sum__items {
  border: 1px solid var(--f15-line); border-bottom: 0; border-radius: 12px 12px 0 0; background: #fff; padding: 16px 18px;
}
.f15-co .f15-sum__totals {
  border: 1px solid var(--f15-line); border-top: 1px solid var(--f15-hair); border-radius: 0 0 12px 12px; background: #fff; padding: 14px 18px 18px;
}
.f15-co .f15-sum__item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; }
.f15-co .f15-sum__item + .f15-sum__item { border-top: 1px solid var(--f15-hair); }
.f15-co .f15-sum__thumb { position: relative; width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--f15-hair); overflow: visible; background: #fafafa; }
.f15-co .f15-sum__thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.f15-co .f15-sum__qty {
  position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px;
  background: #6b6b6b; color: #fff; border-radius: 999px; font-size: 11px; line-height: 20px; text-align: center;
}
.f15-co .f15-sum__name { font-size: 13px; line-height: 1.4; color: #333; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.f15-co .f15-sum__line { font-size: 14px; font-weight: 600; white-space: nowrap; }

.f15-co .f15-sum__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; padding: 6px 0; }
.f15-co .f15-sum__row--total { border-top: 1px solid var(--f15-hair); margin-top: 8px; padding-top: 12px; font-size: 17px; font-weight: 700; }
.f15-co .f15-sum__row--total .amount { font-weight: 700; }
.f15-co .f15-sum__cur { font-size: 12px; color: var(--f15-muted); margin-right: 4px; font-weight: 400; }
.f15-co .f15-sum__row--shipping .amount { font-weight: 400; }

/* 支付区 */
.f15-co #payment.f15-co-payment-section {
  background: transparent; border: 0; padding: 0; margin: 0;
}
.f15-co #payment ul.payment_methods { list-style: none; margin: 0 0 16px; padding: 0; }
.f15-co #payment ul.payment_methods li { margin: 0 0 12px; }
.f15-co #payment .payment_method_f15_card > label,
.f15-co #payment .wc_payment_method label {
  display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin: 0 0 10px;
}
.f15-co #payment .luckpayex-card-brands { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.f15-co #payment .luckpayex-card-brands img { width: 32px; height: 21px; }

/* 卡字段：卡号整行；有效期 + 安全码两列 */
.f15-co #payment .mvbas-card { border: 0; padding: 0; margin: 0; }
.f15-co #payment .mvbas-card__field { margin: 0 0 12px; }
.f15-co #payment .mvbas-card__field > label { display: block; font-size: 13px; color: #4a4a4a; margin: 0 0 6px; }
.f15-co #payment .mvbas-card__field input.input-text {
  height: 48px; font-size: 16px; border: 1px solid var(--f15-field); border-radius: 8px; padding: 0 14px; width: 100%;
  box-sizing: border-box; background: #fff;
}
.f15-co #payment .mvbas-card__field input.input-text:focus { border-color: #111; box-shadow: 0 0 0 1px #111 inset; outline: none; }
.f15-co #payment .mvbas-card__number-wrap { position: relative; }
.f15-co #payment .mvbas-card__number-wrap > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #9aa0a6; display: inline-flex; }
.f15-co #payment .mvbas-card__number-wrap input { padding-right: 46px; }
.f15-co #payment .mvbas-card__row { display: flex; gap: 12px; }
.f15-co #payment .mvbas-card__row .mvbas-card__field { flex: 1 1 50%; min-width: 0; }
.f15-co #payment .mvbas-card__field small { display: block; font-size: 12px; color: var(--f15-muted); margin-top: 4px; }
.f15-co #payment .mvbas-card__footer { font-size: 12px; color: var(--f15-muted); margin: 2px 0 14px; }

/* Place order：通栏单层实心 */
.f15-co #payment #place_order {
  display: block; width: 100%; min-height: 52px; font-size: 16px; font-weight: 600;
  border-radius: 10px; background: #111; color: #fff; border: 0; box-shadow: none; letter-spacing: 0;
}
.f15-co #payment #place_order:hover { background: #000; color: #fff; }
.f15-co .woocommerce-terms-and-conditions-wrapper { font-size: 13px; margin-bottom: 12px; }
.f15-co .woocommerce-privacy-policy-text p { font-size: 12px; color: var(--f15-muted); }

/* 未填地址时的运费提示 */
.f15-co #f15-shipping-hint { margin: 0 0 6px; }
.f15-co .f15-co-shipping-mirror:empty { display: none; }
.f15-co .f15-co-shipping-mirror { font-size: 14px; color: #333; }

/* 手机：单列，摘要在前 */
@media screen and (max-width: 989px) {
  .f15-co { padding: 4px 0 48px; }
  .f15-co .f15-sum__items { border-radius: 12px 12px 0 0; }
  .f15-co .f15-sum__totals { border-radius: 0 0 12px 12px; margin-bottom: 8px; }
  .f15-co .f15-co-fields .form-row-third { flex: 0 0 calc(50% - 7px); }
  .f15-co .f15-co-fields .form-row-third:last-child { flex: 1 1 100%; }
}
@media screen and (max-width: 480px) {
  .f15-co .f15-co-fields .form-row-first,
  .f15-co .f15-co-fields .form-row-last,
  .f15-co .f15-co-fields .form-row-third { flex: 1 1 100%; }
  .f15-co-contact-row { flex-wrap: wrap; }
  .f15-co-signin { padding-bottom: 0; margin-bottom: 12px; }
}

/* 旧版结账样式（Woo 默认壳）全部停用 */
.f15-checkout-page form.checkout #order_review table.shop_table,
.f15-checkout-page table.shop_table { border: 0; }

/* 国家下拉（Woo 用 .country_to_state，单独兜一层样式） */
.f15-co select.country_to_state,
.f15-co .form-row select.country_to_state,
.f15-co .woocommerce-input-wrapper select {
  height: 48px; width: 100%; border: 1px solid #d9d9d9; border-radius: 8px; padding: 0 14px;
  font-size: 16px; background: #fff; color: #111; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23111' stroke-width='1.2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px;
}
.f15-co .form-row-first, .f15-co .form-row-last { display: inline-block; vertical-align: top; }

/* ===== [布局修正 2026-11-27] 两栏比例与右栏溢出 ===== */
.f15-co {
  max-width: min(1080px, 100%) !important;
  box-sizing: border-box;
  padding-left: 8px; padding-right: 8px;
}
@media screen and (min-width: 990px) {
  .f15-co {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 33%, 400px) !important;
    column-gap: clamp(28px, 4vw, 56px) !important;
  }
  .f15-co .f15-sum__items,
  .f15-co .f15-sum__totals,
  .f15-co .woocommerce-checkout-review-order,
  .f15-co .f15-co-right {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .f15-co .f15-sum__item { grid-template-columns: 48px minmax(0,1fr) auto !important; gap: 10px !important; }
  .f15-co .f15-sum__name { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
/* 左栏字段宽度自适应，避免把右栏挤出视口 */
.f15-co #customer_details, .f15-co #payment, .f15-co .f15-co-left { min-width: 0; max-width: 100%; }
.f15-co .form-row-first, .f15-co .form-row-last { width: calc(50% - 7px) !important; float: none !important; display: inline-block; vertical-align: top; }
.f15-co .f15-co-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.f15-co .f15-co-fields .form-row { grid-column: 1 / -1; }
.f15-co .f15-co-fields .form-row-first, .f15-co .f15-co-fields .form-row-last { grid-column: auto; }
.f15-co .f15-co-fields .form-row-wide { grid-column: 1 / -1; }
/* 字段顺序与列宽（用 order 锁死，不依赖 DOM 顺序） */
.f15-co .f15-co-fields { display: flex; flex-wrap: wrap; gap: 0 14px; }
.f15-co #billing_country_field   { order: 1; flex: 1 1 100%; }
.f15-co #billing_first_name_field{ order: 2; flex: 0 0 calc(50% - 7px); }
.f15-co #billing_last_name_field { order: 3; flex: 0 0 calc(50% - 7px); }
.f15-co #billing_address_1_field { order: 4; flex: 1 1 100%; }
.f15-co #billing_address_2_field { order: 5; flex: 1 1 100%; }
.f15-co #billing_city_field      { order: 6; flex: 0 0 calc(33.333% - 9.4px); }
.f15-co #billing_state_field     { order: 7; flex: 0 0 calc(33.333% - 9.4px); }
.f15-co #billing_postcode_field  { order: 8; flex: 0 0 calc(33.333% - 9.4px); }
.f15-co #billing_phone_field     { order: 9; flex: 1 1 100%; }
@media screen and (max-width: 480px) {
  .f15-co #billing_first_name_field,
  .f15-co #billing_last_name_field,
  .f15-co #billing_city_field,
  .f15-co #billing_state_field,
  .f15-co #billing_postcode_field { flex: 1 1 100%; }
}
/* 右栏拆成两个网格单元 + 支付区拍平（去掉 Woo 的灰底盒与内框） */
@media screen and (min-width: 990px) {
  .f15-co #order_review { display: contents; }
}
.f15-co #payment,
.f15-co #payment.woocommerce-checkout-payment {
  background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0 !important;
}
.f15-co #payment .payment_box,
.f15-co #payment .payment_box.payment_method_f15_card {
  background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0 !important;
  box-shadow: none !important;
}
.f15-co #payment .payment_box::before { display: none !important; }
.f15-co #payment .form-row.place-order,
.f15-co #payment .place-order {
  background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0 !important;
}
.f15-co .woocommerce-checkout-review-order { background: transparent !important; }
/* 字段用 6 列网格排（比 flex 稳）：国家/地址/公寓/电话 满行；姓名各半；City/State/ZIP 各 1/3 */
.f15-co .f15-co-fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 14px; }
.f15-co #billing_country_field,
.f15-co #billing_address_1_field,
.f15-co #billing_address_2_field,
.f15-co #billing_phone_field { grid-column: span 6; }
.f15-co #billing_first_name_field,
.f15-co #billing_last_name_field { grid-column: span 3; }
.f15-co #billing_city_field,
.f15-co #billing_state_field,
.f15-co #billing_postcode_field { grid-column: span 2; }
@media screen and (max-width: 480px) {
  .f15-co #billing_first_name_field,
  .f15-co #billing_last_name_field,
  .f15-co #billing_city_field,
  .f15-co #billing_state_field,
  .f15-co #billing_postcode_field { grid-column: span 6; }
}
/* 输入包装器撑满网格单元（Woo 默认是 inline，会让 input 缩成内容宽） */
.f15-co .form-row .woocommerce-input-wrapper { display: block; width: 100%; }
.f15-co .form-row > label { white-space: nowrap; display: block; }
.f15-co .form-row input.input-text,
.f15-co .form-row select,
.f15-co .form-row textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
/* Woo 的 .col2-set/.col-1 把左栏压成 48%，这里拉满 */
.f15-co .col2-set,
.f15-co #customer_details { width: 100% !important; max-width: 100% !important; float: none !important; }
.f15-co .col2-set .col-1,
.f15-co #customer_details .col-1 { width: 100% !important; max-width: 100% !important; float: none !important; padding: 0 !important; }
/* ===== R15 布局定稿数值（容器 1080 / 栅格 minmax(0,1fr) clamp(320px,33%,400px) / gap clamp(32px,4vw,56px)） ===== */
.f15-checkout-page .f15-co,
form.checkout.f15-co {
  max-width: 1080px; margin: 0 auto; padding-left: 16px; padding-right: 16px; box-sizing: border-box;
}
@media screen and (min-width: 990px) {
  form.checkout.f15-co {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 33%, 400px);
    column-gap: clamp(32px, 4vw, 56px);
    align-items: start;
  }
  form.checkout.f15-co #customer_details { grid-column: 1; grid-row: 1; min-width: 0; max-width: 100%; }
  form.checkout.f15-co #order_review { display: contents; }
  form.checkout.f15-co .f15-sum__items,
  form.checkout.f15-co .f15-sum__totals {
    grid-column: 2; min-width: 0; max-width: 100%;
    position: sticky;
  }
  form.checkout.f15-co .f15-sum__items { grid-row: 1; top: 16px; }
  form.checkout.f15-co .f15-sum__totals { grid-row: 2; top: calc(16px + var(--f15-sum-items-h, 0px)); }
  form.checkout.f15-co #payment { grid-column: 1; grid-row: 2; min-width: 0; max-width: 100%; }
}
.f15-co #customer_details, .f15-co .f15-co-left, .f15-co .f15-co-section,
.f15-co .f15-co-fields, .f15-co .form-row { min-width: 0; max-width: 100%; }
.f15-co .f15-sum__thumb { width: 48px; height: 48px; }
.f15-co .f15-sum__thumb img { width: 48px; height: 48px; }
.f15-co .f15-sum__item { grid-template-columns: 48px minmax(0, 1fr) auto; }
.f15-co .f15-sum__name { -webkit-line-clamp: 3; }
/* 容器收口：宽度 100% + 16px 内边距（1080 上限），避免 1080 > 视口时溢出 */
.f15-checkout-page { padding-left: 0; padding-right: 0; }
.f15-checkout-page .f15-co {
  width: 100%; max-width: 1080px; margin: 0 auto;
  padding-left: 16px !important; padding-right: 16px !important; box-sizing: border-box;
}
.f15-checkout-page .f15-co-grid, .f15-checkout-page #customer_details { padding-left: 0 !important; padding-right: 0 !important; }
/* ===== [右栏整块 2026-11-27] 商品行与合计必须在同一张卡里，不能分成上下两块留大空档 ===== */
@media screen and (min-width: 990px) {
  .f15-co { align-items: start; }
  .f15-co #customer_details { grid-column: 1; grid-row: 1 / span 2; }
  .f15-co #payment { grid-column: 1; grid-row: 3; }
  /* 摘要整体作为一个单元格，内部自然堆叠 + sticky */
  .f15-co .f15-sum {
    display: block !important;
    grid-column: 2; grid-row: 1 / span 2;
    align-self: start;
    position: sticky; top: 16px;
    background: #fff; border: 1px solid var(--f15-line); border-radius: 12px;
    padding: 16px;
  }
  .f15-co .f15-sum__items,
  .f15-co .f15-sum__totals,
  .f15-co .woocommerce-checkout-review-order { grid-column: auto !important; grid-row: auto !important; position: static !important; }
  .f15-co .f15-sum__totals { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--f15-hair); }
  .f15-co .f15-sum__items { border: 0; padding: 0; }
}
/* 窄屏：摘要当普通卡片跟在表单上方，不再分成两块 */
@media screen and (max-width: 989px) {
  .f15-co .f15-sum { display: block !important; background: #fff; border: 1px solid var(--f15-line); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
}

/* ===== [六栅格 2026-11-27] 消灭空格子：姓名 3+3、城市/州/邮编 2+2+2、宽字段占满 ===== */
.f15-co .woocommerce-billing-fields__field-wrapper,
.f15-co .f15-co-fields {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  column-gap: 14px !important;
  row-gap: 12px !important;
  align-items: start;
}
.f15-co .f15-co-fields .form-row,
.f15-co .woocommerce-billing-fields__field-wrapper .form-row {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0;
}
.f15-co .f15-co-fields .form-row-wide,
.f15-co .woocommerce-billing-fields__field-wrapper .form-row-wide { grid-column: 1 / -1 !important; }
.f15-co .f15-co-fields .form-row-first,
.f15-co .f15-co-fields .form-row-last,
.f15-co .woocommerce-billing-fields__field-wrapper .form-row-first,
.f15-co .woocommerce-billing-fields__field-wrapper .form-row-last { grid-column: span 3 !important; }
.f15-co .f15-co-fields .form-row-third,
.f15-co .woocommerce-billing-fields__field-wrapper .form-row-third { grid-column: span 2 !important; }
@media screen and (max-width: 749px) {
  .f15-co .woocommerce-billing-fields__field-wrapper,
  .f15-co .f15-co-fields { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .f15-co .form-row-first, .f15-co .form-row-last,
  .f15-co .form-row-third, .f15-co .form-row-wide { grid-column: 1 / -1 !important; }
}

/* ===== [无登录入口 2026-11-27] 不显示 Sign in 链接（用户明确不要） ===== */
.f15-co .f15-co-signin, .f15-co .f15-co-contact-row .f15-co-signin { display: none !important; }
.f15-co .f15-co-contact-row .form-row { flex: 1 1 100% !important; }