/* ═══════════════════════════════════════════════════════════════
   SHOP UI v2 — Full-Screen Tàng Kinh Các
   Override drawer-modal → full-screen immersive xianxia experience
   ═══════════════════════════════════════════════════════════════ */

/* ── OVERRIDE: Backdrop ── */
#shop-backdrop.drawer-backdrop {
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: var(--z-modal);
}

/* ── OVERRIDE: Modal → Full-Screen ── */
#shopModal.drawer-modal.shop-fs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  border-radius: 0;
  border: none;
  border-left: none;
  box-shadow: none;
  background: #0c0c18;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98);
  will-change: opacity, transform;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
#shopModal.drawer-modal.shop-fs.open {
  right: 0;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* Override desktop centered modal từ base.css */
@media (min-width: 992px) {
  #shopModal.drawer-modal.shop-fs,
  #shopModal.drawer-modal.shop-fs.open {
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  #shopModal.drawer-modal.shop-fs {
    transform: scale(0.98);
    opacity: 0;
  }
  #shopModal.drawer-modal.shop-fs.open {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── HEADER BAR ── */
.shop-fs-header {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(20,20,25,0.98), rgba(15,15,18,0.95));
  border-bottom: 1px solid rgba(255,215,0,0.15);
  flex-shrink: 0;
  gap: 16px;
  z-index: 2;
}
.shop-fs-title {
  font-family: "Zhi Mang Xing", cursive;
  font-size: 1.8rem;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255,215,0,0.3);
  white-space: nowrap;
  margin: 0;
}
/* ── SEARCH BAR ── */
.shop-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 300px;
  flex-shrink: 1;
  margin: 0 12px 0 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  overflow: visible;
  transition: border-color .2s;
}
.shop-search-wrap:focus-within { border-color: rgba(197,162,39,0.5); }

/* Nút chọn loại vật phẩm */
.shop-cat-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 7px 8px 7px 12px;
  background: none;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px 0 0 22px;
  color: rgba(255,215,0,0.55);
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.shop-cat-btn:hover { color: #ffd700; background: rgba(255,215,0,0.05); }
.shop-cat-btn.open { color: #ffd700; }
.shop-cat-label { font-weight: 600; font-size: 0.72rem; }
.shop-cat-caret { font-size: 0.55rem; opacity: 0.6; transition: transform .2s; }
.shop-cat-btn.open .shop-cat-caret { transform: rotate(180deg); }

/* Dropdown danh sách loại */
.shop-cat-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 176px;
  background: #171525;
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 12px;
  padding: 6px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  display: none;
  flex-direction: column;
  gap: 2px;
}
.shop-cat-dropdown.open { display: flex; }
.shop-cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #bbb;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.shop-cat-item:hover { background: rgba(255,215,0,0.08); color: #ffd700; }
.shop-cat-item.active { background: rgba(255,215,0,0.12); color: #ffd700; }
.cat-i { font-size: 1rem; width: 22px; text-align: center; }

/* Search icon — flex item */
.shop-search-icon {
  flex-shrink: 0;
  padding: 0 5px 0 10px;
  color: rgba(255,255,255,0.3);
  font-size: 0.72rem;
  pointer-events: none;
}

/* Input — không có border/bg riêng (wrap đã xử lý) */
.shop-search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 7px 28px 7px 0;
  color: #e8e0c8;
  font-size: 0.81rem;
  font-family: inherit;
  outline: none;
}
.shop-search-input::placeholder { color: rgba(255,255,255,0.28); font-style: italic; }

/* Nút xóa tìm kiếm */
.shop-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  font-size: 0.65rem;
  padding: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 50%;
  transition: color .15s;
}
.shop-search-clear.vis { display: flex; }
.shop-search-clear:hover { color: rgba(255,80,80,0.9); }

