/* --- 样式命名空间：防止与 Shopline 主题冲突 --- */
.gl-custom-form-wrapper {
  box-sizing: border-box;
}

.gl-custom-form-wrapper .custom-size-container {
  border-radius: 4px;
  margin-top: 15px;
  background: #fdfdfd; /* 淡淡的背景色区分区域 */
  border: 1px solid #eee;
  padding: 15px;
}

/* --- 1. 单位切换开关 --- */
.gl-custom-form-wrapper .measurement-unit-swapper {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  font-size: 12px;
  color: #333;
}

.gl-custom-form-wrapper .unit-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-left: 20px;
}

.gl-custom-form-wrapper .js-unit-toggle {
  display: none; /* 隐藏原生checkbox */
}

.gl-custom-form-wrapper .switch-slider {
  width: 38px;
  height: 20px;
  background: #5C3C30;
  border-radius: 10px;
  position: relative;
  margin: 0 10px;
  transition: all 0.3s ease;
}

.gl-custom-form-wrapper .switch-dot {
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gl-custom-form-wrapper .js-unit-toggle:checked + .switch-slider {
  background: #5C3C30; /* 品牌棕色 */
}

.gl-custom-form-wrapper .js-unit-toggle:checked + .switch-slider .switch-dot {
  transform: translateX(18px);
}

/* --- 2. 表单主布局 --- */
.gl-custom-form-wrapper .custom-form-main {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.gl-custom-form-wrapper .custom-inputs-list {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.gl-custom-form-wrapper .custom-guide-image {
  width: 180px;
  border-left: 1px solid #f5f5f5;
}

.gl-custom-form-wrapper .custom-guide-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0px 0px 10px #00000024;
  padding: 8px;
}

/* --- 3. 输入行样式 --- */
.gl-custom-form-wrapper .custom-input-group {
  margin-bottom: 16px;
}

.gl-custom-form-wrapper .input-wrapper {
  display: flex;
  flex-direction: column;
}

.gl-custom-form-wrapper .input-wrapper label {
  font-size: 12px;
  color: #000;
  flex-shrink: 0;
  line-height: 1.2;
  margin-bottom: 4px;
}

.gl-custom-form-wrapper .input-box {
  display: flex;
  align-items: center;
  width: 160px;
}

.gl-custom-form-wrapper .js-custom-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  font-size: 14px;
  color: #333;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

.gl-custom-form-wrapper .js-custom-input:focus {
  border-color: #5C3C30;
}

.gl-custom-form-wrapper .js-custom-input::placeholder {
  color: #d1d1d1;
}

.gl-custom-form-wrapper .js-unit-text {
  margin-left: 10px;
  font-size: 14px;
  color: #000;
  width: 40px;
  flex-shrink: 0;
}

/* --- 4. 校验与错误提示 --- */
.gl-custom-form-wrapper .js-input-error {
  color: #e02b27;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.gl-custom-form-wrapper .js-agreement-error {
  color: #e02b27;
  font-size: 12px;
  margin-top: 10px;
  display: none;
}

.custom-input-group.is-invalid .js-input-error, .custom-agreement.is-invalid .js-agreement-error{
  display: block;
}

/* --- 5. 协议勾选区 --- */
/* 协议区域容器优化 */
.gl-custom-form-wrapper .custom-agreement {
  margin-top: 20px;
  padding: 20px;
  background-color: #FBF9F8; /* 极浅的暖色调背景，增加质感 */
  border-radius: 8px;
  border: 1px solid #F0EAE8;
  transition: all 0.3s ease;
}

/* 当未勾选点击提交时，增加一个闪烁提示效果的类 */
.gl-custom-form-wrapper .custom-agreement.shake-error {
  border-color: #e02b27;
  background-color: #FFF6F6;
  animation: glShake 0.5s ease-in-out;
}

.gl-custom-form-wrapper .agreement-label {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  cursor: pointer;
}

/* 隐藏原生 checkbox，使用伪元素美化（可选，或保持原生但加美化） */
.gl-custom-form-wrapper .js-agreement-check {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #5C3C30; /* 棕色主题色 */
  flex-shrink: 0;
}

.gl-custom-form-wrapper .agreement-content {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
}

/* 标题样式 */
.gl-custom-form-wrapper .agreement-content p {
  margin: 0 0 10px 0;
  color: #000;
}

/* 列表样式优化 */
.gl-custom-form-wrapper .agreement-content ul {
  margin: 8px 0;
  padding-left: 0;
  list-style: none; /* 去掉原生圆点 */
}

.gl-custom-form-wrapper .agreement-content li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  color: #555;
  font-size: 12.5px;
}

/* 使用自定义的小圆点 */
.gl-custom-form-wrapper .agreement-content li::before {
  content: "•";
  position: absolute;
  left: 5px;
  color: #5C3C30;
  font-weight: bold;
}

/* 错误提示文字 */
.gl-custom-form-wrapper .js-agreement-error {
  color: #e02b27;
  font-size: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #F0DED9;
  display: none;
  font-weight: 500;
}

.current-select-option {
  color: #cc7f85;
  font-size: 14px;
}

/* 抖动动画 */
@keyframes glShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* --- 6. 响应式适配 --- */
@media screen and (max-width: 768px) {
  .gl-custom-form-wrapper .custom-form-main {
    gap: 20px;
  }

  .gl-custom-form-wrapper .custom-guide-image {
    width: 100%;
    border-left: none;
    padding-left: 0;
    text-align: center;
  }

  .gl-custom-form-wrapper .custom-guide-image img {
    width: 140px;
  }

  .gl-custom-form-wrapper .input-wrapper label {
    width: 120px;
    margin-right: 15px;
  }
  
  .gl-custom-form-wrapper .js-input-error {
    /*margin-left: 135px;*/
  }
}


/* --- 表格核心样式 --- */
.size-table-wrapper {
  width: 100%;
  overflow-x: auto; /* 保证移动端可以左右滑动 */
  margin-bottom: 15px;
}

.size-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 13px;
  background: #fff;
}

