/**
 * ======= sanxio store-advanced service-drawer start ===========
 * 右抽屉：锁背后滚动 + 快捷格联系 + 扁平频道
 */

/* 打开时锁背后页面滚动 */
html.is-sca-drawer-open,
html.is-sca-drawer-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}
html.is-sca-drawer-open body {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

body.sx-store-advanced .sca-drawer.is-open {
  display: flex !important;
  align-items: stretch;
  justify-content: flex-end;
  padding: 10px 10px 10px 0;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(2px);
  animation: sca-drawer-fade-in 0.2s ease;
  overscroll-behavior: none;
  touch-action: none;
}
@keyframes sca-drawer-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.sx-store-advanced .sca-drawer__panel {
  position: relative;
  top: auto;
  right: auto;
  display: flex;
  flex-direction: column;
  width: min(348px, calc(100vw - 20px));
  height: auto;
  max-height: calc(100dvh - 20px);
  margin: 0;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: var(--md3-shape-lg, 16px);
  background: var(--md3-color-surface-container-low, #f3f5f9);
  box-shadow: -10px 0 36px rgba(15, 23, 42, 0.2);
  animation: sca-drawer-slide-in 0.28s cubic-bezier(0.2, 0, 0, 1);
  touch-action: manipulation;
}
@keyframes sca-drawer-slide-in {
  from { transform: translateX(108%); }
  to { transform: translateX(0); }
}

body.sx-store-advanced .sca-drawer__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sanxio-gap-sm, 8px);
  margin: 0 !important;
  padding: var(--sanxio-card-py, 16px) var(--sanxio-card-px, 16px);
  border-bottom: 1px solid var(--md3-color-outline-variant, #c3c6cf);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--md3-color-primary, #005fb8) 10%, var(--md3-color-surface, #fff)) 0%,
      var(--md3-color-surface, #fff) 48%,
      var(--md3-color-surface, #fff) 100%
    );
}
body.sx-store-advanced .sca-drawer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
body.sx-store-advanced .sca-drawer__avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--md3-shape-sm, 8px);
  overflow: hidden;
  background: var(--md3-color-surface-container-high, #e8eaed);
  color: var(--md3-color-primary, #005fb8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--md3-color-outline-variant) 55%, transparent);
}
body.sx-store-advanced .sca-drawer__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.sx-store-advanced .sca-drawer__avatar .material-symbols-outlined {
  font-size: 24px;
}
body.sx-store-advanced .sca-drawer__head-text {
  min-width: 0;
  flex: 1;
}
body.sx-store-advanced .sca-drawer__head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--md3-color-on-surface, #1a1c1e);
}
body.sx-store-advanced .sca-drawer__subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--md3-color-on-surface-variant, #43474e);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.sx-store-advanced .sca-drawer__close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: var(--md3-color-surface-container-high, #e8eaed);
  color: var(--md3-color-on-surface, #1a1c1e);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
body.sx-store-advanced .sca-drawer__close:hover,
body.sx-store-advanced .sca-drawer__close:focus-visible {
  background: color-mix(in srgb, var(--md3-color-primary) 12%, var(--md3-color-surface-container-high, #e8eaed));
  color: var(--md3-color-primary, #005fb8);
}
body.sx-store-advanced .sca-drawer__close:active {
  transform: scale(0.94);
}
body.sx-store-advanced .sca-drawer__close .material-symbols-outlined {
  font-size: 20px;
}

/* 仅 body 滚动；阻止滚动链到背后页 */
body.sx-store-advanced .sca-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: var(--sanxio-content-gap, 12px) var(--sanxio-block-px, 12px) calc(16px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

body.sx-store-advanced .sca-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sanxio-content-gap, 12px);
}
body.sx-store-advanced .sca-drawer-nav__lead {
  display: none;
}
body.sx-store-advanced .sca-drawer-nav__section {
  margin: 0;
}
body.sx-store-advanced .sca-drawer-nav__section-title {
  margin: 0 0 6px;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--md3-color-on-surface-variant, #43474e);
}

/* 联系：2 列快捷格（紧凑，去掉虚高） */
body.sx-store-advanced .sca-drawer-nav__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
body.sx-store-advanced .sca-drawer-nav__action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 0;
  padding: 8px 10px;
  border-radius: var(--md3-shape-md, 12px);
  background: var(--md3-color-surface, #fff);
  color: var(--md3-color-on-surface, #1a1c1e);
  text-decoration: none;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--md3-color-outline-variant) 40%, transparent);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
body.sx-store-advanced .sca-drawer-nav__action:hover,
body.sx-store-advanced .sca-drawer-nav__action:focus-visible {
  background: color-mix(in srgb, var(--md3-color-primary) 6%, var(--md3-color-surface));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--md3-color-primary) 12%, transparent);
}
body.sx-store-advanced .sca-drawer-nav__action:active {
  transform: scale(0.98);
}
body.sx-store-advanced .sca-drawer-nav__action--primary {
  background: color-mix(in srgb, var(--md3-color-primary, #005fb8) 10%, var(--md3-color-surface, #fff));
}
body.sx-store-advanced .sca-drawer-nav__action--primary .sca-drawer-nav__action-icon {
  background: var(--md3-color-primary, #005fb8);
  color: var(--md3-color-on-primary, #fff);
}
body.sx-store-advanced .sca-drawer-nav__action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--md3-color-primary, #005fb8) 12%, transparent);
  color: var(--md3-color-primary, #005fb8);
}
body.sx-store-advanced .sca-drawer-nav__action-icon .material-symbols-outlined {
  font-size: 16px;
  color: inherit;
}
body.sx-store-advanced .sca-drawer-nav__action-label {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

/* 频道：单层白底列表 */
body.sx-store-advanced .sca-drawer-nav__list {
  list-style: none;
  margin: 0;
  padding: 2px;
  background: var(--md3-color-surface, #fff);
  border-radius: var(--md3-shape-md, 12px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--md3-color-outline-variant) 40%, transparent);
}
body.sx-store-advanced .sca-drawer-nav__list li {
  margin: 0;
}
body.sx-store-advanced .sca-drawer-nav__list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border: none;
  border-radius: var(--md3-shape-sm, 8px);
  background: transparent;
  color: var(--md3-color-on-surface, #1a1c1e);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  transition: background 0.15s ease;
}
body.sx-store-advanced .sca-drawer-nav__list a:hover,
body.sx-store-advanced .sca-drawer-nav__list a:focus-visible {
  background: var(--md3-color-surface-container-low, #f3f5f9);
}
body.sx-store-advanced .sca-drawer-nav__list a:active {
  background: color-mix(in srgb, var(--md3-color-primary) 8%, var(--md3-color-surface));
}
body.sx-store-advanced .sca-drawer-nav__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--md3-color-surface-container-high, #e8eaed);
  color: var(--md3-color-on-surface, #1a1c1e);
}
body.sx-store-advanced .sca-drawer-nav__icon .material-symbols-outlined {
  font-size: 18px;
  color: inherit;
}
body.sx-store-advanced .sca-drawer-nav__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.sx-store-advanced .sca-drawer-nav__chev {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--md3-color-outline, #747775);
  opacity: 0.75;
}

@media (max-width: 767px) {
  body.sx-store-advanced .sca-drawer.is-open {
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)) 0;
  }
  body.sx-store-advanced .sca-drawer__panel {
    width: min(328px, calc(100vw - 16px));
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom, 0px));
    border-radius: 16px 0 0 16px;
  }
  body.sx-store-advanced .sca-drawer__head {
    padding: var(--sanxio-card-py, 12px) var(--sanxio-card-px, 12px);
  }
}

/**
 * ======= sanxio store-advanced service-drawer end ===========
 */
