/* ---------------------------------------------------------------
   GDL Jersey Customizer — 商品详情页定制表单
   版式对齐参考站：字段平铺、无卡片外框、费用跟在标签后、
   输入控件通栏圆角描边、下拉带圆形清除按钮。
   --------------------------------------------------------------- */

.gdl-jc {
  --gdl-jc-ink: #1f2024;
  --gdl-jc-gold: #b08d3e;
  --gdl-jc-line: #d9d9d9;
  --gdl-jc-muted: #8a8f98;
  margin: 4px 0 18px;
  width: 100%; /* 父级是 flex/grid 时也要撑满整列 */
}

/* form.cart 是 flex row + wrap，.single_variation_wrap 默认收缩到内容宽（~253px），
   会把定制区压窄；带定制区的商品让它占满整行。 */
.woocommerce div.product form.cart:has(.gdl-jc) .single_variation_wrap {
  width: 100%;
}

.gdl-jc__fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 隐藏行由 JS 的 hidden 属性控制 */
.gdl-jc__row[hidden] {
  display: none !important;
}

.gdl-jc__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gdl-jc__label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gdl-jc-ink);
  margin: 0;
  line-height: 1.4;
}

.gdl-jc__fee {
  font-size: 13px;
  font-weight: 600;
  color: var(--gdl-jc-gold);
  margin-left: 2px;
}

.gdl-jc__req {
  color: #b32d2e;
}

.gdl-jc__hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--gdl-jc-muted);
}

.gdl-jc__control {
  position: relative;
}

/* 文本 / 数字 */
.gdl-jc__input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--gdl-jc-line);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: var(--gdl-jc-ink);
  box-sizing: border-box;
}

.gdl-jc__input::placeholder {
  color: #9aa0a8;
}

.gdl-jc__input:focus {
  outline: none;
  border-color: var(--gdl-jc-ink);
  box-shadow: 0 0 0 1px var(--gdl-jc-ink);
}

/* 单选（裸样式，对齐参考站） */
.gdl-jc__radios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
}

.gdl-jc__radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--gdl-jc-ink);
}

.gdl-jc__radio input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--gdl-jc-ink);
  cursor: pointer;
  flex: 0 0 auto;
}

/* 价格角标（单选候选上有价时才出现；下拉候选行用） */
.gdl-jc__price {
  font-size: 12.5px;
  color: var(--gdl-jc-gold);
  font-weight: 600;
}

.gdl-jc__price:empty {
  display: none;
}

/* 下拉 */
.gdl-jc__dd {
  position: relative;
  width: 100%;
}

.gdl-jc__dd-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 6px 74px 6px 14px;
  border: 1px solid var(--gdl-jc-line);
  border-radius: 8px;
  background: #fff;
  font-size: 14.5px;
  color: var(--gdl-jc-ink);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.gdl-jc__dd-toggle:hover {
  border-color: #9aa0a8;
}

.gdl-jc__dd-thumb {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--gdl-jc-line);
}

.gdl-jc__dd-text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gdl-jc__dd-text.is-placeholder {
  color: #9aa0a8;
}

/* 圆形清除按钮（有值时出现） */
.gdl-jc__dd-clear {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-right: 2px;
  border: 1px solid #c9cdd3;
  border-radius: 50%;
  background: #fff;
  color: #6b7280;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.gdl-jc__dd-clear:hover {
  background: #f1f2f4;
  color: #1f2024;
}

.gdl-jc__dd-clear[hidden] {
  display: none;
}

.gdl-jc__dd-caret {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 1.8px solid #1f2024;
  border-bottom: 1.8px solid #1f2024;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  pointer-events: none;
}

.gdl-jc__dd-toggle[aria-expanded="true"] .gdl-jc__dd-caret {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.gdl-jc__dd-panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--gdl-jc-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.gdl-jc__dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 14px;
  color: var(--gdl-jc-ink);
  text-align: left;
  cursor: pointer;
}

.gdl-jc__dd-item:hover,
.gdl-jc__dd-item.is-active {
  background: #f4f1ea;
}

.gdl-jc__dd-item img {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--gdl-jc-line);
}

.gdl-jc__dd-item-label {
  flex: 1 1 auto;
}

/* 购物车 / 订单里的定制明细 */
.woocommerce-cart .gdl-jc-cart-note,
.gdl-jc-cart-note {
  color: var(--gdl-jc-muted, #6b7280);
}

@media (max-width: 575px) {
  .gdl-jc {
    margin: 2px 0 14px;
  }

  .gdl-jc__fields {
    gap: 15px;
  }

  .gdl-jc__radios {
    gap: 4px 20px;
  }

  .gdl-jc__input,
  .gdl-jc__dd-toggle {
    height: 44px;
    min-height: 44px;
    font-size: 16px; /* iOS 聚焦时不自动放大 */
  }

  .gdl-jc__dd-panel {
    max-height: 240px;
  }
}
