﻿/* ==========================================================================
   商家店铺页面
   ========================================================================== */
.shop-page {
  padding-top: var(--header-height, 72px);
  background: #f5f7fa;
  min-height: 100vh;
  padding-left: 50px;
  padding-right: 50px;
}

/* 店铺头部 */
.shop-header {
  background: #fff;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #f1f5f9;
  margin-top: 16px;
  border-radius: 8px;
}

.shop-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fef3c7 center/cover no-repeat;
  flex-shrink: 0;
}

.shop-info {
  flex: 1;
}

.shop-info__name {
  font-size: 20px;
  font-weight: 700;
  color: #1d2129;
  margin-bottom: 4px;
}

.shop-info__name a {
  font-size: 12px;
  color: #86909c;
  margin-left: 8px;
  text-decoration: none;
}

.shop-info__tags {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.shop-info__tag {
  font-size: 11px;
  padding: 2px 6px;
  background: #f0f9ff;
  color: #f59e0b;
  border-radius: 3px;
}

.shop-info__stat {
  font-size: 12px;
  color: #86909c;
}

.shop-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.shop-btn-service {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
}

.shop-btn-service:hover {
  border-color: #096ddd;
  color: #096ddd;
}

.shop-btn-follow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #49c9e9, #096ddd);
  font-size: 13px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.shop-btn-follow:hover {
  opacity: 0.9;
}

/* 店铺主体 */
.shop-body {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

/* 左侧分类栏 */
.shop-sidebar {
  width: 20%;
  max-width: 180px;
  background: #fff;
  padding: 20px 0;
  flex-shrink: 0;
  border-radius: 8px;
}

.shop-sidebar__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.shop-sidebar__item:hover {
  background: #f5f7fa;
}

.shop-sidebar__item.is-active {
  color: #096ddd;
  font-weight: 600;
  background: #eff6ff;
  border-left: 3px solid #096ddd;
}

.shop-sidebar__item svg {
  width: 12px;
  height: 12px;
  opacity: 0.4;
}

/* 右侧产品区 */
.shop-content {
  flex: 1;
  padding: 16px 24px;
  min-width: 0;
  background: #fff;
  border-radius: 8px;
}

/* 排序 tabs */
.shop-sort-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
}

.shop-sort-tab {
  padding: 10px 20px;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.shop-sort-tab:hover {
  color: #096ddd;
}

.shop-sort-tab.is-active {
  color: #096ddd;
  font-weight: 600;
  border-bottom-color: #096ddd;
}

/* 产品网格 */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.shop-product {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s;
  border: 1px solid #f1f5f9;
}

.shop-product:hover {
  transform: translateY(-4px);
}

.shop-product__thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: #e5e7eb center/cover no-repeat;
}

.shop-product__info {
  padding: 8px 10px;
}

.shop-product__title {
  font-size: 12px;
  color: #1d2129;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.shop-product__price {
  font-size: 14px;
  font-weight: 700;
  color: #096ddd;
}

.shop-product__price span {
  font-size: 11px;
  color: #86909c;
  font-weight: 400;
  margin-left: 4px;
}

/* 响应式 */
@media (max-width: 1024px) {
  .shop-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .shop-page {
    padding-left: 0;
    padding-right: 0;
  }
  .shop-header {
    padding: 16px 15px;
    flex-wrap: wrap;
    overflow: hidden;
  }
  .shop-avatar {
    width: 48px;
    height: 48px;
  }
  .shop-info__name {
    font-size: 16px;
  }
  .shop-sidebar {
    display: none;
  }
  .shop-body {
    flex-direction: column;
    gap: 0;
    margin-top: 0;
  }
  .shop-content {
    border-radius: 0;
    padding: 12px 15px;
  }
  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .shop-product__thumb {
    aspect-ratio: 4/3;
  }
  .shop-sort-tabs {
    border-bottom: none;
    gap: 0;
    margin-bottom: 12px;
  }
  .shop-sort-tab {
    padding: 8px 14px;
    font-size: 13px;
  }
  .shop-actions {
    position: absolute;
    top: 16px;
    right: 15px;
  }
}

/* 移动端底部导航 */
.shop-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  z-index: 999;
  align-items: center;
  justify-content: space-around;
}

.shop-mobile-nav__item {
  font-size: 13px;
  color: #4b5563;
  text-decoration: none;
  text-align: center;
}

.shop-mobile-nav__item.is-active {
  color: #096ddd;
  font-weight: 600;
}

@media (max-width: 768px) {
  .shop-mobile-nav {
    display: flex;
  }
  .shop-page {
    padding-bottom: 60px;
  }
  .shop-header {
    position: relative;
  }
}

/* 防止水平滚动，但不能创建滚动容器。
   clip 只裁剪横向溢出，不会像 hidden 一样改变页眉 sticky 的参照滚动区域。 */
html {
  overflow-x: clip;
}

/* ==========================================================================
   资质弹窗
   ========================================================================== */
.shop-qual-link { cursor: pointer; }

.qual-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qual-modal.is-open { display: flex; }
.qual-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.qual-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  animation: qualPop 0.22s ease;
}
@keyframes qualPop {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.qual-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: #fff;
  border-radius: 14px 14px 0 0;
}
.qual-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #1d2129;
}
.qual-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #86909c;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s;
}
.qual-modal__close:hover { color: #1d2129; }
.qual-modal__body { padding: 18px 22px 24px; }
.qual-modal__row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #eef0f2;
  font-size: 14px;
  line-height: 1.6;
}
.qual-modal__label {
  flex-shrink: 0;
  width: 124px;
  color: #86909c;
}
.qual-modal__value { color: #1d2129; word-break: break-all; }
.qual-modal__license { margin-top: 16px; }
.qual-modal__license-img {
  margin-top: 10px;
  width: 100%;
  aspect-ratio: 16 / 11;
  border: 1px solid #eef0f2;
  border-radius: 10px;
  background: #f5f7fa center/cover no-repeat;
}
.qual-modal__note {
  margin: 16px 0 0;
  font-size: 12px;
  color: #a5adb6;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .qual-modal { padding: 0; align-items: flex-end; }
  .qual-modal__dialog {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
  }
  .qual-modal__head { border-radius: 16px 16px 0 0; }
  .qual-modal__label { width: 96px; }
}

/* ==========================================================================
   扫码进店弹窗
   ========================================================================== */
.shop-qr-link { cursor: pointer; }

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qr-modal.is-open { display: flex; }
.qr-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.qr-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  padding: 30px 24px 26px;
  text-align: center;
  animation: qualPop 0.22s ease;
}
.qr-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #86909c;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s;
}
.qr-modal__close:hover { color: #1d2129; }
.qr-modal__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto;
  background: #fef3c7 center/cover no-repeat;
}
.qr-modal__title {
  margin: 12px 0 18px;
  font-size: 17px;
  font-weight: 700;
  color: #1d2129;
}
.qr-modal__img {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border: 1px solid #eef0f2;
  border-radius: 10px;
  background: #f5f7fa center/cover no-repeat;
}
.qr-modal__tip {
  margin: 16px 0 0;
  font-size: 13px;
  color: #86909c;
}

@media (max-width: 768px) {
  .qr-modal__img { width: 180px; height: 180px; }
}