/* Autocomplete dropdown (gắn vào body, position: fixed) */
.shop-autocomplete {
  position: fixed;
  background: #171525;
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 12px;
  padding: 6px;
  z-index: 10001;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.shop-autocomplete.open { display: block; }
.shop-ac-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #ccc;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .12s, color .12s;
}
.shop-ac-item:hover { background: rgba(255,215,0,0.08); color: #ffd700; }
.shop-ac-item.best-match { color: #e0c870; font-weight: 600; }

@media (max-width: 600px) {
  .shop-search-wrap { width: 170px; margin: 0 6px; }
  .shop-cat-label { display: none; }
  .shop-cat-btn { padding: 6px 6px 6px 8px; }
  .shop-search-input { padding: 6px 26px 6px 0; font-size: 0.75rem; }
}
@media (max-width: 380px) {
  .shop-search-wrap { width: 110px; }
  .shop-search-input::placeholder { opacity: 0; }
  .shop-cat-caret { display: none; }
}
/* No-results placeholder for search */
.shop-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: #554a6a;
}
.shop-no-results .no-res-icon { font-size: 1.6rem; margin-bottom: 0.4rem; }
.shop-no-results p { margin: 3px 0; font-size: 0.83rem; }

.shop-fs-wallet {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(79,195,247,0.25);
  border-radius: 24px;
  padding: 6px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #4fc3f7;
  white-space: nowrap;
}
.shop-fs-wallet i { font-size: 1rem; }
.shop-fs-close {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.shop-fs-close:hover {
  color: #ff5252;
  border-color: #ff5252;
  transform: rotate(90deg);
}

/* ── MAIN LAYOUT: Sidebar + Content ── */
.shop-fs-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── SIDEBAR NAV ── */
.shop-fs-sidebar {
  width: 80px;
  background: rgba(15,15,20,0.95);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  overflow-y: auto;
  flex-shrink: 0;
}
.shop-fs-sidebar::-webkit-scrollbar { width: 0; }

.shop-fs-sidebar .shop-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  margin: 2px 6px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #777;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  position: relative;
  font-size: inherit;
}
.shop-fs-sidebar .shop-tab-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #ccc;
}
.shop-fs-sidebar .shop-tab-btn.active {
  background: rgba(255,215,0,0.08);
  color: #ffd700;
  border-bottom: none;
}
.shop-fs-sidebar .shop-tab-btn.active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: #ffd700;
  border-radius: 0 3px 3px 0;
}

.tab-icon { font-size: 1.3rem; line-height: 1; }
.tab-text { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.2px; text-align: center; line-height: 1.2; }

/* ── TABLET SIDEBAR (collapsed) ── */
@media (min-width: 769px) and (max-width: 991px) {
  .shop-fs-sidebar { width: 64px; }
  .tab-text { display: none; }
  .tab-icon { font-size: 1.5rem; }
  .shop-fs-sidebar .shop-tab-btn { padding: 12px 4px; }
}

/* ── CONTENT AREA ── */
.shop-fs-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Override gamification.css drawer-body */
#shopModal.shop-fs .drawer-body { display: none !important; }
#shopModal.shop-fs > .drawer-header,
#shopModal.shop-fs > .drawer-body { display: none !important; }

/* Override grid container để scroll đúng */
.shop-fs-content > .shop-grid-container {
  max-height: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: transparent;
  border-radius: 0;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
}

.shop-fs-content > .shop-list-container {
  max-height: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: transparent;
  border-radius: 0;
}

/* Visibility overrides — shop-content inside shop-fs-content */
.shop-fs-content > .shop-content {
  display: none;
}
.shop-fs-content > .shop-content.active {
  display: block;
  flex: 1;
  min-height: 0;
}
.shop-fs-content > .shop-content.shop-grid-container { display: none !important; }
.shop-fs-content > .shop-content.shop-grid-container.active { display: grid !important; flex: 1; min-height: 0; }
.shop-fs-content > .shop-content.shop-list-container { display: none !important; }
.shop-fs-content > .shop-content.shop-list-container.active { display: flex !important; flex: 1; min-height: 0; }
/* [v8.62] Tab paginated — CSS kiểm soát visibility, không dùng inline style */
.shop-fs-content > .shop-content.tab-paginated { display: none !important; }
.shop-fs-content > .shop-content.tab-paginated.active { display: flex !important; flex-direction: column; overflow: hidden; padding: 0; flex: 1; min-height: 0; }

/* ── ITEM CARD ENHANCEMENTS ── */
.shop-fs-content .xianxia-item-card {
  background: #0a0a12;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  content-visibility: auto;
  contain-intrinsic-size: 200px;
  position: relative;
}
.shop-fs-content .xianxia-item-card:hover {
  border-color: rgba(255,215,0,0.3);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  transform: translateY(-3px);
}
/* Override gamification.css filter — white drop-shadow tạo white glow outline hình chữ nhật
   + tạo compositing layer riêng ngăn mix-blend-mode hoạt động đúng */
