/* Shared Store / Backpack presentation. Purchase and inventory logic stay in their components. */
#mall.tikco-shop-theme {
  --shop-ink: #382032;
  --shop-muted: #8a687d;
  --shop-pink: #f62ba7;
  --shop-coral: #ff667b;
  --shop-line: rgba(171, 102, 145, 0.18);
  --shop-brand-gradient: linear-gradient(105deg, #ff667b 0%, #f62ba7 50%, #ff9890 100%);
  --shop-header-gradient: linear-gradient(90deg, #ffe4e8 0%, #fde2f0 50%, #ffebe9 100%);
  --shop-screen-gradient: var(--shop-header-gradient);
  --shop-safe-bottom: env(safe-area-inset-bottom, 0px);
  min-height: 100vh;
  box-sizing: border-box;
  padding-bottom: calc(72px + var(--shop-safe-bottom));
  color: var(--shop-ink);
  background: var(--shop-screen-gradient);
  background-attachment: fixed;
}

/* Android already reserves navigation/keyboard space outside this WebView. */
html.tikco-android-inset-owned #mall.tikco-shop-theme {
  --shop-safe-bottom: 0px;
}

#mall.tikco-backpack {
  padding-bottom: calc(16px + var(--shop-safe-bottom));
}

#mall.tikco-shop-theme .store-navbar .van-nav-bar,
#mall.tikco-shop-theme .store-navbar.van-nav-bar {
  background: var(--shop-screen-gradient);
  box-shadow: none;
}

#mall.tikco-shop-theme .van-nav-bar__title {
  color: var(--shop-ink);
  font-size: 18px;
  font-weight: 650;
}

#mall.tikco-shop-theme .van-nav-bar .van-icon {
  color: var(--shop-ink);
}

#mall.tikco-shop-theme .category-tabs,
#mall.tikco-shop-theme .category-tabs .van-tabs__nav,
#mall.tikco-shop-theme .sub-tabs {
  background: transparent;
}

#mall.tikco-shop-theme .category-tabs {
  padding: 8px 0 5px;
}

#mall.tikco-shop-theme .category-tabs > .van-tabs {
  flex: 1 1 0%;
  min-width: 0;
  width: 0;
}

#mall.tikco-shop-theme .category-tabs .van-tabs__wrap {
  height: auto !important;
  padding-top: 0;
}

#mall.tikco-shop-theme .category-tabs .van-tab {
  flex: 0 0 auto;
  min-width: max-content;
  max-width: none;
  width: auto;
  padding: 4px 10px 7px;
  overflow: visible;
  color: var(--shop-muted) !important;
}

#mall.tikco-backpack .category-tabs .van-tabs__nav .van-tab:last-child {
  flex-basis: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  width: auto !important;
}

#mall.tikco-shop-theme .tab-title-wrapper {
  width: max-content;
  min-width: 52px;
  gap: 6px;
}

#mall.tikco-shop-theme .tab-icon {
  display: block;
  width: clamp(44px, 12.4vw, 58px);
  height: clamp(44px, 12.4vw, 58px);
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 32%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 12px rgba(177, 76, 126, 0.05);
}

#mall.tikco-shop-theme .van-tab--active .tab-icon {
  border-color: rgba(255, 255, 255, 0.7);
  background: var(--shop-brand-gradient);
  box-shadow: 0 4px 12px rgba(246, 43, 167, 0.18);
}

#mall.tikco-shop-theme .tab-text {
  max-width: none;
  color: inherit;
  font-size: clamp(11px, 3.15vw, 14px);
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  text-align: center;
}

#mall.tikco-shop-theme .category-tabs .van-tab__text,
#mall.tikco-shop-theme .category-tabs .van-tab__text--ellipsis {
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

#mall.tikco-shop-theme .van-tab--active .tab-text {
  color: var(--shop-ink);
  font-weight: 650;
}

#mall.tikco-shop-theme .menu-btn {
  position: static;
  flex: 0 0 44px;
  align-self: flex-start;
  box-sizing: border-box;
  height: 64px;
  width: 44px;
  padding: 0;
  transform: none;
  background: transparent;
}

#mall.tikco-shop-theme .menu-btn .van-icon {
  color: var(--shop-ink) !important;
}

#mall.tikco-shop-theme .sub-tabs {
  padding: 5px 14px 13px;
}

#mall.tikco-shop-theme .sub-tab-button {
  padding: 7px 15px;
  border: 1px solid rgba(229, 182, 208, 0.5);
  background: rgba(255, 255, 255, 0.62);
  color: var(--shop-muted);
  font-size: 12px;
}

#mall.tikco-shop-theme .sub-tab-button.active {
  border-color: transparent;
  background: var(--shop-brand-gradient);
  color: #fff;
  box-shadow: 0 3px 9px rgba(246, 43, 167, 0.12);
}

#mall.tikco-shop-theme .content-area {
  padding: 4px 14px 16px;
}

#mall.tikco-shop-theme .section-block {
  margin-bottom: 24px;
}

#mall.tikco-shop-theme .section-block:last-child {
  margin-bottom: 0;
}

#mall.tikco-store .content-area {
  padding-bottom: 0;
}

#mall.tikco-shop-theme .section-block-top {
  margin-top: 14px;
}

#mall.tikco-shop-theme .section-header {
  padding: 0;
  margin-bottom: 12px;
}

#mall.tikco-shop-theme .section-title {
  color: var(--shop-ink);
  font-size: 15px;
}

#mall.tikco-shop-theme .section-more {
  color: #c32d82;
  font-size: 12px;
}

#mall.tikco-shop-theme .product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 24px;
  align-items: start;
}

