/* 助农商城 · 通用（主色对齐全站 h5-ui 蓝） */
.shop-page {
  --shop-primary: #3d6eff;
  --shop-primary-dark: #2f5ae6;
  --shop-accent: #ff6a2a;
  --shop-bg: #f5f7fb;
  font-size: 14px;
  color: #1f2937;
  background: var(--shop-bg);
}
.shop-page .vui-top {
  background: linear-gradient(135deg, #4a7dff 0%, #3d6eff 100%);
  box-shadow: 0 2px 12px rgba(61, 110, 255, .25);
}
.shop-page .vui-top h1 {
  font-weight: 650;
  letter-spacing: .02em;
}

/* 商品详情 */
.g-main { background: var(--shop-bg); }
.g-gallery {
  background: #fff;
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
}
.g-gallery .g-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .35s ease;
  will-change: transform;
}
.g-gallery .g-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}
.g-gallery .g-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}
.g-gallery .g-dots {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}
.g-gallery .g-dots i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  box-shadow: 0 0 2px rgba(0,0,0,.25);
  transition: all .25s;
}
.g-gallery .g-dots i.on {
  width: 16px;
  border-radius: 4px;
  background: #fff;
}
.g-gallery .g-gallery-idx {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  min-width: 36px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}
.g-info {
  background: #fff;
  padding: 16px 16px 18px;
  margin-top: 0;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.03);
}
.g-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.g-price {
  color: var(--shop-accent);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.g-price small { font-size: 14px; font-weight: 650; margin-right: 1px; }
.g-mp {
  font-size: 13px;
  color: #b0b8b3;
  text-decoration: line-through;
}
.g-sales {
  margin-left: auto;
  font-size: 12px;
  color: #8a9a92;
}
.g-name {
  font-size: 17px;
  font-weight: 650;
  margin: 10px 0 6px;
  line-height: 1.4;
  color: #15241c;
}
.g-sub { color: #7a8a82; font-size: 13px; line-height: 1.45; }
.g-spec {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: #3d6eff;
  background: #eef3ff;
  border-radius: 6px;
  padding: 4px 8px;
}
.g-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eef2f8;
  font-size: 14px;
  color: #44506a;
}
.g-qty .lab { font-size: 14px; font-weight: 500; min-width: auto; }
.g-qty .stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e3e8e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fafbfa;
}
.g-qty .stepper button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 18px;
  color: #44554c;
  cursor: pointer;
  line-height: 1;
}
.g-qty .stepper button:active { background: #e8eef8; }
.g-qty .stepper #qty {
  min-width: 36px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-left: 1px solid #e3e8e5;
  border-right: 1px solid #e3e8e5;
  line-height: 34px;
  height: 34px;
}
.g-qty .stock { margin-left: auto; font-size: 12px; color: #9aa8a0; }

.g-panel {
  background: #fff;
  margin: 10px 0 0;
  border-radius: 12px;
  overflow: visible;
}
.g-panel .hd {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 650;
  color: #1a2e24;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f3f5f4;
  cursor: pointer;
  user-select: none;
}
.g-panel .hd .chev {
  color: #b0bab4;
  font-size: 12px;
  transition: transform .2s;
}
.g-panel.open .hd .chev { transform: rotate(90deg); }
.g-panel .bd { padding: 4px 16px 14px; display: none; }
.g-panel.open .bd { display: block; }
.g-params .row {
  display: flex;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid #f7f8f7;
}
.g-params .row:last-child { border-bottom: 0; }
.g-params .k { width: 88px; flex-shrink: 0; color: #9aa8a0; }
.g-detail {
  padding: 8px 0 24px;
  font-size: 14px;
  line-height: 1.7;
  color: #33443c;
  overflow: visible;
  word-break: break-word;
}
.g-detail p { margin: 0 0 10px; }
.g-detail img {
  display: block;
  max-width: 100% !important;
  width: auto;
  height: auto !important;
  border-radius: 8px;
  margin: 8px 0;
}
/* TinyMCE 富文本偶发带固定宽高/浮动，避免撑破或高度为 0 */
.g-detail video,
.g-detail iframe {
  display: block;
  max-width: 100%;
}
.g-detail table {
  max-width: 100%;
  border-collapse: collapse;
}

.g-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid #eef1ef;
  max-width: 750px;
  margin: 0 auto;
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(0,0,0,.04);
}
.g-bar .svc {
  width: 48px;
  text-align: center;
  font-size: 11px;
  color: #666;
  text-decoration: none !important;
  padding-top: 2px;
  line-height: 1.25;
}
.g-bar .svc::before {
  content: "☎";
  display: block;
  font-size: 16px;
  margin-bottom: 2px;
}
.g-bar .btn {
  flex: 1;
  height: 42px;
  border: 0;
  border-radius: 21px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.g-bar .cart {
  background: #fff4e8;
  color: #d46b08;
}
.g-bar .buy {
  background: linear-gradient(135deg, #4a7dff, #3d6eff);
  color: #fff;
  box-shadow: 0 4px 12px rgba(61, 110, 255, .28);
}
.g-bar .btn:disabled { opacity: .45; cursor: not-allowed; }
/* 底栏约 62px + safe-area；多留空隙避免图文详情被挡住 */
.shop-page.vui-page.has-bar {
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}
.g-panels {
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

/* 手机不显示信息区内购买按钮；PC 显示 */
.g-actions { display: none; }
.g-assure { display: none; }
.g-thumbs { display: none; }
.g-price-box .lab,
.g-spec-row .lab { display: none; }
.g-meta-row { display: none; }
.g-sales { margin-left: auto; font-size: 12px; color: #8a9a92; }

.shop-empty {
  text-align: center;
  color: #999;
  padding: 60px 20px;
}

/* 地址表单 */
.shop-addr-form .vui-field select {
  width: 100%;
  height: 40px;
  border: 1px solid #e5ebe7;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #fafbfa;
  color: #1f2d26;
  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 fill='%239aa8a0' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.shop-addr-form .vui-field select:disabled {
  color: #b0bab4;
  background-color: #f3f5f4;
}
.shop-addr-form .vui-field input {
  width: 100%;
  height: 40px;
  border: 1px solid #e5ebe7;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #fafbfa;
  box-sizing: border-box;
}
.shop-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 4px;
  margin-top: 4px;
  border-top: 1px solid #f0f3f1;
}
.shop-switch-row .lab {
  font-size: 14px;
  color: #1f2d26;
  font-weight: 500;
}
.shop-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.shop-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.shop-switch i {
  position: absolute;
  inset: 0;
  background: #d6ddd8;
  border-radius: 999px;
  transition: .2s;
  cursor: pointer;
}
.shop-switch i::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.shop-switch input:checked + i {
  background: #3d6eff;
}
.shop-switch input:checked + i::before {
  transform: translateX(20px);
}

@media (min-width: 992px) {
  html.gov-pc-page .shop-page.vui-page {
    font-size: 15px;
    background: #fff;
  }

  /* ===== 商品详情：京东/淘宝式左图右文 ===== */
  html.gov-pc-page .g-main {
    background: #fff;
    padding: 24px 28px 8px;
  }
  html.gov-pc-page .g-layout {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 36px;
    align-items: start;
    background: #fff;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f3f1;
  }
  html.gov-pc-page .g-gallery-wrap {
    position: sticky;
    top: 16px;
  }
  html.gov-pc-page .g-gallery {
    aspect-ratio: 1;
    min-height: 0;
    border-radius: 8px;
    border: 1px solid #e8eef8;
    overflow: hidden;
    background: #fafbfa;
  }
  /* PC 用缩略图切换，隐藏手机指示器 */
  html.gov-pc-page .g-gallery .g-dots,
  html.gov-pc-page .g-gallery .g-gallery-idx {
    display: none;
  }
  html.gov-pc-page .g-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
  }
  html.gov-pc-page .g-thumb {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
  }
  html.gov-pc-page .g-thumb.on,
  html.gov-pc-page .g-thumb:hover {
    border-color: #3d6eff;
  }
  html.gov-pc-page .g-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  html.gov-pc-page .g-info {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 8px 8px 0;
    display: block;
    background: transparent;
  }
  html.gov-pc-page .g-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px;
    color: #1a1a1a;
  }
  html.gov-pc-page .g-sub {
    font-size: 14px;
    color: #888;
    margin-bottom: 16px;
  }
  html.gov-pc-page .g-price-box {
    background: linear-gradient(90deg, #fff8f3, #fff);
    border: 1px solid #ffe8d6;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
  }
  html.gov-pc-page .g-price-box .lab {
    display: inline-block;
    width: 48px;
    color: #999;
    font-size: 13px;
  }
  html.gov-pc-page .g-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  html.gov-pc-page .g-price {
    font-size: 30px;
    color: #ff6a2a;
  }
  html.gov-pc-page .g-sales { display: none; }
  html.gov-pc-page .g-meta-row {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    font-size: 13px;
    color: #999;
  }
  html.gov-pc-page .g-spec-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    font-size: 14px;
  }
  html.gov-pc-page .g-spec-row .lab {
    display: inline-block;
    width: 48px;
    color: #999;
    font-size: 13px;
  }
  html.gov-pc-page .g-spec {
    margin: 0;
    background: #eef3ff;
    color: #2f5ae6;
  }
  html.gov-pc-page .g-qty {
    border-top: 0;
    margin-top: 8px;
    padding-top: 8px;
  }
  html.gov-pc-page .g-qty .lab {
    width: 48px;
    color: #999;
    font-size: 13px;
  }
  html.gov-pc-page .g-qty .stock { display: none; }

  /* PC：购买按钮在信息区，底栏隐藏 */
  html.gov-pc-page .g-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
  }
  html.gov-pc-page .g-actions .btn {
    height: 46px;
    min-width: 148px;
    padding: 0 28px;
    border: 0;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
  }
  html.gov-pc-page .g-actions .cart {
    background: #fff4e8;
    color: #d46b08;
    border: 1px solid #ffd9b0;
  }
  html.gov-pc-page .g-actions .buy {
    background: linear-gradient(135deg, #4a7dff, #3d6eff);
    color: #fff;
  }
  html.gov-pc-page .g-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
  html.gov-pc-page .g-assure {
    display: flex;
    gap: 18px;
    margin-top: 18px;
    font-size: 13px;
    color: #7a8a82;
  }
  html.gov-pc-page .g-assure span::before {
    content: "✓ ";
    color: #3d6eff;
    font-weight: 700;
  }
  html.gov-pc-page .g-panels {
    padding: 8px 0 32px;
    max-width: none;
  }
  html.gov-pc-page .g-panel {
    margin: 16px 0 0;
    border: 1px solid #e8eef8;
    border-radius: 8px;
    box-shadow: none;
  }
  html.gov-pc-page .g-panel .hd {
    font-size: 16px;
    padding: 16px 20px;
  }
  html.gov-pc-page .g-panel .bd {
    padding: 8px 20px 18px;
  }
  html.gov-pc-page .g-bar {
    display: none !important;
  }
  html.gov-pc-page .shop-page.vui-page.has-bar,
  html.gov-pc-page .vui-page.has-bar {
    padding-bottom: 32px;
  }

  /* ===== 列表/卡片通用（京东式内容宽卡片） ===== */
  html.gov-pc-page .shop-page .vui-form-card {
    margin: 16px 28px 28px;
    max-width: none;
  }
  html.gov-pc-page .addr-item {
    margin: 12px 28px;
  }
  html.gov-pc-page .od-item {
    margin: 12px 28px;
    border-radius: 10px;
    border: 1px solid #e8eef8;
  }
  html.gov-pc-page .shop-page .vui-tabs {
    padding: 12px 28px 0;
  }
  html.gov-pc-page .shop-page .ck-addr,
  html.gov-pc-page .shop-page .ck-goods,
  html.gov-pc-page .shop-page .ck-sum,
  html.gov-pc-page .shop-page .ck-remark {
    margin-left: 28px;
    margin-right: 28px;
    border-radius: 10px;
    border: 1px solid #e8eef8;
  }
  html.gov-pc-page .shop-page .ck-addr { margin-top: 16px; }
  html.gov-pc-page .shop-page .ck-goods,
  html.gov-pc-page .shop-page .ck-sum,
  html.gov-pc-page .shop-page .ck-remark { margin-top: 12px; }

  /* 订单列表等：不要用访客页的两列网格，通栏铺满 */
  html.gov-pc-page .shop-page .vui-list {
    display: block !important;
    grid-template-columns: none !important;
    margin: 0 0 24px !important;
    width: 100%;
    box-sizing: border-box;
  }
  html.gov-pc-page .shop-page .vui-tabs {
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    border-bottom: 1px solid #e8eef8;
    margin-bottom: 8px;
  }
  html.gov-pc-page .shop-page .shop-empty {
    text-align: center;
    color: #999;
    padding: 80px 28px;
    width: 100%;
    box-sizing: border-box;
  }

  /* 表单页提交按钮：PC 右对齐，避免通栏大按钮 */
  html.gov-pc-page .shop-page .vui-form-card .vui-btn {
    width: auto !important;
    min-width: 140px;
    float: right;
    border-radius: 6px;
  }
  html.gov-pc-page .shop-page .vui-form-card::after {
    content: "";
    display: table;
    clear: both;
  }
  html.gov-pc-page .shop-page .vui-card {
    margin: 16px 28px 28px;
    border: 1px solid #e8eef8;
    border-radius: 10px;
  }
}