.shop-fs-content .item-img-wrapper img,
.shop-fs-content .item-img-wrapper video {
  filter: none;
  mix-blend-mode: screen;
}

/* ── "XEM LỚN" Zoom Button (HH3D Pattern) ── */
.shop-zoom-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #fff;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 5;
}
.xianxia-item-card:hover .shop-zoom-btn { opacity: 1; }
/* Preview panel zoom button luôn hiển thị (không cần hover như card) */
.preview-zoom-btn { opacity: 1 !important; }
.shop-zoom-btn:hover { background: rgba(255,215,0,0.25); border-color: #ffd700; color: #ffd700; }

/* ── LIGHTBOX OVERLAY ── */
.shop-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-top);
  background: rgba(0,0,0,0.92);
  display: none; /* Mặc định ẩn — chỉ hiện khi có class .open */
  align-items: center;
  justify-content: center;
}
.shop-lightbox.open {
  display: flex;
  animation: lbFadeIn 0.2s ease;
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.shop-lightbox-inner {
  position: relative;
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-lightbox-inner video,
.shop-lightbox-inner img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
}
.shop-lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.shop-lightbox-close:hover { background: rgba(255,82,82,0.3); border-color: #ff5252; color: #ff5252; }
.shop-lightbox-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.4);
  font-size: 0.8rem;
}
.shop-lightbox.frame-mode {
  background: rgba(0,0,0,0.92);
}

/* Composite avatar+frame trong lightbox frame-mode */
/* [v9.56] 180px layout = cùng tính toán với preview 180px → proportional nhất quán
   CSS scale(1.56) = phóng to visually lên 281px mà không thay đổi offsetWidth */
.frame-lb-composite {
  position: relative;
  width: 180px;
  height: 180px;
  isolation: isolate;
  overflow: visible;
  transform: scale(1.56);
  transform-origin: center center;
}
/* Ngăn .shop-lightbox-inner img/video CSS áp max-width/object-fit vào frame art bên trong */
.frame-lb-composite img,
.frame-lb-composite video {
  max-width: none;
  max-height: none;
}
.frame-lb-avatar-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background-color: rgba(0,0,0,0.2); /* [v9.51] subtle bg — không lòi nền đen khi frame có gap */
}
/* [v9.51] Avatar lấp đầy mask — không scale down, frame ring art tạo boundary tròn */
.frame-lb-avatar-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.frame-lb-overlay {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}
.frame-lb-overlay img,
.frame-lb-overlay video {
  background: transparent;
  display: block;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   AVATAR FRAME TAB — 3-Layer Overlay: Preview + Grid
   ═══════════════════════════════════════════════════════════════
   Nguyên lý 3-Layer:
   Container (relative) → Avatar (absolute center, 75%) → Frame (absolute inset:0, 100%)
   Frame luôn vừa khít mọi kích thước, không bóp méo.
   ═══════════════════════════════════════════════════════════════ */

#shop-avatar_frame.active {
  display: flex !important;
  flex-direction: row;
  overflow: visible; /* frame overlay cần tràn ra ngoài wrap — clip chỉ ở frame-right-col */
  flex: 1;
  min-height: 0;
}

/* Preview Panel (bên trái) */
.frame-preview-panel {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: linear-gradient(180deg, rgba(20,18,30,0.9), rgba(12,10,20,0.95));
  border-right: 1px solid rgba(255,215,0,0.1);
  gap: 16px;
}

.frame-preview-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  overflow: visible; /* ring art phép tràn ra ngoài 180px */
  /* [v9.49] Xóa border-radius + background khỏi wrap: border-radius + isolation:isolate clip overflow ring art trong Chrome */
  isolation: isolate; /* stacking context cho mix-blend-mode */
}

/* [v9.51] Avatar lấp đầy 100% container — KHÔNG thu nhỏ, frame ring art tạo boundary tròn */
.frame-preview-wrap .avatar-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background-color: rgba(0,0,0,0.2); /* [v9.51] subtle bg — HH3D style #00000033, không lòi nền đen */
}

