/* eShop 基础样式（6 语言 / RTL 兼容） */
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #f4f6f9; color: #25324b;
}
a { color: #1665c0; text-decoration: none; }

/* 顶部 */
.esh-top { background: #0f2b52; color: #fff; position: sticky; top: 0; z-index: 20; }
.esh-top-inner { max-width: 1280px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.esh-brand { color: #fff; display: flex; flex-direction: column; line-height: 1.25; }
.esh-logo { font-size: 19px; font-weight: 700; }
.esh-brand small { color: #b9c8e2; font-size: 12px; font-weight: 400; }
.esh-search { flex: 1; display: flex; max-width: 480px; min-width: 200px; }
.esh-search input { flex: 1; padding: 9px 12px; border: 1px solid #cfd8e6; border-radius: 6px 0 0 6px; font-size: 14px; }
.esh-search button { padding: 9px 16px; border: 0; background: #1f7be0; color: #fff; border-radius: 0 6px 6px 0; cursor: pointer; font-size: 14px; }
.esh-langs { display: flex; gap: 4px; }
.esh-langs a { color: #cfd8e6; padding: 4px 7px; border-radius: 4px; font-size: 12px; border: 1px solid transparent; }
.esh-langs a.on { background: #fff; color: #0f2b52; border-color: #fff; font-weight: 700; }
.esh-langs a:hover { border-color: #cfd8e6; }

/* 主体 */
.esh-body { max-width: 1280px; margin: 14px auto; padding: 0 18px; display: flex; gap: 18px; align-items: flex-start; }
.esh-side { flex: 0 0 240px; background: #fff; border: 1px solid #e3e9f2; border-radius: 8px; padding: 10px; position: sticky; top: 68px; max-height: calc(100vh - 84px); overflow: auto; }
.esh-side-title { font-weight: 700; margin: 4px 6px 8px; font-size: 14px; }
.esh-tree { list-style: none; margin: 0; padding: 0; }
.esh-tree ul { list-style: none; margin: 0; padding-left: 6px; }
.cat-row { display: flex; align-items: center; gap: 2px; padding: 2px 0; }
.cat-toggle { color: #789; font-size: 10px; width: 12px; text-align: center; cursor: pointer; flex: 0 0 auto; }
.cat-toggle.n { cursor: default; }
.cat-link { flex: 1; font-size: 13px; padding: 4px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-link:hover { background: #eef4fd; }
.cat-link.active { background: #1f7be0; color: #fff; }
.cat-cnt { font-size: 11px; color: #8aa0bd; padding-right: 6px; }
.cat-children { display: none; }
.has-children.open > .cat-row .cat-toggle { transform: rotate(90deg); }
.has-children.open > .cat-children { display: block; }

.esh-main { flex: 1; min-width: 0; }
.esh-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid #e3e9f2; border-radius: 8px; padding: 8px 14px; margin-bottom: 12px; }
.esh-crumb strong { font-size: 15px; }
.esh-crumb .sep { color: #9ab; margin: 0 4px; }
.esh-q { background: #e8f1fb; color: #1665c0; padding: 3px 10px; border-radius: 12px; font-size: 13px; }
.esh-q a { color: #1665c0; font-weight: 700; }
.esh-count { margin-inline-start: auto; color: #667fa0; font-size: 13px; }

/* 产品网格 */
.esh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.esh-card { background: #fff; border: 1px solid #e3e9f2; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s; }
.esh-card:hover { box-shadow: 0 4px 14px rgba(15,43,82,.12); }
.esh-card-img { height: 150px; display: flex; align-items: center; justify-content: center; background: #fbfcfe; border-bottom: 1px solid #eef2f8; }
.esh-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 6px; }
.esh-noimg { color: #ccd6e5; font-size: 30px; }
.esh-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; }
.esh-code { color: #8aa0bd; font-size: 11px; }
.esh-name { font-size: 14px; color: #25324b; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.esh-name:hover { color: #1665c0; }
.esh-specs { font-size: 12px; color: #667fa0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esh-unit { font-size: 12px; color: #25324b; margin-top: auto; }

.esh-empty { background: #fff; border: 1px solid #e3e9f2; border-radius: 8px; padding: 40px; text-align: center; color: #8aa0bd; }

.esh-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; }
.esh-pg { background: #fff; border: 1px solid #cfd8e6; padding: 6px 14px; border-radius: 6px; font-size: 13px; }
.esh-pg:hover { background: #eef4fd; }
.esh-pg-cur { color: #667fa0; font-size: 13px; }

.esh-foot { text-align: center; color: #8aa0bd; font-size: 12px; padding: 18px; }

/* RTL */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .esh-search input { border-radius: 0 6px 6px 0; }
html[dir="rtl"] .esh-search button { border-radius: 6px 0 0 6px; }
html[dir="rtl"] .cat-children { padding-left: 0; padding-right: 6px; }

/* 商品详情弹层 */
.esh-modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 22, 40, .55);
  z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px;
}
.esh-modal {
  background: #fff; border-radius: 10px; width: 100%; max-width: 620px;
  max-height: 88vh; overflow: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  animation: eshPop .18s ease-out;
}
@keyframes eshPop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.esh-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid #e3e9f2; font-size: 16px;
}
.esh-close {
  border: 0; background: #eef2f8; color: #54657e; width: 30px; height: 30px;
  border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer;
}
.esh-close:hover { background: #dbe4f0; }
.esh-modal-body { display: flex; gap: 18px; padding: 18px; }
.esh-modal-img {
  flex: 0 0 200px; height: 160px; background: #fbfcfe; border: 1px solid #eef2f8;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.esh-modal-img img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 6px; }
.esh-modal-meta { flex: 1; font-size: 14px; color: #25324b; }
.esh-modal-meta b { color: #667fa0; font-weight: 600; }
.esh-modal-meta > div { margin-bottom: 8px; }
.esh-modal-foot { border-top: 1px solid #e3e9f2; padding: 10px 18px; color: #8aa0bd; font-size: 13px; }
@media (max-width: 520px) {
  .esh-modal-body { flex-direction: column; }
  .esh-modal-img { flex: auto; width: 100%; }
}

/* 移动端 */
@media (max-width: 860px) {
  .esh-body { flex-direction: column; }
  .esh-side { flex: auto; width: 100%; position: static; max-height: none; }
}