/* /public/css/shop.css */

.shop-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: 120px; /* 하단 네비게이션과 겹치지 않도록 */
}

/* 뒤로가기 버튼 (character-detail.css에서 가져옴) */
.shop-container .back-btn {
  position: static; /* 고정 해제 */
  background: var(--surface);
  color: var(--text-secondary);
  border: 2px solid var(--surface-light);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px; /* 헤더와 간격 */
}

.shop-container .back-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  border: 1px solid var(--surface-light);
}

.user-coins {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-coins i {
  color: var(--warning);
  font-size: 1.5rem;
}

.shop-tabs {
  display: flex;
  gap: 10px;
}

.shop-tab {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface-light);
  color: var(--text-secondary);
  transition: var(--transition);
}

.shop-tab.active {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-md);
}

.shop-tab.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 필터 (inventory.css 재사용) */
.shop-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--border-radius);
  margin-bottom: 24px;
}

/* 일괄 판매 */
.batch-sell-section {
  padding: 20px;
  background: var(--surface);
  border-radius: var(--border-radius);
  margin-bottom: 24px;
}

.batch-sell-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.rarity-sell-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-batch-sell {
  padding: 8px 16px;
  border: 1px solid var(--surface-light);
  background: var(--surface-light);
  color: var(--text-primary);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-batch-sell:hover:not(:disabled) {
  background: var(--error);
  color: white;
  border-color: var(--error);
  transform: translateY(-2px);
}

.btn-batch-sell:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 아이템 그리드 (inventory.css 재사용) */
.shop-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.shop-item-card {
  background: var(--surface);
  border: 1px solid var(--surface-light);
  border-radius: 12px;
  padding: 1rem;
  transition: var(--transition);
}

.shop-item-card.equipped {
  opacity: 0.6;
  border-color: var(--text-muted);
}

.shop-item-card .item-card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.shop-item-card .item-name {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  font-weight: 600;
}

.shop-item-card .item-rarity {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.shop-item-card .item-description-short {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1rem;
  height: 40px; /* 2줄 고정 */
  overflow: hidden;
}

.item-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--warning);
  margin-bottom: 12px;
  text-align: right;
}

.btn-sell-item {
  width: 100%;
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--error);
  color: white;
  border: 1px solid var(--error);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-sell-item:hover:not(:disabled) {
  background: #dc2626; /* 더 진한 빨강 */
  border-color: #dc2626;
  box-shadow: var(--shadow-md);
}

.btn-sell-item:disabled {
  background: var(--surface-light);
  color: var(--text-muted);
  border-color: var(--surface-light);
  cursor: not-allowed;
}

.shop-item-grid .empty-message {
  color: var(--text-muted);
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
}