/* [v9.51] Avatar = full container, frame ring art bao quanh và clip visual */
.frame-preview-avatar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* [RCA v2] overlayEl là passthrough — JS set absolute px trực tiếp lên mediaEl */
.frame-preview-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
/* [v8.94] blendMode=screen cho mọi frame — JS inject inline, xóa pixel đen baked-in */
.frame-preview-overlay video,
.frame-preview-overlay img {
  /* position/width/height/left/top: JS set theo absolute px */
  background: transparent;
  display: block;
  pointer-events: none;
}

.frame-preview-label {
  text-align: center;
  color: #ccc;
  font-size: 0.85rem;
  min-height: 20px;
}
.frame-preview-label strong {
  color: #ffd700;
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}
.frame-preview-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 200px;
}
.frame-preview-actions .btn-buy-item {
  border-radius: 10px;
  padding: 10px 16px;
}
.frame-preview-hint {
  color: #666;
  font-size: 0.75rem;
  text-align: center;
  font-style: italic;
}
/* [v9.49] margin-top bù cho ring art tràn ~48px bên dưới wrap 180px */
.frame-preview-info-mobile {
  margin-top: 48px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Frame Items Grid (bên phải — chứa trong column wrapper) */
#shop-avatar_frame .frame-right-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.frame-items-grid {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 12px 20px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 14px;
  align-content: start;
}
.frame-items-grid::-webkit-scrollbar { width: 6px; }
.frame-items-grid::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.3); border-radius: 3px; }