.size-table th {
  background: #f9f9f9;
  padding: 6px 5px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #eee;
}

.size-table td {
  padding: 6px 5px;
  border-bottom: 1px solid #f5f5f5;
  color: #666;
}

/* --- 高亮当前选择的行 --- */
.size-table tr.is-selected {
  background-color: var(--table-select-background-color) !important; /* 对应你图中那种淡淡的粉色 */
}

.size-table tr.is-selected td {
  color: #000;
  font-weight: 500;
}

/* --- 底部提示文案 --- */
.size-note {
  font-size: 12px;
  color: #d9393d; /* 醒目的红色提醒 */
  line-height: 1.4;
  font-weight: 500;
  margin-top: 10px;
}

/* 针对移动端的微调 */
@media (max-width: 768px) {
  .size-table {
    font-size: 12px;
  }
  .size-table td, .size-table th {
    padding: 6px 4px;
  }
}

.dynamic-guide-tip {
  margin-top: 15px;
  padding: 12px;
  background-color: #f9f9f9;
  border-left: 3px solid #5C3C30; /* 用你图标的棕色作为点缀线 */
  font-size: 13px;
  line-height: 1.5;
  color: #333;
}

.tip-title {
  font-weight: bold;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.tip-content {
  color: #666;
}

/* 全屏遮罩层容器 */
.custom-image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85); /* 黑色背景，带点透明 */
  z-index: 10000; /* 确保在最顶层 */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  cursor: pointer; /* 点击遮罩层关闭 */
}

/* 激活状态 */
.custom-image-lightbox.is-active {
  opacity: 1;
  visibility: visible;
}

/* 图片内容容器，可以添加动画效果 */
.custom-image-lightbox .lightbox-content {
  max-width: 90%;
  max-height: 100%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  background: #fff;
}

.custom-image-lightbox.is-active .lightbox-content {
  transform: scale(1); /* 放大到正常比例 */
}

/* 被放大的图片本身 */
.custom-image-lightbox img {
  display: block;
  width: 600px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* 保持纵横比，不被拉伸 */
  margin: auto;
  user-select: none; /* 防止点击时文字被选中 */
  -webkit-user-select: none;
}