.shop-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #141415;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* ── Hero header ── */
.shop-hero {
  position: relative;
  flex-shrink: 0;
  height: clamp(140px, 36vw, 180px);
  overflow: hidden;
  border-bottom: 2px solid #B80E13;
}

.shop-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

.shop-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 8, 9, 0.35) 0%,
    rgba(8, 8, 9, 0.1) 45%,
    rgba(20, 20, 22, 0.9) 100%
  );
  pointer-events: none;
}

.shop-hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shop-hero-piece {
  position: absolute;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.shop-hero-gem--l {
  width: 34px;
  height: 34px;
  top: 18%;
  left: 14%;
  transform: rotate(-12deg);
  opacity: 0.95;
}

.shop-hero-gem--r {
  width: 30px;
  height: 30px;
  top: 14%;
  right: 12%;
  transform: rotate(14deg);
  opacity: 0.9;
}

.shop-hero-avatar--l {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  bottom: 22%;
  left: 18%;
  border: 2px solid #2B2B2D;
  background: #1C1C1E;
}

.shop-hero-avatar--c {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid #B80E13;
  background: #1C1C1E;
  z-index: 2;
}

.shop-hero-avatar--r {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  bottom: 22%;
  right: 18%;
  border: 2px solid #2B2B2D;
  background: #1C1C1E;
}

.shop-hero-frame--l {
  width: 68px;
  height: 68px;
  top: 28%;
  left: 4%;
  opacity: 0.85;
}

.shop-hero-frame--r {
  width: 64px;
  height: 64px;
  top: 26%;
  right: 4%;
  opacity: 0.85;
}

.shop-hero-title-wrap {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: rgba(20, 20, 22, 0.9);
  border: 1px solid #B80E13;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.shop-hero-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.shop-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #EDEDED;
  white-space: nowrap;
}

/* ── Content area ── */
.shop-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 12px 20px;
  background:
    linear-gradient(180deg, #18181a 0%, #141415 100%);
  overflow-y: auto;
}

.shop-tabs-wrap {
  flex-shrink: 0;
  margin-bottom: 14px;
  padding: 6px;
  border-radius: 18px;
  background: linear-gradient(180deg, #161617 0%, #0E0E0F 100%);
  border: 1.5px solid #2B2B2D;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.shop-tabs {
  display: flex;
  gap: 6px;
  overflow-x: hidden;
  padding-bottom: 2px;
}

.shop-tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 78px;
  padding: 10px 8px 12px;
  border: 2px solid #2B2B2D;
  border-radius: 14px;
  background: linear-gradient(180deg, #2B2B2D 0%, #1C1C1E 100%);
  color: #EDEDED;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s, color 0.15s;
}

.shop-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
}

.shop-tab-icon img {
  object-fit: contain;
}

.shop-tab-icon--avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.shop-tab-icon--frame img {
  width: 34px;
  height: 34px;
}

.shop-tab-icon--gem img {
  width: 30px;
  height: 30px;
}

.shop-tab-label {
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.shop-tab:hover:not(.active) {
  background: linear-gradient(180deg, #333335 0%, #232325 100%);
  border-color: #444;
  transform: translateY(-1px);
}

.shop-tab.active {
  background: linear-gradient(180deg, #c41419 0%, #8b0c10 100%);
  border-color: #e0474b;
  color: #fff;
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 0 20px rgba(184, 14, 19, 0.4),
    0 4px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.shop-tab.active .shop-tab-icon {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(224, 71, 75, 0.5);
  box-shadow:
    0 0 10px rgba(184, 14, 19, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.shop-subtabs {
  display: flex;
  gap: 8px;
  flex: 1;
}

.shop-avatar-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #232325 0%, #18181a 100%);
  border: 1px solid #2B2B2D;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.shop-avatar-filters[hidden] {
  display: none !important;
}

.shop-category-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-category-label {
  font-size: 12px;
  font-weight: 700;
  color: #ececec;
  white-space: nowrap;
}

.shop-category-select {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1.5px solid #2B2B2D;
  background: linear-gradient(180deg, #2B2B2D 0%, #1C1C1E 100%);
  color: #EDEDED;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  appearance: none;
  background-image:
    linear-gradient(180deg, #2B2B2D 0%, #1C1C1E 100%),
    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='%23A6A6A6' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, left 12px center;
  padding-left: 32px;
}

.shop-category-select:focus {
  outline: none;
  border-color: #B80E13;
  box-shadow: 0 0 0 2px rgba(184, 14, 19, 0.25);
}

.shop-category-select option {
  background: #1C1C1E;
  color: #EDEDED;
}

.shop-subtab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #2B2B2D;
  background: linear-gradient(180deg, #2B2B2D 0%, #1C1C1E 100%);
  color: #EDEDED;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.shop-subtab:hover:not(.active) {
  background: linear-gradient(180deg, #333335 0%, #232325 100%);
  border-color: #444;
}

.shop-subtab.active {
  color: #fff;
  border-color: #e0474b;
  background: linear-gradient(180deg, #c41419 0%, #8b0c10 100%);
  box-shadow:
    0 0 12px rgba(184, 14, 19, 0.3),
    0 3px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 8px;
}

.shop-catalog {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 4px 2px 10px;
  font-family: 'Iranian Sans', Tahoma, serif;
  font-size: 13px;
  color: #f0e6d8;
}

.shop-pagination[hidden] {
  display: none !important;
}

.shop-pagination button {
  min-width: 72px;
  padding: 8px 14px;
  border: 1px solid #2B2B2D;
  border-radius: 10px;
  background: #1C1C1E;
  color: #e0474b;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

.shop-pagination button:hover:not(:disabled) {
  background: #232325;
}

.shop-pagination button:disabled {
  filter: grayscale(100%);
  opacity: 0.45;
  cursor: not-allowed;
}

#shopPageLabel {
  flex: 1;
  text-align: center;
  font-weight: 600;
}

.shop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 14px;
  border: 1px solid #2B2B2D;
  background: #1C1C1E;
  cursor: pointer;
  text-align: center;
  color: #EDEDED;
  font-family: inherit;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}

.shop-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #B80E13;
  background: #232325;
}

.shop-card:disabled {
  opacity: 0.72;
  cursor: default;
}

.shop-card.is-owned {
  opacity: 1;
  cursor: pointer;
}

.shop-card.is-owned:hover {
  transform: translateY(-1px);
  border-color: #3d7a4a;
  background: #1a261c;
}

.shop-card.is-active {
  border-color: #B80E13;
  background: #2a1416;
}

.shop-card-badge.is-active-badge {
  color: #e0474b;
}

.shop-card-visual {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-card-visual img.shop-frame {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  object-fit: contain;
  pointer-events: none;
}

.shop-card-visual img.shop-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
}

.shop-card-visual img.shop-frame-only {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.shop-card-visual img.shop-gem-pack {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.shop-card-visual--emoji {
  width: 64px;
  height: 64px;
}

.shop-emoji-preview {
  width: 52px;
  height: 52px;
  display: block;
}

.shop-emoji-preview svg {
  width: 100% !important;
  height: 100% !important;
}

.shop-emoji-preview--modal {
  width: 72px;
  height: 72px;
  margin: 0 auto;
}

.shop-tab-icon--emoji {
  font-size: 22px;
  line-height: 1;
}

.shop-card-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
}

.shop-card-category {
  font-size: 10px;
  font-weight: 600;
  color: #b8c0cc;
  line-height: 1.3;
}

.shop-card-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #C9C9C9;
  font-weight: 700;
}

.shop-card-price img {
  width: 16px;
  height: 16px;
}

.shop-card-price.toman {
  color: #e0474b;
}

.shop-card-badge {
  font-size: 11px;
  color: #86efac;
  font-weight: 700;
}

.shop-empty,
.shop-loading,
.shop-error {
  text-align: center;
  color: #d0d0d0;
  padding: 32px 12px;
  grid-column: 1 / -1;
}

#shopPurchaseModal .shop-purchase-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 12px 0 18px;
}

#shopPurchaseModal .shop-purchase-visual {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#shopPurchaseModal .shop-purchase-visual img.preview-frame {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  object-fit: contain;
}

#shopPurchaseModal .shop-purchase-visual img.preview-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
}

#shopPurchaseModal .shop-purchase-visual img.preview-frame-only,
#shopPurchaseModal .shop-purchase-visual img.preview-gem {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

#shopPurchaseModal .shop-purchase-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

#shopPurchaseModal .shop-purchase-price {
  margin: 0;
  font-size: 15px;
  color: #e8e8e8;
}

.shop-purchase-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #2477c4 0%, #18558c 100%);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.shop-purchase-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.shop-purchase-msg {
  margin: 10px 0 0;
  text-align: center;
  font-size: 13px;
  color: #ffb4b4;
  min-height: 1.2em;
}

.shop-coming-soon {
  text-align: center;
  color: #c8c8c8;
  font-size: 13px;
  margin: 0 0 12px;
  flex-shrink: 0;
}

@media (max-width: 360px) {
  .shop-hero-avatar--l,
  .shop-hero-avatar--r {
    width: 44px;
    height: 44px;
  }

  .shop-hero-avatar--c {
    width: 52px;
    height: 52px;
  }

  .shop-hero-frame--l,
  .shop-hero-frame--r {
    width: 54px;
    height: 54px;
  }
}