/* Frame Card */
.frame-card {
  background: #0a0a12;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  /* [v9.55] content-visibility:auto đã xóa — pagination 24 card/trang = không cần,
     và có thể ngăn APNG animation restart khi card vào viewport */
}
.frame-card:hover {
  border-color: rgba(255,215,0,0.3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}
.frame-card.frame-selected {
  border-color: #ffd700;
  box-shadow: 0 0 18px rgba(255,215,0,0.18);
  background: linear-gradient(145deg, #1a1820, #252330);
}
.frame-card.frame-owned::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  background: #4caf50;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
/* BUG-3: equipped = golden ring glow, không dùng badge text */
.frame-card.frame-equipped {
  border-color: #ffd700;
  box-shadow: 0 0 0 2px #ffd700, 0 0 18px rgba(255,215,0,0.35);
}
.frame-card.frame-equipped .frame-card-media {
  /* box-shadow xóa — tránh "khung vuông phát sáng" chồng lên frame art */
}

/* ── Frame Card Media — thumbnail preview (frame asset only, no avatar) ── */
.frame-card-media {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 8px;
  background: transparent; /* [v8.65] bỏ radial-gradient tím → không còn "vòng đen tím" */
  /* border-radius và overflow:hidden đã xóa → frame art hiển thị đầy đủ, không bị clip tròn */
}
.frame-card-media video,
.frame-card-media img:not(.frame-card-avatar) {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  z-index: 2;
  display: block;
  background: transparent;
}

.frame-card-name {
  font-size: 0.8rem;
  color: #ddd;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.frame-card-price {
  font-size: 0.8rem;
  color: #4fc3f7;
  font-weight: 700;
}
.frame-card-price i { font-size: 0.7rem; }

.frame-card-btn {
  margin-top: 8px;
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 6px;
  background: rgba(255,215,0,0.08);
  color: #ffd700;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.frame-card-btn:hover { background: rgba(255,215,0,0.18); border-color: #ffd700; }
.frame-card-btn.btn-owned { border-color: rgba(76,175,80,0.3); background: rgba(76,175,80,0.08); color: #81c784; cursor: default; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .shop-fs-main { flex-direction: column; }
  .shop-fs-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 8px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .shop-fs-sidebar .shop-tab-btn {
    flex-direction: column;
    margin: 0 2px;
    padding: 6px 8px;
    min-width: 56px;
    flex-shrink: 0;
  }
  .shop-fs-sidebar .shop-tab-btn.active::before { display: none; }
  .shop-fs-sidebar .shop-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: #ffd700;
    border-radius: 2px;
  }
  .tab-icon { font-size: 1.1rem; }
  .tab-text { font-size: 0.55rem; }

  .shop-fs-header { padding: 10px 14px; gap: 10px; }
  .shop-fs-title { font-size: 1.3rem; }
  .shop-fs-wallet { padding: 4px 10px; font-size: 0.8rem; }
  .shop-fs-close { width: 34px; height: 34px; }

  .shop-fs-content > .shop-grid-container {
    padding: 12px;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .shop-fs-content > .shop-list-container { padding: 12px; }

  /* Avatar Frame — vertical on mobile */
  #shop-avatar_frame.active { flex-direction: column; }
  .frame-preview-panel {
    width: 100%;
    flex-direction: column;      /* wrap trên, info dưới — tránh lệch tâm khi frame tràn ngang */
    align-items: center;         /* center wrap theo trục ngang */
    padding: 80px 14px 16px;     /* 80px top → frame extension (~82px) không bị clip */
    border-right: none;
    border-bottom: 1px solid rgba(255,215,0,0.1);
    gap: 12px;
    justify-content: flex-start;
  }
  .frame-preview-wrap { width: 110px; height: 110px; }
  .frame-preview-info-mobile {
    flex: unset;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 22px; /* ring extension cho wrap 110px (~30px) */
  }
  .frame-preview-label { text-align: center; }
  .frame-preview-actions { max-width: none; width: 100%; }
  .frame-preview-hint { text-align: center; }
  .frame-items-grid {
    padding: 12px;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }
  .frame-card-media { width: 75px; height: 75px; }
}

@media (max-width: 420px) {
  .shop-fs-content > .shop-grid-container { grid-template-columns: repeat(2, 1fr); }
  .frame-items-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   [v8.60] PAGINATION CONTROLS — phân trang 24 items/trang
   ═══════════════════════════════════════════════════════════════ */

/* ── Generic tab pagination wrapper ── */
.shop-tab-paged-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.shop-tab-count-bar {
  padding: 10px 20px 4px;
  flex-shrink: 0;
}
/* Inner grid dùng lại layout shop-fs-content > shop-grid-container */
.shop-fs-content-inner-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 20px 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
  align-content: start;
}
.shop-fs-content-inner-grid::-webkit-scrollbar { width: 6px; }
.shop-fs-content-inner-grid::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.3); border-radius: 3px; }
@media (max-width: 768px) {
  .shop-fs-content-inner-grid {
    padding: 10px 12px 8px;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .shop-tab-count-bar { padding: 8px 12px 2px; }
}
@media (max-width: 420px) {
  .shop-fs-content-inner-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Grid header — đếm số khung */
.frame-grid-header {
  padding: 12px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.frame-grid-count {
  color: #888;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Pagination bar */
.frame-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px 18px;
  flex-shrink: 0;
}

/* Prev / Next buttons */
.frame-page-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.frame-page-btn:hover:not(:disabled) {
  background: rgba(255,215,0,0.12);
  border-color: #ffd700;
  transform: scale(1.05);
}
.frame-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Page number container */
.frame-page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Individual page number buttons */
.frame-page-num {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.frame-page-num:hover {
  background: rgba(255,215,0,0.08);
  border-color: rgba(255,215,0,0.3);
  color: #ffd700;
}
.frame-page-num.active {
  background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,170,0,0.15));
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 12px rgba(255,215,0,0.15);
  cursor: default;
}

/* Ellipsis dots */
.frame-page-dots {
  color: #666;
  font-size: 0.9rem;
  padding: 0 4px;
  user-select: none;
}

/* ── Wallet Flash + Currency Delta Animation (Phase 4) ── */
@keyframes walletFlash {
  0%   { transform: scale(1);    color: inherit; }
  25%  { transform: scale(1.25); color: #4fc3f7; }
  50%  { transform: scale(1.1);  color: #fff;    }
  100% { transform: scale(1);    color: inherit; }
}
.wallet-flash {
  animation: walletFlash 0.5s ease-out;
}

@keyframes currencyDeltaFloat {
  0%   { opacity: 1; transform: translateY(0)   scale(1); }
  80%  { opacity: 1; transform: translateY(-28px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-40px) scale(0.9); }
}
.shop-currency-delta {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  animation: currencyDeltaFloat 1.2s ease-out forwards;
  z-index: 9999;
}
.shop-currency-delta.gain { color: #69f0ae; }
.shop-currency-delta.loss { color: #ff6b6b; }

/* ── Responsive pagination (shared: avatar_frame + generic tabs) ── */
@media (max-width: 768px) {
  .frame-grid-header { padding: 8px 12px 0; }
  .frame-pagination { padding: 10px 12px 14px; gap: 4px; }
  .frame-page-btn { width: 32px; height: 32px; font-size: 0.8rem; }
  .frame-page-num { min-width: 32px; height: 32px; font-size: 0.8rem; }
}