#mall.tikco-shop-theme .product-item {
  min-width: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

#mall.tikco-shop-theme .product-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
  padding: 7px;
  overflow: hidden;
  border: 1px solid var(--shop-line);
  border-radius: clamp(13px, 4vw, 20px);
  background: linear-gradient(140deg, #f2e6fb 0, #fff0e2 56%, #fffdfd 90%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 6px rgba(108, 43, 78, 0.025);
}

#mall.tikco-shop-theme .product-image > img:not(.lucky-bg):not(.lucky-ssr),
#mall.tikco-shop-theme .product-image > .avatar-frame-image,
#mall.tikco-shop-theme .product-image > .svga-container {
  position: absolute;
  inset: 7px;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  max-width: none;
  max-height: none;
  object-fit: contain;
}

#mall.tikco-shop-theme .avatar-frame-image .user-avatar {
  position: absolute;
  top: 47%;
  left: 50%;
  width: 64%;
  height: 64%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
}

#mall.tikco-shop-theme .avatar-frame-overlay,
#mall.tikco-shop-theme .avatar-frame-image .svga-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  z-index: 2;
}

#mall.tikco-shop-theme .product-image .svga-container canvas {
  display: block;
  /* SVGA applies its own AspectFit matrix using intrinsic canvas dimensions. */
  width: auto !important;
  height: auto !important;
  max-width: none;
  max-height: none;
}

#mall.tikco-shop-theme .product-info {
  min-width: 0;
  padding: 6px 0 0;
  background: transparent;
}

#mall.tikco-shop-theme .product-name {
  margin: 0 0 5px;
  color: var(--shop-ink);
  font-size: clamp(12px, 3.25vw, 15px);
  font-weight: 550;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#mall.tikco-shop-theme .product-price {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 20px;
  color: #ce257e;
  font-size: clamp(12px, 3.4vw, 15px);
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

#mall.tikco-shop-theme .product-price img {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  object-fit: contain;
}

#mall.tikco-shop-theme .product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  min-height: 16px;
}

#mall.tikco-shop-theme .product-kind,
#mall.tikco-shop-theme .product-duration {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  padding: 2px 3px;
  border: 1px solid rgba(197, 156, 181, 0.16);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  color: #826474;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

#mall.tikco-shop-theme .bottom-bar {
  box-sizing: border-box;
  padding: 8px 15px calc(8px + var(--shop-safe-bottom));
  border-top: 0;
  background: var(--shop-screen-gradient);
  box-shadow: none;
}

#mall.tikco-shop-theme .detail-popup,
#mall.tikco-shop-theme .category-panel {
  background: var(--shop-screen-gradient);
}

#mall.tikco-shop-theme .detail-preview,
#mall.tikco-shop-theme .detail-info,
#mall.tikco-shop-theme .detail-footer,
#mall.tikco-shop-theme .info-card,
#mall.tikco-shop-theme .popup-header {
  background: transparent;
}

#mall.tikco-shop-theme .preview-image {
  height: auto;
  min-height: min(60vw, 240px);
  padding: 10px 0 16px;
}

#mall.tikco-shop-theme .preview-image > .avatar-frame-image,
#mall.tikco-shop-theme .preview-image > .svga-container-detail {
  position: relative;
  width: min(60vw, 240px);
  height: min(60vw, 240px);
  flex: 0 0 auto;
}

#mall.tikco-shop-theme .preview-image > img {
  width: min(60vw, 240px);
  height: min(60vw, 240px);
  max-width: 100%;
  max-height: none;
  object-fit: contain;
}

#mall.tikco-shop-theme .preview-image .avatar-frame-image .svga-container-detail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#mall.tikco-shop-theme .preview-image .avatar-frame-overlay {
  max-width: 100%;
  max-height: 100%;
}

#mall.tikco-shop-theme .preview-image .user-avatar1 {
  position: absolute;
  top: 47%;
  left: 50%;
  width: 64%;
  height: 64%;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
}

#mall.tikco-shop-theme .svga-container-detail {
  z-index: 2;
}

#mall.tikco-shop-theme .cart-btn,
#mall.tikco-shop-theme .buy-btn {
  border: 0;
  background: var(--shop-brand-gradient);
}

#mall.tikco-backpack .product-due-date {
  margin-top: 7px;
  color: var(--shop-muted);
  font-size: 10px;
  line-height: 1.4;
}

#mall.tikco-backpack .product-price {
  min-height: 17px;
  color: #78566b;
  font-size: clamp(10px, 2.7vw, 12px);
  font-weight: 500;
  overflow-wrap: anywhere;
}

#mall.tikco-backpack .wear-button {
  box-sizing: border-box;
  width: 100%;
  margin-top: 9px;
  padding: 7px 4px;
  border-radius: 20px;
  font-size: 11px;
  line-height: 1.3;
}

#mall.tikco-backpack .wear-button.status-on {
  background: var(--shop-brand-gradient);
}

#mall.tikco-backpack .wear-button.status-off {
  border: 1px solid #ecc5dc;
  background: #f8e7f1;
  color: #9c4277;
}

@supports not (aspect-ratio: 1 / 1) {
  #mall.tikco-shop-theme .product-image {
    height: calc((100vw - 48px) / 3);
  }
}

@media (min-width: 600px) {
  #mall.tikco-shop-theme .content-area {
    padding-right: 24px;
    padding-left: 24px;
  }

  #mall.tikco-shop-theme .product-grid {
    column-gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mall.tikco-shop-theme .product-item,
  #mall.tikco-shop-theme .sub-tab-button,
  #mall.tikco-shop-theme .wear-button {
    transition: none;
  }
}
