/* ════════════════════════════════════════════
   SHOP PAGE CSS – AionEvolution
════════════════════════════════════════════ */

/* ── Layout ── */
.shop-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 70px);
  padding-top: 70px;
  max-width: 1400px;
  margin: 0 auto;
  gap: 0;
}

/* ── Sidebar ── */
.shop-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 28px 14px 28px;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.shop-sidebar-title {
  font-family: 'Oxanium', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.shop-cat-list { list-style: none; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.shop-cat-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.25s ease;
}
.shop-cat-item:hover  { background: rgba(212,175,55,0.07); color: var(--text); }
.shop-cat-item.active { background: rgba(212,175,55,0.11); color: var(--gold); border: 1px solid var(--border); }
.shop-cat-item i      { width: 18px; text-align: center; }

/* Balance box */
.shop-sidebar-balance {
  margin-top: 24px;
  padding: 18px;
  background: rgba(212,175,55,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.ssb-label  { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.ssb-amount { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ssb-amount span { font-family: 'Oxanium', sans-serif; font-size: 22px; font-weight: 800; color: var(--gold); }
.ssb-unit   { font-size: 11px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }

/* Nav toll display */
.shop-toll-display {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: rgba(212,175,55,0.08);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Oxanium', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}

/* ── Main area ── */
.shop-main {
  padding: 32px 32px;
  overflow-y: auto;
}

.shop-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.shop-page-title {
  font-family: 'Oxanium', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}
.shop-page-title i { color: var(--gold); }

.shop-guest-note {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-guest-note i { color: var(--blue-light); }
.shop-guest-note a { color: var(--gold); }

.shop-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}
.shop-empty i  { font-size: 48px; opacity: 0.2; display: block; margin-bottom: 16px; }
.shop-empty p  { font-size: 15px; }

/* ── Items grid ── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* ── Item card ── */
.shop-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.shop-card:hover {
  transform: translateY(-5px);
  border-color: rgba(212,175,55,0.4);
  box-shadow: 0 12px 36px rgba(0,0,0,0.4), 0 0 20px rgba(212,175,55,0.08);
}
.shop-card-featured {
  border-color: rgba(212,175,55,0.3);
  background: rgba(212,175,55,0.04);
}

/* Hot / sale badges */
.shop-card-hot {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px;
}
.shop-card-sale {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  font-size: 9px; font-weight: 800;
  padding: 3px 8px; border-radius: 20px;
}

/* Item icon area */
.shop-card-icon {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}
.shop-item-img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}
.shop-item-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--text-dim); opacity: 0.2;
}

/* Card body */
.shop-card-info  { padding: 7px 10px 0; flex: 1; }
.shop-card-name  {
  font-family: 'Oxanium', sans-serif;
  font-size: 12px; font-weight: 700; color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-card-count {
  font-size: 10px; color: var(--gold); margin-top: 3px; font-weight: 600;
}

/* Card footer: price + buy */
.shop-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 10px;
  gap: 5px;
  flex-wrap: wrap;
}
.shop-card-price { display: flex; flex-direction: column; }
.shop-price-old  { font-size: 10px; color: var(--text-dim); text-decoration: line-through; }
.shop-price-cur  {
  font-family: 'Oxanium', sans-serif;
  font-size: 13px; font-weight: 800; color: var(--gold);
  display: flex; align-items: center; gap: 3px;
}

.shop-buy-btn {
  padding: 5px 10px; font-size: 10px; letter-spacing: 1px;
  background: linear-gradient(135deg, var(--gold), #b8960c);
  color: #050508;
  border-radius: 6px; border: none; cursor: pointer;
  font-family: 'Oxanium', sans-serif; font-weight: 700;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.shop-buy-btn:hover:not(.shop-buy-disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(212,175,55,0.35);
}
.shop-buy-disabled {
  background: rgba(255,255,255,0.07) !important;
  color: var(--text-dim) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

/* ════════════════ MODAL ════════════════ */
.shop-modal-bg {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.shop-modal-bg.active { display: flex; }

.shop-modal {
  background: var(--bg2);
  border: 1px solid rgba(212,175,55,0.28);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 40px rgba(212,175,55,0.07);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1);      opacity: 1; }
}

.shop-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.shop-modal-close:hover { background: rgba(239,68,68,0.15); color: #f87171; border-color: rgba(239,68,68,0.3); }

/* Loading spinner */
.smo-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px;
}

/* Modal header: icon + name */
.smo-header {
  display: flex; gap: 18px; align-items: center; margin-bottom: 18px;
}
.smo-icon-wrap {
  width: 80px; height: 80px; flex-shrink: 0;
  border-radius: 14px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(212,175,55,0.2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.smo-icon-wrap .shop-item-img  { width: 90%; height: 90%; }
.smo-icon-wrap .shop-item-placeholder { font-size: 30px; }

.smo-name {
  font-family: 'Oxanium', sans-serif;
  font-size: 18px; font-weight: 800; color: var(--text);
  letter-spacing: 1px; line-height: 1.3;
}
.smo-count {
  font-size: 13px; color: var(--gold); font-weight: 700; margin-top: 4px;
}

/* Description */
.smo-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.7;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 16px;
}

/* Price row */
.smo-price-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 16px;
}
.smo-price-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.smo-price-val {
  font-family: 'Oxanium', sans-serif;
  font-size: 18px; font-weight: 800; color: var(--gold);
  display: flex; align-items: center; gap: 6px;
}
.smo-balance-label { font-size: 12px; color: var(--text-dim); margin-left: auto; }

/* Character select */
.smo-field { margin-bottom: 16px; }
.smo-char-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.smo-char-option input { display: none; }
.smo-char-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.smo-char-option input:checked + .smo-char-card {
  border-color: var(--gold);
  background: rgba(212,175,55,0.08);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.15);
}
.smo-char-card:hover { border-color: rgba(212,175,55,0.35); }
.smo-char-name  { font-family: 'Oxanium', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); }
.smo-char-class { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* Note */
.smo-note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: rgba(59,130,246,0.07);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 9px;
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
  margin-bottom: 16px;
}
.smo-note i { color: #60a5fa; flex-shrink: 0; margin-top: 2px; }
.smo-note strong { color: var(--text); }

/* Buy button */
.smo-buy-btn {
  width: 100%; justify-content: center;
  padding: 14px; font-size: 15px; letter-spacing: 2px;
  border-radius: 10px; margin-top: 4px;
}
.smo-buy-btn:disabled {
  opacity: 0.4; cursor: not-allowed;
  transform: none !important; box-shadow: none !important;
}

/* ── Light theme ── */
[data-theme="light"] .shop-sidebar { background: var(--bg2); border-right-color: rgba(100,80,200,0.12); }
[data-theme="light"] .shop-cat-item:hover  { background: rgba(100,80,200,0.06); }
[data-theme="light"] .shop-cat-item.active { background: rgba(100,80,200,0.09); border-color: rgba(100,80,200,0.2); }
[data-theme="light"] .shop-card { background: rgba(255,255,255,0.7); border-color: rgba(100,80,200,0.1); }
[data-theme="light"] .shop-card:hover { border-color: rgba(212,175,55,0.45); }
[data-theme="light"] .shop-card-icon { background: rgba(100,80,200,0.05); }
[data-theme="light"] .shop-modal { background: rgba(245,245,255,0.98); }
[data-theme="light"] .smo-char-card { background: rgba(100,80,200,0.04); border-color: rgba(100,80,200,0.14); }
[data-theme="light"] .shop-sidebar-balance { background: rgba(212,175,55,0.06); }

/* ── Character delivery selector ── */
.shop-deliver-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(212,175,55,0.14), rgba(255,255,255,0.03));
  border: 1px solid rgba(212,175,55,0.35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}
.shop-deliver-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.35);
  color: var(--gold);
  font-size: 20px;
}
.shop-deliver-copy { flex: 1; min-width: 0; }
.shop-deliver-label {
  display: block;
  font-family: 'Oxanium', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.shop-deliver-form { margin: 0; }
.shop-char-select {
  width: 100%;
  max-width: 420px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(0,0,0,0.45)
    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='%23d4af37' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    right 14px center / 12px no-repeat;
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Oxanium', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 40px 12px 14px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.shop-char-select:hover,
.shop-char-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
}
.shop-char-select option {
  background: #1a1a1f;
  color: #fff;
}
.shop-deliver-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.shop-deliver-hint strong { color: var(--gold); }
.shop-char-empty {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

.shop-item-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
  white-space: pre-line;
}

/* Shop item cards (override .feature-card overflow:hidden which blocks scroll) */
.shop-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.shop-card-item {
  margin: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  overflow: visible !important;
}

.shop-card-item::before {
  pointer-events: none;
}

.shop-card-item > * {
  position: relative;
  z-index: 1;
}

.shop-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}

.shop-item-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.shop-card-title {
  min-width: 0;
  flex: 1;
}

.shop-card-name {
  font-weight: 700;
  font-family: 'Oxanium', sans-serif;
  font-size: 0.95rem;
  line-height: 1.3;
}

.shop-card-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.shop-item-desc-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 6px;
  margin-right: -2px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.shop-item-desc-wrap .shop-item-desc {
  padding: 10px 10px 10px 12px;
}

.shop-item-desc-wrap::-webkit-scrollbar {
  width: 10px;
}

.shop-item-desc-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 5px;
}

.shop-item-desc-wrap::-webkit-scrollbar-thumb {
  background: var(--purple);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 40px;
}

.shop-item-desc-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--purple-light);
  background-clip: padding-box;
}

.shop-item-desc-wrap {
  scrollbar-width: thin;
  scrollbar-color: var(--purple) rgba(255, 255, 255, 0.06);
}

.shop-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  margin-top: auto;
}

.shop-card-price {
  color: var(--gold);
  font-weight: 800;
  font-family: 'Oxanium', sans-serif;
}

[data-theme="light"] .shop-item-desc-wrap {
  background: rgba(100, 80, 200, 0.04);
  border-color: rgba(100, 80, 200, 0.1);
}

@media (max-width: 700px) {
  .shop-deliver-bar { align-items: flex-start; }
  .shop-char-select { max-width: none; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .shop-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; padding: 14px; }
  .shop-cat-list { flex-direction: row; flex-wrap: wrap; }
  .shop-sidebar-balance { margin-top: 0; flex: 1; min-width: 200px; }
  .shop-main { padding: 20px 16px; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
}
@media (max-width: 500px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-modal { padding: 22px 18px; }
}
